-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathCMakeLists.txt
66 lines (50 loc) · 1.82 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(CEPCSW)
# setup some necessary envvar
include(cmake/CEPCSWEnv.cmake)
#
find_package(ROOT COMPONENTS RIO Tree)
find_package(Gaudi)
include(GNUInstallDirs)
include(CTest)
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 "17|20")
message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
endif()
list(PREPEND CMAKE_MODULE_PATH $ENV{PANDORAPFA}/cmakemodules)
list(PREPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") # (Find*.cmake)
include(cmake/CEPCSWDependencies.cmake)
add_subdirectory(Analysis)
add_subdirectory(Detector)
add_subdirectory(Digitisers)
add_subdirectory(Examples)
add_subdirectory(Generator)
add_subdirectory(Reconstruction)
add_subdirectory(Service)
add_subdirectory(Simulation)
add_subdirectory(Utilities)
##############################################################################
# INSTALL
##############################################################################
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)
file(WRITE ${CMAKE_BINARY_DIR}/setup.sh.in
"#!/bin/bash\n"
"# Generated by cmake \n"
"# Following is the extra envvar:\n"
"@RUN_SCRIPT_EXTRA_COMMANDS@"
)
configure_file("${CMAKE_BINARY_DIR}/setup.sh.in" "${CMAKE_BINARY_DIR}/setup.sh"
@ONLY)
install(FILES "${CMAKE_BINARY_DIR}/setup.sh"
DESTINATION ${CMAKE_INSTALL_PREFIX})