-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathCMakeLists.txt
executable file
·102 lines (75 loc) · 2.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
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
cmake_minimum_required(VERSION 3.3)
project(fccedm VERSION 0.5.6)
set(fccedm_VERSION "${fccedm_VERSION_MAJOR}.${fccedm_VERSION_MINOR}.${fccedm_VERSION_PATCH}")
# Define basic build settings
# Use GNU-style hierarchy for installing build products
include(GNUInstallDirs)
# Define a default build type can be overriden by passing
# ``-DCMAKE_BUILD_TYPE=<type>`` when invoking CMake
if(NOT CMAKE_CONFIGURATION_TYPES)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo
CACHE STRING "Choose the type of build, options are: None Release MinSizeRel Debug RelWithDebInfo"
FORCE
)
else()
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
CACHE STRING "Choose the type of build, options are: None Release MinSizeRel Debug RelWithDebInfo"
FORCE
)
endif()
endif()
find_package(podio REQUIRED)
#--- Declare options -----------------------------------------------------------
option(fccedm_documentation "Whether or not to create doxygen doc target." OFF)
# 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")
# Use .so also on macOS so ROOT can load them
if(APPLE)
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif(APPLE)
# Set up C++ Standard
# podio v0.11: forces 17
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}")
if (${APPLE})
set(CPP_STANDARD_FLAGS "-std=c++${CMAKE_CXX_STANDARD}\ -stdlib=libc++")
endif()
#--- Declare ROOT dependency ---------------------------------------------------
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(ROOT REQUIRED COMPONENTS RIO Tree Physics)
set(ROOT_genreflex_cmd ${ROOT_genreflex_CMD})
include(${ROOT_USE_FILE})
# set up include-directories
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR}
${ROOT_INCLUDE_DIR}
${podio_INCLUDE_DIR}
)
# adding testing capabilities
include(CTest)
#--- enable CPack --------------------------------------------------------------
option(ENABLE_CPACK "Whether or not to enable CPack" OFF)
if(ENABLE_CPACK)
include(cmake/fccedmCPack.cmake)
endif()
#--- target for Doxygen documentation ------------------------------------------
if(fccedm_documentation)
include(cmake/fccedmDoxygen.cmake)
endif()
# Add sub-directories
add_subdirectory(datamodel)
# disabled due to recent breaking changes in podio
#add_subdirectory(utilities)
#if(BUILD_TESTING)
# add_subdirectory(examples)
#endif()
include(cmake/fccedmCreateConfig.cmake)