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
|
Author: Andreas Tille <tille@debian.org>
Last-Update: Fri, 08 Jun 2018 13:20:51 +0200
Description: Build shared and static lib
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,14 +11,22 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(thread_pool_build_tests "Build thread_pool unit tests" OFF)
-add_library(thread_pool STATIC
+add_library(thread_pool SHARED
+ src/thread_pool.cpp)
+
+add_library(thread_pool_static STATIC
src/thread_pool.cpp)
target_include_directories(thread_pool PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
+target_include_directories(thread_pool_static PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:include>)
+
install(TARGETS thread_pool DESTINATION lib)
+install(TARGETS thread_pool_static DESTINATION lib)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/thread_pool DESTINATION include)
if (thread_pool_build_tests)
|