-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
75 lines (54 loc) · 2 KB
/
CMakeLists.txt
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
cmake_minimum_required(VERSION 3.13)
# add this options before PROJECT keyword
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_CXX_STANDARD 20)
# set(CMAKE_CXX_COMPILER c++)
project(sieve_exec_comparison)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# This does not seem to be needed any longer
# set(OPENSSL_ROOT_DIR /opt/homebrew/Cellar/[email protected]/1.1.1o)
option(EC_BUILD_SIEVE "Option to build sieve demo programs." ON)
option(EC_USE_CONCURRENCPP "Option whether or not to use concurrencpp library" ON)
option(EC_USE_WG21_P2003 "Option whether or not to use std execution library" ON)
option(EC_USE_LIBUNIFEX "Option whether or not to use libunifex" ON)
option(EC_USE_TBB "Option whether or not to use TBB" ON)
option(EC_USE_LOCAL_TBB "Use TBB submodule (rather than system TBB)" ON)
if (CMAKE_COMPILER_IS_GNUCXX)
set(EC_USE_CONCURRENCPP OFF)
set(EC_USE_WG21_P2003 OFF)
message("")
message(WARNING "*** Cannot use concurrencpp with GNU!! Disabling! ***")
message(WARNING "*** Cannot use wg21_p2003 with GNU!! Disabling! ***")
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL arm64)
set(TBBMALLOC_BUILD OFF)
message(WARNING "*** Cannot build tbbmalloc with GNU on arm64!! Disabling! ***")
endif()
message("")
endif()
if(EC_USE_TBB)
option(TBB_TEST "" OFF)
if(EC_USE_LOCAL_TBB)
# Use as submodule
add_subdirectory(external/oneTBB)
else()
find_package(TBB REQUIRED)
endif()
endif()
find_package(Threads REQUIRED)
if (EC_USE_WG21_P2003)
add_library(wg21_p2300_std_execution INTERFACE)
target_include_directories(wg21_p2300_std_execution INTERFACE external/wg21_p2300_std_execution/include)
endif()
if (EC_USE_LIBUNIFEX)
# add_library(libunifex INTERFACE)
# target_include_directories(libunifex INTERFACE external/libunifex/include)
add_subdirectory(external/libunifex)
endif()
if (EC_USE_CONCURRENCPP)
add_subdirectory(external/concurrencpp)
endif()
if (EC_BUILD_SIEVE)
add_subdirectory(sieve)
endif()