I have some simple implementation of LinkedList in file list
.
To crate library out of it I'm using cmake, my CMakelists.txt looks like that:
cmake_minimum_required(VERSION 2.6)
project(LinkedList)
set(CMAKE_CXX_FLAGS "-o -Wall")
include_directories(${LinkedList_SOURCE_DIR})
link_directories(${LinkedList_BINARY_DIR})
add_executable(list list.c)
add_library(listStatic STATIC list.c)
add_library(listShared SHARED list.c)
Everything works fine. But now it comes to use my library in other programs.
As far as I know listShared.h
is required to use this library in my program and listStatic.h
for static library.
Is there a way to automatically generate header file in CMake, so I can #include
those libraries in other programs?
Or I just don't understand how it all works?