-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
25 lines (20 loc) · 756 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
25 lines (20 loc) · 756 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
cmake_minimum_required(VERSION 3.5)
project(multithreading)
set(include_dir ${CMAKE_CURRENT_LIST_DIR}/include)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
option(BUILD_TEST "build multithreading tests" OFF)
option(BUILD_BENCHMARK "build multithreading benchmark" OFF)
add_library(multithreading INTERFACE)
target_include_directories(multithreading INTERFACE ${include_dir})
target_compile_features(multithreading INTERFACE cxx_std_17)
target_link_libraries(multithreading INTERFACE Threads::Threads)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(BUILD_TEST)
add_subdirectory(test)
endif()
if(BUILD_BENCHMARK)
add_subdirectory(benchmark)
endif()
endif()