forked from HEP-FCC/FCCAnalyses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
116 lines (70 loc) · 3.63 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
108
109
110
111
112
113
114
115
116
cmake_minimum_required(VERSION 3.1...3.16)
#cmake_minimum_required(VERSION 2.8)
project(FCCAnalyses CXX)
#needed for ACTS
cmake_policy(SET CMP0057 NEW)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "RPATH USE LINK PATH")
#--- enable unit testing capabilities ------------------------------------------
include(CTest)
option(USE_EXTERNAL_CATCH2 "Link against an external Catch2 v3 static library, otherwise build it locally" ON)
option(WITH_DD4HEP "Build analyzers that need DD4hep" OFF)
#--- Set a better default for installation directory---------------------------
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/install" CACHE PATH "default install path" FORCE)
endif()
#--- Declare C++ Standard -----------------------------------------------------
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")
if(NOT CMAKE_CXX_STANDARD MATCHES "17")
message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
endif()
message (STATUS "C++ standard: ${CMAKE_CXX_STANDARD}")
find_package(ROOT COMPONENTS ROOTDataFrame)
include(${ROOT_USE_FILE})
find_package(EDM4HEP)
find_package(podio)
# Define basic build settings
# Use GNU-style hierarchy for installing build products
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package(FastJet)
find_package( Acts COMPONENTS Core )
# Offer the user the choice of overriding the installation directories
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set(INSTALL_INCLUDE_DIR include CACHE PATH
"Installation directory for header files")
#--- add CMake infrastructure --------------------------------------------------
include(cmake/FCCAnalysesCreateConfig.cmake)
file(COPY bin/fccanalysis
DESTINATION ${CMAKE_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(PROGRAMS bin/fccanalysis DESTINATION bin)
file(GLOB _run_python_files config/*.py)
install(FILES ${_run_python_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/python/config)
install(FILES config/doPlots.py PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION ${CMAKE_INSTALL_PREFIX}/python/config)
#install(DIRECTORY FCCeeAnalyses DESTINATION ${CMAKE_INSTALL_PREFIX}/python)
#install(DIRECTORY FCChhAnalyses DESTINATION ${CMAKE_INSTALL_PREFIX}/python)
execute_process(COMMAND python -m awkward.config --incdir OUTPUT_VARIABLE _AWKWARD_INCLUDE OUTPUT_STRIP_TRAILING_WHITESPACE)
set(AWKWARD_INCLUDE ${_AWKWARD_INCLUDE})
execute_process(COMMAND python -m awkward.config --libdir OUTPUT_VARIABLE _AWKWARD_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
set(AWKWARD_LIBRARIES ${_AWKWARD_LIBRARIES})
include_directories(BEFORE "${AWKWARD_INCLUDE}")
find_library(CPU-KERNELS awkward-cpu-kernels REQUIRED HINTS ${AWKWARD_LIBRARIES})
find_library(LIBAWKWARD awkward REQUIRED HINTS ${AWKWARD_LIBRARIES})
find_library(LIBDL dl REQUIRED)
message(STATUS "Libraries: ${CPU-KERNELS} ${LIBAWKWARD} ${LIBDL}")
message(STATUS "includes--------------------- main: ${AWKWARD_INCLUDE}")
message(STATUS "Library---------------------- main: ${AWKWARD_LIBRARIES}")
add_subdirectory(analyzers/dataframe)
option(FCCANALYSES_CASESTUDIES "Build the case studies" OFF)
if(FCCANALYSES_CASESTUDIES)
add_subdirectory(analyzers/dataframe/case-studies FCCANALYSES_CASESTUDIES)
endif()
option(FCCANALYSES_DOCUMENTATION "Whether or not to create doxygen doc target." ON)
if(FCCANALYSES_DOCUMENTATION)
include(cmake/FCCANALYSESDoxygen.cmake)
endif()
if(BUILD_TESTING)
add_subdirectory(tests)
endif()