forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
90 lines (72 loc) · 2.76 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
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
cmake_minimum_required(VERSION 3.23 FATAL_ERROR)
project(O2Physics
VERSION 0.0.1
LANGUAGES C CXX
DESCRIPTION "Physics Analysis for O2")
cmake_policy(SET CMP0144 NEW)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set_property(GLOBAL PROPERTY REPORT_UNDEFINED_PROPERTIES)
cmake_host_system_information(RESULT _totalmem QUERY TOTAL_PHYSICAL_MEMORY)
math(EXPR _total_analysis_jobs "(${_totalmem}-2048)/2048")
if(_total_analysis_jobs LESS_EQUAL 0)
set(_total_analysis_jobs 1)
endif()
set(ANALYSIS_COMPILE_POOL ${_total_analysis_jobs} CACHE STRING "How many parallel analysis compilation jobs")
set_property(GLOBAL PROPERTY JOB_POOLS analysis=${ANALYSIS_COMPILE_POOL})
message(STATUS "Limiting workflow compilations in parallel to: ${ANALYSIS_COMPILE_POOL}")
# C++ standard
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
endif()
include(O2PhysicsDefineOptions)
o2physics_define_options()
include(O2PhysicsDefineOutputPaths)
o2physics_define_output_paths()
include(O2PhysicsDefineRPATH)
o2physics_define_rpath()
# External dependencies
include(dependencies/CMakeLists.txt)
# Include macros
include(O2PhysicsNameTarget)
include(O2PhysicsAddExecutable)
include(O2PhysicsAddWorkflow)
include(O2PhysicsAddLibrary)
include(O2PhysicsAddHeaderOnlyLibrary)
include(O2PhysicsTargetRootDictionary)
include(O2PhysicsSetROOTPCMDependencies)
include(O2PhysicsDataFile)
include(AddRootDictionary)
# Main targets of the project in various subdirectories. Order matters.
add_subdirectory(Common)
add_subdirectory(ALICE3)
add_subdirectory(DPG)
add_subdirectory(PWGCF)
add_subdirectory(PWGDQ)
add_subdirectory(PWGEM)
add_subdirectory(PWGHF)
add_subdirectory(PWGJE)
add_subdirectory(PWGLF)
add_subdirectory(PWGMM)
add_subdirectory(PWGUD)
add_subdirectory(Tools)
add_subdirectory(Tutorials)
add_subdirectory(EventFiltering)
add_subdirectory(Scripts)
# Testing and packaging only needed if we are the top level directory
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_subdirectory(packaging)
endif()
set_root_pcm_dependencies()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ClangBuildAnalyzer.ini.in
${CMAKE_CURRENT_BINARY_DIR}/ClangBuildAnalyzer.ini @ONLY)