-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
40 lines (32 loc) · 942 Bytes
/
CMakeLists.txt
File metadata and controls
40 lines (32 loc) · 942 Bytes
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.0.2)
project(threadpool)
add_compile_options(-std=c++14)
## Specify additional locations of header files
include_directories(
include
)
## Declare a C++ library
add_library(${PROJECT_NAME} SHARED src/threadpool.cpp)
target_link_libraries(${PROJECT_NAME} pthread)
add_executable(example src/test.cpp)
target_link_libraries(example ${PROJECT_NAME})
#############
## Install ##
#############
## Mark libraries for installation
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Config
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)
## Install the config file associated with the cpp_timer lib
install(
EXPORT ${PROJECT_NAME}Config
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${PROJECT_NAME}
NAMESPACE ${PROJECT_NAME}::
)
## Mark header files for installation
install(
FILES include/${PROJECT_NAME}/threadpool.hpp
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}
)