Skip to content

Commit 9c4b1d5

Browse files
Dario Berzanodberzano
authored andcommitted
Clean up ALICEO2_MODULAR_BUILD
1 parent bd0c527 commit 9c4b1d5

File tree

2 files changed

+14
-69
lines changed

2 files changed

+14
-69
lines changed

CMakeLists.txt

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,7 @@ ADD_CUSTOM_TARGET(man ALL)
3333
#In case you need Fortran
3434
#ENABLE_LANGUAGE(Fortran)
3535

36-
# Check for needed environment variables
37-
#IF not stop execution unless modular build is activated
38-
Option(ALICEO2_MODULAR_BUILD "Modular build without environment variables" OFF)
39-
IF (NOT ALICEO2_MODULAR_BUILD)
40-
IF (NOT DEFINED ENV{FAIRROOTPATH})
41-
MESSAGE(FATAL_ERROR "You did not define the environment variable FAIRROOTPATH which is needed to find FairRoot. Please set this variable and execute cmake again.")
42-
ENDIF (NOT DEFINED ENV{FAIRROOTPATH})
43-
44-
IF (NOT DEFINED ENV{SIMPATH})
45-
MESSAGE(FATAL_ERROR "You did not define the environment variable SIMPATH which is nedded to find the external packages. Please set this variable and execute cmake again.")
46-
ENDIF (NOT DEFINED ENV{SIMPATH})
47-
48-
SET(SIMPATH $ENV{SIMPATH})
49-
SET(FAIRROOTPATH $ENV{FAIRROOTPATH})
50-
51-
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/
52-
# is checked
53-
set(CMAKE_MODULE_PATH "${FAIRROOTPATH}/share/fairbase/cmake/modules" ${CMAKE_MODULE_PATH})
54-
set(CMAKE_MODULE_PATH "${FAIRROOTPATH}/share/fairbase/cmake/modules_old" ${CMAKE_MODULE_PATH})
55-
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
56-
57-
Set(CheckSrcDir "${FAIRROOTPATH}/share/fairbase/cmake/checks")
58-
ELSE (NOT ALICEO2_MODULAR_BUILD)
59-
find_package(Boost REQUIRED)
60-
ENDIF (NOT ALICEO2_MODULAR_BUILD)
36+
find_package(Boost REQUIRED)
6137

6238
# Load some basic macros which are needed later on
6339
include(O2Utils)
@@ -135,12 +111,6 @@ ENDIF (NOT UNIX)
135111
# directory
136112
CHECK_EXTERNAL_PACKAGE_INSTALL_DIR()
137113

138-
# set a variable which should be used in all CMakeLists.txt
139-
# Defines all basic include directories from fairbase
140-
IF (NOT ALICEO2_MODULAR_BUILD)
141-
SetBasicVariables()
142-
ENDIF (NOT ALICEO2_MODULAR_BUILD)
143-
144114
# Set the library version in the main CMakeLists.txt
145115
SET(ALICEO2_MAJOR_VERSION 0)
146116
SET(ALICEO2_MINOR_VERSION 0)
@@ -178,25 +148,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
178148
endif()
179149
unset(isSystemDir)
180150

181-
IF (NOT ALICEO2_MODULAR_BUILD)
182-
# Check IF the compiler support specific C++14 features
183-
# Up to now this is only a check since the code does not use
184-
# any of the features of the new standard
185-
# does not work straightforward
186-
include(CheckCXX11Features)
187-
188-
# Check IF the compilation flag -std=c++14 is set
189-
IF (NOT CMAKE_CXX_FLAGS)
190-
Message(FATAL_ERROR "No C++14 support found. AliceO2 requires C++14 be build.")
191-
EndIF (NOT CMAKE_CXX_FLAGS)
192-
193-
ELSE (NOT ALICEO2_MODULAR_BUILD)
194-
# This needs to be improved
195-
# (hopefully by making CheckCXX11Features working also with this build option)
196-
set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
197-
ENDIF (NOT ALICEO2_MODULAR_BUILD)
198-
199-
#check C++14 features
151+
# Check for the required C++ standard features (break if not available)
200152
set(CheckCXX14SrcDir "${CMAKE_SOURCE_DIR}/cmake/checks")
201153
include(CheckCXX14Features)
202154

cmake/O2Dependencies.cmake

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,18 @@ find_package(ROOT 6.06.00 REQUIRED)
2222
find_package(Vc REQUIRED)
2323
find_package(Pythia8)
2424
find_package(Pythia6)
25-
if (ALICEO2_MODULAR_BUILD)
26-
# Installed via CMake. Note: we work around hardcoded full paths in the CMake
27-
# config files not being relocated properly by appending library paths.
28-
guess_append_libpath(geant321 "${Geant3_DIR}")
29-
find_package(Geant3 NO_MODULE)
30-
guess_append_libpath(G4run "${Geant4_DIR}")
31-
find_package(Geant4 NO_MODULE)
32-
guess_append_libpath(geant4vmc "${GEANT4_VMC_DIR}")
33-
find_package(Geant4VMC NO_MODULE)
34-
guess_append_libpath(BaseVGM "${VGM_DIR}")
35-
find_package(VGM NO_MODULE)
36-
else (ALICEO2_MODULAR_BUILD)
37-
# For old versions of VMC packages (to be removed)
38-
find_package(GEANT3)
39-
find_package(GEANT4)
40-
find_package(GEANT4DATA)
41-
find_package(GEANT4VMC)
42-
find_package(CLHEP)
43-
endif (ALICEO2_MODULAR_BUILD)
25+
26+
# Installed via CMake. Note: we work around hardcoded full paths in the CMake
27+
# config files not being relocated properly by appending library paths.
28+
guess_append_libpath(geant321 "${Geant3_DIR}")
29+
find_package(Geant3 NO_MODULE)
30+
guess_append_libpath(G4run "${Geant4_DIR}")
31+
find_package(Geant4 NO_MODULE)
32+
guess_append_libpath(geant4vmc "${GEANT4_VMC_DIR}")
33+
find_package(Geant4VMC NO_MODULE)
34+
guess_append_libpath(BaseVGM "${VGM_DIR}")
35+
36+
find_package(VGM NO_MODULE)
4437
find_package(CERNLIB)
4538
find_package(HEPMC)
4639
# FIXME: the way, iwyu is integrated now conflicts with the possibility to add

0 commit comments

Comments
 (0)