-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
60 lines (54 loc) · 1.17 KB
/
CMakeLists.txt
File metadata and controls
60 lines (54 loc) · 1.17 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
cmake_minimum_required(VERSION 3.12)
project(gcdpp)
add_library(gcdpp STATIC
src/work.cpp
src/queue.cpp
src/group.cpp
src/semaphore.cpp
src/data.cpp
src/source.cpp
)
target_compile_features(
gcdpp PUBLIC
cxx_std_11
)
target_include_directories(
gcdpp PUBLIC
src/include
)
if(APPLE)
target_compile_options(
gcdpp PRIVATE
-fblocks
)
else()
target_include_directories(
gcdpp PUBLIC
${GCDPP_LIBDISPATCH_DIR}/include
)
endif()
include(GNUInstallDirs)
file(GLOB GCDPP_INCLUDE_FILES "src/include/gcdpp/*.h")
install(
TARGETS gcdpp
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(
FILES ${GCDPP_INCLUDE_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gcdpp)
option(BUIULD_TESTS "Build test programs" OFF)
if (BUILD_TESTS)
add_executable(gcdpp_test
examples/test.cpp
)
add_dependencies(gcdpp_test gcdpp)
target_link_directories(gcdpp_test PRIVATE
${GCDPP_LIBDISPATCH_DIR}/lib
)
target_link_libraries(gcdpp_test gcdpp)
if (NOT APPLE)
target_link_libraries(gcdpp_test dispatch BlocksRuntime)
endif()
endif()