-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
43 lines (28 loc) · 997 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 3.15.0)
project(worker_crew_manager VERSION 0.0.1)
#Setting compilation flags
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
#Build flags
option(BUILD_SAMPLES "Build available samples" ON)
option(BUILD_TESTS "Build available samples" ON)
#Add all .cpp and .c files in src folder to compile list
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/src/*.cpp
${PROJECT_SOURCE_DIR}/src/*.c
)
#Add all header files located include to headers list
include_directories(${PROJECT_SOURCE_DIR}/inc)
#Setting target name
add_library(${PROJECT_NAME} STATIC ${PROJECT_SOURCE_DIR}/src/worker_crew_manager.cpp)
install(TARGETS ${PROJECT_NAME} ARCHIVE)
install(TARGETS ${PROJECT_NAME} PUBLIC_HEADER)
if(BUILD_SAMPLES)
add_subdirectory(${PROJECT_SOURCE_DIR}/samples)
endif()
if(BUILD_TESTS)
add_subdirectory(test)
endif()
target_link_libraries(${PROJECT_NAME}
pthread
)