forked from HEP-FCC/k4SimGeant4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (50 loc) · 1.91 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
project(k4SimGeant4)
#---------------------------------------------------------------
# Options
option(BUILD_DOCS "Whether or not to create doxygen doc target." ON)
#---------------------------------------------------------------
find_package(ROOT COMPONENTS RIO Tree)
#---------------------------------------------------------------
# Load macros and functions for Gaudi-based projects
find_package(Gaudi)
find_package(k4FWCore)
find_package(EDM4HEP)
find_package(Geant4)
find_package(DD4hep)
find_package(CLHEP)
#---------------------------------------------------------------
include(GNUInstallDirs)
include(CTest)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "RPATH USE LINK PATH")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/InstallArea/ CACHE PATH
"Install path prefix, prepended onto install directories." FORCE )
endif()
# Set up C++ Standard
# ``-DCMAKE_CXX_STANDARD=<standard>`` when invoking CMake
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")
if(NOT CMAKE_CXX_STANDARD MATCHES "14|17")
message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
endif()
message(${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
message(${CMAKE_MODULE_PATH})
add_subdirectory(Detector)
add_subdirectory(SimG4Interface)
add_subdirectory(SimG4Common)
add_subdirectory(SimG4Fast)
add_subdirectory(SimG4Components)
add_subdirectory(SimG4Full)
#---------------------------------------------------------------
# Build documentation
if(BUILD_DOCS)
include(cmake/k4SimGeant4Doxygen.cmake)
endif()
#---------------------------------------------------------------
install(EXPORT ${PROJECT_NAME}Targets
NAMESPACE ${PROJECT_NAME}::
FILE "${PROJECT_NAME}Targets.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/"
)
gaudi_install(CMAKE cmake/${PROJECT_NAME}Config.cmake)