diff --git a/.cmake-format b/.cmake-format index 39b9d6e4f..8f897774c 100644 --- a/.cmake-format +++ b/.cmake-format @@ -6,6 +6,14 @@ line_width = 100 # How many spaces to tab for indent tab_size = 4 +# If a candidate layout is wrapped horizontally but it exceeds this many +# lines, then reject the layout. +max_lines_hwrap = 4 + +# If a positional argument group contains more than this many arguments, then +# force it to a vertical layout. +max_pargs_hwrap = 4 + # If true, separate flow control names from their parentheses with a space separate_ctrl_name_with_space = False @@ -39,4 +47,5 @@ enable_markup = False # If true, the argument lists which are known to be sortable will be sorted # lexicographicall +autosort = True enable_sort = True diff --git a/.github/actions/pre-build/action.yml b/.github/actions/pre-build/action.yml index 294951d7b..456439d12 100644 --- a/.github/actions/pre-build/action.yml +++ b/.github/actions/pre-build/action.yml @@ -25,7 +25,8 @@ runs: - name: mount cvmfs run: | - apt-get install -y ccache + apt-get update + apt-get install --fix-missing -y ccache sudo wget https://cernbox.cern.ch/remote.php/dav/public-files/RmnTeeOZpYjCJQb/masterkey.gsi.de.pub mv masterkey.gsi.de.pub /etc/cvmfs/keys cp .githubfiles/fairsoft.gsi.de.conf /etc/cvmfs/config.d diff --git a/CMakeLists.txt b/CMakeLists.txt index 73caecc74..0c1268189 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,10 @@ if(SIMPATH) set(CMAKE_PREFIX_PATH ${SIMPATH} ${CMAKE_PREFIX_PATH}) endif() +# fairsoft lib path needed to be added for root dictionary detection: +set(LD_LIBRARY_PATH ${SIMPATH}/lib ${LD_LIBRARY_PATH}) +set(GRAPHVIZ_EXTERNAL_LIBS FALSE) + if(NOT DEFINED ENV{FAIRROOTPATH}) message( FATAL_ERROR @@ -63,6 +67,13 @@ string(REGEX MATCHALL "[^:]+" PATH $ENV{PATH}) set(CMAKE_MODULE_PATH "${FAIRROOTPATH}/share/fairbase/cmake/modules" ${CMAKE_MODULE_PATH}) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/scripts" ${CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/utils" ${CMAKE_MODULE_PATH}) + +# For CMakeLists that still use the old way +set(ROOT_FOUND_VERSION 600000) +set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib") +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") set(CheckSrcDir "${FAIRROOTPATH}/share/fairbase/cmake/checks") @@ -84,6 +95,7 @@ if(NOT FairCMakeModules_FOUND) message(FATAL_ERROR "Could not find FairCMakeModules! ") endif() +include(create_library_with_dictionary) include(FairFindPackage2) include(FairFormattedOutput) @@ -118,9 +130,9 @@ list(APPEND optional_root_components gdml vmc) find_package2( PUBLIC ROOT - VERSION - 6.16.00 - MODULE + # VERSION + # 6.16.00 + CONFIG REQUIRED COMPONENTS ${required_root_components} @@ -137,28 +149,41 @@ endif() include(R3BMacros) include(WriteConfigFile_r3b) include(WriteEnvCache) -include(Dart) include(CheckCompiler) -include(ROOTMacros) -find_package2(PUBLIC FairLogger VERSION 1.6.0 REQUIRED) +find_package2( + PUBLIC + FairLogger + VERSION + 1.6.0 + REQUIRED) foreach(dep IN LISTS FairLogger_PACKAGE_DEPENDENCIES) if(NOT dep STREQUAL "Boost") - find_package2(PUBLIC ${dep} REQUIRED VERSION ${FairLogger_${dep}_VERSION}) + find_package2( + PUBLIC + ${dep} + REQUIRED + VERSION + ${FairLogger_${dep}_VERSION}) endif() endforeach() if("${FairRoot_VERSION}" VERSION_GREATER 18.6.4) - find_package2(PUBLIC FairMQ VERSION 1.4.0 REQUIRED) + find_package2( + PUBLIC + FairMQ + VERSION + 1.4.0 + REQUIRED) find_package2(PUBLIC DDS) if(FAIRSOFT_EXTERN) - set(BOOST_ROOT ${SIMPATH}) + set(Boost_ROOT ${SIMPATH}) set(GSL_DIR ${SIMPATH}) else(FAIRSOFT_EXTERN) - set(BOOST_ROOT ${SIMPATH}/basics/boost) + set(Boost_ROOT ${SIMPATH}/basics/boost) set(GSL_DIR ${SIMPATH}/basics/gsl) endif(FAIRSOFT_EXTERN) @@ -215,10 +240,10 @@ else() set(Boost_NO_BOOST_CMAKE TRUE) if(${ROOT_LIBRARY_DIR} MATCHES /lib/root) - set(BOOST_ROOT ${SIMPATH}) + set(Boost_ROOT ${SIMPATH}) set(GSL_DIR ${SIMPATH}) else(${ROOT_LIBRARY_DIR} MATCHES /lib/root) - set(BOOST_ROOT ${SIMPATH}/basics/boost) + set(Boost_ROOT ${SIMPATH}/basics/boost) set(GSL_DIR ${SIMPATH}/basics/gsl) endif(${ROOT_LIBRARY_DIR} MATCHES /lib/root) @@ -294,8 +319,8 @@ set(CMAKE_CXX_FLAGS "-D_GLIBCXX_ASSERTIONS ${CMAKE_CXX_FLAGS}") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # used by clang-tidy -set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib") -set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") set(INCLUDE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/include") set(VMCWORKDIR ${CMAKE_SOURCE_DIR}) @@ -334,7 +359,12 @@ find_package2(PUBLIC yaml-cpp) # Workaround missing exported include directories # Upstream has fixed this in https://github.com/jbeder/yaml-cpp/commit/ab5f9259a4e67d3fe0e4832bd407a9e596e2d884 (since 0.6.3) if(yaml-cpp_FOUND) - get_filename_component(YAML_CPP_INCLUDE_DIR "${YAML_CPP_INCLUDE_DIR}" REALPATH BASE_DIR "/") + get_filename_component( + YAML_CPP_INCLUDE_DIR + "${YAML_CPP_INCLUDE_DIR}" + REALPATH + BASE_DIR + "/") endif() if(yaml-cpp_FOUND AND TARGET yaml-cpp @@ -359,8 +389,12 @@ if(NOT DEFINED ROOT_FOUND_VERSION) endif() message("ROOT_FOUND_VERSION = ${ROOT_FOUND_VERSION}") -set(FAIRROOT_LIBRARY_PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES} VERSION "${R3BROOT_VERSION}" - SOVERSION "${R3BROOT_VERSION}") +set(FAIRROOT_LIBRARY_PROPERTIES + ${FAIRROOT_LIBRARY_PROPERTIES} + VERSION + "${R3BROOT_VERSION}" + SOVERSION + "${R3BROOT_VERSION}") string(COMPARE EQUAL "${CMAKE_GENERATOR}" "Xcode" IS_XCODE) set(R3BLIBDIR ${CMAKE_BINARY_DIR}/lib) @@ -473,6 +507,15 @@ r3b_generate_version_info() find_package(VMC QUIET) set(BASE_INCLUDE_DIRECTORIES ${BASE_INCLUDE_DIRECTORIES} ${VMC_INCLUDE_DIRS}) +find_program( + ROOT_CINT_EXECUTABLE + NAMES rootcint + PATHS ${ROOT_BINDIR} + NO_DEFAULT_PATH) + +include(CTest) +include(RootCTest) + if(MODULE) add_subdirectory(${MODULE}) endif(MODULE) @@ -488,16 +531,15 @@ if(NOT MODULE) endif() message(STATUS " ${BWhite}ROOT geometries${CR} ${unitgeo_summary}") add_subdirectory(r3bbase) + add_subdirectory(r3bdata) + add_subdirectory(field) + add_subdirectory(tracking) + add_subdirectory(passive) + add_subdirectory(tcal) if(WITH_UCESB) add_subdirectory(r3bsource) - endif(WITH_UCESB) - if(WITH_EPICS) - add_subdirectory(epics) - endif(WITH_EPICS) - if(Atima_FOUND) - add_subdirectory(atima) - endif(Atima_FOUND) - add_subdirectory(passive) + endif() + add_subdirectory(neuland) add_subdirectory(glad) add_subdirectory(xball) add_subdirectory(dch) @@ -505,7 +547,6 @@ if(NOT MODULE) add_subdirectory(gfi) add_subdirectory(mfi) add_subdirectory(land) - add_subdirectory(neuland) add_subdirectory(los) add_subdirectory(rolu) add_subdirectory(frssci) @@ -520,33 +561,36 @@ if(NOT MODULE) add_subdirectory(tttx) add_subdirectory(strawtubes) add_subdirectory(music) - add_subdirectory(r3bdata) - add_subdirectory(field) add_subdirectory(r3bgen) add_subdirectory(lumon) + add_subdirectory(califa) add_subdirectory(evtvis) add_subdirectory(psp) add_subdirectory(compilehelper) - add_subdirectory(tcal) - add_subdirectory(tracking) - add_subdirectory(analysis) add_subdirectory(tracker_rene) add_subdirectory(pdc) - add_subdirectory(califa) add_subdirectory(rpc) add_subdirectory(alpide) add_subdirectory(mwpc) add_subdirectory(twim) add_subdirectory(musli) - if(WITH_ACTAR) - add_subdirectory(actar) - endif(WITH_ACTAR) + add_subdirectory(analysis) + + #================================================================================ + # TODO: Since other dependencies still use the old cmake configurations, include(ROOTMacros) has to be used. Please change them using CMake targets ASAP. + include(ROOTMacros) if(WITH_SOFIA) add_subdirectory(sofia) endif(WITH_SOFIA) - if(WITH_NeuLAND_DNN) - add_subdirectory(NeuLAND_DNN) - endif(WITH_NeuLAND_DNN) + if(WITH_EPICS) + add_subdirectory(epics) + endif(WITH_EPICS) + if(Atima_FOUND) + add_subdirectory(atima) + endif(Atima_FOUND) + if(WITH_ACTAR) + add_subdirectory(actar) + endif(WITH_ACTAR) if(WITH_GTPC) add_subdirectory(glad-tpc) endif(WITH_GTPC) @@ -562,6 +606,8 @@ if(NOT MODULE) if(EXISTS "${PROJECT_SOURCE_DIR}/macros") add_subdirectory(macros) endif(EXISTS "${PROJECT_SOURCE_DIR}/macros") + #================================================================================ + endif(NOT MODULE) # add_subdirectory(gconfig) @@ -648,7 +694,13 @@ if(PROJECT_PACKAGE_DEPENDENCIES) if(DISABLE_COLOR) fair_pad("${version_str}${version_req_str}" 26 " " version_padded) else() - fair_pad("${version_str}${version_req_str}" 26 " " version_padded COLOR 1) + fair_pad( + "${version_str}${version_req_str}" + 26 + " " + version_padded + COLOR + 1) endif() set(prefix ${${dep}_PREFIX}) if(${dep} STREQUAL Boost) @@ -711,7 +763,12 @@ if(PROJECT_PACKAGE_DEPENDENCIES) # endif() if(${dep} STREQUAL Geant4) foreach(dataset IN LISTS Geant4_DATASETS) - fair_pad(${Geant4_DATASET_${dataset}_ENVVAR} 21 " " envvar_padded LEFT) + fair_pad( + ${Geant4_DATASET_${dataset}_ENVVAR} + 21 + " " + envvar_padded + LEFT) message( STATUS " ${envvar_padded}: ${Geant4_DATASET_${dataset}_PATH}" diff --git a/README.md b/README.md index efa02cb21..678a222f4 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,19 @@ [![CI-CD](https://github.com/R3BRootGroup/R3BRoot/actions/workflows/main.yml/badge.svg)](https://github.com/R3BRootGroup/R3BRoot/actions/workflows/main.yml) [![Static Analysis](https://github.com/R3BRootGroup/R3BRoot/actions/workflows/static_analysis.yml/badge.svg)](https://github.com/R3BRootGroup/R3BRoot/actions/workflows/static_analysis.yml) [![Validate Codemeta](https://github.com/R3BRootGroup/R3BRoot/actions/workflows/codemeta_validate.yaml/badge.svg)](https://github.com/R3BRootGroup/R3BRoot/actions/workflows/codemeta_validate.yaml) [![Cleanup Caches on PR Close](https://github.com/R3BRootGroup/R3BRoot/actions/workflows/cleanup_cache.yml/badge.svg)](https://github.com/R3BRootGroup/R3BRoot/actions/workflows/cleanup_cache.yml) ## The R3BRoot Framework + The R3BRoot software is based on the FairRoot framework and can be used to perform Monte Carlo simulations and experimental data analysis of the R3B (Reactions with Relativistic Radioactive Beams) nuclear physics experiments at the GSI-FAIR research center (Facility for Antiproton and Ion Research). The user can create simulated data and/or perform analysis with the same framework. Geant3 and Geant4 transport engines are supported, however, the implemented tasks that create simulated data do not depend on a particular Monte Carlo engine. The framework delivers base classes which enable the users to construct their detectors and/or analysis tasks in a simple way, it also delivers some general functionality like track visualization. Moreover, an interface for reading experimental and/or simulated magnetic field maps is also implemented. ## Discussion Forum + For the software-related user support you can post a new topic on our [forum](https://forum.gsi.de/index.php?t=index&cat=40&). ## License + R3BRoot is distributed under the terms of the GNU General Public Licence version 3 ([GPLv3](https://github.com/R3BRootGroup/R3BRoot/blob/dev/LICENSE)). ## Release Information + Please visit [releases](https://github.com/R3BRootGroup/R3BRoot/releases) ## Download @@ -25,6 +29,7 @@ git clone https://github.com/R3BRootGroup/macros.git ## Step by Step Installation ### Required Software + First, you will need to install FairSoft and FairRoot. For more details: 1. Install [FairSoft](https://github.com/FairRootGroup/FairSoft) @@ -34,15 +39,13 @@ First, you will need to install FairSoft and FairRoot. For more details: ### Configure and Compile ~~~bash -from %R3BRoot_DIRECTORY% -cd .. -mkdir build -cd build export SIMPATH=%PATH_TO_FAIRSOFT% export FAIRROOTPATH=%PATH_TO_FAIRROOT% -cmake ../R3BRoot -. config.sh -make -j6 +from %R3BRoot_DIRECTORY% +mkdir build +cmake -S . -B ./build +cmake --build ./build +source build/config.sh ~~~ To run the detector tests do: @@ -54,16 +57,21 @@ make -j8 test ~~~ ## Simulations and Data Analysis + This is performed from the GitHub parameter and data analysis repository, which contains all the macros and parameter files needed by the user to carry out the simulations and data analysis of each experiment. There is one repository per experiment, please, visit the [R3B-Wiki](https://wiki.r3b-nustar.de) for more details. ## Contributing + Please ask your questions, request features, and report issues by [creating a github issue](https://github.com/R3BRootGroup/R3BRoot/issues/new/choose). ## Code Formatting + The R3BRoot project uses clang-format-15 to ensure a common code formatting. The script "clang-format-all.sh" can be used for this purpose: ~~~bash source util/clang-format-all.sh ~~~ -## Static analyzer using Clang-tidy -Please go to this [instruction](config/clang_tidy/README.md). +## More Information + +* [Static analyzer using Clang-tidy](config/clang_tidy/README.md) +* [CMake build system for R3BRoot](doc/cmake_usage.md) diff --git a/alpide/CMakeLists.txt b/alpide/CMakeLists.txt index b54729c78..ed5f4605d 100644 --- a/alpide/CMakeLists.txt +++ b/alpide/CMakeLists.txt @@ -1,4 +1,3 @@ - ############################################################################## # Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH # # Copyright (C) 2022-2023 Members of R3B Collaboration # @@ -12,62 +11,39 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BAlpide" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -${Boost_INCLUDE_DIR} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/alpideData -${R3BROOT_SOURCE_DIR}/passive -${R3BROOT_SOURCE_DIR}/alpide -${R3BROOT_SOURCE_DIR}/alpide/sim -${R3BROOT_SOURCE_DIR}/alpide/digi -${R3BROOT_SOURCE_DIR}/alpide/geo -${R3BROOT_SOURCE_DIR}/alpide/pars -${R3BROOT_SOURCE_DIR}/alpide/calibration -${R3BROOT_SOURCE_DIR}/alpide/online -) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) -link_directories( ${LINK_DIRECTORIES}) - -file(GLOB SRCS -./sim/*.cxx -./digi/*.cxx -./geo/*.cxx -./pars/*.cxx -./calibration/*.cxx -./online/*.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF AlpideLinkDef.h) -set(LIBRARY_NAME R3BAlpide) -set(DEPENDENCIES - R3BBase R3BData R3BPassive R3BTracking Boost::regex) - -GENERATE_LIBRARY() +file( + GLOB + SRCS + sim/*.cxx + digi/*.cxx + geo/*.cxx + pars/*.cxx + calibration/*.cxx + online/*.cxx) + +change_file_extension(*.cxx *.h HEADERS "${SRCS}") + +add_library_with_dictionary( + LIBNAME + R3BAlpide + LINKDEF + AlpideLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + sim + digi + geo + pars + calibration + online + DEPENDENCIES + R3BPassive) if(BUILD_GEOMETRY) - add_subdirectory(geobase) + add_subdirectory(geobase) endif() add_subdirectory(test) diff --git a/analysis/AnaLinkDef.h b/analysis/AnaLinkDef.h index a84155faf..16aef363d 100644 --- a/analysis/AnaLinkDef.h +++ b/analysis/AnaLinkDef.h @@ -53,5 +53,9 @@ #pragma link C++ class R3BTofDvsTttxOnlineSpectra+; #pragma link C++ class R3BOnlineSyncCheck+; #pragma link C++ class R3BScalersOnlineSpectra+; +#pragma link C++ class R3BMSOffsetContFact+; +#pragma link C++ class R3BMSOffsetPar+; +#pragma link C++ class R3BMSOffsetFinder+; +#pragma link C++ class R3BTprevTnext+; #endif diff --git a/analysis/CMakeLists.txt b/analysis/CMakeLists.txt index 05d231261..00f4af5c4 100644 --- a/analysis/CMakeLists.txt +++ b/analysis/CMakeLists.txt @@ -11,101 +11,38 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BAnalysis" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/passive -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/los -${R3BROOT_SOURCE_DIR}/rolu -${R3BROOT_SOURCE_DIR}/sci2 -${R3BROOT_SOURCE_DIR}/sci8 -${R3BROOT_SOURCE_DIR}/music/pars -${R3BROOT_SOURCE_DIR}/tof -${R3BROOT_SOURCE_DIR}/tofi -${R3BROOT_SOURCE_DIR}/tofd/online -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/fiber -${R3BROOT_SOURCE_DIR}/fiber/pars -${R3BROOT_SOURCE_DIR}/fibers -${R3BROOT_SOURCE_DIR}/fibers/fi30 -${R3BROOT_SOURCE_DIR}/fibers/fi31 -${R3BROOT_SOURCE_DIR}/fibers/fi32 -${R3BROOT_SOURCE_DIR}/fibers/fi33 -${R3BROOT_SOURCE_DIR}/fibers/fi23a -${R3BROOT_SOURCE_DIR}/fibers/fi23b -${R3BROOT_SOURCE_DIR}/ssd/online -${R3BROOT_SOURCE_DIR}/los/online -${R3BROOT_SOURCE_DIR}/califa/online -${R3BROOT_SOURCE_DIR}/music/online -${R3BROOT_SOURCE_DIR}/twim/online -${R3BROOT_SOURCE_DIR}/mwpc/online -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/landData -${R3BROOT_SOURCE_DIR}/r3bdata/beammonitorData -${R3BROOT_SOURCE_DIR}/r3bdata/neulandData -${R3BROOT_SOURCE_DIR}/r3bdata/califaData -${R3BROOT_SOURCE_DIR}/r3bdata/alpideData -${R3BROOT_SOURCE_DIR}/r3bdata/tttxData -${R3BROOT_SOURCE_DIR}/r3bdata/startrackData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/roluData -${R3BROOT_SOURCE_DIR}/r3bdata/sci2Data -${R3BROOT_SOURCE_DIR}/r3bdata/sci8Data -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/tofiData -${R3BROOT_SOURCE_DIR}/r3bdata/pdcData -${R3BROOT_SOURCE_DIR}/r3bdata/pspData -${R3BROOT_SOURCE_DIR}/r3bdata/fibData -${R3BROOT_SOURCE_DIR}/r3bdata/frssciData -${R3BROOT_SOURCE_DIR}/r3bdata/ptofData -${R3BROOT_SOURCE_DIR}/r3bdata/sampData -${R3BROOT_SOURCE_DIR}/r3bdata/sfibData -${R3BROOT_SOURCE_DIR}/r3bdata/musicData -${R3BROOT_SOURCE_DIR}/r3bdata/musliData -${R3BROOT_SOURCE_DIR}/r3bdata/twimData -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -${R3BROOT_SOURCE_DIR}/r3bdata/frsData -${R3BROOT_SOURCE_DIR}/r3bdata/footData -${R3BROOT_SOURCE_DIR}/r3bdata/rpcData -${R3BROOT_SOURCE_DIR}/r3bdata/wrData -${R3BROOT_SOURCE_DIR}/r3bdata/synccheckData -${R3BROOT_SOURCE_DIR}/r3bdata/trloiiData -${R3BROOT_SOURCE_DIR}/tracker_rene -${R3BROOT_SOURCE_DIR}/analysis -${R3BROOT_SOURCE_DIR}/analysis/pars -${R3BROOT_SOURCE_DIR}/analysis/offline -${R3BROOT_SOURCE_DIR}/analysis/online -${R3BROOT_SOURCE_DIR}/neuland/shared -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -link_directories(${FAIRROOT_LIBRARY_DIR} ${ROOT_LIBRARY_DIR}) - -file(GLOB SRCS ./online/*.cxx ./offline/*.cxx ./pars/*.cxx) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF AnaLinkDef.h) - -Set(DEPENDENCIES -GeoBase ParBase MbsAPI Base FairTools R3BPassive R3BData Core Geom GenVector Physics Matrix MathCore R3BTraRene R3BTracking -R3BSsd R3BLos R3BCalifa R3BMwpc R3BTofD R3BTwim R3BMusic R3BBunchedFiber -) - -Set(LIBRARY_NAME R3BAnalysis) - -GENERATE_LIBRARY() +file( + GLOB + SRCS + ./online/*.cxx + ./offline/*.cxx + ./pars/*.cxx) + +change_file_extension(*.cxx *.h HEADERS "${SRCS}") + +add_library_with_dictionary( + LIBNAME + R3BAnalysis + LINKDEF + AnaLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + offline + online + pars + DEPENDENCIES + R3BTraRene + R3BLos + R3BCalifa + R3BMwpc + R3BSsd + R3BTof + R3BTofD + R3BTofi + R3BTwim + R3BMusic + R3BBunchedFiber) diff --git a/r3bbase/R3BTprevTnext.cxx b/analysis/offline/R3BTprevTnext.cxx similarity index 100% rename from r3bbase/R3BTprevTnext.cxx rename to analysis/offline/R3BTprevTnext.cxx diff --git a/r3bbase/R3BTprevTnext.h b/analysis/offline/R3BTprevTnext.h similarity index 100% rename from r3bbase/R3BTprevTnext.h rename to analysis/offline/R3BTprevTnext.h diff --git a/r3bbase/pars/R3BMSOffsetContFact.cxx b/analysis/pars/R3BMSOffsetContFact.cxx similarity index 100% rename from r3bbase/pars/R3BMSOffsetContFact.cxx rename to analysis/pars/R3BMSOffsetContFact.cxx diff --git a/r3bbase/pars/R3BMSOffsetContFact.h b/analysis/pars/R3BMSOffsetContFact.h similarity index 100% rename from r3bbase/pars/R3BMSOffsetContFact.h rename to analysis/pars/R3BMSOffsetContFact.h diff --git a/r3bbase/pars/R3BMSOffsetFinder.cxx b/analysis/pars/R3BMSOffsetFinder.cxx similarity index 100% rename from r3bbase/pars/R3BMSOffsetFinder.cxx rename to analysis/pars/R3BMSOffsetFinder.cxx diff --git a/r3bbase/pars/R3BMSOffsetFinder.h b/analysis/pars/R3BMSOffsetFinder.h similarity index 100% rename from r3bbase/pars/R3BMSOffsetFinder.h rename to analysis/pars/R3BMSOffsetFinder.h diff --git a/r3bbase/pars/R3BMSOffsetPar.cxx b/analysis/pars/R3BMSOffsetPar.cxx similarity index 100% rename from r3bbase/pars/R3BMSOffsetPar.cxx rename to analysis/pars/R3BMSOffsetPar.cxx diff --git a/r3bbase/pars/R3BMSOffsetPar.h b/analysis/pars/R3BMSOffsetPar.h similarity index 100% rename from r3bbase/pars/R3BMSOffsetPar.h rename to analysis/pars/R3BMSOffsetPar.h diff --git a/califa/CMakeLists.txt b/califa/CMakeLists.txt index 03f62d7be..e8de8be21 100644 --- a/califa/CMakeLists.txt +++ b/califa/CMakeLists.txt @@ -11,64 +11,37 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BCalifa" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -${Boost_INCLUDE_DIR} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/passive -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/califa -${R3BROOT_SOURCE_DIR}/califa/online -${R3BROOT_SOURCE_DIR}/califa/calibration -${R3BROOT_SOURCE_DIR}/califa/ana -${R3BROOT_SOURCE_DIR}/califa/pars -${R3BROOT_SOURCE_DIR}/califa/sim -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/wrData -${R3BROOT_SOURCE_DIR}/r3bdata/califaData -${R3BROOT_SOURCE_DIR}/r3bdata/amsData -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -file(GLOB SRCS -./sim/*.cxx -./pars/*.cxx -./online/*.cxx -./calibration/*.cxx -./ana/*.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF CalifaLinkDef.h) -set(LIBRARY_NAME R3BCalifa) - -set(DEPENDENCIES - Spectrum R3BBase R3BPassive R3BData R3BTracking Boost::regex) - -GENERATE_LIBRARY() +file( + GLOB + SRCS + ./sim/*.cxx + ./pars/*.cxx + ./online/*.cxx + ./calibration/*.cxx + ./ana/*.cxx) + +change_file_extension(*.cxx *.h HEADERS "${SRCS}") + +add_library_with_dictionary( + LIBNAME + R3BCalifa + LINKDEF + CalifaLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + sim + pars + online + calibration + ana + DEPENDENCIES + R3BPassive) if(BUILD_GEOMETRY) - add_subdirectory(geobase) + add_subdirectory(geobase) endif() add_subdirectory(test) diff --git a/cmake/CI_CD/CDash.cmake b/cmake/CI_CD/CDash.cmake index 7993572f9..e2559fa57 100644 --- a/cmake/CI_CD/CDash.cmake +++ b/cmake/CI_CD/CDash.cmake @@ -3,7 +3,9 @@ # mandatory cmake variable definition set(CTEST_SOURCE_DIRECTORY "${CTEST_SCRIPT_DIRECTORY}/../..") set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build") -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") +set(CTEST_CONFIGURE_COMMAND + "${CMAKE_COMMAND} -S ${CTEST_SOURCE_DIRECTORY} -B ${CTEST_BINARY_DIRECTORY}") +set(CTEST_BUILD_COMMAND "${CMAKE_COMMAND} --build ${CTEST_BINARY_DIRECTORY}") #include macros and function definition include(${CTEST_SOURCE_DIRECTORY}/cmake/CI_CD/Macros.cmake) diff --git a/cmake/modules/Finducesb.cmake b/cmake/modules/Finducesb.cmake index 2364663e6..8cac68751 100644 --- a/cmake/modules/Finducesb.cmake +++ b/cmake/modules/Finducesb.cmake @@ -29,48 +29,53 @@ set(ucesb_LIBRARY_SHARED ext_data_clnt) set(ucesb_LIBRARY_STATIC ext_data_clnt.o) -find_path(ucesb_INCLUDE_DIR NAMES ext_data_clnt.hh ext_h101.h - PATHS $ENV{UCESB_DIR} - $ENV{UCESB_DIR}/hbook - NO_DEFAULT_PATH - DOC "Path to ucesb include header files." -) +find_path( + ucesb_INCLUDE_DIR + NAMES ext_data_clnt.hh ext_h101.h + PATHS $ENV{UCESB_DIR} $ENV{UCESB_DIR}/hbook + NO_DEFAULT_PATH + DOC "Path to ucesb include header files.") -find_path(ucesb_LIBRARY_DIR NAMES "lib${ucesb_LIBRARY_SHARED}.so" - PATHS $ENV{UCESB_DIR} - $ENV{UCESB_DIR}/hbook - NO_DEFAULT_PATH - DOC "Path to ucesb library files." -) +find_path( + ucesb_LIBRARY_DIR + NAMES "lib${ucesb_LIBRARY_SHARED}.so" + PATHS $ENV{UCESB_DIR} $ENV{UCESB_DIR}/hbook + NO_DEFAULT_PATH + DOC "Path to ucesb library files.") #find_library(ucesb_LIBRARY_SHARED NAMES ${ucesb_LIBRARY_SHARED} # PATHS $ENV{UCESB_DIR}/hbook # NO_DEFAULT_PATH # DOC "Path to ${LIBucesb_SHARED}." #) -find_library(ucesb_LIBRARY_STATIC NAMES ${ucesb_LIBRARY_STATIC} - PATHS $ENV{UCESB_DIR}/hbook - NO_DEFAULT_PATH - DOC "Path to ${LIBucesb_STATIC}." -) +find_library( + ucesb_LIBRARY_STATIC + NAMES ${ucesb_LIBRARY_STATIC} + PATHS $ENV{UCESB_DIR}/hbook + NO_DEFAULT_PATH + DOC "Path to ${LIBucesb_STATIC}.") + +add_library(Ucesb SHARED IMPORTED GLOBAL) +set_property(TARGET Ucesb PROPERTY IMPORTED_LOCATION + "${ucesb_LIBRARY_DIR}/lib${ucesb_LIBRARY_SHARED}.so") +target_include_directories(Ucesb INTERFACE $ENV{UCESB_DIR}/hbook) if(ucesb_INCLUDE_DIR - AND ucesb_LIBRARY_SHARED - AND ucesb_LIBRARY_STATIC - AND ucesb_LIBRARY_DIR -) - set(ucesb_FOUND true) -else(ucesb_INCLUDE_DIR - AND ucesb_LIBRARY_SHARED - AND ucesb_LIBRARY_STATIC - AND ucesb_LIBRARY_DIR -) - set(ucesb_FOUND false) -endif(ucesb_INCLUDE_DIR - AND ucesb_LIBRARY_SHARED - AND ucesb_LIBRARY_STATIC - AND ucesb_LIBRARY_DIR -) + AND ucesb_LIBRARY_SHARED + AND ucesb_LIBRARY_STATIC + AND ucesb_LIBRARY_DIR) + set(ucesb_FOUND true) +else( + ucesb_INCLUDE_DIR + AND ucesb_LIBRARY_SHARED + AND ucesb_LIBRARY_STATIC + AND ucesb_LIBRARY_DIR) + set(ucesb_FOUND false) +endif( + ucesb_INCLUDE_DIR + AND ucesb_LIBRARY_SHARED + AND ucesb_LIBRARY_STATIC + AND ucesb_LIBRARY_DIR) message(" - ${Cyan}UCESB_DIR${CR} = ${BGreen}$ENV{UCESB_DIR}${CR}") message(" - ${Cyan}ucesb_INCLUDE_DIR${CR} = ${BGreen}${ucesb_INCLUDE_DIR}${CR}") @@ -79,25 +84,20 @@ message(" - ${Cyan}ucesb_LIBRARY_STATIC${CR} = ${BGreen}${ucesb_LIBRARY_STATI message(" - ${Cyan}ucesb_LIBRARY_DIR${CR} = ${BGreen}${ucesb_LIBRARY_DIR}${CR}") if(ucesb_FOUND) - add_definitions(-DWITH_UCESB) - set(ucesb_LIBRARIES "${ucesb_LIBRARY_STATIC};${ucesb_LIBRARY_SHARED}") - if(NOT ucesb_FIND_QUIETLY) - set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${ucesb_LIBRARY_DIR}) - endif(NOT ucesb_FIND_QUIETLY) - message(STATUS "${BBlue}UCESB was FOUND${CR}") + add_definitions(-DWITH_UCESB) + set(ucesb_LIBRARIES "${ucesb_LIBRARY_STATIC};${ucesb_LIBRARY_SHARED}") + if(NOT ucesb_FIND_QUIETLY) + set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${ucesb_LIBRARY_DIR}) + endif(NOT ucesb_FIND_QUIETLY) + message(STATUS "${BBlue}UCESB was FOUND${CR}") else(ucesb_FOUND) - if(NOT ucesb_FIND_QUIETLY) - if(ucesb_FIND_REQUIRED) - message(FATAL_ERROR "${BRed}Could not find package UCESB${CR}") - else(ucesb_FIND_REQUIRED) - message(STATUS "${BYellow}Could not find package UCESB${CR}") - endif(ucesb_FIND_REQUIRED) - endif(NOT ucesb_FIND_QUIETLY) + if(NOT ucesb_FIND_QUIETLY) + if(ucesb_FIND_REQUIRED) + message(FATAL_ERROR "${BRed}Could not find package UCESB${CR}") + else(ucesb_FIND_REQUIRED) + message(STATUS "${BYellow}Could not find package UCESB${CR}") + endif(ucesb_FIND_REQUIRED) + endif(NOT ucesb_FIND_QUIETLY) endif(ucesb_FOUND) -mark_as_advanced( - ucesb_INCLUDE_DIR - ucesb_LIBRARIES - ucesb_LIBRARY_SHARED - ucesb_LIBRARY_STATIC -) +mark_as_advanced(ucesb_INCLUDE_DIR ucesb_LIBRARIES ucesb_LIBRARY_SHARED ucesb_LIBRARY_STATIC) diff --git a/cmake/scripts/RootCTest.cmake b/cmake/scripts/RootCTest.cmake new file mode 100644 index 000000000..ab8bbc621 --- /dev/null +++ b/cmake/scripts/RootCTest.cmake @@ -0,0 +1,42 @@ +MACRO (GENERATE_ROOT_TEST_SCRIPT SCRIPT_FULL_NAME) + + get_filename_component(path_name ${SCRIPT_FULL_NAME} PATH) + get_filename_component(file_extension ${SCRIPT_FULL_NAME} EXT) + get_filename_component(file_name ${SCRIPT_FULL_NAME} NAME_WE) + set(shell_script_name "${file_name}.sh") + + #MESSAGE("PATH: ${path_name}") + #MESSAGE("Ext: ${file_extension}") + #MESSAGE("Name: ${file_name}") + #MESSAGE("Shell Name: ${shell_script_name}") + + string(REPLACE ${PROJECT_SOURCE_DIR} + ${PROJECT_BINARY_DIR} new_path ${path_name} + ) + + #MESSAGE("New PATH: ${new_path}") + + file(MAKE_DIRECTORY ${new_path}/data) + + CONVERT_LIST_TO_STRING(${LD_LIBRARY_PATH}) + set(MY_LD_LIBRARY_PATH ${output}) + + CONVERT_LIST_TO_STRING(${ROOT_INCLUDE_PATH}) + set(MY_ROOT_INCLUDE_PATH ${output}) + + set(my_script_name ${SCRIPT_FULL_NAME}) + + Write_Geant4Data_Variables_sh() + IF(FAIRROOTPATH) + configure_file(${FAIRROOTPATH}/share/fairbase/cmake/scripts/root_macro.sh.in + ${new_path}/${shell_script_name} + ) + ELSE(FAIRROOTPATH) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/root_macro.sh.in + ${new_path}/${shell_script_name} + ) + ENDIF(FAIRROOTPATH) + execute_process(COMMAND /bin/chmod u+x ${new_path}/${shell_script_name} OUTPUT_QUIET) + +ENDMACRO (GENERATE_ROOT_TEST_SCRIPT) + diff --git a/cmake/utils/create_library_with_dictionary.cmake b/cmake/utils/create_library_with_dictionary.cmake new file mode 100644 index 000000000..03de36a69 --- /dev/null +++ b/cmake/utils/create_library_with_dictionary.cmake @@ -0,0 +1,37 @@ +# generate root dictioanry from cmake target +function(add_library_with_dictionary) + set(options) + set(oneValueArgs LIBNAME LINKDEF) + set(multiValueArgs SRCS INCLUDEDIRS HEADERS PRIVATE_INCLUDEDIRS DEPENDENCIES + PRIVATE_DEPENDENCIES) + cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + add_library(${ARGS_LIBNAME} SHARED ${ARGS_SRCS}) + target_include_directories( + ${ARGS_LIBNAME} + PUBLIC ${ARGS_INCLUDEDIRS} + PRIVATE ${ARGS_PRIVATE_INCLUDEDIRS}) + target_link_libraries( + ${ARGS_LIBNAME} + PUBLIC ${ARGS_DEPENDENCIES} + PRIVATE ${ARGS_PRIVATE_DEPENDENCIES}) + root_generate_dictionary(${ARGS_LIBNAME}_dict ${ARGS_HEADERS} MODULE ${ARGS_LIBNAME} LINKDEF + ${ARGS_LINKDEF}) +endfunction() + +# generate macros using availble variables. Please use create_library_with_dictionary instead. +macro(ADD_LIB_WITH_DIC) + add_library_with_dictionary( + LIBNAME + ${LIBRARY_NAME} + LINKDEF + ${LINKDEF} + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${INCLUDE_DIRS} + DEPENDENCIES + ${DEPENDENCIES}) +endmacro() diff --git a/compilehelper/CMakeLists.txt b/compilehelper/CMakeLists.txt index c5efb2622..37250ca21 100644 --- a/compilehelper/CMakeLists.txt +++ b/compilehelper/CMakeLists.txt @@ -11,58 +11,21 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BCal" which includes the source files given in -# the array . -# The extension is already found. Any number of sources could be listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/passive -${R3BROOT_SOURCE_DIR}/xball -${R3BROOT_SOURCE_DIR}/cal -${R3BROOT_SOURCE_DIR}/cal/unpack -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/caloData -${R3BROOT_SOURCE_DIR}/r3bdata/dchData -${R3BROOT_SOURCE_DIR}/r3bdata/gfiData -${R3BROOT_SOURCE_DIR}/r3bdata/mtofData -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/landData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData -${R3BROOT_SOURCE_DIR}/compilehelper -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DINCLUDE_DIRECTORIES=\"${INCLUDE_DIRECTORIES};${SYSTEM_INCLUDE_DIRECTORIES}\"" ) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -#Put here your sourcefiles -R3BMacroCompiler.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF LinkDef.h) -set(LIBRARY_NAME R3BMacroCompiler) -set(DEPENDENCIES - R3BBase R3BData R3BPassive R3BXBall) - -GENERATE_LIBRARY() - +set(SRCS R3BMacroCompiler.cxx) + +set(HEADERS R3BMacroCompiler.h) + +add_library_with_dictionary( + LIBNAME + R3BMacroCompiler + LINKDEF + LinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BPassive + R3BXBall) diff --git a/dch/CMakeLists.txt b/dch/CMakeLists.txt index e46e220b6..f8cb90559 100644 --- a/dch/CMakeLists.txt +++ b/dch/CMakeLists.txt @@ -12,52 +12,39 @@ ############################################################################## # Create a library called "libR3BDch" which includes the source files given in -# the array. The extension is already found. Any number of sources could be +# the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/dch -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/dchData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -R3BDch.cxx -R3BGeoDch.cxx -R3BGeoDchPar.cxx -R3BDchContFact.cxx -R3BDchDigiPar.cxx -R3BDchDigitizer.cxx -R3BDch2pDigiPar.cxx -R3BDch2pDigitizer.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF DchLinkDef.h) -set(LIBRARY_NAME R3BDch) -set(DEPENDENCIES - R3BBase R3BData) - -GENERATE_LIBRARY() - + R3BDch.cxx + R3BGeoDch.cxx + R3BGeoDchPar.cxx + R3BDchContFact.cxx + R3BDchDigiPar.cxx + R3BDchDigitizer.cxx + R3BDch2pDigiPar.cxx + R3BDch2pDigitizer.cxx) + +set(HEADERS + R3BDch.h + R3BGeoDch.h + R3BGeoDchPar.h + R3BDchContFact.h + R3BDchDigiPar.h + R3BDchDigitizer.h + R3BDch2pDigiPar.h + R3BDch2pDigitizer.h) + +add_library_with_dictionary( + LIBNAME + R3BDch + LINKDEF + DchLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData) diff --git a/doc/cmake_usage.md b/doc/cmake_usage.md new file mode 100644 index 000000000..b1f13156f --- /dev/null +++ b/doc/cmake_usage.md @@ -0,0 +1,109 @@ +## Quick look + +### Dependency graph of R3BRoot + +![r3bbase](pics/r3bbase_dependers.png) + +> [!NOTE] +> This dependency graph should be generated and updated by a CI pipeline. + +### Adding a library with a ROOT dictionary + +```cmake +add_library_with_dictionary( + LIBNAME # library name for the target + R3BLibName + LINKDEF # LinkDef file name for the ROOT dictionary + LibNameLinkDef.h + HEADERS # header file names used by the library + file1.h + file2.h + SRCS # source file names used by the library + file1.cxx + file2.cxx + INCLUDEDIRS # include directories of the target + ${CMAKE_CURRENT_SOURCE_DIR} # the folder of the current CMakeLists.cxx + dir1 # any sub folders of ${CMAKE_CURRENT_SOURCE_DIR} + dir2 + DEPENDENCIES # Dependencies + OtherLib # e.g. R3BSource, R3BTracking +) +``` +`PRIVATE` dependencies can be specified by `PRIVATE_INCLUDEDIRS` and `PRIVATE_DEPENDENCIES`. + +## Principles of CMake + +### What is CMake + +CMake is the most popular _build system_ for large C++ projects. Users can specify the build and linking options for C++ binaries using commands defined in `CMakeLists.txt` files. + +### CMake targets + +The most important conception of "modern" CMake is the so-called CMake **target**. A CMake target can either represent a library or an executable. However, what really makes the CMake target so useful is that a target can attach a library/executable with multiple "target properties", that can be propagated along the dependency chain. See [this list](https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html#properties-on-targets) for all available properties of CMake targets. + +#### Creating a simple target + +A target can be created either with `add_library` or `add_executable`. The dependencies between different targets can be specified by using `target_link_libraries`: + +```cmake +# Creating a library as a target +add_library(mylib SHARED mylib.cxx others.cxx) # Same for add_executable + +# Linking the library with other targets/libraries +target_link_libraries(mylib PUBLIC R3BSource PRIVATE R3BNeulandShared) + +# add include directory to the target property +target_include_directories(mylib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} dir1 PRIVATE dir2) +``` + +`add_library` creates a library or an executable from a list of C++ source files. The header files, such as `mylib.h` and `others.h`, don't need to be added. The keyword `SHARED` tells the target represents a dynamic library. If a static library is needed, use the keyword `STATIC`. + +`target_link_libraries` specifies the dependencies of a library. If your library use any classes or functions defined in the library `R3BSource`, you have to add the "R3BSource" either after `PUBLIC` or `PRIVATE` keywords. `target_include_directories` specifies the include directories of a target. The include directories are a set of directory paths that C++ compiler will search when you use a include macro, such as `#include`. If `FileName.h` doesn't exist in any include directories of the target, the compilation would fail. + +The keywords "PUBLIC" and "PRIVATE" specifies whether the properties or dependencies can be propagated in the dependency chain. `PUBLIC` means any libraries (or directories) linked to the current target are also linked to any other targets that link the current target. On the other hand, `PRIVATE` means the dependencies and include directories are only for the current target. + +For example, if the following dependency chain exists: + +```cmake +target_link_libraries(A PUBLIC B PRIVATE C) +target_link_libraries(D PUBLIC A) +``` +the `D` target can use all classes and functions defined in both `A` and `B`, but not in `C`. The functions and classes from `C` can only be used in the target `A`. + +Similarly, if the following exists: + +```cmake +target_include_directories(A PUBLIC dir1 PRIVATE dir2) +target_include_directories(B PUBLIC dir3) +target_link_libraries(B PUBLIC A) +``` +the include directory of the target `B` contains both `dir3` and `dir1`, but not `dir2`. + +> [!IMPORTANT] +> It's strongly recommended that `PRIVATE` should always prioritized above `PUBLIC` to reduce unnecessary dependencies. Clean dependencies can improve the compile time of the project. + +#### Behind `add_library_with_dictionary` + +From this ROOT official [webpage](https://root.cern/manual/io_custom_classes/#using-cmake), it can be found that a root dictionary can be generated directly from a target: + +```cmake +ROOT_GENERATE_DICTIONARY(myapp_dict myapp.h MODULE myapp LINKDEF LinkDef.h) +``` + +Thus, the implementation of the CMake function `add_library_with_dictionary` utilize such the feature and create a target together with a root dictionary: + +```cmake +add_library(${LIBNAME} SHARED ${SRCS}) +target_include_directories( + ${LIBNAME} + PUBLIC ${INCLUDEDIRS} + PRIVATE ${PRIVATE_INCLUDEDIRS}) +target_link_libraries( + ${LIBNAME} + PUBLIC ${DEPENDENCIES} + PRIVATE ${PRIVATE_DEPENDENCIES}) +root_generate_dictionary(${LIBNAME}_dict ${HEADERS} MODULE ${LIBNAME} LINKDEF + ${LINKDEF}) +``` + +NOTE: for the full detail of the CMake function, please visit the [source file](../cmake/utils/create_library_with_dictionary.cmake). diff --git a/doc/pics/r3bbase_dependers.png b/doc/pics/r3bbase_dependers.png new file mode 100644 index 000000000..b7fc5d37f Binary files /dev/null and b/doc/pics/r3bbase_dependers.png differ diff --git a/evtvis/CMakeLists.txt b/evtvis/CMakeLists.txt index b0d1ff5e8..33ea6ce53 100644 --- a/evtvis/CMakeLists.txt +++ b/evtvis/CMakeLists.txt @@ -11,52 +11,46 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BEvtVis" - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${GEANT3_INCLUDE_DIR} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/field -${R3BROOT_SOURCE_DIR}/geane -${R3BROOT_SOURCE_DIR}/califa -${R3BROOT_SOURCE_DIR}/r3bdata/califaData -${R3BROOT_SOURCE_DIR}/eventdisplay -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/evtvis -) - - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -R3BEventManager.cxx -R3BEventManagerEditor.cxx -R3BCalifaEventDisplay.cxx -R3BCalifaClusterEventDisplay.cxx -R3BMCTracks.cxx -R3BIonName.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF R3BEventDisplayLinkDef.h) -set(LIBRARY_NAME R3BEvtVis) -set(DEPENDENCIES - Field R3BData R3BCalifa Geane EventDisplay Eve Gui Ged RGL Graf3d Geom GeomPainter) - -GENERATE_LIBRARY() - + R3BEventManager.cxx + R3BEventManagerEditor.cxx + R3BCalifaEventDisplay.cxx + R3BCalifaClusterEventDisplay.cxx + R3BMCTracks.cxx + R3BIonName.cxx) + +set(HEADERS + R3BEventManager.h + R3BEventManagerEditor.h + R3BCalifaEventDisplay.h + R3BCalifaClusterEventDisplay.h + R3BMCTracks.h + R3BIonName.h) + +add_library_with_dictionary( + LIBNAME + R3BEvtVis + LINKDEF + R3BEventDisplayLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BCalifa) + +# set(DEPENDENCIES +# Field +# R3BData +# R3BCalifa +# Geane +# EventDisplay +# Eve +# Gui +# Ged +# RGL +# Graf3d +# Geom +# GeomPainter) diff --git a/fiber/CMakeLists.txt b/fiber/CMakeLists.txt index 7d7349f45..67433e01e 100644 --- a/fiber/CMakeLists.txt +++ b/fiber/CMakeLists.txt @@ -12,70 +12,68 @@ ############################################################################## # Create a library called "R3BBunchedFiber" which includes the source files -# given in the array. The extension is already found. Any number of +# given in the array. The extension is already found. Any number of # sources could be listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/fibData -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/fiber -${R3BROOT_SOURCE_DIR}/fiber/online -${R3BROOT_SOURCE_DIR}/fiber/sim -${R3BROOT_SOURCE_DIR}/fiber/digi -${R3BROOT_SOURCE_DIR}/fiber/pars -${R3BROOT_SOURCE_DIR}/fiber/mapmt -${R3BROOT_SOURCE_DIR}/fiber/bunched -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/tracking -) - -include_directories(${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories(${LINK_DIRECTORIES}) - set(SRCS -./sim/R3BFiber.cxx -./digi/R3BFiberDigitizer.cxx -./bunched/R3BBunchedFiberMapped2CalPar.cxx -./bunched/R3BBunchedFiberMapped2Cal.cxx -./bunched/R3BBunchedFiberCal2Hit.cxx -./bunched/R3BBunchedFiberCal2Hit_s494.cxx -./bunched/R3BBunchedFiberSPMTTrigMapped2CalPar.cxx -./bunched/R3BBunchedFiberSPMTTrigMapped2Cal.cxx -./mapmt/R3BFiberMAPMTMapped2Cal.cxx -./mapmt/R3BFiberMAPMTCal2Hit.cxx -./mapmt/R3BFiberMAPMTMapped2CalPar.cxx -./pars/R3BFiberContFact.cxx -./pars/R3BBunchedFiberHitModulePar.cxx -./pars/R3BBunchedFiberHitPar.cxx -./pars/R3BFiberMAPMTHitPar.cxx -./pars/R3BFiberMAPMTHitModulePar.cxx -./pars/R3BFiberMappingPar.cxx -./online/R3BFiberMAPMTOnlineSpectra.cxx -./online/R3BFiberMAPMTCorrelationOnlineSpectra.cxx -) - -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF FiberLinkDef.h) - -Set(LIBRARY_NAME R3BBunchedFiber) + sim/R3BFiber.cxx + digi/R3BFiberDigitizer.cxx + bunched/R3BBunchedFiberMapped2CalPar.cxx + bunched/R3BBunchedFiberMapped2Cal.cxx + bunched/R3BBunchedFiberCal2Hit.cxx + bunched/R3BBunchedFiberCal2Hit_s494.cxx + bunched/R3BBunchedFiberSPMTTrigMapped2CalPar.cxx + bunched/R3BBunchedFiberSPMTTrigMapped2Cal.cxx + mapmt/R3BFiberMAPMTMapped2Cal.cxx + mapmt/R3BFiberMAPMTCal2Hit.cxx + mapmt/R3BFiberMAPMTMapped2CalPar.cxx + pars/R3BFiberContFact.cxx + pars/R3BBunchedFiberHitModulePar.cxx + pars/R3BBunchedFiberHitPar.cxx + pars/R3BFiberMAPMTHitPar.cxx + pars/R3BFiberMAPMTHitModulePar.cxx + pars/R3BFiberMappingPar.cxx + online/R3BFiberMAPMTOnlineSpectra.cxx + online/R3BFiberMAPMTCorrelationOnlineSpectra.cxx) -set(DEPENDENCIES -R3BData R3BTCal R3BTracking R3BBase -) +set(HEADERS + sim/R3BFiber.h + digi/R3BFiberDigitizer.h + bunched/R3BBunchedFiberMapped2CalPar.h + bunched/R3BBunchedFiberMapped2Cal.h + bunched/R3BBunchedFiberCal2Hit.h + bunched/R3BBunchedFiberCal2Hit_s494.h + bunched/R3BBunchedFiberSPMTTrigMapped2CalPar.h + bunched/R3BBunchedFiberSPMTTrigMapped2Cal.h + mapmt/R3BFiberMAPMTMapped2Cal.h + mapmt/R3BFiberMAPMTCal2Hit.h + mapmt/R3BFiberMAPMTMapped2CalPar.h + pars/R3BFiberContFact.h + pars/R3BBunchedFiberHitModulePar.h + pars/R3BBunchedFiberHitPar.h + pars/R3BFiberMAPMTHitPar.h + pars/R3BFiberMAPMTHitModulePar.h + pars/R3BFiberMappingPar.h + online/R3BFiberMAPMTOnlineSpectra.h + online/R3BFiberMAPMTCorrelationOnlineSpectra.h) -GENERATE_LIBRARY() +add_library_with_dictionary( + LIBNAME + R3BBunchedFiber + LINKDEF + FiberLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + bunched + digi + mapmt + online + pars + sim + DEPENDENCIES + R3BTCal + R3BTracking) diff --git a/field/CMakeLists.txt b/field/CMakeLists.txt index c2acce519..325c6c5c8 100644 --- a/field/CMakeLists.txt +++ b/field/CMakeLists.txt @@ -11,48 +11,34 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libField" which includes the source files given in -# the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/field -${R3BROOT_SOURCE_DIR}/r3bbase -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -R3BFieldConst.cxx -R3BFieldContFact.cxx -R3BFieldPar.cxx -R3BFieldCreator.cxx -R3BGladFieldMap.cxx -R3BFieldInterp.cxx -R3BAladinFieldMap.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF FieldLinkDef.h) -set(LIBRARY_NAME Field) -set(DEPENDENCIES - Base ParBase R3BBase) - -GENERATE_LIBRARY() - + R3BFieldConst.cxx + R3BFieldContFact.cxx + R3BFieldPar.cxx + R3BFieldCreator.cxx + R3BGladFieldMap.cxx + R3BFieldInterp.cxx + R3BAladinFieldMap.cxx) + +set(HEADERS + R3BFieldConst.h + R3BFieldContFact.h + R3BFieldPar.h + R3BFieldCreator.h + R3BGladFieldMap.h + R3BFieldInterp.h + R3BAladinFieldMap.h) + +add_library_with_dictionary( + LIBNAME + Field + LINKDEF + FieldLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BBase) diff --git a/frssci/CMakeLists.txt b/frssci/CMakeLists.txt index 9895c0448..4bacb1fd7 100644 --- a/frssci/CMakeLists.txt +++ b/frssci/CMakeLists.txt @@ -15,53 +15,42 @@ # the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/frssci -${R3BROOT_SOURCE_DIR}/frssci/parameters -${R3BROOT_SOURCE_DIR}/frssci/calibration -${R3BROOT_SOURCE_DIR}/frssci/online -${R3BROOT_SOURCE_DIR}/r3bdata/ -${R3BROOT_SOURCE_DIR}/r3bdata/frssciData -${R3BROOT_SOURCE_DIR}/r3bdata/musliData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -parameters/R3BFrsSciContFact.cxx -parameters/R3BFrsSciTcalPar.cxx -parameters/R3BFrsSciCalPar.cxx -calibration/R3BFrsSciMapped2Tcal.cxx -calibration/R3BFrsSciMapped2TcalPar.cxx -calibration/R3BFrsSciTcal2Cal.cxx -online/R3BOnlineSpectraFrsSci.cxx -online/R3BOnlineSpectraFrsSciVsMusli.cxx -online/R3BOnlineSpectraFrsSciVsLos.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF FrsSciLinkDef.h) -Set(LIBRARY_NAME R3BFrsSci) -Set(DEPENDENCIES - R3BBase R3BData R3BTCal) - -GENERATE_LIBRARY() + parameters/R3BFrsSciContFact.cxx + parameters/R3BFrsSciTcalPar.cxx + parameters/R3BFrsSciCalPar.cxx + calibration/R3BFrsSciMapped2Tcal.cxx + calibration/R3BFrsSciMapped2TcalPar.cxx + calibration/R3BFrsSciTcal2Cal.cxx + online/R3BOnlineSpectraFrsSci.cxx + online/R3BOnlineSpectraFrsSciVsMusli.cxx + online/R3BOnlineSpectraFrsSciVsLos.cxx) + +set(HEADERS + parameters/R3BFrsSciContFact.h + parameters/R3BFrsSciTcalPar.h + parameters/R3BFrsSciCalPar.h + calibration/R3BFrsSciMapped2Tcal.h + calibration/R3BFrsSciMapped2TcalPar.h + calibration/R3BFrsSciTcal2Cal.h + online/R3BOnlineSpectraFrsSci.h + online/R3BOnlineSpectraFrsSciVsMusli.h + online/R3BOnlineSpectraFrsSciVsLos.h) + +add_library_with_dictionary( + LIBNAME + R3BFrsSci + LINKDEF + FrsSciLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calibration + online + parameters + DEPENDENCIES + R3BData + R3BTCal) diff --git a/gfi/CMakeLists.txt b/gfi/CMakeLists.txt index 272964e27..9401e5bc8 100644 --- a/gfi/CMakeLists.txt +++ b/gfi/CMakeLists.txt @@ -11,52 +11,21 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BGFI" which includes the source files -#given in # the array . # The extension is already found. Any number -#of sources could be listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/gfi -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/gfiData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -#Put here your sourcefiles -R3BGfi.cxx -R3BGeoGfi.cxx -R3BGeoGfiPar.cxx -R3BGfiContFact.cxx -R3BGfiDigiPar.cxx -R3BGfiDigitizer.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF GfiLinkDef.h) -set(LIBRARY_NAME R3BGfi) -set(DEPENDENCIES - R3BBase R3BData) - -GENERATE_LIBRARY() - +set(SRCS R3BGfi.cxx R3BGeoGfi.cxx R3BGeoGfiPar.cxx R3BGfiContFact.cxx R3BGfiDigiPar.cxx + R3BGfiDigitizer.cxx) + +set(HEADERS R3BGfi.h R3BGeoGfi.h R3BGeoGfiPar.h R3BGfiContFact.h R3BGfiDigiPar.h R3BGfiDigitizer.h) + +add_library_with_dictionary( + LIBNAME + R3BGfi + LINKDEF + GfiLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData) diff --git a/glad/CMakeLists.txt b/glad/CMakeLists.txt index b8b782375..817ac3a03 100644 --- a/glad/CMakeLists.txt +++ b/glad/CMakeLists.txt @@ -11,48 +11,23 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BGlad" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/field -${R3BROOT_SOURCE_DIR}/passive -${R3BROOT_SOURCE_DIR}/glad -${R3BROOT_SOURCE_DIR}/tracking) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -R3BGladMagnet.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF GladLinkDef.h) -Set(LIBRARY_NAME R3BGlad) -Set(DEPENDENCIES - R3BBase Field R3BTracking) - -GENERATE_LIBRARY() +set(SRCS R3BGladMagnet.cxx) +set(HEADERS R3BGladMagnet.h) + +add_library_with_dictionary( + LIBNAME + R3BGlad + LINKDEF + GladLinkDef.h + SRCS + R3BGladMagnet.cxx + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + HEADERS + R3BGladMagnet.h + DEPENDENCIES + R3BTracking) if(BUILD_GEOMETRY) -add_subdirectory(geobase) + add_subdirectory(geobase) endif() - diff --git a/land/CMakeLists.txt b/land/CMakeLists.txt index 2907806c0..45acd08d9 100644 --- a/land/CMakeLists.txt +++ b/land/CMakeLists.txt @@ -11,32 +11,10 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BLand" which includes the source files given in +# Create a library called "libR3BLand" which includes the source files given in # the array. The extension is already found. Any number of sources could be # listed here. -set(SYSTEM_INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${BASE_INCLUDE_DIRECTORIES}) - -set(INCLUDE_DIRECTORIES - # put here all directories where header files are located - ${R3BROOT_SOURCE_DIR}/r3bbase - ${R3BROOT_SOURCE_DIR}/land - ${R3BROOT_SOURCE_DIR}/los - ${R3BROOT_SOURCE_DIR}/r3bdata/ - ${R3BROOT_SOURCE_DIR}/r3bdata/tofData - ${R3BROOT_SOURCE_DIR}/r3bdata/landData - ${R3BROOT_SOURCE_DIR}/r3bdata/neulandData - ${R3BROOT_SOURCE_DIR}/r3bdata/losData - ${R3BROOT_SOURCE_DIR}/tcal - ${R3BROOT_SOURCE_DIR}/neuland/unpack) - -include_directories(${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR}) - -link_directories(${LINK_DIRECTORIES}) - set(SRCS R3BLand.cxx R3BGeoLand.cxx @@ -53,14 +31,33 @@ set(SRCS R3BNeutronTracker2D.cxx R3BNeutHit.cxx) -# fill list of header files from list of source files by exchanging the file extension -change_file_extension(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF LandLinkDef.h) - -set(LIBRARY_NAME R3BLand) - -set(DEPENDENCIES -R3BBase R3BData R3BTCal) - -generate_library() +set(HEADERS + R3BLand.h + R3BGeoLand.h + R3BGeoLandPar.h + R3BLandContFact.h + R3BLandDigitizer.h + R3BLandDigitizerQA.h + R3BNeutronTracker.h + R3BLandDigiPar.h + R3BNeuLandCluster.h + R3BNeuLandClusterFinder.h + R3BNeutronCalibr2D.h + R3BPrimPart.h + R3BNeutronTracker2D.h + R3BNeutHit.h) + +add_library_with_dictionary( + LIBNAME + R3BLand + LINKDEF + LandLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData + R3BTCal) diff --git a/los/CMakeLists.txt b/los/CMakeLists.txt index a94a33499..962ad6d78 100644 --- a/los/CMakeLists.txt +++ b/los/CMakeLists.txt @@ -15,56 +15,48 @@ # the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/los -${R3BROOT_SOURCE_DIR}/los/calib -${R3BROOT_SOURCE_DIR}/los/params -${R3BROOT_SOURCE_DIR}/los/online -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/neuland/shared -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -calib/R3BLosMapped2Cal.cxx -calib/R3BLosMapped2TCal.cxx -params/R3BLosMapped2CalPar.cxx -calib/R3BLosCal2Hit.cxx -calib/R3BLosTCal2Hit.cxx -R3BLosProvideTStart.cxx -params/R3BLosHitPar.cxx -params/R3BLosContFact.cxx -online/R3BLosOnlineSpectra.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF LosLinkDef.h) -Set(LIBRARY_NAME R3BLos) -Set(DEPENDENCIES - R3BBase R3BData R3BTracking R3BTCal) - -GENERATE_LIBRARY() + calib/R3BLosMapped2Cal.cxx + calib/R3BLosMapped2TCal.cxx + params/R3BLosMapped2CalPar.cxx + calib/R3BLosCal2Hit.cxx + calib/R3BLosTCal2Hit.cxx + R3BLosProvideTStart.cxx + params/R3BLosHitPar.cxx + params/R3BLosContFact.cxx + online/R3BLosOnlineSpectra.cxx) + +set(HEADERS + calib/R3BLosMapped2Cal.h + calib/R3BLosMapped2TCal.h + params/R3BLosMapped2CalPar.h + calib/R3BLosCal2Hit.h + calib/R3BLosTCal2Hit.h + R3BLosProvideTStart.h + params/R3BLosHitPar.h + params/R3BLosContFact.h + online/R3BLosOnlineSpectra.h) + +set(LINKDEF LosLinkDef.h) +set(LIBRARY_NAME R3BLos) +set(DEPENDENCIES R3BBase R3BData R3BTracking R3BTCal) + +add_library_with_dictionary( + LIBNAME + R3BLos + LINKDEF + LosLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calib + online + params + DEPENDENCIES + R3BTracking + R3BTCal + # TODO: only due to TCAConnector. + R3BNeulandShared) diff --git a/lumon/CMakeLists.txt b/lumon/CMakeLists.txt index 3bf5cc65e..080486a56 100644 --- a/lumon/CMakeLists.txt +++ b/lumon/CMakeLists.txt @@ -11,51 +11,20 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libELILuMon" which includes the source files given in -# the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tof -${R3BROOT_SOURCE_DIR}/lumon -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/lumonData - ) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -#Put here your sourcefiles -ELILuMon.cxx -ELIGeoLuMon.cxx -ELIGeoLuMonPar.cxx -ELILuMonContFact.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF LuMonLinkDef.h) -set(LIBRARY_NAME ELILuMon) -set(DEPENDENCIES - R3BBase R3BData) - -GENERATE_LIBRARY() - - +set(SRCS ELILuMon.cxx ELIGeoLuMon.cxx ELIGeoLuMonPar.cxx ELILuMonContFact.cxx) + +set(HEADERS ELILuMon.h ELIGeoLuMon.h ELIGeoLuMonPar.h ELILuMonContFact.h) + +add_library_with_dictionary( + LIBNAME + ELILuMon + LINKDEF + LuMonLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData) diff --git a/mfi/CMakeLists.txt b/mfi/CMakeLists.txt index 9d9e41a63..74e7ac6e5 100644 --- a/mfi/CMakeLists.txt +++ b/mfi/CMakeLists.txt @@ -11,57 +11,44 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BMfi" which includes the source files given in -# the array. The extension is already found. Any number of sources could be +# Create a library called "libR3BMfi" which includes the source files given in +# the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/gfi -${R3BROOT_SOURCE_DIR}/mfi -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/mfiData -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/landData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -R3BMfi.cxx -R3BGeoMfi.cxx -#R3BGeoMfiPar.cxx -#R3BMfiContFact.cxx -R3BMfiDigiPar.cxx -R3BMfiDigitizer.cxx -R3BKeepEventProbabilityMfi.cxx -#unpack/R3BMfiRawHit.cxx -#unpack/R3BMfiUnpack.cxx + R3BMfi.cxx + R3BGeoMfi.cxx + #R3BGeoMfiPar.cxx + #R3BMfiContFact.cxx + R3BMfiDigiPar.cxx + R3BMfiDigitizer.cxx + R3BKeepEventProbabilityMfi.cxx + #unpack/R3BMfiRawHit.cxx + #unpack/R3BMfiUnpack.cxx ) -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF MfiLinkDef.h) - -Set(LIBRARY_NAME R3BMfi) - -Set(DEPENDENCIES - R3BBase R3BData) +set(HEADERS + R3BMfi.h + R3BGeoMfi.h + #R3BGeoMfiPar.h + #R3BMfiContFact.h + R3BMfiDigiPar.h + R3BMfiDigitizer.h + R3BKeepEventProbabilityMfi.h + #unpack/R3BMfiRawHit.h + #unpack/R3BMfiUnpack.h +) -GENERATE_LIBRARY() +add_library_with_dictionary( + LIBNAME + R3BMfi + LINKDEF + MfiLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData) diff --git a/mtof/CMakeLists.txt b/mtof/CMakeLists.txt index e0022643a..cf836f5e5 100644 --- a/mtof/CMakeLists.txt +++ b/mtof/CMakeLists.txt @@ -11,52 +11,32 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BmTof" which includes the source files given in -# the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/mtof -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/mtofData -${R3BROOT_SOURCE_DIR}/tracking -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -R3BmTof.cxx -R3BGeomTof.cxx -R3BGeomTofPar.cxx -R3BmTofContFact.cxx -R3BmTofDigiPar.cxx -R3BmTofDigitizer.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF mTofLinkDef.h) -set(LIBRARY_NAME R3BmTof) -set(DEPENDENCIES - R3BBase R3BData R3BTracking) - -GENERATE_LIBRARY() - + R3BmTof.cxx + R3BGeomTof.cxx + R3BGeomTofPar.cxx + R3BmTofContFact.cxx + R3BmTofDigiPar.cxx + R3BmTofDigitizer.cxx) + +set(HEADERS + R3BmTof.h + R3BGeomTof.h + R3BGeomTofPar.h + R3BmTofContFact.h + R3BmTofDigiPar.h + R3BmTofDigitizer.h) + +add_library_with_dictionary( + LIBNAME + R3BmTof + LINKDEF + mTofLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BTracking) diff --git a/music/CMakeLists.txt b/music/CMakeLists.txt index 85c7934b2..0fd2dcd03 100644 --- a/music/CMakeLists.txt +++ b/music/CMakeLists.txt @@ -11,58 +11,36 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BMusic" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/music -${R3BROOT_SOURCE_DIR}/music/online -${R3BROOT_SOURCE_DIR}/music/pars -${R3BROOT_SOURCE_DIR}/music/calibration -${R3BROOT_SOURCE_DIR}/music/sim -${R3BROOT_SOURCE_DIR}/music/digi -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/musicData -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR} ) - -link_directories( ${LINK_DIRECTORIES}) - -file(GLOB SRCS -./sim/*.cxx -./digi/*.cxx -./pars/*.cxx -./calibration/*.cxx -./online/*.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF MusicLinkDef.h) -set(LIBRARY_NAME R3BMusic) -set(DEPENDENCIES - R3BBase R3BData R3BTracking) - -GENERATE_LIBRARY() +file( + GLOB + SRCS + ./sim/*.cxx + ./digi/*.cxx + ./pars/*.cxx + ./calibration/*.cxx + ./online/*.cxx) +change_file_extension(*.cxx *.h HEADERS "${SRCS}") + +add_library_with_dictionary( + LIBNAME + R3BMusic + LINKDEF + MusicLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + sim + digi + pars + calibration + online + DEPENDENCIES + R3BTracking) if(BUILD_GEOMETRY) - add_subdirectory(geobase) + add_subdirectory(geobase) endif() add_subdirectory(test) diff --git a/musli/CMakeLists.txt b/musli/CMakeLists.txt index 1139a813a..dae875e2e 100755 --- a/musli/CMakeLists.txt +++ b/musli/CMakeLists.txt @@ -11,53 +11,26 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BMusli" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/mwpc -${R3BROOT_SOURCE_DIR}/mwpc/mwpc0 -${R3BROOT_SOURCE_DIR}/mwpc/mwpc1 -${R3BROOT_SOURCE_DIR}/musli -${R3BROOT_SOURCE_DIR}/musli/online -${R3BROOT_SOURCE_DIR}/musli/pars -${R3BROOT_SOURCE_DIR}/musli/calibration -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/musliData -${R3BROOT_SOURCE_DIR}/r3bdata/frsData -${R3BROOT_SOURCE_DIR}/r3bdata/frssciData -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -${R3BROOT_SOURCE_DIR}/tracking -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR} ) - -link_directories( ${LINK_DIRECTORIES}) - -file(GLOB SRCS -./pars/*.cxx -./calibration/*.cxx -./online/*.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF MusliLinkDef.h) -set(LIBRARY_NAME R3BMusli) -set(DEPENDENCIES - R3BBase R3BData R3BTracking) - -GENERATE_LIBRARY() +file( + GLOB + SRCS + ./pars/*.cxx + ./calibration/*.cxx + ./online/*.cxx) +change_file_extension(*.cxx *.h HEADERS "${SRCS}") + +add_library_with_dictionary( + LIBNAME + R3BMusli + LINKDEF + MusliLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + pars + calibration + online + DEPENDENCIES + R3BTracking) diff --git a/mwpc/CMakeLists.txt b/mwpc/CMakeLists.txt index 1648cfd78..2b7e4a8df 100755 --- a/mwpc/CMakeLists.txt +++ b/mwpc/CMakeLists.txt @@ -11,65 +11,40 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BMwpc" which includes the source files given in the -# array. The extension is already found. Any number of sources could be listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${BASE_INCLUDE_DIRECTORIES}) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/mwpc -${R3BROOT_SOURCE_DIR}/mwpc/digi -${R3BROOT_SOURCE_DIR}/mwpc/online -${R3BROOT_SOURCE_DIR}/mwpc/mwpc0 -${R3BROOT_SOURCE_DIR}/mwpc/mwpc1 -${R3BROOT_SOURCE_DIR}/mwpc/mwpc2 -${R3BROOT_SOURCE_DIR}/mwpc/mwpc3 -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -${R3BROOT_SOURCE_DIR}/r3bdata/musliData -) - -if(WITH_SOFIA) -set(INCLUDE_DIRECTORIES -${INCLUDE_DIRECTORIES} -${R3BROOT_SOURCE_DIR}/sofia/sofdata/tofwData -) -endif(WITH_SOFIA) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR} ) - -link_directories( ${LINK_DIRECTORIES}) - -file(GLOB SRCS -mwpc0/*.cxx -mwpc1/*.cxx -mwpc2/*.cxx -digi/*.cxx -online/*.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF MwpcLinkDef.h) -set(LIBRARY_NAME R3BMwpc) -set(DEPENDENCIES - R3BBase R3BData R3BTracking) - -GENERATE_LIBRARY() +file( + GLOB + SRCS + mwpc0/*.cxx + mwpc1/*.cxx + mwpc2/*.cxx + digi/*.cxx + online/*.cxx) + +change_file_extension(*.cxx *.h HEADERS "${SRCS}") + +add_library_with_dictionary( + LIBNAME + R3BMwpc + LINKDEF + MwpcLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + digi + mwpc0 + mwpc1 + mwpc2 + online + DEPENDENCIES + R3BTracking) if(WITH_SOFIA) - add_subdirectory(mwpc3) + add_subdirectory(mwpc3) endif(WITH_SOFIA) if(BUILD_GEOMETRY) - add_subdirectory(geobase) + add_subdirectory(geobase) endif() add_subdirectory(test) diff --git a/mwpc/mwpc3/CMakeLists.txt b/mwpc/mwpc3/CMakeLists.txt index 5d8644852..05a6856be 100755 --- a/mwpc/mwpc3/CMakeLists.txt +++ b/mwpc/mwpc3/CMakeLists.txt @@ -11,56 +11,33 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BMwpc" which includes the source files given in the -# array. The extension is already found. Any number of sources could be listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${BASE_INCLUDE_DIRECTORIES}) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/mwpc -${R3BROOT_SOURCE_DIR}/mwpc/digi -${R3BROOT_SOURCE_DIR}/mwpc/online -${R3BROOT_SOURCE_DIR}/mwpc/mwpc0 -${R3BROOT_SOURCE_DIR}/mwpc/mwpc1 -${R3BROOT_SOURCE_DIR}/mwpc/mwpc2 -${R3BROOT_SOURCE_DIR}/mwpc/mwpc3 -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -) - -if(WITH_SOFIA) -set(INCLUDE_DIRECTORIES -${INCLUDE_DIRECTORIES} -${R3BROOT_SOURCE_DIR}/sofia/sofdata/tofwData -) -endif(WITH_SOFIA) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR} ) - -link_directories( ${LINK_DIRECTORIES}) - -file(GLOB SRCS -R3BMwpc3.cxx -R3BMwpc3ContFact.cxx -R3BMwpc3CalPar.cxx -R3BMwpc3Mapped2Cal.cxx -R3BMwpc3Mapped2CalPar.cxx -R3BMwpc3Cal2Hit.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF Mwpc3LinkDef.h) -set(LIBRARY_NAME R3BMwpc3) -set(DEPENDENCIES - R3BBase R3BData R3BTracking) - -GENERATE_LIBRARY() +set(SRCS + R3BMwpc3.cxx + R3BMwpc3ContFact.cxx + R3BMwpc3CalPar.cxx + R3BMwpc3Mapped2Cal.cxx + R3BMwpc3Mapped2CalPar.cxx + R3BMwpc3Cal2Hit.cxx) + +set(HEADERS + R3BMwpc3.h + R3BMwpc3ContFact.h + R3BMwpc3CalPar.h + R3BMwpc3Mapped2Cal.h + R3BMwpc3Mapped2CalPar.h + R3BMwpc3Cal2Hit.h) + +add_library_with_dictionary( + LIBNAME + R3BMwpc3 + LINKDEF + Mwpc3LinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BSofData + R3BTracking) diff --git a/neuland/CMakeLists.txt b/neuland/CMakeLists.txt index 523dc0027..abb1fe287 100644 --- a/neuland/CMakeLists.txt +++ b/neuland/CMakeLists.txt @@ -11,21 +11,6 @@ # or submit itself to any jurisdiction. # ############################################################################## -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat-security -march=native") - -set(SYSTEM_INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${BASE_INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/neulandData -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/neuland/shared -) - -link_directories(${ROOT_LIBRARY_DIR} ${Boost_LIBRARY_DIRS} ${FAIRROOT_LIBRARY_DIR}) - add_subdirectory(calibration) add_subdirectory(clustering) add_subdirectory(digitizing) @@ -40,5 +25,5 @@ add_subdirectory(test) add_subdirectory(unpack) add_subdirectory(executables) if(BUILD_GEOMETRY) - add_subdirectory(geobase) + add_subdirectory(geobase) endif() diff --git a/neuland/calibration/CMakeLists.txt b/neuland/calibration/CMakeLists.txt index abf289150..008fc09f7 100644 --- a/neuland/calibration/CMakeLists.txt +++ b/neuland/calibration/CMakeLists.txt @@ -11,21 +11,6 @@ # or submit itself to any jurisdiction. # ############################################################################## -set(LIBRARY_NAME R3BNeulandCalibration) -set(LINKDEF NeulandCalibrationLinkDef.h) - -#set(CMAKE_CXX_STANDARD 14) - -set(DEPENDENCIES R3BBase R3BData R3BTCal R3BNeulandShared) - -set(INCLUDE_DIRECTORIES - ${INCLUDE_DIRECTORIES} - ${R3BROOT_SOURCE_DIR}/neuland/calibration - ${R3BROOT_SOURCE_DIR}/neuland/shared - ${R3BROOT_SOURCE_DIR}/r3bdata/losData - ${R3BROOT_SOURCE_DIR}/tcal) -include_directories(${INCLUDE_DIRECTORIES}) - set(SRCS R3BNeulandMappedHist.cxx R3BNeulandMapped2Cal.cxx @@ -49,6 +34,33 @@ set(SRCS R3BNeulandQCalFiller.cxx R3BNeulandProvideTStart.cxx R3BNeulandMappingPar.cxx) - change_file_extension(*.cxx *.h HEADERS "${SRCS}") - -generate_library() + +set(HEADERS + R3BNeulandMappedHist.h + R3BNeulandMapped2Cal.h + R3BNeulandMapped2CalPar.h + R3BNeulandTacquilaMapped2Cal.h + R3BNeulandTacquilaMapped2CalPar.h + R3BNeulandTacquilaMapped2QCalPar.h + R3BNeulandHitHist.h + # R3BNeulandCalTest.h + R3BNeulandHitPar.h + R3BNeulandCosmicTracker.h + R3BNeulandHitCalibrationEngine.h + R3BNeulandHitCalibrationBar.h + R3BNeulandTSyncer.h + LSQR.h + R3BNeulandCal2HitPar.h + R3BNeulandParFact.h + R3BNeulandCal2Hit.h + R3BNeulandHitModulePar.h + R3BNeulandQCalPar.h + R3BNeulandQCalFiller.h + R3BNeulandProvideTStart.h + R3BNeulandMappingPar.h) + +add_library(R3BNeulandCalibration SHARED ${SRCS}) +target_include_directories(R3BNeulandCalibration PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(R3BNeulandCalibration PUBLIC R3BTCal R3BNeulandShared) +root_generate_dictionary(R3BNeulandCalibration_dict ${HEADERS} MODULE R3BNeulandCalibration LINKDEF + NeulandCalibrationLinkDef.h) diff --git a/neuland/clustering/CMakeLists.txt b/neuland/clustering/CMakeLists.txt index 8c72fb8da..8001a83e1 100644 --- a/neuland/clustering/CMakeLists.txt +++ b/neuland/clustering/CMakeLists.txt @@ -10,17 +10,11 @@ # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################## - -set(LIBRARY_NAME R3BNeulandClustering) -set(LINKDEF NeulandClusteringLinkDef.h) - -set(DEPENDENCIES R3BNeulandShared R3BData) - -set(INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${R3BROOT_SOURCE_DIR}/neuland/clustering) -include_directories(${INCLUDE_DIRECTORIES}) - set(SRCS R3BNeulandClusterMon.cxx R3BNeulandClusterFinder.cxx) -change_file_extension(*.cxx *.h HEADERS "${SRCS}") +set(HEADERS R3BNeulandClusterMon.h R3BNeulandClusterFinder.h) -generate_library() -target_include_directories(R3BNeulandClustering PUBLIC .) +add_library(R3BNeulandClustering SHARED ${SRCS}) +target_include_directories(R3BNeulandClustering PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(R3BNeulandClustering PUBLIC R3BNeulandShared) +root_generate_dictionary(R3BNeulandClustering_dict ${HEADERS} MODULE R3BNeulandClustering LINKDEF + NeulandClusteringLinkDef.h) diff --git a/neuland/digitizing/CMakeLists.txt b/neuland/digitizing/CMakeLists.txt index ff03698ef..d54e9c624 100644 --- a/neuland/digitizing/CMakeLists.txt +++ b/neuland/digitizing/CMakeLists.txt @@ -10,11 +10,6 @@ # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################## - -set(INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${R3BROOT_SOURCE_DIR}/neuland/calibration - ${R3BROOT_SOURCE_DIR}/neuland/digitizing) -include_directories(${INCLUDE_DIRECTORIES}) - set(SRCS R3BDigitizingChannel.cxx R3BDigitizingPaddle.cxx @@ -38,8 +33,16 @@ set(HEADERS R3BNeulandDigitizer.h R3BNeulandHitMon.h) -set(LINKDEF NeulandDigitizingLinkDef.h) -set(LIBRARY_NAME R3BNeulandDigitizing) -set(DEPENDENCIES R3BNeulandShared R3BData R3BNeulandCalibration) - -generate_library() +add_library_with_dictionary( + LIBNAME + R3BNeulandDigitizing + LINKDEF + NeulandDigitizingLinkDef.h + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + HEADERS + ${HEADERS} + DEPENDENCIES + R3BNeulandCalibration) diff --git a/neuland/executables/CMakeLists.txt b/neuland/executables/CMakeLists.txt index 4babddc17..2d4c62211 100644 --- a/neuland/executables/CMakeLists.txt +++ b/neuland/executables/CMakeLists.txt @@ -1,43 +1,6 @@ -set(EXE_NAME neulandSim) -set(DEPENDENCIES - R3BNeulandShared - R3BNeulandSimulation - R3BPassive - R3BData - R3BBase - Gen - ${Geant4_LIBRARIES} - ${Geant4VMC_LIBRARIES} - ExTestDetector - Boost::program_options) +add_executable(neulandSim neulandSim.cxx) +target_link_libraries(neulandSim PRIVATE R3BNeulandSimulation ${Geant4_LIBRARIES} + ${Geant4VMC_LIBRARIES} ExTestDetector) -set(INCLUDE_DIRECTORIES - ${INCLUDE_DIRECTORIES} ${R3BROOT_SOURCE_DIR}/passive ${R3BROOT_SOURCE_DIR}/neuland/executables - ${R3BROOT_SOURCE_DIR}/neuland/simulation ${Geant4_INCLUDE_DIRS} ${Geant4VMC_INCLUDE_DIRS}) - -message(STATUS "include dir: ${Geant4_INCLUDE_DIRS}") -include_directories(${INCLUDE_DIRECTORIES}) -set(SRCS neulandSim.cxx) - -generate_executable() - -set(EXE_NAME neulandAna) -set(DEPENDENCIES - R3BNeulandShared - R3BNeulandDigitizing - R3BPassive - R3BData - R3BBase - Gen - Boost::program_options) - -set(INCLUDE_DIRECTORIES - ${INCLUDE_DIRECTORIES} ${R3BROOT_SOURCE_DIR}/passive ${R3BROOT_SOURCE_DIR}/neuland/executables - ${R3BROOT_SOURCE_DIR}/neuland/digitizing ${R3BROOT_SOURCE_DIR}/neuland/calibration) - -include_directories(${INCLUDE_DIRECTORIES}) -set(SRCS neulandAna.cxx) - -generate_executable() - -add_subdirectory(templates) +add_executable(neulandAna neulandAna.cxx) +target_link_libraries(neulandAna PRIVATE R3BNeulandDigitizing) diff --git a/neuland/executables/neulandSim.cxx b/neuland/executables/neulandSim.cxx index 2798e7286..bbc5e9145 100644 --- a/neuland/executables/neulandSim.cxx +++ b/neuland/executables/neulandSim.cxx @@ -52,7 +52,7 @@ int main(int argc, const char** argv) } // Logging - FairLogger::GetLogger()->SetLogVerbosityLevel("LOW"); + // FairLogger::GetLogger()->SetLogVerbosityLevel("LOW"); FairLogger::GetLogger()->SetLogScreenLevel(logLevel->value().c_str()); // System paths diff --git a/neuland/online/CMakeLists.txt b/neuland/online/CMakeLists.txt index ce80f2e75..17948646b 100644 --- a/neuland/online/CMakeLists.txt +++ b/neuland/online/CMakeLists.txt @@ -10,18 +10,11 @@ # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################## - -set(LIBRARY_NAME R3BNeulandOnline) -set(LINKDEF NeulandOnlineLinkDef.h) - -set(DEPENDENCIES R3BData R3BBase) - -set(INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} -${R3BROOT_SOURCE_DIR}/neuland/online) -include_directories(${INCLUDE_DIRECTORIES}) - set(SRCS R3BNeulandOnlineReconstruction.cxx R3BNeulandOnlineSpectra.cxx) - set(HEADERS R3BNeulandOnlineReconstruction.h R3BNeulandOnlineSpectra.h) -generate_library() +add_library(R3BNeulandOnline SHARED ${SRCS}) +target_include_directories(R3BNeulandOnline PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(R3BNeulandOnline PUBLIC R3BTCal R3BNeulandShared) +root_generate_dictionary(R3BNeulandOnline_dict ${HEADERS} MODULE R3BNeulandOnline LINKDEF + NeulandOnlineLinkDef.h) diff --git a/neuland/preexp/CMakeLists.txt b/neuland/preexp/CMakeLists.txt index 186a6a75d..c0eef9d27 100644 --- a/neuland/preexp/CMakeLists.txt +++ b/neuland/preexp/CMakeLists.txt @@ -11,22 +11,11 @@ # or submit itself to any jurisdiction. # ############################################################################## -set(LIBRARY_NAME R3BNeulandPreexp) -set(LINKDEF NeulandPreexpLinkDef.h) - -set(DEPENDENCIES R3BData R3BBase R3BChannelAccess) - -set(INCLUDE_DIRECTORIES - ${INCLUDE_DIRECTORIES} - ${EPICS_INCLUDE_DIR} - ${EPICS_OS_INCLUDE_DIR} - ${R3BROOT_SOURCE_DIR}/epics - ${R3BROOT_SOURCE_DIR}/neuland/preexp) -include_directories(${INCLUDE_DIRECTORIES}) - -link_directories(${EPICS_LIBRARY_DIR}) - set(SRCS R3BNeulandCheckMapping.cxx R3BNeulandGainMatching.cxx R3BNeulandTimeRes.cxx) -change_file_extension(*.cxx *.h HEADERS "${SRCS}") +set(HEADERS R3BNeulandCheckMapping.h R3BNeulandGainMatching.h R3BNeulandTimeRes.h) -generate_library() +add_library(R3BNeulandPreexp SHARED ${SRCS}) +target_include_directories(R3BNeulandPreexp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(R3BNeulandPreexp PUBLIC R3BData R3BChannelAccess) +root_generate_dictionary(R3BNeulandPreexp_dict ${HEADERS} MODULE R3BNeulandPreexp LINKDEF + R3BNeulandPreexpLinkDef.h) diff --git a/neuland/reconstruction/CMakeLists.txt b/neuland/reconstruction/CMakeLists.txt index f1ac9ad62..a59c6039d 100644 --- a/neuland/reconstruction/CMakeLists.txt +++ b/neuland/reconstruction/CMakeLists.txt @@ -11,19 +11,7 @@ # or submit itself to any jurisdiction. # ############################################################################## -set(LIBRARY_NAME R3BNeulandReconstruction) -set(LINKDEF NeulandReconstructionLinkDef.h) - -# set(DEPENDENCIES R3BNeulandShared R3BData PyROOT) -set(DEPENDENCIES R3BNeulandShared R3BData) - -set(INCLUDE_DIRECTORIES - ${INCLUDE_DIRECTORIES} ${R3BROOT_SOURCE_DIR}/neuland/reconstruction - ${R3BROOT_SOURCE_DIR}/neuland/reconstruction/multiplicity - ${R3BROOT_SOURCE_DIR}/neuland/reconstruction/neutrons) -include_directories(${INCLUDE_DIRECTORIES}) # link_libraries(/home/jmayer/.pyenv/versions/3.7.6/lib/libpython3.7m.so.1.0) - set(SRCS multiplicity/R3BNeulandMultiplicityBayes.cxx multiplicity/R3BNeulandMultiplicityBayesPar.cxx @@ -41,6 +29,26 @@ set(SRCS R3BNeulandReconstructionContFact.cxx R3BNeulandNeutronReconstructionMon.cxx R3BNeulandNeutronReconstructionStatistics.cxx) -change_file_extension(*.cxx *.h HEADERS "${SRCS}") +set(HEADERS + multiplicity/R3BNeulandMultiplicityBayes.h + multiplicity/R3BNeulandMultiplicityBayesPar.h + multiplicity/R3BNeulandMultiplicityBayesTrain.h + multiplicity/R3BNeulandMultiplicityCalorimetric.h + multiplicity/R3BNeulandMultiplicityCalorimetricPar.h + multiplicity/R3BNeulandMultiplicityCalorimetricTrain.h + multiplicity/R3BNeulandMultiplicityCheat.h + multiplicity/R3BNeulandMultiplicityFixed.h + # multiplicity/R3BNeulandMultiplicityScikit.h + neutrons/R3BNeulandNeutronsCheat.h + neutrons/R3BNeulandNeutronsRValue.h + # neutrons/R3BNeulandNeutronsScikit.h + # neutrons/R3BNeulandNeutronsKeras.h + R3BNeulandReconstructionContFact.h + R3BNeulandNeutronReconstructionMon.h + R3BNeulandNeutronReconstructionStatistics.h) -generate_library() +add_library(R3BNeulandReconstruction SHARED ${SRCS}) +target_include_directories(R3BNeulandReconstruction PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} multiplicity neutrons) +target_link_libraries(R3BNeulandReconstruction PUBLIC R3BNeulandShared) +root_generate_dictionary(R3BNeulandReconstruction_dict ${HEADERS} MODULE R3BNeulandReconstruction LINKDEF + NeulandReconstructionLinkDef.h) diff --git a/neuland/shared/CMakeLists.txt b/neuland/shared/CMakeLists.txt index a23c02872..c6b8b73a0 100644 --- a/neuland/shared/CMakeLists.txt +++ b/neuland/shared/CMakeLists.txt @@ -11,13 +11,6 @@ # or submit itself to any jurisdiction. # ############################################################################## -set(LIBRARY_NAME R3BNeulandShared) -set(LINKDEF NeulandSharedLinkDef.h) - -set(DEPENDENCIES R3BData R3BBase ParBase Boost::program_options) - -include_directories(${INCLUDE_DIRECTORIES}) - set(SRCS ElasticScattering.cxx IsElastic.cxx R3BNeulandGeoPar.cxx R3BNeulandContFact.cxx R3BProgramOptions.cxx R3BNeulandVisualizer.cxx) @@ -34,9 +27,13 @@ set(HEADERS R3BNeulandVisualizer.h R3BNeulandCommon.h) -generate_library() - # find_package(Protobuf REQUIRED) protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS neuland.proto) # protobuf_generate_python(PROTO_PY neuland.proto) set(SRCS ${SRCS} ${PROTO_SRCS}) set(HEADERS # ${HEADERS} ${PROTO_HDRS}) Include directory such that protoc generated headers are found # include_directories(${CMAKE_CURRENT_BINARY_DIR}) ${PROTOBUF_LIBRARY} + +add_library(R3BNeulandShared SHARED ${SRCS}) +target_include_directories(R3BNeulandShared PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(R3BNeulandShared PUBLIC R3BData Boost::program_options) +root_generate_dictionary(R3BNeulandShared_dict ${HEADERS} MODULE R3BNeulandShared LINKDEF + NeulandSharedLinkDef.h) diff --git a/neuland/shared/R3BProgramOptions.cxx b/neuland/shared/R3BProgramOptions.cxx index a914713a5..03a034262 100644 --- a/neuland/shared/R3BProgramOptions.cxx +++ b/neuland/shared/R3BProgramOptions.cxx @@ -2,7 +2,7 @@ namespace R3B { - bool ProgramOptions::Verify(int argc, const char** argv) + auto ProgramOptions::Verify(int argc, const char** argv) -> bool { try diff --git a/neuland/shared/R3BProgramOptions.h b/neuland/shared/R3BProgramOptions.h index ded9e8e9a..e16b91ab5 100644 --- a/neuland/shared/R3BProgramOptions.h +++ b/neuland/shared/R3BProgramOptions.h @@ -7,8 +7,6 @@ namespace R3B { - using std::runtime_error; - namespace po = boost::program_options; template @@ -50,10 +48,10 @@ namespace R3B return option; } - bool Verify(int argc, const char** argv); + auto Verify(int argc, const char** argv) -> bool; void Delete_Option(const std::string& optionName) { registries_.erase(optionName); } - auto& Get_PosDescRef() { return pos_desc_; } - auto& Get_DescRef() { return desc_; } + auto Get_PosDescRef() -> auto& { return pos_desc_; } + auto Get_DescRef() -> auto& { return desc_; } private: std::unordered_map registries_; @@ -67,8 +65,8 @@ namespace R3B public: OptionConcept(const OptionConcept&) = delete; OptionConcept(OptionConcept&&) = delete; - OptionConcept& operator=(const OptionConcept&) = delete; - OptionConcept& operator=(OptionConcept&&) = delete; + auto operator=(const OptionConcept&) -> OptionConcept& = delete; + auto operator=(OptionConcept&&) -> OptionConcept& = delete; virtual ~OptionConcept() = default; OptionConcept() = default; virtual void Retrieve(const po::variables_map& varMap) = 0; @@ -81,8 +79,8 @@ namespace R3B using type = Type; Option(const Option&) = delete; Option(Option&&) = delete; - Option& operator=(const Option&) = delete; - Option& operator=(Option&&) = delete; + auto operator=(const Option&) -> Option& = delete; + auto operator=(Option&&) -> Option& = delete; Option(std::string name, Type defaultValue, ProgramOptions* program) : name_{ std::move(name) } , value_{ std::move(defaultValue) } @@ -131,7 +129,7 @@ namespace R3B else if (is_required) { const auto error_msg = "program option " + name_ + " is required."; - throw runtime_error(error_msg); + throw std::runtime_error(error_msg); } } diff --git a/neuland/simulation/CMakeLists.txt b/neuland/simulation/CMakeLists.txt index 4beb27b33..ef9c240aa 100644 --- a/neuland/simulation/CMakeLists.txt +++ b/neuland/simulation/CMakeLists.txt @@ -11,22 +11,14 @@ # or submit itself to any jurisdiction. # ############################################################################## -set(LIBRARY_NAME R3BNeulandSimulation) -set(LINKDEF NeulandSimulationLinkDef.h) +set(SRCS R3BNeuland.cxx R3BNeulandMCMon.cxx R3BNeulandPrimaryClusterFinder.cxx + R3BNeulandPrimaryInteractionFinder.cxx) -set(DEPENDENCIES R3BNeulandShared R3BData R3BBase) +set(HEADERS R3BNeuland.h R3BNeulandMCMon.h R3BNeulandPrimaryClusterFinder.h + R3BNeulandPrimaryInteractionFinder.h) -set(INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${R3BROOT_SOURCE_DIR}/neuland/simulation) -include_directories(${INCLUDE_DIRECTORIES}) - -set(SRCS - R3BNeuland.cxx - R3BNeulandMCMon.cxx - R3BNeulandPrimaryClusterFinder.cxx - R3BNeulandPrimaryInteractionFinder.cxx) -change_file_extension(*.cxx - *.h - HEADERS - "${SRCS}") - -generate_library() +add_library(R3BNeulandSimulation SHARED ${SRCS}) +target_include_directories(R3BNeulandSimulation PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(R3BNeulandSimulation PUBLIC R3BNeulandShared R3BPassive) +root_generate_dictionary(R3BNeulandSimulation_dict ${HEADERS} MODULE R3BNeulandSimulation LINKDEF + NeulandSimulationLinkDef.h) diff --git a/neuland/test/CMakeLists.txt b/neuland/test/CMakeLists.txt index b0a91eb9c..e70546112 100644 --- a/neuland/test/CMakeLists.txt +++ b/neuland/test/CMakeLists.txt @@ -11,81 +11,65 @@ # or submit itself to any jurisdiction. # ############################################################################## -cmake_minimum_required(VERSION 3.23) -set(PROJECT_TEST_NAME NeulandUnitTests) - if(GTEST_FOUND) - file(GLOB TEST_SRC_FILES ${PROJECT_SOURCE_DIR}/neuland/test/*.cxx) - add_subdirectory(digitizing) - - include_directories( - ${SYSTEM_INCLUDE_DIRECTORIES} - ${BASE_INCLUDE_DIRECTORIES} - ${R3BROOT_SOURCE_DIR}/r3bbase - ${R3BROOT_SOURCE_DIR}/r3bdata/neulandData - ${R3BROOT_SOURCE_DIR}/neuland/shared - ${R3BROOT_SOURCE_DIR}/neuland/reconstruction - ${R3BROOT_SOURCE_DIR}/neuland/digitizing - ${R3BROOT_SOURCE_DIR}/neuland/reconstruction/multiplicity) - - link_directories(${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR} - ${Boost_LIBRARY_DIRS}) - - set(TEST_DEPENDENCIES - GTest::gtest_main - GTest::gmock_main - ${ROOT_LIBRARIES} - FairTools - R3BData - ParBase - GeoBase - R3BNeulandShared - R3BNeulandDigitizing - R3BNeulandReconstruction - Alignment) - - add_executable(${PROJECT_TEST_NAME} ${TEST_SRC_FILES}) - target_link_libraries(${PROJECT_TEST_NAME} ${TEST_DEPENDENCIES}) - gtest_discover_tests(${PROJECT_TEST_NAME} DISCOVERY_TIMEOUT 600) + add_executable( + NeulandUnitTests + digitizing/testNeulandDigitizingPaddle.cxx + digitizing/testNeulandDigitizingTamex.cxx + NeulandUnitTests.cxx + testClusteringEngine.cxx + testNeulandMultiplicityCalorimetricPar.cxx) + target_link_libraries(NeulandUnitTests PRIVATE GTest::gtest_main GTest::gmock_main + R3BNeulandDigitizing R3BNeulandReconstruction) + gtest_discover_tests(NeulandUnitTests DISCOVERY_TIMEOUT 600) endif(GTEST_FOUND) -# generate_root_test_script(${R3BROOT_SOURCE_DIR}/neuland/test/testNeulandSimulation.C) -# add_test(NeulandSimulation ${R3BROOT_BINARY_DIR}/neuland/test/testNeulandSimulation.sh) set(simuPars - --simuFile test.simu.root - --paraFile test.para.root - --eventNum 100 - --eventPrint 10 - --energy 1.0 - --multiplicity 4 - --logLevel error - ) + --simuFile + test_exe.simu.root + --paraFile + test_exe.para.root + --eventNum + 100 + --eventPrint + 10 + --energy + 1.0 + --multiplicity + 4 + --logLevel + error) add_test(NeulandSimulation ${R3BROOT_BINARY_DIR}/bin/neulandSim ${simuPars}) set_tests_properties(NeulandSimulation PROPERTIES TIMEOUT "2000") set_tests_properties(NeulandSimulation PROPERTIES PASS_REGULAR_EXPRESSION - "Macro finished successfully.") + "Macro finished successfully.") set(digiPars - --simuFile test.simu.root - --paraFile test.para.root - --paddle neuland - --channel tamex - --digiFile test.digi.root - -v info - ) + --simuFile + test_exe.simu.root + --paraFile + test_exe.para.root + --paddle + neuland + --channel + tamex + --digiFile + test_exe.digi.root + -v + info) add_test(NeulandDigitizer ${R3BROOT_BINARY_DIR}/bin/neulandAna ${digiPars}) set_tests_properties(NeulandDigitizer PROPERTIES DEPENDS NeulandSimulation) set_tests_properties(NeulandDigitizer PROPERTIES TIMEOUT "1000") set_tests_properties(NeulandDigitizer PROPERTIES PASS_REGULAR_EXPRESSION - "Macro finished successfully.") + "Macro finished successfully.") + +generate_root_test_script(${R3BROOT_SOURCE_DIR}/neuland/test/testNeulandSimulation.C) +add_test(NeulandSimulationMacro ${R3BROOT_BINARY_DIR}/neuland/test/testNeulandSimulation.sh) generate_root_test_script(${R3BROOT_SOURCE_DIR}/neuland/test/testNeulandDigitizer.C) add_test(NeulandDigitizerMacro ${R3BROOT_BINARY_DIR}/neuland/test/testNeulandDigitizer.sh) -set_tests_properties(NeulandDigitizerMacro PROPERTIES DEPENDS NeulandSimulation) +set_tests_properties(NeulandDigitizerMacro PROPERTIES DEPENDS NeulandSimulationMacro) set_tests_properties(NeulandDigitizerMacro PROPERTIES TIMEOUT "1000") -set_tests_properties(NeulandDigitizerMacro PROPERTIES PASS_REGULAR_EXPRESSION - "Macro finished successfully.") - # generate_root_test_script(${R3BROOT_SOURCE_DIR}/neuland/test/testNeulandTrain.C) # add_test(NeulandTrain ${R3BROOT_BINARY_DIR}/neuland/test/testNeulandTrain.sh) diff --git a/neuland/test/digitizing/CMakeLists.txt b/neuland/test/digitizing/CMakeLists.txt deleted file mode 100644 index f289f2d3a..000000000 --- a/neuland/test/digitizing/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################## -# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH # -# Copyright (C) 2019 Members of R3B Collaboration # -# # -# This software is distributed under the terms of the # -# GNU General Public Licence (GPL) version 3, # -# copied verbatim in the file "LICENSE". # -# # -# In applying this license GSI 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. # -############################################################################## - -project(TestNeulandDigitizing) - -file(GLOB TestFiles testNeulandDigitizingTamex.cxx testNeulandDigitizingPaddle.cxx) - -set(TEST_SRC_FILES - ${TEST_SRC_FILES} ${TestFiles} - PARENT_SCOPE) diff --git a/neuland/unpack/CMakeLists.txt b/neuland/unpack/CMakeLists.txt index c1de7b208..efd27691e 100644 --- a/neuland/unpack/CMakeLists.txt +++ b/neuland/unpack/CMakeLists.txt @@ -11,21 +11,11 @@ # or submit itself to any jurisdiction. # ############################################################################## -set(LIBRARY_NAME R3BNeulandUnpack) -set(LINKDEF NeulandUnpackLinkDef.h) - set(SRCS R3BNeulandTcalFill.cxx R3BNeulandTcal.cxx R3BNeulandPmt.cxx) -change_file_extension(*.cxx *.h HEADERS "${SRCS}") - -set(DEPENDENCIES R3BBase R3BTCal R3BData) - -set(INCLUDE_DIRECTORIES - ${R3BROOT_SOURCE_DIR}/neuland/unpack - ${R3BROOT_SOURCE_DIR}/r3bbase/ - ${R3BROOT_SOURCE_DIR}/r3bdata/ - ${R3BROOT_SOURCE_DIR}/r3bdata/neulandData - ${R3BROOT_SOURCE_DIR}/r3bbase - ${R3BROOT_SOURCE_DIR}/tcal) -include_directories(${INCLUDE_DIRECTORIES}) +set(SRCS R3BNeulandTcalFill.h R3BNeulandTcal.h R3BNeulandPmt.h) -generate_library() +add_library(R3BNeulandUnpack SHARED ${SRCS}) +target_include_directories(R3BNeulandUnpack PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(R3BNeulandUnpack PUBLIC R3BNeulandShared) +root_generate_dictionary(R3BNeulandUnpack_dict ${HEADERS} MODULE R3BNeulandUnpack LINKDEF + NeulandUnpackLinkDef.h) diff --git a/passive/CMakeLists.txt b/passive/CMakeLists.txt index d2ad9360f..1e744a5c3 100644 --- a/passive/CMakeLists.txt +++ b/passive/CMakeLists.txt @@ -11,52 +11,46 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BPassive" which includes the source files given +# Create a library called "libR3BPassive" which includes the source files given # in the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/field -${R3BROOT_SOURCE_DIR}/passive -${R3BROOT_SOURCE_DIR}/tracking) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -R3BCave.cxx -R3BGeoCave.cxx -R3BGeoPassivePar.cxx -R3BGeoTarget.cxx -R3BAladinMagnet.cxx -R3BNeutronWindowAndSomeAir.cxx -R3BPassiveContFact.cxx -R3BPipe.cxx -R3BVacVesselCool.cxx -R3BTarget.cxx -R3BCollimator.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF PassiveLinkDef.h) -Set(LIBRARY_NAME R3BPassive) -Set(DEPENDENCIES - R3BBase Field R3BTracking) - -GENERATE_LIBRARY() + R3BCave.cxx + R3BGeoCave.cxx + R3BGeoPassivePar.cxx + R3BGeoTarget.cxx + R3BAladinMagnet.cxx + R3BNeutronWindowAndSomeAir.cxx + R3BPassiveContFact.cxx + R3BPipe.cxx + R3BVacVesselCool.cxx + R3BTarget.cxx + R3BCollimator.cxx) + +set(HEADERS + R3BCave.h + R3BGeoCave.h + R3BGeoPassivePar.h + R3BGeoTarget.h + R3BAladinMagnet.h + R3BNeutronWindowAndSomeAir.h + R3BPassiveContFact.h + R3BPipe.h + R3BVacVesselCool.h + R3BTarget.h + R3BCollimator.h) + +add_library_with_dictionary( + LIBNAME + R3BPassive + LINKDEF + PassiveLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BTracking) diff --git a/passive/R3BCollimator.cxx b/passive/R3BCollimator.cxx index 8a8482427..a6ace1723 100644 --- a/passive/R3BCollimator.cxx +++ b/passive/R3BCollimator.cxx @@ -12,7 +12,6 @@ ******************************************************************************/ #include "R3BCollimator.h" -#include "R3BTGeoPar.h" #include "TGeoManager.h" #include "TGeoTube.h" diff --git a/passive/R3BTarget.cxx b/passive/R3BTarget.cxx index 877dc6be4..8c3090cb9 100644 --- a/passive/R3BTarget.cxx +++ b/passive/R3BTarget.cxx @@ -12,7 +12,6 @@ ******************************************************************************/ #include "R3BTarget.h" -#include "R3BTGeoPar.h" #include "TGeoManager.h" #include "TGeoTube.h" diff --git a/pdc/CMakeLists.txt b/pdc/CMakeLists.txt index b50d36784..b8cb63e14 100644 --- a/pdc/CMakeLists.txt +++ b/pdc/CMakeLists.txt @@ -11,54 +11,32 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BCal" which includes the source files given in -# the array . -# The extension is already found. Any number of sources could be listed here. - -set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/pdc -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData -${R3BROOT_SOURCE_DIR}/r3bdata/pdcData -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/r3bsource/pdc -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles - -R3BGeoPdcPar.cxx -R3BPdcContFact.cxx -R3BPdcMapped2CalPar.cxx -R3BPdcMapped2Cal.cxx -R3BPdcCal2Hit.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF PdcLinkDef.h) -set(LIBRARY_NAME R3BPdc) -set(DEPENDENCIES - Spectrum R3BBase R3BTracking R3BData R3BTCal) - -GENERATE_LIBRARY() + R3BGeoPdcPar.cxx + R3BPdcContFact.cxx + R3BPdcMapped2CalPar.cxx + R3BPdcMapped2Cal.cxx + R3BPdcCal2Hit.cxx) + +set(HEADERS + R3BGeoPdcPar.h + R3BPdcContFact.h + R3BPdcMapped2CalPar.h + R3BPdcMapped2Cal.h + R3BPdcCal2Hit.h) + +add_library_with_dictionary( + LIBNAME + R3BPdc + LINKDEF + PdcLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BTracking + R3BTCal + R3BSource) diff --git a/psp/CMakeLists.txt b/psp/CMakeLists.txt index ec9579112..525492b2f 100644 --- a/psp/CMakeLists.txt +++ b/psp/CMakeLists.txt @@ -11,67 +11,55 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BPSP" which includes the source files -#given in # the array . # The extension is already found. Any number -#of sources could be listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/psp -${R3BROOT_SOURCE_DIR}/psp/par -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/calData -# ${R3BROOT_SOURCE_DIR}/r3bdata/dchData -${R3BROOT_SOURCE_DIR}/r3bdata/pspData -${R3BROOT_SOURCE_DIR}/r3bdata/mtofData -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/landData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData -${R3BROOT_SOURCE_DIR}/tracking) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -R3BPsp.cxx -R3BGeoPsp.cxx -# R3BGeoPspPar.cxx -# R3BPspContFact.cxx -R3BPspDigiPar.cxx -R3BPspDigitizer.cxx -# R3BPspxMapped2Cal.cxx -R3BPspxMapped2Precal.cxx -R3BPspxPrecal2Cal.cxx -R3BPspxCal2Hit.cxx -R3BPspxOnlineSpectra.cxx -par/R3BPspxMappedPar.cxx -par/R3BPspxPrecalPar.cxx -par/R3BPspxCalPar.cxx -par/R3BPspxHitPar.cxx -par/R3BPspxContFact.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") + R3BPsp.cxx + R3BGeoPsp.cxx + # R3BGeoPspPar.cxx + # R3BPspContFact.cxx + R3BPspDigiPar.cxx + R3BPspDigitizer.cxx + # R3BPspxMapped2Cal.cxx + R3BPspxMapped2Precal.cxx + R3BPspxPrecal2Cal.cxx + R3BPspxCal2Hit.cxx + R3BPspxReader.cxx + R3BPspxOnlineSpectra.cxx + par/R3BPspxMappedPar.cxx + par/R3BPspxPrecalPar.cxx + par/R3BPspxCalPar.cxx + par/R3BPspxHitPar.cxx + par/R3BPspxContFact.cxx) -Set(LINKDEF PspLinkDef.h) -Set(LIBRARY_NAME R3BPsp) -Set(DEPENDENCIES - R3BBase R3BData R3BTracking) +set(HEADERS + R3BPsp.h + R3BGeoPsp.h + # R3BGeoPspPar.h + # R3BPspContFact.h + R3BPspDigiPar.h + R3BPspDigitizer.h + # R3BPspxMapped2Cal.h + R3BPspxMapped2Precal.h + R3BPspxPrecal2Cal.h + R3BPspxCal2Hit.h + R3BPspxReader.h + R3BPspxOnlineSpectra.h + par/R3BPspxMappedPar.h + par/R3BPspxPrecalPar.h + par/R3BPspxCalPar.h + par/R3BPspxHitPar.h + par/R3BPspxContFact.h) -GENERATE_LIBRARY() +add_library_with_dictionary( + LIBNAME + R3BPsp + LINKDEF + PspLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + par + DEPENDENCIES + R3BTracking R3BSource) diff --git a/psp/PspLinkDef.h b/psp/PspLinkDef.h index a1cb8df5c..50ebd8de3 100644 --- a/psp/PspLinkDef.h +++ b/psp/PspLinkDef.h @@ -36,5 +36,6 @@ #pragma link C++ class R3BPspxContFact + ; #pragma link C++ class R3BPspxOnlineSpectra + ; #pragma link C++ class R3BPspxOnlineSpectra + ; +#pragma link C++ class R3BPspxReader+; #endif diff --git a/r3bsource/pspx/R3BPspxReader.cxx b/psp/R3BPspxReader.cxx similarity index 100% rename from r3bsource/pspx/R3BPspxReader.cxx rename to psp/R3BPspxReader.cxx diff --git a/r3bsource/pspx/R3BPspxReader.h b/psp/R3BPspxReader.h similarity index 100% rename from r3bsource/pspx/R3BPspxReader.h rename to psp/R3BPspxReader.h diff --git a/r3bbase/BaseLinkDef.h b/r3bbase/BaseLinkDef.h index 44f4b39f8..efe5a8d0a 100644 --- a/r3bbase/BaseLinkDef.h +++ b/r3bbase/BaseLinkDef.h @@ -31,8 +31,4 @@ #pragma link C++ class R3BTcutPar+; #pragma link C++ class R3BTsplinePar+; #pragma link C++ class R3BCoarseTimeStitch+; -#pragma link C++ class R3BMSOffsetContFact+; -#pragma link C++ class R3BMSOffsetPar+; -#pragma link C++ class R3BMSOffsetFinder+; -#pragma link C++ class R3BTprevTnext+; #endif diff --git a/r3bbase/CMakeLists.txt b/r3bbase/CMakeLists.txt index 018029a9c..d03d34c96 100644 --- a/r3bbase/CMakeLists.txt +++ b/r3bbase/CMakeLists.txt @@ -11,23 +11,6 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BBase" which includes the source files given in -# the array. The extension is already found. Any number of sources could be -# listed here. - -set(SYSTEM_INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${BASE_INCLUDE_DIRECTORIES}) - -set(INCLUDE_DIRECTORIES - #put here all directories where header files are located - ${R3BROOT_SOURCE_DIR}/r3bbase ${R3BROOT_SOURCE_DIR}/tcal ${R3BROOT_SOURCE_DIR}/r3bdata - ${R3BROOT_SOURCE_DIR}/r3bdata/sampData ${R3BROOT_SOURCE_DIR}/r3bdata/wrData - ${R3BROOT_SOURCE_DIR}/r3bbase/pars) - -include_directories(${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -link_directories(${FAIRROOT_LIBRARY_DIR} ${ROOT_LIBRARY_DIR}) - set(SRCS R3BCoarseTimeStitch.cxx R3BDataPropagator.cxx @@ -41,11 +24,7 @@ set(SRCS R3BModule.cxx R3BTcutPar.cxx R3BTsplinePar.cxx - R3BWhiterabbitPropagator.cxx - R3BTprevTnext.cxx - ./pars/R3BMSOffsetPar.cxx - ./pars/R3BMSOffsetContFact.cxx - ./pars/R3BMSOffsetFinder.cxx) + R3BWhiterabbitPropagator.cxx) set(HEADERS R3BCoarseTimeStitch.h @@ -62,43 +41,48 @@ set(HEADERS R3BShared.h R3BTcutPar.h R3BTsplinePar.h - R3BWhiterabbitPropagator.h - R3BTprevTnext.h - ./pars/R3BMSOffsetPar.h - ./pars/R3BMSOffsetContFact.h - ./pars/R3BMSOffsetFinder.h) - -set(LINKDEF BaseLinkDef.h) + R3BWhiterabbitPropagator.h) set(DEPENDENCIES GeoBase ParBase Base + Gen + Online FairTools - R3BData - Core - Geom - GenVector - Physics - Matrix - MathCore - Hist - Graf - Gpad - Net - Imt - RIO - RHTTP - Spectrum) + ROOT::Geom + ROOT::Physics + ROOT::Matrix + ROOT::Hist + ROOT::Graf + ROOT::Gpad + ROOT::Net + ROOT::Imt + VMCLibrary + ROOT::Core + ROOT::MathCore + ROOT::RIO + ROOT::RHTTP + ROOT::Spectrum + FairLogger::FairLogger + fmt::fmt) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9) - set(DEPENDENCIES ${DEPENDENCIES} -lstdc++fs) -endif() - -if("${FairRoot_VERSION}" VERSION_GREATER_EQUAL 18.8.0) - set(DEPENDENCIES ${DEPENDENCIES} Online) -endif() +add_library_with_dictionary( + LIBNAME + R3BBase + LINKDEF + BaseLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + ${DEPENDENCIES}) -set(LIBRARY_NAME R3BBase) +target_link_directories(R3BBase PUBLIC ${FAIRROOTPATH}/lib) -generate_library() +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9) + target_link_libraries(R3BBase PRIVATE -lstdc++fs) +endif() diff --git a/r3bdata/CMakeLists.txt b/r3bdata/CMakeLists.txt index aa79f9e33..f60817783 100755 --- a/r3bdata/CMakeLists.txt +++ b/r3bdata/CMakeLists.txt @@ -17,215 +17,362 @@ # Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-overloaded-virtual") Set(CMAKE_CXX_FLAGS # "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat-security -march=native") -set(SYSTEM_INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${BASE_INCLUDE_DIRECTORIES}) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/r3bdata/xballData -${R3BROOT_SOURCE_DIR}/r3bdata/califaData -${R3BROOT_SOURCE_DIR}/r3bdata/wrData -${R3BROOT_SOURCE_DIR}/r3bdata/beammonitorData -${R3BROOT_SOURCE_DIR}/r3bdata/dhcData -${R3BROOT_SOURCE_DIR}/r3bdata/gfiData -${R3BROOT_SOURCE_DIR}/r3bdata/mtofData -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/pdcData -${R3BROOT_SOURCE_DIR}/r3bdata/vetoData -${R3BROOT_SOURCE_DIR}/r3bdata/lumonData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData -${R3BROOT_SOURCE_DIR}/r3bdata/landData -${R3BROOT_SOURCE_DIR}/r3bdata/roluData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/frssciData -${R3BROOT_SOURCE_DIR}/r3bdata/sci2Data -${R3BROOT_SOURCE_DIR}/r3bdata/sci8Data -${R3BROOT_SOURCE_DIR}/r3bdata/mfiData -${R3BROOT_SOURCE_DIR}/r3bdata/fibData -${R3BROOT_SOURCE_DIR}/r3bdata/pspData -${R3BROOT_SOURCE_DIR}/r3bdata/neulandData -${R3BROOT_SOURCE_DIR}/r3bdata/actarData -${R3BROOT_SOURCE_DIR}/r3bdata/strawtubesData -${R3BROOT_SOURCE_DIR}/r3bdata/amsData -${R3BROOT_SOURCE_DIR}/r3bdata/footData -${R3BROOT_SOURCE_DIR}/r3bdata/alpideData -${R3BROOT_SOURCE_DIR}/r3bdata/musicData -${R3BROOT_SOURCE_DIR}/r3bdata/sampData -${R3BROOT_SOURCE_DIR}/r3bdata/sfibData -${R3BROOT_SOURCE_DIR}/r3bdata/frsData -${R3BROOT_SOURCE_DIR}/r3bdata/rpcData -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -${R3BROOT_SOURCE_DIR}/r3bdata/twimData -${R3BROOT_SOURCE_DIR}/r3bdata/tttxData -${R3BROOT_SOURCE_DIR}/r3bdata/musliData -${R3BROOT_SOURCE_DIR}/r3bdata/synccheckData -) - -include_directories(${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR}) - -link_directories(${LINK_DIRECTORIES}) - set(SRCS -R3BMCStack.cxx -R3BMCTrack.cxx -wrData/R3BWRData.cxx -trloiiData/R3BTrloiiData.cxx -R3BHit.cxx -R3BTrack.cxx -R3BDouble.cxx -xballData/R3BXBallPoint.cxx -xballData/R3BXBallCrystalHit.cxx -xballData/R3BXBallCrystalHitSim.cxx -califaData/R3BCalifaCrystalCalData.cxx -califaData/R3BCalifaMappedData.cxx -califaData/R3BCalifaClusterData.cxx -califaData/R3BCalifaPoint.cxx -dchData/R3BDchPoint.cxx -dchData/R3BDchFullPoint.cxx -gfiData/R3BGfiPoint.cxx -mtofData/R3BmTofPoint.cxx -mtofData/R3BmTofDigi.cxx -tofData/R3BTofPoint.cxx -vetoData/R3BVetoPoint.cxx -lumonData/ELILuMonPoint.cxx -trackerData/R3BTraPoint.cxx -trackerData/R3BTraHit.cxx -trackerData/R3BSitrackerHit.cxx -trackerData/R3BTrackerHit.cxx -landData/R3BLandPoint.cxx -landData/R3BLandDigi.cxx -landData/R3BLandFirstHits.cxx -landData/R3BLandHit.cxx -landData/R3BPaddleCrystalHit.cxx -landData/R3BNeutronTrack.cxx -dchData/R3BDchDigi.cxx -dchData/R3BDch2pDigi.cxx -tofData/R3BTofDigi.cxx -tofData/R3BTof2pDigi.cxx -gfiData/R3BGfiDigi.cxx -trackerData/R3BTraDigi.cxx -trackerData/R3BTra2pDigi.cxx -trackerData/R3BTraFraDigi.cxx -trackerData/R3BTargetDigi.cxx -trackerData/R3BTarget2pDigi.cxx -mfiData/R3BMfiPoint.cxx -mfiData/R3BMfiDigi.cxx -pspData/R3BPspPoint.cxx -pspData/R3BPspDigi.cxx -neulandData/R3BNeulandTacquilaMappedData.cxx -neulandData/R3BNeulandCalData.cxx -neulandData/R3BNeulandPoint.cxx -neulandData/R3BNeulandHit.cxx -neulandData/R3BNeulandMultiplicity.cxx -neulandData/R3BNeulandCluster.cxx -neulandData/R3BNeulandNeutron.cxx -pspData/R3BPspxMappedData.cxx -pspData/R3BPspxPrecalData.cxx -pspData/R3BPspxCalData.cxx -pspData/R3BPspxHitData.cxx -losData/R3BLosMappedData.cxx -losData/R3BLosCalData.cxx -losData/R3BLosTCalData.cxx -losData/R3BLosHitData.cxx -roluData/R3BRoluMappedData.cxx -roluData/R3BRoluCalData.cxx -roluData/R3BRoluHitData.cxx -frssciData/R3BFrsSciMappedData.cxx -frssciData/R3BFrsSciTcalData.cxx -frssciData/R3BFrsSciPosCalData.cxx -frssciData/R3BFrsSciTofCalData.cxx -sci2Data/R3BSci2MappedData.cxx -sci2Data/R3BSci2TcalData.cxx -sci2Data/R3BSci2CalData.cxx -sci2Data/R3BSci2HitData.cxx -sci8Data/R3BSci8MappedData.cxx -sci8Data/R3BSci8CalData.cxx -sci8Data/R3BSci8HitData.cxx -actarData/R3BActarPoint.cxx -strawtubesData/R3BStrawtubesMappedData.cxx -strawtubesData/R3BStrawtubesCalData.cxx -strawtubesData/R3BStrawtubesHitData.cxx -neulandData/R3BPaddleTamexMappedData.cxx -tofData/R3BTofdMappedData.cxx -tofData/R3BTofdCalData.cxx -tofData/R3BTofdHitData.cxx -tofData/R3BPaddleCalData.cxx -tofData/R3BTofdPoint.cxx -tofData/R3BTofdDigi.cxx -tofData/R3BPtofHit.cxx -tofiData/R3BTofiMappedData.cxx -tofiData/R3BTofiCalData.cxx -tofiData/R3BTofiHitData.cxx -tofiData/R3BTofiPoint.cxx -tofiData/R3BTofiDigi.cxx -pdcData/R3BPdcMappedData.cxx -pdcData/R3BPdcCalData.cxx -pdcData/R3BPdcHitData.cxx -fibData/R3BBunchedFiberCalData.cxx -fibData/R3BBunchedFiberHitData.cxx -fibData/R3BBunchedFiberMappedData.cxx -fibData/R3BFi4Point.cxx -fibData/R3BFi4CalItem.cxx -fibData/R3BFi4HitItem.cxx -fibData/R3BFiberMappedData.cxx -fibData/R3BFibMappedData.cxx -fibData/R3BFibCalData.cxx -fibData/R3BFibPoint.cxx -fibData/R3BFiberMAPMTCalData.cxx -fibData/R3BFiberMAPMTHitData.cxx -fibData/R3BFiberMAPMTMappedData.cxx -amsData/R3BAmsMappedData.cxx -amsData/R3BAmsStripCalData.cxx -amsData/R3BAmsHitData.cxx -beammonitorData/R3BBeamMonitorMappedData.cxx -musicData/R3BMusicPoint.cxx -musicData/R3BMusicMappedData.cxx -musicData/R3BMusicCalData.cxx -musicData/R3BMusicHitData.cxx -sampData/R3BSamplerMappedData.cxx -sampData/R3BSampLosMappedData.cxx -sfibData/R3BSfibMappedData.cxx -sfibData/R3BSfibCalData.cxx -sfibData/R3BSfibHitData.cxx -frsData/R3BFrsData.cxx -footData/R3BFootMappedData.cxx -footData/R3BFootCalData.cxx -footData/R3BFootHitData.cxx -alpideData/R3BAlpidePoint.cxx -alpideData/R3BAlpideMappedData.cxx -alpideData/R3BAlpideCalData.cxx -alpideData/R3BAlpideHitData.cxx -rpcData/R3BRpcMappedData.cxx -rpcData/R3BRpcPreCalData.cxx -rpcData/R3BRpcCalData.cxx -rpcData/R3BRpcHitData.cxx -rpcData/R3BRpcPoint.cxx -mwpcData/R3BMwpcPoint.cxx -mwpcData/R3BMwpcMappedData.cxx -mwpcData/R3BMwpcCalData.cxx -mwpcData/R3BMwpcHitData.cxx -twimData/R3BTwimPoint.cxx -twimData/R3BTwimMappedData.cxx -twimData/R3BTwimCalData.cxx -twimData/R3BTwimHitData.cxx -tttxData/R3BTttxMappedData.cxx -tttxData/R3BTttxCalData.cxx -tttxData/R3BTttxHitData.cxx -musliData/R3BMusliMappedData.cxx -musliData/R3BMusliCalData.cxx -musliData/R3BMusliHitData.cxx -synccheckData/R3BSyncCheckData.cxx -) + #cmake-format: sortable + actarData/R3BActarPoint.cxx + alpideData/R3BAlpideCalData.cxx + alpideData/R3BAlpideHitData.cxx + alpideData/R3BAlpideMappedData.cxx + alpideData/R3BAlpidePoint.cxx + amsData/R3BAmsHitData.cxx + amsData/R3BAmsMappedData.cxx + amsData/R3BAmsStripCalData.cxx + beammonitorData/R3BBeamMonitorMappedData.cxx + califaData/R3BCalifaClusterData.cxx + califaData/R3BCalifaCrystalCalData.cxx + califaData/R3BCalifaMappedData.cxx + califaData/R3BCalifaPoint.cxx + dchData/R3BDch2pDigi.cxx + dchData/R3BDchDigi.cxx + dchData/R3BDchFullPoint.cxx + dchData/R3BDchPoint.cxx + fibData/R3BBunchedFiberCalData.cxx + fibData/R3BBunchedFiberHitData.cxx + fibData/R3BBunchedFiberMappedData.cxx + fibData/R3BFi4CalItem.cxx + fibData/R3BFi4HitItem.cxx + fibData/R3BFi4Point.cxx + fibData/R3BFibCalData.cxx + fibData/R3BFiberMAPMTCalData.cxx + fibData/R3BFiberMAPMTHitData.cxx + fibData/R3BFiberMAPMTMappedData.cxx + fibData/R3BFiberMappedData.cxx + fibData/R3BFibMappedData.cxx + fibData/R3BFibPoint.cxx + footData/R3BFootCalData.cxx + footData/R3BFootHitData.cxx + footData/R3BFootMappedData.cxx + frsData/R3BFrsData.cxx + frssciData/R3BFrsSciMappedData.cxx + frssciData/R3BFrsSciPosCalData.cxx + frssciData/R3BFrsSciTcalData.cxx + frssciData/R3BFrsSciTofCalData.cxx + gfiData/R3BGfiDigi.cxx + gfiData/R3BGfiPoint.cxx + landData/R3BLandDigi.cxx + landData/R3BLandFirstHits.cxx + landData/R3BLandHit.cxx + landData/R3BLandPoint.cxx + landData/R3BNeutronTrack.cxx + landData/R3BPaddleCrystalHit.cxx + losData/R3BLosCalData.cxx + losData/R3BLosHitData.cxx + losData/R3BLosMappedData.cxx + losData/R3BLosTCalData.cxx + lumonData/ELILuMonPoint.cxx + mfiData/R3BMfiDigi.cxx + mfiData/R3BMfiPoint.cxx + mtofData/R3BmTofDigi.cxx + mtofData/R3BmTofPoint.cxx + musicData/R3BMusicCalData.cxx + musicData/R3BMusicHitData.cxx + musicData/R3BMusicMappedData.cxx + musicData/R3BMusicPoint.cxx + musliData/R3BMusliCalData.cxx + musliData/R3BMusliHitData.cxx + musliData/R3BMusliMappedData.cxx + mwpcData/R3BMwpcCalData.cxx + mwpcData/R3BMwpcHitData.cxx + mwpcData/R3BMwpcMappedData.cxx + mwpcData/R3BMwpcPoint.cxx + neulandData/R3BNeulandCalData.cxx + neulandData/R3BNeulandCluster.cxx + neulandData/R3BNeulandHit.cxx + neulandData/R3BNeulandMultiplicity.cxx + neulandData/R3BNeulandNeutron.cxx + neulandData/R3BNeulandPoint.cxx + neulandData/R3BNeulandTacquilaMappedData.cxx + neulandData/R3BPaddleTamexMappedData.cxx + pdcData/R3BPdcCalData.cxx + pdcData/R3BPdcHitData.cxx + pdcData/R3BPdcMappedData.cxx + pspData/R3BPspDigi.cxx + pspData/R3BPspPoint.cxx + pspData/R3BPspxCalData.cxx + pspData/R3BPspxHitData.cxx + pspData/R3BPspxMappedData.cxx + pspData/R3BPspxPrecalData.cxx + R3BDouble.cxx + R3BHit.cxx + R3BMCStack.cxx + R3BMCTrack.cxx + R3BTrack.cxx + roluData/R3BRoluCalData.cxx + roluData/R3BRoluHitData.cxx + roluData/R3BRoluMappedData.cxx + rpcData/R3BRpcCalData.cxx + rpcData/R3BRpcHitData.cxx + rpcData/R3BRpcMappedData.cxx + rpcData/R3BRpcPoint.cxx + rpcData/R3BRpcPreCalData.cxx + sampData/R3BSamplerMappedData.cxx + sampData/R3BSampLosMappedData.cxx + sci2Data/R3BSci2CalData.cxx + sci2Data/R3BSci2HitData.cxx + sci2Data/R3BSci2MappedData.cxx + sci2Data/R3BSci2TcalData.cxx + sci8Data/R3BSci8CalData.cxx + sci8Data/R3BSci8HitData.cxx + sci8Data/R3BSci8MappedData.cxx + sfibData/R3BSfibCalData.cxx + sfibData/R3BSfibHitData.cxx + sfibData/R3BSfibMappedData.cxx + strawtubesData/R3BStrawtubesCalData.cxx + strawtubesData/R3BStrawtubesHitData.cxx + strawtubesData/R3BStrawtubesMappedData.cxx + synccheckData/R3BSyncCheckData.cxx + tofData/R3BPaddleCalData.cxx + tofData/R3BPtofHit.cxx + tofData/R3BTof2pDigi.cxx + tofData/R3BTofdCalData.cxx + tofData/R3BTofdDigi.cxx + tofData/R3BTofdHitData.cxx + tofData/R3BTofDigi.cxx + tofData/R3BTofdMappedData.cxx + tofData/R3BTofdPoint.cxx + tofData/R3BTofPoint.cxx + tofiData/R3BTofiCalData.cxx + tofiData/R3BTofiDigi.cxx + tofiData/R3BTofiHitData.cxx + tofiData/R3BTofiMappedData.cxx + tofiData/R3BTofiPoint.cxx + trackerData/R3BSitrackerHit.cxx + trackerData/R3BTarget2pDigi.cxx + trackerData/R3BTargetDigi.cxx + trackerData/R3BTra2pDigi.cxx + trackerData/R3BTrackerHit.cxx + trackerData/R3BTraDigi.cxx + trackerData/R3BTraFraDigi.cxx + trackerData/R3BTraHit.cxx + trackerData/R3BTraPoint.cxx + trloiiData/R3BTrloiiData.cxx + tttxData/R3BTttxCalData.cxx + tttxData/R3BTttxHitData.cxx + tttxData/R3BTttxMappedData.cxx + twimData/R3BTwimCalData.cxx + twimData/R3BTwimHitData.cxx + twimData/R3BTwimMappedData.cxx + twimData/R3BTwimPoint.cxx + vetoData/R3BVetoPoint.cxx + wrData/R3BWRData.cxx + xballData/R3BXBallCrystalHit.cxx + xballData/R3BXBallCrystalHitSim.cxx + xballData/R3BXBallPoint.cxx) -# fill list of header files from list of source files by exchanging the file extension -change_file_extension(*.cxx *.h HEADERS "${SRCS}") -set(HEADERS ${HEADERS} R3BDetectorList.h) +set(HEADERS + #cmake-format: sortable + actarData/R3BActarPoint.h + alpideData/R3BAlpideCalData.h + alpideData/R3BAlpideHitData.h + alpideData/R3BAlpideMappedData.h + alpideData/R3BAlpidePoint.h + amsData/R3BAmsHitData.h + amsData/R3BAmsMappedData.h + amsData/R3BAmsStripCalData.h + beammonitorData/R3BBeamMonitorMappedData.h + califaData/R3BCalifaClusterData.h + califaData/R3BCalifaCrystalCalData.h + califaData/R3BCalifaMappedData.h + califaData/R3BCalifaPoint.h + dchData/R3BDch2pDigi.h + dchData/R3BDchDigi.h + dchData/R3BDchFullPoint.h + dchData/R3BDchPoint.h + fibData/R3BBunchedFiberCalData.h + fibData/R3BBunchedFiberHitData.h + fibData/R3BBunchedFiberMappedData.h + fibData/R3BFi4CalItem.h + fibData/R3BFi4HitItem.h + fibData/R3BFi4Point.h + fibData/R3BFibCalData.h + fibData/R3BFiberMAPMTCalData.h + fibData/R3BFiberMAPMTHitData.h + fibData/R3BFiberMAPMTMappedData.h + fibData/R3BFiberMappedData.h + fibData/R3BFibMappedData.h + fibData/R3BFibPoint.h + footData/R3BFootCalData.h + footData/R3BFootHitData.h + footData/R3BFootMappedData.h + frsData/R3BFrsData.h + frssciData/R3BFrsSciMappedData.h + frssciData/R3BFrsSciPosCalData.h + frssciData/R3BFrsSciTcalData.h + frssciData/R3BFrsSciTofCalData.h + gfiData/R3BGfiDigi.h + gfiData/R3BGfiPoint.h + landData/R3BLandDigi.h + landData/R3BLandFirstHits.h + landData/R3BLandHit.h + landData/R3BLandPoint.h + landData/R3BNeutronTrack.h + landData/R3BPaddleCrystalHit.h + losData/R3BLosCalData.h + losData/R3BLosHitData.h + losData/R3BLosMappedData.h + losData/R3BLosTCalData.h + lumonData/ELILuMonPoint.h + mfiData/R3BMfiDigi.h + mfiData/R3BMfiPoint.h + mtofData/R3BmTofDigi.h + mtofData/R3BmTofPoint.h + musicData/R3BMusicCalData.h + musicData/R3BMusicHitData.h + musicData/R3BMusicMappedData.h + musicData/R3BMusicPoint.h + musliData/R3BMusliCalData.h + musliData/R3BMusliHitData.h + musliData/R3BMusliMappedData.h + mwpcData/R3BMwpcCalData.h + mwpcData/R3BMwpcHitData.h + mwpcData/R3BMwpcMappedData.h + mwpcData/R3BMwpcPoint.h + neulandData/R3BNeulandCalData.h + neulandData/R3BNeulandCluster.h + neulandData/R3BNeulandHit.h + neulandData/R3BNeulandMultiplicity.h + neulandData/R3BNeulandNeutron.h + neulandData/R3BNeulandPoint.h + neulandData/R3BNeulandTacquilaMappedData.h + neulandData/R3BPaddleTamexMappedData.h + pdcData/R3BPdcCalData.h + pdcData/R3BPdcHitData.h + pdcData/R3BPdcMappedData.h + pspData/R3BPspDigi.h + pspData/R3BPspPoint.h + pspData/R3BPspxCalData.h + pspData/R3BPspxHitData.h + pspData/R3BPspxMappedData.h + pspData/R3BPspxPrecalData.h + R3BDouble.h + R3BHit.h + R3BMCStack.h + R3BMCTrack.h + R3BTrack.h + roluData/R3BRoluCalData.h + roluData/R3BRoluHitData.h + roluData/R3BRoluMappedData.h + rpcData/R3BRpcCalData.h + rpcData/R3BRpcHitData.h + rpcData/R3BRpcMappedData.h + rpcData/R3BRpcPoint.h + rpcData/R3BRpcPreCalData.h + sampData/R3BSamplerMappedData.h + sampData/R3BSampLosMappedData.h + sci2Data/R3BSci2CalData.h + sci2Data/R3BSci2HitData.h + sci2Data/R3BSci2MappedData.h + sci2Data/R3BSci2TcalData.h + sci8Data/R3BSci8CalData.h + sci8Data/R3BSci8HitData.h + sci8Data/R3BSci8MappedData.h + sfibData/R3BSfibCalData.h + sfibData/R3BSfibHitData.h + sfibData/R3BSfibMappedData.h + strawtubesData/R3BStrawtubesCalData.h + strawtubesData/R3BStrawtubesHitData.h + strawtubesData/R3BStrawtubesMappedData.h + synccheckData/R3BSyncCheckData.h + tofData/R3BPaddleCalData.h + tofData/R3BPtofHit.h + tofData/R3BTof2pDigi.h + tofData/R3BTofdCalData.h + tofData/R3BTofdDigi.h + tofData/R3BTofdHitData.h + tofData/R3BTofDigi.h + tofData/R3BTofdMappedData.h + tofData/R3BTofdPoint.h + tofData/R3BTofPoint.h + tofiData/R3BTofiCalData.h + tofiData/R3BTofiDigi.h + tofiData/R3BTofiHitData.h + tofiData/R3BTofiMappedData.h + tofiData/R3BTofiPoint.h + trackerData/R3BSitrackerHit.h + trackerData/R3BTarget2pDigi.h + trackerData/R3BTargetDigi.h + trackerData/R3BTra2pDigi.h + trackerData/R3BTrackerHit.h + trackerData/R3BTraDigi.h + trackerData/R3BTraFraDigi.h + trackerData/R3BTraHit.h + trackerData/R3BTraPoint.h + trloiiData/R3BTrloiiData.h + tttxData/R3BTttxCalData.h + tttxData/R3BTttxHitData.h + tttxData/R3BTttxMappedData.h + twimData/R3BTwimCalData.h + twimData/R3BTwimHitData.h + twimData/R3BTwimMappedData.h + twimData/R3BTwimPoint.h + vetoData/R3BVetoPoint.h + wrData/R3BWRData.h + xballData/R3BXBallCrystalHit.h + xballData/R3BXBallCrystalHitSim.h + xballData/R3BXBallPoint.h) -set(LINKDEF DataLinkDef.h) -set(LIBRARY_NAME R3BData) -set(DEPENDENCIES Base FairTools VMCLibrary FairLogger::FairLogger) +set(DIRS + actarData + alpideData + amsData + beammonitorData + califaData + dchData + fibData + footData + frsData + frssciData + gfiData + landData + losData + lumonData + mfiData + mtofData + musicData + musliData + mwpcData + neulandData + pdcData + pspData + roluData + rpcData + sampData + sci2Data + sci8Data + sfibData + strawtubesData + synccheckData + tofData + tofiData + trackerData + trloiiData + tttxData + twimData + vetoData + wrData + xballData) -generate_library() +add_library_with_dictionary( + LIBNAME + R3BData + LINKDEF + DataLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + ${DIRS} + DEPENDENCIES + R3BBase) diff --git a/r3bgen/CMakeLists.txt b/r3bgen/CMakeLists.txt index 7f157b032..87514f179 100644 --- a/r3bgen/CMakeLists.txt +++ b/r3bgen/CMakeLists.txt @@ -27,25 +27,6 @@ endif((${fairroot_major_version} EQUAL 17 AND ${fairroot_minor_version} EQUAL 10 OR ${fairroot_major_version} GREATER 17) ######################################################### -set(SYSTEM_INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${BASE_INCLUDE_DIRECTORIES}) - -set(INCLUDE_DIRECTORIES - ${R3BROOT_SOURCE_DIR}/field - ${R3BROOT_SOURCE_DIR}/generators - ${R3BROOT_SOURCE_DIR}/r3bgen - ${R3BROOT_SOURCE_DIR}/r3bdata - ${R3BROOT_SOURCE_DIR}/r3bbase - ${Geant4_INCLUDE_DIRS} -) - -include_directories(${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FairLogger_LIBDIR} ${FAIRROOT_LIBRARY_DIR} - ${Geant4_LIBRARY_DIR}) - -link_directories(${LINK_DIRECTORIES}) - set(SRCS R3BSpecificGenerator.cxx R3BReadKinematics.cxx @@ -69,26 +50,48 @@ set(SRCS R3Bp2pevtGenerator.cxx R3BParticleSelector.cxx R3BBeamProperties.cxx - R3BINCLRootGenerator.cxx - ) + R3BINCLRootGenerator.cxx) -# fill list of header files from list of source files -# by exchanging the file extension -change_file_extension(*.cxx *.h HEADERS "${SRCS}") +set(HEADERS + R3BSpecificGenerator.h + R3BReadKinematics.h + R3BCDGenerator.h + R3BBeamInfo.h + R3BBackTracking.h + R3BBackTrackingStorageState.h + R3BAsciiGenerator.h + R3BCosmicGenerator.h + R3BCryAsciiGenerator.h + R3Bp2pGenerator.h + R3BLandGenerator.h + R3BCALIFATestGenerator.h + R3BParticleGenerator.h + R3BIonGenerator.h + R3BGammaGenerator.h + R3BPhaseSpaceGenerator.h + R3BDistribution1D.h + R3BDistribution2D.h + R3BDistribution3D.h + R3Bp2pevtGenerator.h + R3BParticleSelector.h + R3BBeamProperties.h + R3BINCLRootGenerator.h) -set(LINKDEF R3BGenLinkDef.h) -set(LIBRARY_NAME R3BGen) -set(DEPENDENCIES - FairTools - Field - Gen - R3BBase +add_library_with_dictionary( + LIBNAME + R3BGen + LINKDEF + R3BGenLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES R3BData - G4materials - Boost::iostreams - Boost::filesystem) - -generate_library() + PRIVATE_DEPENDENCIES + Geant4::G4materials +) -# Testing add_subdirectory(test) diff --git a/r3bsource/CMakeLists.txt b/r3bsource/CMakeLists.txt index de7a44f2f..e80018588 100644 --- a/r3bsource/CMakeLists.txt +++ b/r3bsource/CMakeLists.txt @@ -15,236 +15,284 @@ # in the array. The extension is already found. Any number of sources could be # listed here. -set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -${ucesb_INCLUDE_DIR} -) - set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bsource -${R3BROOT_SOURCE_DIR}/r3bsource/base -${R3BROOT_SOURCE_DIR}/r3bsource/base/utils -${R3BROOT_SOURCE_DIR}/r3bsource/wr -${R3BROOT_SOURCE_DIR}/r3bsource/trloii -${R3BROOT_SOURCE_DIR}/r3bsource/beammonitor -${R3BROOT_SOURCE_DIR}/r3bsource/frssci -${R3BROOT_SOURCE_DIR}/r3bsource/sci2 -${R3BROOT_SOURCE_DIR}/r3bsource/sci8 -${R3BROOT_SOURCE_DIR}/r3bsource/rolu -${R3BROOT_SOURCE_DIR}/r3bsource/pspx -${R3BROOT_SOURCE_DIR}/r3bsource/pdc -${R3BROOT_SOURCE_DIR}/r3bsource/stubes -${R3BROOT_SOURCE_DIR}/r3bsource/strack -${R3BROOT_SOURCE_DIR}/r3bsource/califa -${R3BROOT_SOURCE_DIR}/r3bsource/neuland -${R3BROOT_SOURCE_DIR}/r3bsource/ams -${R3BROOT_SOURCE_DIR}/r3bsource/foot -${R3BROOT_SOURCE_DIR}/r3bsource/alpide -${R3BROOT_SOURCE_DIR}/r3bsource/music -${R3BROOT_SOURCE_DIR}/r3bsource/mwpc -${R3BROOT_SOURCE_DIR}/r3bsource/twim -${R3BROOT_SOURCE_DIR}/r3bsource/musli -${R3BROOT_SOURCE_DIR}/r3bsource/fibers -${R3BROOT_SOURCE_DIR}/r3bsource/tofd -${R3BROOT_SOURCE_DIR}/r3bsource/tofi -${R3BROOT_SOURCE_DIR}/r3bsource/rpc -${R3BROOT_SOURCE_DIR}/r3bsource/sync_check -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/r3bdata/beammonitorData -${R3BROOT_SOURCE_DIR}/r3bdata/califaData -${R3BROOT_SOURCE_DIR}/r3bdata/neulandData -${R3BROOT_SOURCE_DIR}/r3bdata/pspData -${R3BROOT_SOURCE_DIR}/r3bdata/fibData -${R3BROOT_SOURCE_DIR}/r3bdata/sfibData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/roluData -${R3BROOT_SOURCE_DIR}/r3bdata/frssciData -${R3BROOT_SOURCE_DIR}/r3bdata/sci2Data -${R3BROOT_SOURCE_DIR}/r3bdata/sci8Data -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/tofiData -${R3BROOT_SOURCE_DIR}/r3bdata/pdcData -${R3BROOT_SOURCE_DIR}/r3bdata/strawtubesData -${R3BROOT_SOURCE_DIR}/psp/par -${R3BROOT_SOURCE_DIR}/r3bdata/amsData -${R3BROOT_SOURCE_DIR}/r3bdata/footData -${R3BROOT_SOURCE_DIR}/r3bdata/alpideData -${R3BROOT_SOURCE_DIR}/r3bdata/wrData -${R3BROOT_SOURCE_DIR}/r3bdata/rpcData -${R3BROOT_SOURCE_DIR}/r3bdata/trloiiData -${R3BROOT_SOURCE_DIR}/r3bdata/musicData -${R3BROOT_SOURCE_DIR}/r3bdata/twimData -${R3BROOT_SOURCE_DIR}/r3bdata/tttxData -${R3BROOT_SOURCE_DIR}/r3bdata/musliData -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -${R3BROOT_SOURCE_DIR}/r3bdata/sampData -${R3BROOT_SOURCE_DIR}/r3bdata/synccheckData -) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -${ucesb_LIBRARY_DIR} -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) -link_directories( ${LINK_DIRECTORIES}) + #cmake-format: sortable + ${CMAKE_CURRENT_SOURCE_DIR} + alpide + ams + base + base/utils + beammonitor + califa + fibers + foot + frssci + music + musli + mwpc + neuland + pdc + pspx + rolu + rpc + sci2 + sci8 + strack + stubes + sync_check + tofd + tofi + trloii + twim + wr) set(SRCS -./base/utils/R3BUcesbLauncher.cxx -./base/utils/R3BUcesbStructInfo.cxx -./base/R3BUcesbSource.cxx -./base/R3BUcesbSource2.cxx -./base/R3BReader.cxx -./base/R3BUnpackReader.cxx -./wr/R3BWhiterabbitMasterReader.cxx -./califa/R3BWhiterabbitCalifaReader.cxx -./neuland/R3BWhiterabbitNeulandReader.cxx -./ams/R3BWhiterabbitAmsReader.cxx -./foot/R3BWhiterabbitFootReader.cxx -./wr/R3BWhiterabbitS2Reader.cxx -./wr/R3BWhiterabbitS8Reader.cxx -./los/R3BWhiterabbitLosReader.cxx -./wr/R3BWhiterabbitPspReader.cxx -./music/R3BWhiterabbitMusicReader.cxx -./trloii/R3BTrloiiTpatReader.cxx -./trloii/R3BTrloiiSampReader.cxx -./trloii/R3BTrloiiScalerReader.cxx -./trloii/R3BTrloiiScalerReader_s467.cxx -./wr/R3BTimestampMasterReader.cxx -./pspx/R3BPspxReader.cxx -./pspx/R3BS515PspxReader.cxx -./fibers/R3BBunchedFiberReader.cxx -./fibers/R3BBunchedFiberSPMTTrigReader.cxx -./beammonitor/R3BBeamMonitorReader.cxx -./fibers/R3BFi0Reader.cxx -./fibers/R3BFi1aReader.cxx -./fibers/R3BFi1bReader.cxx -./fibers/R3BFi3aReader.cxx -./fibers/R3BFi3bReader.cxx -./fibers/R3BFi4Reader.cxx -./fibers/R3BFi5Reader.cxx -./fibers/R3BFi6Reader.cxx -./fibers/R3BFi7Reader.cxx -./fibers/R3BFi8Reader.cxx -./fibers/R3BFiberReader.cxx -./los/R3BLosReader.cxx -./rolu/R3BRoluReader.cxx -./rolu/R3BRoluReaderOnline.cxx -./frssci/R3BFrsSciReader.cxx -./sci2/R3BSci2Reader.cxx -./sci8/R3BSci8Reader.cxx -./fibers/R3BSfibReader.cxx -./tofd/R3BTofdReader.cxx -./tofi/R3BTofiReader.cxx -./pdc/R3BPdcReader.cxx -./califa/R3BCalifaFebexReader.cxx -./califa/R3BCalifaJulichReader.cxx -./tofd/R3BPtofReader.cxx -./neuland/R3BNeulandTamexReader.cxx -./neuland/R3BNeulandTacquilaReader.cxx -./stubes/R3BStrawtubesReader.cxx -./ams/R3BAmsReader.cxx -./foot/R3BFootReader.cxx -./foot/R3BFootSiReader.cxx -./alpide/R3BAlpideReader.cxx -./alpide/R3BMosaicReader.cxx -./music/R3BMusicReader.cxx -./rpc/R3BRpcReader.cxx -./twim/R3BTwimReader.cxx -./tttx/R3BTttxReader.cxx -./musli/R3BMusliReader.cxx -./mwpc/R3BMwpcReader.cxx -./sync_check/R3BSyncCheckReader.cxx -) + base/utils/R3BUcesbLauncher.cxx + base/utils/R3BUcesbStructInfo.cxx + base/R3BUcesbSource.cxx + base/R3BUcesbSource2.cxx + base/R3BReader.cxx + base/R3BUnpackReader.cxx + wr/R3BWhiterabbitMasterReader.cxx + califa/R3BWhiterabbitCalifaReader.cxx + neuland/R3BWhiterabbitNeulandReader.cxx + ams/R3BWhiterabbitAmsReader.cxx + foot/R3BWhiterabbitFootReader.cxx + wr/R3BWhiterabbitS2Reader.cxx + wr/R3BWhiterabbitS8Reader.cxx + los/R3BWhiterabbitLosReader.cxx + wr/R3BWhiterabbitPspReader.cxx + music/R3BWhiterabbitMusicReader.cxx + trloii/R3BTrloiiTpatReader.cxx + trloii/R3BTrloiiSampReader.cxx + trloii/R3BTrloiiScalerReader.cxx + trloii/R3BTrloiiScalerReader_s467.cxx + wr/R3BTimestampMasterReader.cxx + pspx/R3BS515PspxReader.cxx + fibers/R3BBunchedFiberReader.cxx + fibers/R3BBunchedFiberSPMTTrigReader.cxx + beammonitor/R3BBeamMonitorReader.cxx + fibers/R3BFi0Reader.cxx + fibers/R3BFi1aReader.cxx + fibers/R3BFi1bReader.cxx + fibers/R3BFi3aReader.cxx + fibers/R3BFi3bReader.cxx + fibers/R3BFi4Reader.cxx + fibers/R3BFi5Reader.cxx + fibers/R3BFi6Reader.cxx + fibers/R3BFi7Reader.cxx + fibers/R3BFi8Reader.cxx + fibers/R3BFiberReader.cxx + los/R3BLosReader.cxx + rolu/R3BRoluReader.cxx + rolu/R3BRoluReaderOnline.cxx + frssci/R3BFrsSciReader.cxx + sci2/R3BSci2Reader.cxx + sci8/R3BSci8Reader.cxx + fibers/R3BSfibReader.cxx + tofd/R3BTofdReader.cxx + tofi/R3BTofiReader.cxx + pdc/R3BPdcReader.cxx + califa/R3BCalifaFebexReader.cxx + califa/R3BCalifaJulichReader.cxx + tofd/R3BPtofReader.cxx + neuland/R3BNeulandTamexReader.cxx + neuland/R3BNeulandTacquilaReader.cxx + stubes/R3BStrawtubesReader.cxx + ams/R3BAmsReader.cxx + foot/R3BFootReader.cxx + foot/R3BFootSiReader.cxx + alpide/R3BAlpideReader.cxx + alpide/R3BMosaicReader.cxx + music/R3BMusicReader.cxx + rpc/R3BRpcReader.cxx + twim/R3BTwimReader.cxx + tttx/R3BTttxReader.cxx + musli/R3BMusliReader.cxx + mwpc/R3BMwpcReader.cxx + sync_check/R3BSyncCheckReader.cxx) + +set(STRUCT_HEADERS + base/ext_h101_unpack.h + wr/ext_h101_whiterabbit.h + wr/ext_h101_wrmaster.h + califa/ext_h101_wrcalifa.h + neuland/ext_h101_wrneuland.h + ams/ext_h101_wrams.h + foot/ext_h101_wrfoot.h + music/ext_h101_wrmusic.h + wr/ext_h101_timestamp_pspx.h + wr/ext_h101_wrs2.h + wr/ext_h101_wrs8.h + los/ext_h101_wrlos.h + trloii/ext_h101_tpat.h + trloii/ext_h101_trlo.h + trloii/ext_h101_trlo_s467.h + wr/ext_h101_timestamp_master.h + beammonitor/ext_h101_bmon.h + fibers/ext_h101_fib.h + fibers/ext_h101_fibzero.h + fibers/ext_h101_fibonea.h + fibers/ext_h101_fiboneb.h + fibers/ext_h101_fibthreea.h + fibers/ext_h101_fibthreeb.h + fibers/ext_h101_fibfour.h + fibers/ext_h101_fibfive.h + fibers/ext_h101_fibsix.h + fibers/ext_h101_fibseven.h + fibers/ext_h101_fibeight.h + fibers/ext_h101_fibten.h + fibers/ext_h101_fibeleven.h + fibers/ext_h101_fibtwelve.h + fibers/ext_h101_fibthirteen.h + fibers/ext_h101_fib23a.h + fibers/ext_h101_fib23b.h + fibers/ext_h101_fib30.h + fibers/ext_h101_fib31.h + fibers/ext_h101_fib32.h + fibers/ext_h101_fib33.h + los/ext_h101_los_dez19.h + rolu/ext_h101_rolu.h + rolu/ext_h101_rolu_online.h + frssci/ext_h101_frssci.h + sci2/ext_h101_sci2.h + sci8/ext_h101_sci8.h + fibers/ext_h101_sfib.h + tofd/ext_h101_tofd.h + tofi/ext_h101_tofi.h + tofd/ext_h101_ptof.h + pspx/ext_h101_psp.h + califa/ext_h101_califa.h + neuland/ext_h101_raw_nnp_tacquila.h + neuland/ext_h101_raw_nnp_tamex.h + stubes/ext_h101_strawtubes.h + ams/ext_h101_ams.h + foot/ext_h101_foot.h + alpide/ext_h101_alpide.h + alpide/ext_h101_mosaic.h + music/ext_h101_music.h + twim/ext_h101_twim.h + tttx/ext_h101_ttt10.h + musli/ext_h101_musli.h + mwpc/ext_h101_mwpc.h + trloii/ext_h101_samp.h + trloii/ext_h101_samplos.h + trloii/ext_h101_sampms.h + trloii/ext_h101_samplosms.h + pdc/ext_h101_pdc.h + rpc/ext_h101_rpc.h + sync_check/ext_h101_sync_check.h) -Set(STRUCT_HEADERS -./base/ext_h101_unpack.h -./wr/ext_h101_whiterabbit.h -./wr/ext_h101_wrmaster.h -./califa/ext_h101_wrcalifa.h -./neuland/ext_h101_wrneuland.h -./ams/ext_h101_wrams.h -./foot/ext_h101_wrfoot.h -./music/ext_h101_wrmusic.h -./wr/ext_h101_timestamp_pspx.h -./wr/ext_h101_wrs2.h -./wr/ext_h101_wrs8.h -./los/ext_h101_wrlos.h -./trloii/ext_h101_tpat.h -./trloii/ext_h101_trlo.h -./trloii/ext_h101_trlo_s467.h -./wr/ext_h101_timestamp_master.h -./beammonitor/ext_h101_bmon.h -./fibers/ext_h101_fib.h -./fibers/ext_h101_fibzero.h -./fibers/ext_h101_fibonea.h -./fibers/ext_h101_fiboneb.h -./fibers/ext_h101_fibthreea.h -./fibers/ext_h101_fibthreeb.h -./fibers/ext_h101_fibfour.h -./fibers/ext_h101_fibfive.h -./fibers/ext_h101_fibsix.h -./fibers/ext_h101_fibseven.h -./fibers/ext_h101_fibeight.h -./fibers/ext_h101_fibten.h -./fibers/ext_h101_fibeleven.h -./fibers/ext_h101_fibtwelve.h -./fibers/ext_h101_fibthirteen.h -./fibers/ext_h101_fib23a.h -./fibers/ext_h101_fib23b.h -./fibers/ext_h101_fib30.h -./fibers/ext_h101_fib31.h -./fibers/ext_h101_fib32.h -./fibers/ext_h101_fib33.h -./los/ext_h101_los_dez19.h -./rolu/ext_h101_rolu.h -./rolu/ext_h101_rolu_online.h -./frssci/ext_h101_frssci.h -./sci2/ext_h101_sci2.h -./sci8/ext_h101_sci8.h -./fibers/ext_h101_sfib.h -./tofd/ext_h101_tofd.h -./tofi/ext_h101_tofi.h -./tofd/ext_h101_ptof.h -./pspx/ext_h101_psp.h -./califa/ext_h101_califa.h -./neuland/ext_h101_raw_nnp_tacquila.h -./neuland/ext_h101_raw_nnp_tamex.h -./stubes/ext_h101_strawtubes.h -./ams/ext_h101_ams.h -./foot/ext_h101_foot.h -./alpide/ext_h101_alpide.h -./alpide/ext_h101_mosaic.h -./music/ext_h101_music.h -./twim/ext_h101_twim.h -./tttx/ext_h101_ttt10.h -./musli/ext_h101_musli.h -./mwpc/ext_h101_mwpc.h -./trloii/ext_h101_samp.h -./trloii/ext_h101_samplos.h -./trloii/ext_h101_sampms.h -./trloii/ext_h101_samplosms.h -./pdc/ext_h101_pdc.h -./rpc/ext_h101_rpc.h -./sync_check/ext_h101_sync_check.h -) +set(HEADERS + base/R3BUcesbSource.h + base/R3BReader.h + base/R3BUnpackReader.h + base/utils/R3BUcesbDecl.h + base/utils/R3BUcesbLauncher.h + base/utils/R3BUcesbMappingFlag.h + base/utils/R3BUcesbStructInfo.h + wr/R3BWhiterabbitMasterReader.h + califa/R3BWhiterabbitCalifaReader.h + neuland/R3BWhiterabbitNeulandReader.h + ams/R3BWhiterabbitAmsReader.h + foot/R3BWhiterabbitFootReader.h + wr/R3BWhiterabbitS2Reader.h + wr/R3BWhiterabbitS8Reader.h + los/R3BWhiterabbitLosReader.h + wr/R3BWhiterabbitPspReader.h + music/R3BWhiterabbitMusicReader.h + trloii/R3BTrloiiTpatReader.h + trloii/R3BTrloiiSampReader.h + trloii/R3BTrloiiScalerReader.h + trloii/R3BTrloiiScalerReader_s467.h + wr/R3BTimestampMasterReader.h + pspx/R3BS515PspxReader.h + fibers/R3BBunchedFiberReader.h + fibers/R3BBunchedFiberSPMTTrigReader.h + beammonitor/R3BBeamMonitorReader.h + fibers/R3BFi0Reader.h + fibers/R3BFi1aReader.h + fibers/R3BFi1bReader.h + fibers/R3BFi3aReader.h + fibers/R3BFi3bReader.h + fibers/R3BFi4Reader.h + fibers/R3BFi5Reader.h + fibers/R3BFi6Reader.h + fibers/R3BFi7Reader.h + fibers/R3BFi8Reader.h + fibers/R3BFiberReader.h + frssci/R3BFrsSciReader.h + los/R3BLosReader.h + rolu/R3BRoluReader.h + rolu/R3BRoluReaderOnline.h + sci2/R3BSci2Reader.h + sci8/R3BSci8Reader.h + fibers/R3BSfibReader.h + tofd/R3BTofdReader.h + tofi/R3BTofiReader.h + pdc/R3BPdcReader.h + califa/R3BCalifaFebexReader.h + califa/R3BCalifaJulichReader.h + tofd/R3BPtofReader.h + neuland/R3BNeulandTamexReader.h + neuland/R3BNeulandTacquilaReader.h + stubes/R3BStrawtubesReader.h + ams/R3BAmsReader.h + foot/R3BFootReader.h + foot/R3BFootSiReader.h + alpide/R3BAlpideReader.h + alpide/R3BMosaicReader.h + music/R3BMusicReader.h + rpc/R3BRpcReader.h + tttx/R3BTttxReader.h + twim/R3BTwimReader.h + musli/R3BMusliReader.h + mwpc/R3BMwpcReader.h + sync_check/R3BSyncCheckReader.h) -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") -Set(HEADERS ${STRUCT_HEADERS} ${HEADERS}) +set(HEADERS ${STRUCT_HEADERS} ${HEADERS}) -set(LINKDEF SourceLinkDef.h) -set(DEPENDENCIES - GeoBase ParBase MbsAPI Base FairTools - R3BBase R3BData Core Geom GenVector - Physics Matrix MathCore R3BPsp - ${ucesb_LIBRARY_SHARED}) -set(LIBRARY_NAME R3Bsource) +set(DIRS + alpide + ams + base + base/utils + beammonitor + califa + fibers + foot + los + music + musli + mwpc + neuland + pdc + pspx + rolu + rpc + sci2 + sci8 + stubes + sync_check + tofd + tofi + trloii + twim + wr) -GENERATE_LIBRARY() -target_include_directories(R3Bsource PUBLIC neuland base base/utils trloii wr ${SYSTEM_INCLUDE_DIRECTORIES}) +add_library_with_dictionary( + LIBNAME + R3BSource + LINKDEF + SourceLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${DIRS} + DEPENDENCIES + R3BData + Ucesb + PRIVATE_DEPENDENCIES + MbsAPI) diff --git a/r3bsource/SourceLinkDef.h b/r3bsource/SourceLinkDef.h index c48c06c5c..850a391c8 100644 --- a/r3bsource/SourceLinkDef.h +++ b/r3bsource/SourceLinkDef.h @@ -39,7 +39,6 @@ #pragma link C++ class R3BTrloiiScalerReader_s467+; #pragma link C++ class R3BTimestampMasterReader+; #pragma link C++ class R3BBeamMonitorReader+; -#pragma link C++ class R3BPspxReader+; #pragma link C++ class R3BS515PspxReader+; #pragma link C++ class R3BBunchedFiberReader+; #pragma link C++ class R3BBunchedFiberSPMTTrigReader+; diff --git a/r3bsource/base/R3BReader.h b/r3bsource/base/R3BReader.h index f9031cedc..40cfb96a2 100644 --- a/r3bsource/base/R3BReader.h +++ b/r3bsource/base/R3BReader.h @@ -17,10 +17,7 @@ #include #include -extern "C" -{ -#include "ext_data_struct_info.hh" -} +#include class TClonesArray; class R3BEventHeader; diff --git a/r3bsource/pspx/R3BS515PspxReader.cxx b/r3bsource/pspx/R3BS515PspxReader.cxx index 36872d452..e076f5195 100644 --- a/r3bsource/pspx/R3BS515PspxReader.cxx +++ b/r3bsource/pspx/R3BS515PspxReader.cxx @@ -18,7 +18,6 @@ #include "R3BLogger.h" #include "R3BPspxMappedData.h" -#include "R3BPspxMappedPar.h" #include "R3BS515PspxReader.h" #include "TClonesArray.h" diff --git a/rolu/CMakeLists.txt b/rolu/CMakeLists.txt index ec667d025..d19aa4a87 100644 --- a/rolu/CMakeLists.txt +++ b/rolu/CMakeLists.txt @@ -12,47 +12,24 @@ ############################################################################## # Create a library called "libR3BRolu" which includes the source files given in -# the array. The extension is already found. Any number of sources could be +# the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/rolu -${R3BROOT_SOURCE_DIR}/r3bdata/roluData -${R3BROOT_SOURCE_DIR}/tcal -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -R3BRoluMapped2Cal.cxx -R3BRoluMapped2CalPar.cxx -R3BRoluCal2Hit.cxx -R3BRoluOnlineSpectra.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF RoluLinkDef.h) -Set(LIBRARY_NAME R3BRolu) -Set(DEPENDENCIES - R3BBase R3BData R3BTCal) - -GENERATE_LIBRARY() - +set(SRCS R3BRoluMapped2Cal.cxx R3BRoluMapped2CalPar.cxx R3BRoluCal2Hit.cxx R3BRoluOnlineSpectra.cxx) + +set(HEADERS R3BRoluMapped2Cal.h R3BRoluMapped2CalPar.h R3BRoluCal2Hit.h R3BRoluOnlineSpectra.h) + +add_library_with_dictionary( + LIBNAME + R3BRolu + LINKDEF + RoluLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData + R3BTCal) diff --git a/rpc/CMakeLists.txt b/rpc/CMakeLists.txt index 36e9953ec..2a3899496 100644 --- a/rpc/CMakeLists.txt +++ b/rpc/CMakeLists.txt @@ -1,4 +1,3 @@ - ############################################################################## # Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH # # Copyright (C) 2022-2023 Members of R3B Collaboration # @@ -12,72 +11,57 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BRpc" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/rpcData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/wrData -${R3BROOT_SOURCE_DIR}/rpc -${R3BROOT_SOURCE_DIR}/rpc/sim -${R3BROOT_SOURCE_DIR}/rpc/digi -${R3BROOT_SOURCE_DIR}/rpc/pars -${R3BROOT_SOURCE_DIR}/rpc/calibration -${R3BROOT_SOURCE_DIR}/rpc/online -${R3BROOT_SOURCE_DIR}/tcal -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -sim/R3BRpc.cxx -pars/R3BRpcContFact.cxx -#R3BRpcDigitizer.cxx -calibration/R3BRpcMapped2PreCalPar.cxx -calibration/R3BRpcMapped2PreCal.cxx -calibration/R3BRpcPreCal2CalPar.cxx -calibration/R3BRpcPreCal2Cal.cxx -pars/R3BRpcTotCalPar.cxx -calibration/R3BRpcCal2Hit.cxx -calibration/R3BRpcCal2HitPar.cxx -pars/R3BRpcHitPar.cxx -pars/R3BRpcPars4Sim.cxx -./online/R3BRpcOnlineSpectra.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF RpcLinkDef.h) -set(LIBRARY_NAME R3BRpc) + sim/R3BRpc.cxx + pars/R3BRpcContFact.cxx + #R3BRpcDigitizer.cxx + calibration/R3BRpcMapped2PreCalPar.cxx + calibration/R3BRpcMapped2PreCal.cxx + calibration/R3BRpcPreCal2CalPar.cxx + calibration/R3BRpcPreCal2Cal.cxx + pars/R3BRpcTotCalPar.cxx + calibration/R3BRpcCal2Hit.cxx + calibration/R3BRpcCal2HitPar.cxx + pars/R3BRpcHitPar.cxx + pars/R3BRpcPars4Sim.cxx + online/R3BRpcOnlineSpectra.cxx) -set(DEPENDENCIES - R3BBase R3BTracking R3BData R3BTCal) +set(HEADERS + sim/R3BRpc.h + pars/R3BRpcContFact.h + #R3BRpcDigitizer.h + calibration/R3BRpcMapped2PreCalPar.h + calibration/R3BRpcMapped2PreCal.h + calibration/R3BRpcPreCal2CalPar.h + calibration/R3BRpcPreCal2Cal.h + pars/R3BRpcTotCalPar.h + calibration/R3BRpcCal2Hit.h + calibration/R3BRpcCal2HitPar.h + pars/R3BRpcHitPar.h + pars/R3BRpcPars4Sim.h + online/R3BRpcOnlineSpectra.h) -GENERATE_LIBRARY() +add_library_with_dictionary( + LIBNAME + R3BRpc + LINKDEF + RpcLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calibration + digi + online + pars + sim + DEPENDENCIES + R3BTracking + R3BTCal) if(BUILD_GEOMETRY) - add_subdirectory(geobase) + add_subdirectory(geobase) endif() add_subdirectory(test) diff --git a/sci2/CMakeLists.txt b/sci2/CMakeLists.txt index ba16ccac7..6f8fe7bd5 100644 --- a/sci2/CMakeLists.txt +++ b/sci2/CMakeLists.txt @@ -15,51 +15,38 @@ # the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/sci2 -${R3BROOT_SOURCE_DIR}/sci2/params -${R3BROOT_SOURCE_DIR}/sci2/calib -${R3BROOT_SOURCE_DIR}/sci2/online -${R3BROOT_SOURCE_DIR}/r3bdata/ -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/sci2Data -${R3BROOT_SOURCE_DIR}/tcal -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -calib/R3BSci2Mapped2Tcal.cxx -calib/R3BSci2Mapped2Cal.cxx -params/R3BSci2Mapped2CalPar.cxx -calib/R3BSci2Tcal2Hit.cxx -params/R3BSci2HitPar.cxx -params/R3BSci2ContFact.cxx -online/R3BOnlineSpectraSci2.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF Sci2LinkDef.h) -Set(LIBRARY_NAME R3BSci2) -Set(DEPENDENCIES - R3BBase R3BData R3BTCal) - -GENERATE_LIBRARY() + calib/R3BSci2Mapped2Tcal.cxx + calib/R3BSci2Mapped2Cal.cxx + params/R3BSci2Mapped2CalPar.cxx + calib/R3BSci2Tcal2Hit.cxx + params/R3BSci2HitPar.cxx + params/R3BSci2ContFact.cxx + online/R3BOnlineSpectraSci2.cxx) + +set(HEADERS + calib/R3BSci2Mapped2Tcal.h + calib/R3BSci2Mapped2Cal.h + params/R3BSci2Mapped2CalPar.h + calib/R3BSci2Tcal2Hit.h + params/R3BSci2HitPar.h + params/R3BSci2ContFact.h + online/R3BOnlineSpectraSci2.h) + +add_library_with_dictionary( + LIBNAME + R3BSci2 + LINKDEF + Sci2LinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calib + online + params + DEPENDENCIES + R3BData + R3BTCal) diff --git a/sci8/CMakeLists.txt b/sci8/CMakeLists.txt index 48ec8ecd2..ce4d8d392 100644 --- a/sci8/CMakeLists.txt +++ b/sci8/CMakeLists.txt @@ -15,45 +15,21 @@ # the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/sci8 -${R3BROOT_SOURCE_DIR}/r3bdata/ -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/sci8Data -${R3BROOT_SOURCE_DIR}/tcal -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -R3BSci8Mapped2Cal.cxx -R3BSci8Mapped2CalPar.cxx -R3BSci8Cal2Hit.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF Sci8LinkDef.h) -Set(LIBRARY_NAME R3BSci8) -Set(DEPENDENCIES - R3BBase R3BData R3BTCal) - -GENERATE_LIBRARY() - +set(SRCS R3BSci8Mapped2Cal.cxx R3BSci8Mapped2CalPar.cxx R3BSci8Cal2Hit.cxx) + +set(HEADERS R3BSci8Mapped2Cal.h R3BSci8Mapped2CalPar.h R3BSci8Cal2Hit.h) + +add_library_with_dictionary( + LIBNAME + R3BSci8 + LINKDEF + Sci8LinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData + R3BTCal) diff --git a/sfib/CMakeLists.txt b/sfib/CMakeLists.txt index b2575b706..9e6e9f9ac 100644 --- a/sfib/CMakeLists.txt +++ b/sfib/CMakeLists.txt @@ -11,48 +11,32 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BSfib" which includes the source files given -# in the array. The extension is already found. Any number of sources could +# Create a library called "libR3BSfib" which includes the source files given +# in the array. The extension is already found. Any number of sources could # be listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/sfib -${R3BROOT_SOURCE_DIR}/sfib/sim -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/sfibData -${R3BROOT_SOURCE_DIR}/r3bdata/fibData -${R3BROOT_SOURCE_DIR}/tcal -) - -include_directories(${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories(${LINK_DIRECTORIES}) - set(SRCS -./sim/R3Bsfi.cxx -./sim/R3BsfiDigitizer.cxx -R3BSfibMapped2Cal.cxx -R3BSfibMapped2CalPar.cxx -R3BSfibCal2Hit.cxx -#R3BSfibCal2HitPar.cxx + sim/R3Bsfi.cxx sim/R3BsfiDigitizer.cxx R3BSfibMapped2Cal.cxx R3BSfibMapped2CalPar.cxx + R3BSfibCal2Hit.cxx + #R3BSfibCal2HitPar.cxx ) -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF SfibLinkDef.h) -Set(LIBRARY_NAME R3BSfib) -Set(DEPENDENCIES R3BData R3BTCal) - -GENERATE_LIBRARY() +set(HEADERS + sim/R3Bsfi.h sim/R3BsfiDigitizer.h R3BSfibMapped2Cal.h R3BSfibMapped2CalPar.h R3BSfibCal2Hit.h + #R3BSfibCal2HitPar.h +) +add_library_with_dictionary( + LIBNAME + R3BSfib + LINKDEF + SfibLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + sim + DEPENDENCIES + R3BTCal + R3BData) diff --git a/ssd/CMakeLists.txt b/ssd/CMakeLists.txt index 389b9bb46..cdf5979f6 100644 --- a/ssd/CMakeLists.txt +++ b/ssd/CMakeLists.txt @@ -1,4 +1,3 @@ - ############################################################################## # Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH # # Copyright (C) 2019-2024 Members of R3B Collaboration # @@ -12,88 +11,83 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BSsd" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/califaData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/amsData -${R3BROOT_SOURCE_DIR}/r3bdata/footData -${R3BROOT_SOURCE_DIR}/r3bdata/wrData -${R3BROOT_SOURCE_DIR}/ssd -${R3BROOT_SOURCE_DIR}/ssd/sim -${R3BROOT_SOURCE_DIR}/ssd/digi -${R3BROOT_SOURCE_DIR}/ssd/pars -${R3BROOT_SOURCE_DIR}/ssd/calibration -${R3BROOT_SOURCE_DIR}/ssd/online -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -./sim/R3BTra.cxx -./sim/R3BTraHitFinder.cxx -./pars/R3BGeoTra.cxx -./pars/R3BGeoTraPar.cxx -./pars/R3BAmsMappingPar.cxx -./pars/R3BAmsStripCalPar.cxx -./pars/R3BSsdContFact.cxx -./digi/R3BTraDigiPar.cxx -./digi/R3BTraDigitizer.cxx -./digi/R3BTargetDigiPar.cxx -./digi/R3BTargetDigitizer.cxx -./digi/R3BAmsDigitizer.cxx -./digi/R3BTra2pDigiPar.cxx -./digi/R3BTra2pDigitizer.cxx -./digi/R3BTraFraDigiPar.cxx -./digi/R3BTraFraDigitizer.cxx -./digi/R3BTarget2pDigiPar.cxx -./digi/R3BTarget2pDigitizer.cxx -./calibration/R3BAmsMapped2StripCalPar.cxx -./calibration/R3BAmsMapped2StripCal.cxx -./calibration/R3BAmsStripCal2Hit.cxx -./online/R3BAmsOnlineSpectra.cxx -./online/R3BAmsCalifaCorrelatedOnlineSpectra.cxx -./online/R3BFootOnlineSpectra.cxx -./pars/R3BFootMappingPar.cxx -./pars/R3BFootCalPar.cxx -./calibration/R3BFootMapped2StripCal.cxx -./calibration/R3BFootStripCal2Hit.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") + sim/R3BTra.cxx + sim/R3BTraHitFinder.cxx + pars/R3BGeoTra.cxx + pars/R3BGeoTraPar.cxx + pars/R3BAmsMappingPar.cxx + pars/R3BAmsStripCalPar.cxx + pars/R3BSsdContFact.cxx + digi/R3BTraDigiPar.cxx + digi/R3BTraDigitizer.cxx + digi/R3BTargetDigiPar.cxx + digi/R3BTargetDigitizer.cxx + digi/R3BAmsDigitizer.cxx + digi/R3BTra2pDigiPar.cxx + digi/R3BTra2pDigitizer.cxx + digi/R3BTraFraDigiPar.cxx + digi/R3BTraFraDigitizer.cxx + digi/R3BTarget2pDigiPar.cxx + digi/R3BTarget2pDigitizer.cxx + calibration/R3BAmsMapped2StripCalPar.cxx + calibration/R3BAmsMapped2StripCal.cxx + calibration/R3BAmsStripCal2Hit.cxx + online/R3BAmsOnlineSpectra.cxx + online/R3BAmsCalifaCorrelatedOnlineSpectra.cxx + online/R3BFootOnlineSpectra.cxx + pars/R3BFootMappingPar.cxx + pars/R3BFootCalPar.cxx + calibration/R3BFootMapped2StripCal.cxx + calibration/R3BFootStripCal2Hit.cxx) -set(LINKDEF SsdLinkDef.h) -set(LIBRARY_NAME R3BSsd) -set(DEPENDENCIES - Spectrum R3BBase R3BData R3BTracking - #Online - ) +set(HEADERS + sim/R3BTra.h + sim/R3BTraHitFinder.h + pars/R3BGeoTra.h + pars/R3BGeoTraPar.h + pars/R3BAmsMappingPar.h + pars/R3BAmsStripCalPar.h + pars/R3BSsdContFact.h + digi/R3BTraDigiPar.h + digi/R3BTraDigitizer.h + digi/R3BTargetDigiPar.h + digi/R3BTargetDigitizer.h + digi/R3BAmsDigitizer.h + digi/R3BTra2pDigiPar.h + digi/R3BTra2pDigitizer.h + digi/R3BTraFraDigiPar.h + digi/R3BTraFraDigitizer.h + digi/R3BTarget2pDigiPar.h + digi/R3BTarget2pDigitizer.h + calibration/R3BAmsMapped2StripCalPar.h + calibration/R3BAmsMapped2StripCal.h + calibration/R3BAmsStripCal2Hit.h + online/R3BAmsOnlineSpectra.h + online/R3BAmsCalifaCorrelatedOnlineSpectra.h + online/R3BFootOnlineSpectra.h + pars/R3BFootMappingPar.h + pars/R3BFootCalPar.h + calibration/R3BFootMapped2StripCal.h + calibration/R3BFootStripCal2Hit.h) -GENERATE_LIBRARY() +add_library_with_dictionary( + LIBNAME + R3BSsd + LINKDEF + SsdLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calibration + digi + online + pars + sim + DEPENDENCIES + R3BTracking R3BTCal) add_subdirectory(test) diff --git a/ssd/test/CMakeLists.txt b/ssd/test/CMakeLists.txt index 76f657eec..035bb674f 100644 --- a/ssd/test/CMakeLists.txt +++ b/ssd/test/CMakeLists.txt @@ -11,7 +11,6 @@ # or submit itself to any jurisdiction. # ############################################################################## - generate_root_test_script(${R3BROOT_SOURCE_DIR}/ssd/test/testAmsSimulation.C) add_test(AmsSimulation ${R3BROOT_BINARY_DIR}/ssd/test/testAmsSimulation.sh) set_tests_properties(AmsSimulation PROPERTIES TIMEOUT "2000") diff --git a/strawtubes/CMakeLists.txt b/strawtubes/CMakeLists.txt index 8c85c3680..aea02d651 100644 --- a/strawtubes/CMakeLists.txt +++ b/strawtubes/CMakeLists.txt @@ -11,45 +11,21 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BStrawtubes" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -${R3BROOT_SOURCE_DIR}/strawtubes -${R3BROOT_SOURCE_DIR}/r3bdata/strawtubesData -${R3BROOT_SOURCE_DIR}/tcal -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -R3BStrawtubesMapped2Cal.cxx -R3BStrawtubesMapped2CalPar.cxx -R3BStrawtubesCal2Hit.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF StrawtubesLinkDef.h) -Set(LIBRARY_NAME R3BStrawtubes) -Set(DEPENDENCIES - R3BBase R3BData R3BPassive R3BTCal) - -GENERATE_LIBRARY() - +set(SRCS R3BStrawtubesMapped2Cal.cxx R3BStrawtubesMapped2CalPar.cxx R3BStrawtubesCal2Hit.cxx) + +set(HEADERS R3BStrawtubesMapped2Cal.h R3BStrawtubesMapped2CalPar.h R3BStrawtubesCal2Hit.h) + +add_library_with_dictionary( + LIBNAME + R3BStrawtubes + LINKDEF + StrawtubesLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BPassive + R3BTCal) diff --git a/tcal/CMakeLists.txt b/tcal/CMakeLists.txt index 587025edc..84bf2bc6c 100644 --- a/tcal/CMakeLists.txt +++ b/tcal/CMakeLists.txt @@ -11,46 +11,19 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BTCal" which includes the source files given in -# the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/r3bbase -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -R3BTCalModulePar.cxx -R3BTCalPar.cxx -R3BTCalContFact.cxx -R3BTCalEngine.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF TCalLinkDef.h) -Set(LIBRARY_NAME R3BTCal) -Set(DEPENDENCIES - Base ParBase R3BBase) - -GENERATE_LIBRARY() - +set(SRCS R3BTCalModulePar.cxx R3BTCalPar.cxx R3BTCalContFact.cxx R3BTCalEngine.cxx) +set(HEADERS R3BTCalModulePar.h R3BTCalPar.h R3BTCalContFact.h R3BTCalEngine.h) + +add_library_with_dictionary( + LIBNAME + R3BTCal + LINKDEF + TCalLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BBase) diff --git a/tof/CMakeLists.txt b/tof/CMakeLists.txt index f7676db6c..be51010bd 100644 --- a/tof/CMakeLists.txt +++ b/tof/CMakeLists.txt @@ -15,79 +15,86 @@ # the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tof -${R3BROOT_SOURCE_DIR}/los -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/mtofData -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/ptofData -${R3BROOT_SOURCE_DIR}/r3bdata/neulandData -${R3BROOT_SOURCE_DIR}/tracking -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -R3BTof.cxx -R3BGeoTof.cxx -R3BGeoTofPar.cxx -R3BTofContFact.cxx -R3BTofDigiPar.cxx -R3BTofDigitizer.cxx -R3BTof2pDigiPar.cxx -R3BTof2pDigitizer.cxx -R3BTofdMapped2Cal.cxx -R3BTofdMapped2CalPar.cxx -R3BTofdCal2HitPar.cxx -R3BTofdCal2Histo.cxx -R3BTofdCal2HistoPar.cxx -R3BTofdChangePar.cxx -R3BTofdCal2Hit.cxx -R3BTofdCal2HitS454.cxx -R3BTofdCal2HitS494.cxx -R3BTofdHitModulePar.cxx -R3BTofdHitPar.cxx -R3BTofd.cxx -R3BTofdDigitizer.cxx -R3BTofdDigitizerCal.cxx -R3BGeoTofd.cxx -R3BGeoTofdPar.cxx -R3BTofdContFact.cxx -R3BTofdDigiPar.cxx -R3BPtofMapped2CalPar.cxx -R3BPtofMapped2Cal.cxx -calibration/R3BPtofCal2HitPar.cxx -calibration/R3BPtofCal2Hit.cxx -calibration/R3BPtofHitPar.cxx -calibration/R3BPtofParFact.cxx -) + R3BTof.cxx + R3BGeoTof.cxx + R3BGeoTofPar.cxx + R3BTofContFact.cxx + R3BTofDigiPar.cxx + R3BTofDigitizer.cxx + R3BTof2pDigiPar.cxx + R3BTof2pDigitizer.cxx + R3BTofdMapped2Cal.cxx + R3BTofdMapped2CalPar.cxx + R3BTofdCal2HitPar.cxx + R3BTofdCal2Histo.cxx + R3BTofdCal2HistoPar.cxx + R3BTofdChangePar.cxx + R3BTofdCal2Hit.cxx + R3BTofdCal2HitS454.cxx + R3BTofdCal2HitS494.cxx + R3BTofdHitModulePar.cxx + R3BTofdHitPar.cxx + R3BTofd.cxx + R3BTofdDigitizer.cxx + R3BTofdDigitizerCal.cxx + R3BGeoTofd.cxx + R3BGeoTofdPar.cxx + R3BTofdContFact.cxx + R3BTofdDigiPar.cxx + R3BPtofMapped2CalPar.cxx + R3BPtofMapped2Cal.cxx + calibration/R3BPtofCal2HitPar.cxx + calibration/R3BPtofCal2Hit.cxx + calibration/R3BPtofHitPar.cxx + calibration/R3BPtofParFact.cxx) -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") +set(HEADERS + R3BTof.h + R3BGeoTof.h + R3BGeoTofPar.h + R3BTofContFact.h + R3BTofDigiPar.h + R3BTofDigitizer.h + R3BTof2pDigiPar.h + R3BTof2pDigitizer.h + R3BTofdMapped2Cal.h + R3BTofdMapped2CalPar.h + R3BTofdCal2HitPar.h + R3BTofdCal2Histo.h + R3BTofdCal2HistoPar.h + R3BTofdChangePar.h + R3BTofdCal2Hit.h + R3BTofdCal2HitS454.h + R3BTofdCal2HitS494.h + R3BTofdHitModulePar.h + R3BTofdHitPar.h + R3BTofd.h + R3BTofdDigitizer.h + R3BTofdDigitizerCal.h + R3BGeoTofd.h + R3BGeoTofdPar.h + R3BTofdContFact.h + R3BTofdDigiPar.h + R3BPtofMapped2CalPar.h + R3BPtofMapped2Cal.h + calibration/R3BPtofCal2HitPar.h + calibration/R3BPtofCal2Hit.h + calibration/R3BPtofHitPar.h + calibration/R3BPtofParFact.h) -set(LINKDEF TofLinkDef.h) -set(LIBRARY_NAME R3BTof) -set(DEPENDENCIES - Spectrum R3BBase R3BTracking R3BData R3BTCal) - -GENERATE_LIBRARY() +add_library_with_dictionary( + LIBNAME + R3BTof + LINKDEF + TofLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calibration + DEPENDENCIES + R3BTracking + R3BTCal) diff --git a/tofd/CMakeLists.txt b/tofd/CMakeLists.txt index d01718606..6e580fb21 100644 --- a/tofd/CMakeLists.txt +++ b/tofd/CMakeLists.txt @@ -11,72 +11,68 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BTofD" which includes the source files given in -# the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tofd -${R3BROOT_SOURCE_DIR}/tofd/sim -${R3BROOT_SOURCE_DIR}/tofd/pars -${R3BROOT_SOURCE_DIR}/tofd/digi -${R3BROOT_SOURCE_DIR}/tofd/calibration -${R3BROOT_SOURCE_DIR}/tofd/online -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/tracking -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -./sim/R3BTofD.cxx -./digi/R3BTofDDigitizer.cxx -./digi/R3BTofDDigitizerCal.cxx -./pars/R3BTofDContFact.cxx -./pars/R3BTofDHitPar.cxx -./pars/R3BTofDHitModulePar.cxx -./pars/R3BTofDMappingPar.cxx -./pars/R3BTofDMapped2CalPar.cxx -./pars/R3BTofDCal2HitPar.cxx -./calibration/R3BTofDMapped2Cal.cxx -./calibration/R3BTofDCal2Hit.cxx -./online/R3BTofDOnlineSpectra.cxx -#R3BTofDCal2Histo.cxx -#R3BTofDCal2HistoPar.cxx -#R3BTofDChangePar.cxx -#R3BTofDCal2Hit.cxx -#R3BGeoTofD.cxx -#R3BGeoTofDPar.cxx -#R3BTofDContFact.cxx -#R3BTofDDigiPar.cxx + sim/R3BTofD.cxx + digi/R3BTofDDigitizer.cxx + digi/R3BTofDDigitizerCal.cxx + pars/R3BTofDContFact.cxx + pars/R3BTofDHitPar.cxx + pars/R3BTofDHitModulePar.cxx + pars/R3BTofDMappingPar.cxx + pars/R3BTofDMapped2CalPar.cxx + pars/R3BTofDCal2HitPar.cxx + calibration/R3BTofDMapped2Cal.cxx + calibration/R3BTofDCal2Hit.cxx + online/R3BTofDOnlineSpectra.cxx + #R3BTofDCal2Histo.cxx + #R3BTofDCal2HistoPar.cxx + #R3BTofDChangePar.cxx + #R3BTofDCal2Hit.cxx + #R3BGeoTofD.cxx + #R3BGeoTofDPar.cxx + #R3BTofDContFact.cxx + #R3BTofDDigiPar.cxx ) -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") +set(HEADERS + sim/R3BTofD.h + digi/R3BTofDDigitizer.h + digi/R3BTofDDigitizerCal.h + pars/R3BTofDContFact.h + pars/R3BTofDHitPar.h + pars/R3BTofDHitModulePar.h + pars/R3BTofDMappingPar.h + pars/R3BTofDMapped2CalPar.h + pars/R3BTofDCal2HitPar.h + calibration/R3BTofDMapped2Cal.h + calibration/R3BTofDCal2Hit.h + online/R3BTofDOnlineSpectra.h + #R3BTofDCal2Histo.h + #R3BTofDCal2HistoPar.h + #R3BTofDChangePar.h + #R3BTofDCal2Hit.h + #R3BGeoTofD.h + #R3BGeoTofDPar.h + #R3BTofDContFact.h + #R3BTofDDigiPar.h +) -set(LINKDEF TofDLinkDef.h) -set(LIBRARY_NAME R3BTofD) -set(DEPENDENCIES - Spectrum R3BBase R3BTracking R3BData R3BTCal) - -GENERATE_LIBRARY() +add_library_with_dictionary( + LIBNAME + R3BTofD + LINKDEF + TofDLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calibration + digi + online + pars + sim + DEPENDENCIES + R3BTracking + R3BTCal) diff --git a/tofi/CMakeLists.txt b/tofi/CMakeLists.txt index 5db220c82..f3a289975 100644 --- a/tofi/CMakeLists.txt +++ b/tofi/CMakeLists.txt @@ -1,4 +1,3 @@ - ############################################################################## # Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH # # Copyright (C) 2019-2024 Members of R3B Collaboration # @@ -13,65 +12,58 @@ ############################################################################## # Create a library called "libR3BTofi" which includes the source files given -# in the array. The extension is already found. Any number of sources could be +# in the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/losData -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/tofi/pars -${R3BROOT_SOURCE_DIR}/tofi/sim -${R3BROOT_SOURCE_DIR}/tofi/digi -${R3BROOT_SOURCE_DIR}/tofi/calibration -${R3BROOT_SOURCE_DIR}/tofi -${R3BROOT_SOURCE_DIR}/r3bdata/tofiData -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -./sim/R3BTofi.cxx -./sim/R3BGeoTofi.cxx -./pars/R3BGeoTofiPar.cxx -./pars/R3BTofiDigiPar.cxx -./digi/R3BTofiDigitizerCal.cxx -./pars/R3BTofiHisto2HitPar.cxx -./pars/R3BTofiHitPar.cxx -./pars/R3BTofiHitModulePar.cxx -./pars/R3BTofiChangePar.cxx -./pars/R3BTofiContFact.cxx -./calibration/R3BTofiCal2Histo.cxx -./calibration/R3BTofiMapped2Cal.cxx -./calibration/R3BTofiMapped2CalPar.cxx -./calibration/R3BTofiCal2HitS494.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF TofiLinkDef.h) -set(LIBRARY_NAME R3BTofi) -set(DEPENDENCIES - R3BBase R3BData R3BTCal R3BTracking) + #Put here your sourcefiles + sim/R3BTofi.cxx + sim/R3BGeoTofi.cxx + pars/R3BGeoTofiPar.cxx + pars/R3BTofiDigiPar.cxx + digi/R3BTofiDigitizerCal.cxx + pars/R3BTofiHisto2HitPar.cxx + pars/R3BTofiHitPar.cxx + pars/R3BTofiHitModulePar.cxx + pars/R3BTofiChangePar.cxx + pars/R3BTofiContFact.cxx + calibration/R3BTofiCal2Histo.cxx + calibration/R3BTofiMapped2Cal.cxx + calibration/R3BTofiMapped2CalPar.cxx + calibration/R3BTofiCal2HitS494.cxx) -GENERATE_LIBRARY() +set(HEADERS + #Put here your sourcefiles + sim/R3BTofi.h + sim/R3BGeoTofi.h + pars/R3BGeoTofiPar.h + pars/R3BTofiDigiPar.h + digi/R3BTofiDigitizerCal.h + pars/R3BTofiHisto2HitPar.h + pars/R3BTofiHitPar.h + pars/R3BTofiHitModulePar.h + pars/R3BTofiChangePar.h + pars/R3BTofiContFact.h + calibration/R3BTofiCal2Histo.h + calibration/R3BTofiMapped2Cal.h + calibration/R3BTofiMapped2CalPar.h + calibration/R3BTofiCal2HitS494.h) +add_library_with_dictionary( + LIBNAME + R3BTofi + LINKDEF + TofiLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calibration + digi + pars + sim + DEPENDENCIES + R3BTCal + R3BTracking) diff --git a/tracker_rene/CMakeLists.txt b/tracker_rene/CMakeLists.txt index ba012cdbe..228eff6f5 100644 --- a/tracker_rene/CMakeLists.txt +++ b/tracker_rene/CMakeLists.txt @@ -1,3 +1,4 @@ # Note the Fortran project mention in the main CMakeLists.txt. include(CheckFortran) add_library(R3BTraRene SHARED tracker_routines.f95) +target_include_directories(R3BTraRene PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/tracking/CMakeLists.txt b/tracking/CMakeLists.txt index 4a444752e..a8a3ac437 100644 --- a/tracking/CMakeLists.txt +++ b/tracking/CMakeLists.txt @@ -15,58 +15,42 @@ # in the array. The extension is already found. Any number of sources could be # listed here. -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/field -${R3BROOT_SOURCE_DIR}/tof -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/tofData -${R3BROOT_SOURCE_DIR}/r3bdata/pspData -${R3BROOT_SOURCE_DIR}/r3bdata/fibData -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -${R3BROOT_SOURCE_DIR}/r3bdata/frsData -${R3BROOT_SOURCE_DIR}/r3bdata/musicData -${R3BROOT_SOURCE_DIR}/r3bdata/losData -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -R3BTPropagator.cxx -R3BTGeoPar.cxx -R3BFragmentTracker.cxx -R3BFragmentFitterGeneric.cxx -R3BFragmentFitterChi2.cxx -R3BTrackingDetector.cxx -R3BTrackingParticle.cxx -R3BTrackingSetup.cxx -R3BMDFWrapper.cxx -R3BTrackingS515.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -Set(LINKDEF TrackingLinkDef.h) -Set(LIBRARY_NAME R3BTracking) -Set(DEPENDENCIES - Base ParBase TrkBase R3BBase Minuit Field ) - -GENERATE_LIBRARY() - + R3BTPropagator.cxx + R3BTGeoPar.cxx + R3BFragmentTracker.cxx + R3BFragmentFitterGeneric.cxx + R3BFragmentFitterChi2.cxx + R3BTrackingDetector.cxx + R3BTrackingParticle.cxx + R3BTrackingSetup.cxx + R3BMDFWrapper.cxx + R3BTrackingS515.cxx) + +set(HEADERS + R3BTPropagator.h + R3BTGeoPar.h + R3BFragmentTracker.h + R3BFragmentFitterGeneric.h + R3BFragmentFitterChi2.h + R3BTrackingDetector.h + R3BTrackingParticle.h + R3BTrackingSetup.h + R3BMDFWrapper.h + R3BTrackingS515.h) + +add_library_with_dictionary( + LIBNAME + R3BTracking + LINKDEF + TrackingLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData + Field + TrkBase) diff --git a/tttx/CMakeLists.txt b/tttx/CMakeLists.txt index c0dce7afb..d1e0382bb 100644 --- a/tttx/CMakeLists.txt +++ b/tttx/CMakeLists.txt @@ -1,4 +1,3 @@ - ############################################################################## # Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH # # Copyright (C) 2019-2024 Members of R3B Collaboration # @@ -12,65 +11,41 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BTttx" which includes the source files given -# in the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tcal -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/califaData -${R3BROOT_SOURCE_DIR}/r3bdata/tttxData -${R3BROOT_SOURCE_DIR}/r3bdata/wrData -${R3BROOT_SOURCE_DIR}/tttx -#${R3BROOT_SOURCE_DIR}/tttx/sim -#${R3BROOT_SOURCE_DIR}/tttx/digi -${R3BROOT_SOURCE_DIR}/tttx/pars -${R3BROOT_SOURCE_DIR}/tttx/calibration -${R3BROOT_SOURCE_DIR}/tttx/online -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - set(SRCS -#Put here your sourcefiles -#./pars/R3BTttxMappingPar.cxx -./pars/R3BTttxStripCalPar.cxx -./pars/R3BTttxHitPar.cxx -./pars/R3BTttxContFact.cxx -#./calibration/R3BTttxMapped2CalPar.cxx -./calibration/R3BTttxMapped2Cal.cxx -./calibration/R3BTttxCal2Hit.cxx -./online/R3BTttxOnlineSpectra.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF TttxLinkDef.h) -set(LIBRARY_NAME R3BTttx) -set(DEPENDENCIES - Spectrum R3BBase R3BData R3BTracking - #Online - ) - -GENERATE_LIBRARY() - -#add_subdirectory(test) + #Put here your sourcefiles + #pars/R3BTttxMappingPar.cxx + pars/R3BTttxStripCalPar.cxx + pars/R3BTttxHitPar.cxx + pars/R3BTttxContFact.cxx + #calibration/R3BTttxMapped2CalPar.cxx + calibration/R3BTttxMapped2Cal.cxx + calibration/R3BTttxCal2Hit.cxx + online/R3BTttxOnlineSpectra.cxx) + +set(HEADERS + #Put here your sourcefiles + #pars/R3BTttxMappingPar.h + pars/R3BTttxStripCalPar.h + pars/R3BTttxHitPar.h + pars/R3BTttxContFact.h + #calibration/R3BTttxMapped2CalPar.h + calibration/R3BTttxMapped2Cal.h + calibration/R3BTttxCal2Hit.h + online/R3BTttxOnlineSpectra.h) + +add_library_with_dictionary( + LIBNAME + R3BTttx + LINKDEF + TttxLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + calibration + online + pars + DEPENDENCIES + R3BTracking) diff --git a/twim/CMakeLists.txt b/twim/CMakeLists.txt index 928df26c5..8e0e154b0 100644 --- a/twim/CMakeLists.txt +++ b/twim/CMakeLists.txt @@ -11,63 +11,43 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BTwim" which includes the source files given in the -# array. The extension is already found. Any number of sources could be listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES ${SYSTEM_INCLUDE_DIRECTORIES} ${BASE_INCLUDE_DIRECTORIES}) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/tracking -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/twimData -${R3BROOT_SOURCE_DIR}/r3bdata/mwpcData -${R3BROOT_SOURCE_DIR}/twim -${R3BROOT_SOURCE_DIR}/twim/digi -${R3BROOT_SOURCE_DIR}/twim/sim -${R3BROOT_SOURCE_DIR}/twim/pars -${R3BROOT_SOURCE_DIR}/twim/calibration -${R3BROOT_SOURCE_DIR}/twim/online -${R3BROOT_SOURCE_DIR}/twim/ana -) - -if(EXISTS "${R3BROOT_SOURCE_DIR}/sofia/") -set(INCLUDE_DIRECTORIES -${INCLUDE_DIRECTORIES} -${R3BROOT_SOURCE_DIR}/sofia/sofdata -${R3BROOT_SOURCE_DIR}/sofia/sofdata/tofwData -) -endif(EXISTS "${R3BROOT_SOURCE_DIR}/sofia/") - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES ${ROOT_LIBRARY_DIR} ${FAIRROOT_LIBRARY_DIR} ) - -link_directories( ${LINK_DIRECTORIES}) - -file(GLOB SRCS -./sim/*.cxx -./digi/*.cxx -./pars/*.cxx -./online/*.cxx -./calibration/*.cxx -./ana/*.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF TwimLinkDef.h) -set(LIBRARY_NAME R3BTwim) -set(DEPENDENCIES - R3BBase R3BData R3BTracking) - -GENERATE_LIBRARY() +file( + GLOB + SRCS + ./sim/*.cxx + ./digi/*.cxx + ./pars/*.cxx + ./online/*.cxx + ./calibration/*.cxx + ./ana/*.cxx) + +change_file_extension(*.cxx *.h HEADERS "${SRCS}") + +add_library_with_dictionary( + LIBNAME + R3BTwim + LINKDEF + TwimLinkDef.h + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + sim + digi + pars + online + calibration + ana + DEPENDENCIES + R3BTracking) + +if(WITH_SOFIA) + target_link_libraries(R3BTwim PRIVATE R3BSofData) +endif(WITH_SOFIA) if(BUILD_GEOMETRY) - add_subdirectory(geobase) + add_subdirectory(geobase) endif() + add_subdirectory(test) diff --git a/xball/CMakeLists.txt b/xball/CMakeLists.txt index 2fc556113..ab96c41b0 100644 --- a/xball/CMakeLists.txt +++ b/xball/CMakeLists.txt @@ -11,51 +11,19 @@ # or submit itself to any jurisdiction. # ############################################################################## -# Create a library called "libR3BXBall" which includes the source files given in -# the array. The extension is already found. Any number of sources could be -# listed here. - -Set(SYSTEM_INCLUDE_DIRECTORIES -${SYSTEM_INCLUDE_DIRECTORIES} -${BASE_INCLUDE_DIRECTORIES} -) - -set(INCLUDE_DIRECTORIES -#put here all directories where header files are located -${R3BROOT_SOURCE_DIR}/r3bbase -${R3BROOT_SOURCE_DIR}/xball -${R3BROOT_SOURCE_DIR}/r3bdata -${R3BROOT_SOURCE_DIR}/r3bdata/xballData -${R3BROOT_SOURCE_DIR}/r3bdata/landData -${R3BROOT_SOURCE_DIR}/r3bdata/trackerData -) - -include_directories( ${INCLUDE_DIRECTORIES}) -include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set(LINK_DIRECTORIES -${ROOT_LIBRARY_DIR} -${FAIRROOT_LIBRARY_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set(SRCS -#Put here your sourcefiles -R3BXBall.cxx -R3BGeoXBall.cxx -R3BGeoXBallPar.cxx -R3BXBallContFact.cxx -) - -# fill list of header files from list of source files -# by exchanging the file extension -CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}") - -set(LINKDEF XBallLinkDef.h) -set(LIBRARY_NAME R3BXBall) -set(DEPENDENCIES - R3BBase R3BData) - -GENERATE_LIBRARY() - +set(SRCS R3BXBall.cxx R3BGeoXBall.cxx R3BGeoXBallPar.cxx R3BXBallContFact.cxx) +set(HEADERS R3BXBall.h R3BGeoXBall.h R3BGeoXBallPar.h R3BXBallContFact.h) + +add_library_with_dictionary( + LIBNAME + R3BXBall + LINKDEF + ${LINKDEF} + HEADERS + ${HEADERS} + SRCS + ${SRCS} + INCLUDEDIRS + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDENCIES + R3BData)