diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | examples/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 59ec4c8..2b6a151 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8) project (crow_all) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") find_package(Tcmalloc) +find_package(Threads) if (NOT CMAKE_BUILD_TYPE) message(STATUS "No build type selected, default to Release") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1fcec94..83b5478 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -3,7 +3,8 @@ project (crow_examples) add_executable(example example.cpp) #target_link_libraries(example crow) -target_link_libraries(example ${Boost_LIBRARIES} ) +target_link_libraries(example ${Boost_LIBRARIES}) +target_link_libraries(example ${CMAKE_THREAD_LIBS_INIT}) if (Tcmalloc_FOUND) target_link_libraries(example ${Tcmalloc_LIBRARIES}) @@ -11,7 +12,8 @@ endif(Tcmalloc_FOUND) add_executable(example_with_all example_with_all.cpp) #target_link_libraries(example crow) -target_link_libraries(example_with_all ${Boost_LIBRARIES} ) +target_link_libraries(example_with_all ${Boost_LIBRARIES}) +target_link_libraries(example_with_all ${CMAKE_THREAD_LIBS_INIT}) add_custom_command(OUTPUT example_test.py COMMAND ${CMAKE_COMMAND} -E @@ -22,7 +24,8 @@ add_custom_target(example_copy ALL DEPENDS example_test.py) add_executable(example_chat example_chat.cpp) #target_link_libraries(example_chat crow) -target_link_libraries(example_chat ${Boost_LIBRARIES} ) +target_link_libraries(example_chat ${Boost_LIBRARIES}) +target_link_libraries(example_chat ${CMAKE_THREAD_LIBS_INIT}) add_custom_command(OUTPUT example_chat.html COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/example_chat.html ${CMAKE_CURRENT_BINARY_DIR}/example_chat.html diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5ea48f1..65ab230 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,7 +8,8 @@ unittest.cpp add_executable(unittest ${TEST_SRCS}) #target_link_libraries(unittest crow) -target_link_libraries(unittest ${Boost_LIBRARIES} ) +target_link_libraries(unittest ${Boost_LIBRARIES}) +target_link_libraries(unittest ${CMAKE_THREAD_LIBS_INIT}) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # using Clang |