Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
0633dfd7
Commit
0633dfd7
authored
2 years ago
by
Omveer Singh
Committed by
Florian Uhlig
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Cleaning and Build info Added
print_info() macro added to CbmMacro.cmake module unnecessary variables removed
parent
a55fb106
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1028
Cleaning
Pipeline
#20158
passed
2 years ago
Stage: documentation
Stage: deploy
Changes
2
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+25
-52
25 additions, 52 deletions
CMakeLists.txt
cmake/modules/CbmMacros.cmake
+61
-0
61 additions, 0 deletions
cmake/modules/CbmMacros.cmake
with
86 additions
and
52 deletions
CMakeLists.txt
+
25
−
52
View file @
0633dfd7
...
...
@@ -39,7 +39,9 @@ project(CBMROOT
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/
# is checked
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_SOURCE_DIR
}
/cmake/modules"
)
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_SOURCE_DIR
}
/cmake"
)
# Load some basic cmake functionality
include
(
ExternalProject
)
...
...
@@ -57,7 +59,7 @@ include(ROOTMacros)
include
(
FairMacros
)
include
(
WriteConfigFile
)
include
(
CheckCompiler
)
include
(
ROOTMacros
)
# Do some basic checks
# out-of-source build, unix system and
...
...
@@ -67,14 +69,13 @@ Check_Prerequisites()
#Fairsoft Modules Path
list
(
PREPEND CMAKE_PREFIX_PATH
${
SIMPATH
}
)
unset
(
packages
)
#Searches for ROOT Package
find_package
(
ROOT 6.22 CONFIG REQUIRED
)
if
(
ROOT_FOUND
)
Message
(
"Root was found"
)
list
(
APPEND packages ROOT
)
# The following CMake variables are needed until the modernization is done
set
(
ROOT_CINT_EXECUTABLE
${
ROOT_BINDIR
}
/rootcling
)
set
(
ROOT_CONFIG_EXECUTABLE
${
ROOT_BINDIR
}
/root-config
)
set
(
ROOT_INCLUDE_DIR
${
ROOT_INCLUDE_DIRS
}
)
endif
()
find_package
(
FairCMakeModules REQUIRED
)
...
...
@@ -85,8 +86,7 @@ find_package2(PUBLIC FairLogger)
# at the end after all find_package[2] calls, call once
find_package2_implicit_dependencies
()
if
(
FairLogger_FOUND
)
Message
(
"FairLogger was found"
)
set
(
FAIRLOGGER_FOUND TRUE
)
list
(
APPEND packages FairLogger
)
set
(
FAIRLOGGER_INCLUDE_DIR
${
FairLogger_INCDIR
}
/fairlogger
)
# CbmRoot expects that the Logger include statement does not need any
...
...
@@ -102,74 +102,71 @@ endif()
#Searches for VMC Package
if
(
ROOT_vmc_FOUND
)
set
(
VMCLIB ROOT::VMC
)
Message
(
"Root_VMC was found"
)
list
(
APPEND packages ROOT_vmc
)
else
()
find_package2
(
PUBLIC VMC REQUIRED
)
set
(
VMCLIB VMCLibrary
)
endif
()
if
(
VMC_FOUND
)
Mess
age
(
"
VMC
was found"
)
list
(
APPEND pack
age
s
VMC
)
endif
()
#Searches for FairROOT Package
include
(
FairRootTargets
)
find_package
(
FairRoot REQUIRED
)
if
(
FAIRROOT_FOUND
)
Message
(
"FairRoot was found"
)
list
(
APPEND packages FairRoot
)
set
(
FairRoot_FOUND TRUE
)
endif
()
#Searching for Boost Package
find_package
(
Boost COMPONENTS serialization regex filesystem log log_setup container program_options thread
)
if
(
Boost_FOUND
)
Mess
age
(
"
Boost
was found"
)
list
(
APPEND pack
age
s
Boost
)
endif
()
#Searching for Geant4 Package
find_package
(
Geant4 CONFIG REQUIRED
)
if
(
Geant4_FOUND
)
Mess
age
(
"
Geant4
was found"
)
list
(
APPEND pack
age
s
Geant4
)
endif
()
#Searching for Vc Package
find_package
(
Vc 1.4.1 CONFIG REQUIRED
)
if
(
Vc_FOUND
)
Message
(
"Vc was found"
)
list
(
APPEND packages Vc
)
endif
()
#Searching for VGM Package
find_package
(
VGM CONFIG REQUIRED
)
if
(
VGM_FOUND
)
Message
(
"VGM was found"
)
endif
()
#Searching for Geant4VMC Package
find_package
(
Geant4VMC CONFIG REQUIRED
)
if
(
Geant4VMC_FOUND
)
Mess
age
(
"
Geant4VMC
was found"
)
list
(
APPEND pack
age
s
Geant4VMC
)
endif
()
#Searching for Geant3 Package
find_package
(
Geant3 CONFIG REQUIRED
)
if
(
Geant3_FOUND
)
Mess
age
(
"
Geant3
was found"
)
list
(
APPEND pack
age
s
Geant3
)
endif
()
#Searching for SSE
find_package
(
SSE REQUIRED
)
if
(
SSE_FOUND
)
Mess
age
(
"
SSE
was found"
)
list
(
APPEND pack
age
s
SSE
)
endif
()
#Searching for FairMQ
find_package
(
FairMQ CONFIG REQUIRED
)
if
(
FairMQ_FOUND
)
Message
(
"FairMQ was found"
)
set
(
FAIRMQ_INCLUDE_DIR
${
FairMQ_INCDIR
}
/fairmq
)
list
(
APPEND packages FairMQ
)
get_target_property
(
_inDirMQ FairMQ::FairMQ INTERFACE_INCLUDE_DIRECTORIES
)
set_property
(
TARGET FairMQ::FairMQ APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
"
${
_inDirMQ
}
/fairmq/options"
)
endif
()
...
...
@@ -204,24 +201,9 @@ If(DEFINED ENV{OMP_NUM_THREADS} )
set
(
OMP_NUM_THREADS $ENV{OMP_NUM_THREADS}
)
endif
()
# set a variable which should be used in all CMakeLists.txt
# Defines all basic include directories from fairbase
SetBasicVariables
()
# Add the Geant3 include directory such that ROOT can find TGeant3.h
# Has to be done after calling SetBasicVariables, otherwise the value
# is overwritten
SET
(
ROOT_INCLUDE_PATH
${
ROOT_INCLUDE_PATH
}
"
${
Geant3_INCLUDE_DIRS
}
"
)
Set
(
BASE_INCLUDE_DIRECTORIES
${
BASE_INCLUDE_DIRECTORIES
}
${
SYSTEM_INCLUDE_DIRECTORIES
}
${
FAIRLOGGER_INCLUDE_DIR
}
${
VMC_INCLUDE_DIRS
}
)
SET
(
CBMLIBDIR
${
CMAKE_BINARY_DIR
}
/lib
)
SET
(
LD_LIBRARY_PATH
${
CBMLIBDIR
}
${
Boost_LIBRARY_DIRS
}
${
LD_LIBRARY_PATH
}
)
set
(
CBMLIBDIR
${
CMAKE_BINARY_DIR
}
/lib
)
set
(
LD_LIBRARY_PATH
${
CBMLIBDIR
}
${
Boost_LIBRARY_DIRS
}
${
LD_LIBRARY_PATH
}
${
FAIRROOT_LIBRARY_DIR
}
)
set
(
ROOT_INCLUDE_PATH
${
FAIRROOT_INCLUDE_DIR
}
)
# Recurse into the given subdirectories. This does not actually
# cause another cmake executable to run. The same process will walk through
...
...
@@ -241,17 +223,6 @@ endif()
# following targets
add_subdirectory
(
external
)
set
(
BASE_INCLUDE_DIRECTORIES
${
BASE_INCLUDE_DIRECTORIES
}
${
XPU_INCLUDE_DIRECTORY
}
# Required for XPU_D macro in base data types
)
set
(
BASE_INCLUDE_DIRECTORIES
${
BASE_INCLUDE_DIRECTORIES
}
${
GSL_INCLUDE_DIRECTORY
}
)
### Base directories
add_subdirectory
(
core
)
...
...
@@ -300,3 +271,5 @@ generate_config_files()
Install
(
DIRECTORY geometry input parameters
DESTINATION share/cbmroot
PATTERN
".git"
EXCLUDE
)
print_info
()
This diff is collapsed.
Click to expand it.
cmake/modules/CbmMacros.cmake
+
61
−
0
View file @
0633dfd7
...
...
@@ -271,3 +271,64 @@ macro(generate_cbm_executable)
set
(
INTERFACE_DEPENDENCIES
)
endmacro
(
generate_cbm_executable
)
macro
(
print_info
)
set
(
CR
"
${
Esc
}
[m"
)
set
(
CB
"
${
Esc
}
[1m"
)
set
(
Red
"
${
Esc
}
[31m"
)
set
(
Green
"
${
Esc
}
[32m"
)
set
(
Yellow
"
${
Esc
}
[33m"
)
set
(
Blue
"
${
Esc
}
[34m"
)
set
(
Magenta
"
${
Esc
}
[35m"
)
set
(
Cyan
"
${
Esc
}
[36m"
)
set
(
White
"
${
Esc
}
[37m"
)
set
(
BRed
"
${
Esc
}
[1;31m"
)
set
(
BGreen
"
${
Esc
}
[1;32m"
)
set
(
BYellow
"
${
Esc
}
[1;33m"
)
set
(
BBlue
"
${
Esc
}
[1;34m"
)
set
(
BMagenta
"
${
Esc
}
[1;35m"
)
set
(
BCyan
"
${
Esc
}
[1;36m"
)
set
(
BWhite
"
${
Esc
}
[1;37m"
)
message
(
STATUS
" "
)
message
(
STATUS
"
${
Cyan
}
CXX STANDARD
${
CR
}
${
BGreen
}
C++
${
CMAKE_CXX_STANDARD
}${
CR
}
(change with
${
BMagenta
}
-DCMAKE_CXX_STANDARD=17
${
CR
}
)"
)
if
(
packages
)
list
(
SORT packages
)
message
(
STATUS
" "
)
message
(
STATUS
"
${
Cyan
}
PACKAGE VERSION OPTION
${
CR
}
"
)
foreach
(
dep IN LISTS packages
)
if
(
${${
dep
}
_FOUND
}
} MATCHES
"TRUE"
OR
${${
dep
}
_FOUND
}
} MATCHES
"1"
OR
${${
dep
}
_FOUND
}
} MATCHES
"true"
)
set
(
dep_found
"
${
BGreen
}
-FOUND"
)
else
()
set
(
dep_found
"
${
Red
}
-NOT FOUND"
)
endif
()
pad
(
"
${
BYellow
}${${
dep
}
_VERSION
}${
CR
}
"
15
" "
dep_version COLOR 1
)
pad
(
${
dep
}
20
" "
dep_name
)
pad
(
"
${
dep_found
}${
CR
}
"
15
" "
version_found COLOR 1
)
message
(
STATUS
"
${
BWhite
}${
dep_name
}${
CR
}${
dep_version
}${
version_found
}
"
)
unset
(
dep
)
unset
(
dep_found
)
unset
(
dep_version
)
unset
(
version_found
)
unset
(
dep_name
)
endforeach
()
endif
()
message
(
STATUS
" "
)
message
(
STATUS
"
${
Cyan
}
INSTALL PREFIX
${
CR
}
${
BGreen
}${
CMAKE_INSTALL_PREFIX
}${
CR
}
(change with
${
BMagenta
}
-DCMAKE_INSTALL_PREFIX=...
${
CR
}
)"
)
message
(
STATUS
" "
)
message
(
STATUS
"
${
Cyan
}
SIMPATH =
${
BGreen
}${
SIMPATH
}${
CR
}
"
)
message
(
STATUS
"
${
Cyan
}
FAIRROOTPATH =
${
BGreen
}${
FAIRROOTPATH
}${
CR
}
"
)
message
(
STATUS
" "
)
message
(
STATUS
"
${
Cyan
}
CbmRoot Version::
${
BGreen
}${
CBMROOT_VERSION
}${
CR
}
"
)
message
(
STATUS
" "
)
endmacro
(
print_info
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment