-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (55 loc) · 2.44 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
cmake_minimum_required(VERSION 3.25)
# TODO: fix GCC build with .clang-tidy PCH
set(CMAKE_CXX_COMPILER "/usr/bin/clang++" CACHE STRING "Clang C++ compiler")
set(CMAKE_CXX_FLAGS "-Wall" CACHE STRING "C++ compiler flags")
set(CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING "C++ compiler debug flags")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG" CACHE STRING "C++ compiler min size release flags")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "C++ compiler release flags")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "C++ compiler flags for release with debug info")
set(CMAKE_AR "ar" CACHE STRING "Archiver program")
set(CMAKE_LINKER "ld" CACHE STRING "Linker program")
set(CMAKE_NM "nm" CACHE STRING "Symbol table viewer")
set(CMAKE_OBJDUMP "objdump" CACHE STRING "Object dump program")
set(CMAKE_RANLIB "ranlib" CACHE STRING "Archive indexer")
project(DRL VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy")
if(PROJECT_IS_TOP_LEVEL)
set(LAB_TOP_PROJECT ON)
else()
set(LAB_TOP_PROJECT OFF)
endif()
option(LAB_BUILD_EXAMPLES "Build examples" ${LAB_TOP_PROJECT})
option(LAB_BUILD_TESTS "Build tests" ${LAB_TOP_PROJECT})
option(LAB_GPU "GPU Support" ON)
if (DEFINED CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} CACHE PATH "Path to the folder containing finders")
endif()
include(cmake/build_options.cmake)
include(cmake/paths.cmake)
if(LAB_GPU)
enable_language(CUDA)
include(cmake/utils.cmake)
include(cmake/select_compute_arch.cmake)
include(cmake/cuda.cmake)
endif()
add_subdirectory("3rdparty")
include(cmake/dependencies.cmake)
add_subdirectory("lab")
if(LAB_BUILD_TESTS)
add_subdirectory("test")
endif()
if(LAB_BUILD_EXAMPLES)
add_subdirectory("example")
endif()
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/labConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lab
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/labConfig.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lab
)