-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
107 lines (93 loc) · 3.49 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# VecMem project, part of the ACTS project (R&D line)
#
# (c) 2021-2024 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0
# Set up the project.
cmake_minimum_required( VERSION 3.10 )
project( vecmem VERSION 1.12.0 LANGUAGES CXX )
# Standard CMake include(s).
include( GNUInstallDirs )
include( CTest )
# Set the location of the installed CMake files.
set( CMAKE_INSTALL_CMAKEDIR
"${CMAKE_INSTALL_LIBDIR}/cmake/vecmem-${PROJECT_VERSION}" )
# Explicitly set the output directory for the binaries. Such that if this
# project is included by another project, the main project's configuration would
# win out.
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}" CACHE PATH
"Directory for the built binaries" )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH
"Directory for the built libraries" )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH
"Directory for the built static libraries" )
# Flags controlling the meta-build system.
option( VECMEM_USE_SYSTEM_LIBS "Use system libraries by default" FALSE )
option( VECMEM_BUILD_TESTING "Build the unit tests of VecMem" TRUE )
option( VECMEM_TEST_UBSAN "Use the undefined behavior sanitizer for the tests"
TRUE )
# Include the VecMem CMake code.
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
include( vecmem-functions )
include( vecmem-options )
# Add the library sub-directories.
add_subdirectory( core )
if( VECMEM_BUILD_CUDA_LIBRARY )
add_subdirectory( cuda )
endif()
if( VECMEM_BUILD_HIP_LIBRARY )
add_subdirectory( hip )
endif()
if( VECMEM_BUILD_SYCL_LIBRARY )
add_subdirectory( sycl )
endif()
# Set up the test(s).
if( BUILD_TESTING AND VECMEM_BUILD_TESTING )
add_subdirectory( tests )
endif()
# Set up the benchmarks.
option(VECMEM_BUILD_BENCHMARKING "Build the benchmarks of VecMem" OFF)
if(VECMEM_BUILD_BENCHMARKING)
add_subdirectory(benchmarks)
endif()
# Set up the packaging of the project.
include( vecmem-packaging )
# Set up Doxygen documentation creation for the project, if requested.
if( VECMEM_BUILD_DOCS )
# This requires / uses Doxygen and doxygen-awesome-css.
find_package( Doxygen REQUIRED )
add_subdirectory( cmake/doxygen-awesome-css )
# Set up how to build the Doxygen documentation.
set( DOXYGEN_JAVADOC_AUTOBRIEF TRUE )
set( DOXYGEN_USE_MDFILE_AS_MAINPAGE
"${CMAKE_CURRENT_SOURCE_DIR}/README.md" )
set( DOXYGEN_FULL_PATH_NAMES TRUE )
set( DOXYGEN_INLINE_INHERITED_MEMB TRUE )
set( DOXYGEN_INHERIT_DOCS TRUE )
set( DOXYGEN_EXTRACT_PRIV_VIRTUAL TRUE )
set( DOXYGEN_STRIP_FROM_PATH
"${CMAKE_CURRENT_SOURCE_DIR}" )
set( DOXYGEN_STRIP_FROM_INC_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/core/include"
"${CMAKE_CURRENT_SOURCE_DIR}/cuda/include"
"${CMAKE_CURRENT_SOURCE_DIR}/hip/include"
"${CMAKE_CURRENT_SOURCE_DIR}/sycl/include" )
set( DOXYGEN_PREDEFINED
"__cplusplus=201700L" )
set( DOXYGEN_EXCLUDE
"${CMAKE_CURRENT_SOURCE_DIR}/tests"
"${CMAKE_CURRENT_SOURCE_DIR}/benchmarks"
"${CMAKE_CURRENT_SOURCE_DIR}/build" )
set( DOXYGEN_GENERATE_TREEVIEW FALSE )
set( DOXYGEN_DISABLE_INDEX FALSE )
set( DOXYGEN_FULL_SIDEBAR FALSE )
set( DOXYGEN_HTML_EXTRA_STYLESHEET
"${doxygenawesomecss_SOURCE_DIR}/doxygen-awesome.css" )
# Set up the "vecmem_docs" target.
doxygen_add_docs( vecmem_docs
"${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Generating Doxygen pages" )
endif()