-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (56 loc) · 1.97 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
75
76
77
78
79
cmake_minimum_required(VERSION 3.23.5)
set(CMAKE_CXX_STANDARD 20)
set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
project(
allocators
VERSION 0.0.1
LANGUAGES CXX)
include(GNUInstallDirs)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(
${PROJECT_NAME}
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
# Copy include files to the install include directory.
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/${PROJECT_NAME}/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
# Import dep on named-template-parameters
include(FetchContent)
FetchContent_Declare(
named-template-parameters
GIT_REPOSITORY https://github.com/yaneury/named-template-parameters.git
GIT_TAG main)
FetchContent_MakeAvailable(named-template-parameters)
target_link_libraries(${PROJECT_NAME} INTERFACE ntp)
FetchContent_Declare(
Result
GIT_REPOSITORY https://github.com/bitwizeshift/result.git
GIT_TAG master)
FetchContent_MakeAvailable(Result)
target_link_libraries(${PROJECT_NAME} INTERFACE Result)
FetchContent_Declare(
magic_enum
GIT_REPOSITORY https://github.com/Neargye/magic_enum.git
GIT_TAG v0.8.2)
FetchContent_MakeAvailable(magic_enum)
target_link_libraries(${PROJECT_NAME} INTERFACE magic_enum)
option(ALLOCATORS_BUILD_TESTS "Set to ON to build tests" OFF)
option(ALLOCATORS_BUILD_SANDBOX "Set to ON to build sandbox" OFF)
option(ALLOCATORS_DEBUG "Set to ON to enable debug messages" OFF)
if(ALLOCATORS_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
if(ALLOCATORS_BUILD_SANDBOX)
add_subdirectory(sandbox)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(${PROJECT_NAME} INTERFACE -DDEBUG)
FetchContent_Declare(
plog
GIT_REPOSITORY https://github.com/SergiusTheBest/plog.git
GIT_TAG master)
FetchContent_MakeAvailable(plog)
target_link_libraries(${PROJECT_NAME} INTERFACE plog)
endif()