Commit 89a1edae by Geoff Romer Committed by Dominic Hamon

Require cmake 2.8.12 in order to support target_include_directories, and

simplify thread linking logic.
parent a6ad799a
cmake_minimum_required (VERSION 2.8) cmake_minimum_required (VERSION 2.8.12)
project (benchmark) project (benchmark)
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON) option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
......
...@@ -18,14 +18,9 @@ else() ...@@ -18,14 +18,9 @@ else()
endif() endif()
add_library(benchmark ${SOURCE_FILES} ${RE_FILES}) add_library(benchmark ${SOURCE_FILES} ${RE_FILES})
find_package(Threads REQUIRED)
# Link threading if building a shared library, otherwise let client do it. find_package(Threads REQUIRED)
if (BUILD_SHARED_LIBS) target_link_libraries(benchmark ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(benchmark PRIVATE ${CMAKE_THREAD_LIBS_INIT})
else()
target_link_libraries(benchmark ${CMAKE_THREAD_LIBS_INIT})
endif()
set_target_properties(benchmark PROPERTIES set_target_properties(benchmark PROPERTIES
OUTPUT_NAME "benchmark" OUTPUT_NAME "benchmark"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment