forked from NVIDIA/cccl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (49 loc) · 1.73 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
# 3.15 is the minimum for including the project with add_subdirectory.
# 3.21 is the minimum for the developer build.
cmake_minimum_required(VERSION 3.15)
# Determine whether CCCL is the top-level project or included into
# another project via add_subdirectory()
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}")
set(CCCL_TOPLEVEL_PROJECT ON)
endif()
project(CCCL LANGUAGES NONE)
# Optionally include installation rules for non-top-level builds:
option(CCCL_ENABLE_INSTALL_RULES "Enable installation of CCCL." ${CCCL_TOPLEVEL_PROJECT})
if (CCCL_ENABLE_INSTALL_RULES)
include(cmake/CCCLInstallRules.cmake)
endif()
# Support adding CCCL to a parent project via add_subdirectory.
if (NOT CCCL_TOPLEVEL_PROJECT)
include(cmake/CCCLAddSubdir.cmake)
return()
endif()
# We require a higher cmake version for dev builds
cmake_minimum_required(VERSION 3.21)
option(CCCL_ENABLE_LIBCUDACXX "Enable the libcu++ developer build." ON)
option(CCCL_ENABLE_CUB "Enable the CUB developer build." ON)
option(CCCL_ENABLE_THRUST "Enable the Thrust developer build." ON)
option(CCCL_ENABLE_TESTING "Enable CUDA C++ Core Library tests." ON)
option(CCCL_ENABLE_EXAMPLES "Enable CUDA C++ Core Library examples." ON)
include(CTest)
enable_testing()
include(cmake/CCCLUtilities.cmake)
if (CCCL_ENABLE_LIBCUDACXX)
set(LIBCUDACXX_TOPLEVEL_PROJECT ON)
endif()
if (CCCL_ENABLE_CUB)
set(CUB_TOPLEVEL_PROJECT ON)
endif()
if (CCCL_ENABLE_THRUST)
set(THRUST_TOPLEVEL_PROJECT ON)
endif()
add_subdirectory(libcudacxx)
add_subdirectory(cub)
add_subdirectory(thrust)
if (CCCL_ENABLE_TESTING)
add_subdirectory(test)
endif()
if (CCCL_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()
# Must stay at the end of this file.
include(cmake/CCCLHideThirdPartyOptions.cmake)