diff --git a/CMakeLists.txt b/CMakeLists.txt index 88d59037037805ae0a66745c86834dc3373198bc..b72981f4d2bef7c1adf9437b4e9a63f1b3b341ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,11 +6,6 @@ project(CEPCSW) include(cmake/CEPCSWEnv.cmake) # -find_package(ROOT COMPONENTS RIO Tree) - -find_package(Gaudi) -find_package(Eigen3) - include(GNUInstallDirs) include(CTest) @@ -19,6 +14,17 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) "Install path prefix, prepended onto install directories." FORCE ) endif() +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(CMAKE_EXECUTABLE_SUFFIX .exe) + +# Put bin/lib/include under CMAKE_BINARY_DIR +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +include_directories(${CMAKE_BINARY_DIR}/include) + +# set Install/lib +set(CMAKE_INSTALL_LIBDIR lib) + # Set up C++ Standard # ``-DCMAKE_CXX_STANDARD=<standard>`` when invoking CMake set(CMAKE_CXX_STANDARD 17 CACHE STRING "") diff --git a/Detector/DetCEPCv4/CMakeLists.txt b/Detector/DetCEPCv4/CMakeLists.txt index 03b897aece53d097dcbe979c271d06a39e007021..c7520576b7cf22687029a68535d817e7c4938423 100644 --- a/Detector/DetCEPCv4/CMakeLists.txt +++ b/Detector/DetCEPCv4/CMakeLists.txt @@ -4,18 +4,6 @@ # Based on package: lcgeo ################################################################################ -find_package(DD4hep COMPONENTS DDRec DDG4 DDParsers REQUIRED) -# find_package(DD4hep) -find_package(Geant4) -include(${Geant4_USE_FILE}) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake ) -include( DD4hep ) - -find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED) - -# install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetCEPCv4) - gaudi_add_module(DetCEPCv4 SOURCES src/tracker/VXD04_geo.cpp src/tracker/FTD_Simple_Staggered_geo.cpp diff --git a/Detector/DetCRD/CMakeLists.txt b/Detector/DetCRD/CMakeLists.txt index f762843115db2b45e57697aa7239835938cc8cf8..e271c24d3c673cbfad3f846e17a3803f1b805e08 100644 --- a/Detector/DetCRD/CMakeLists.txt +++ b/Detector/DetCRD/CMakeLists.txt @@ -3,18 +3,6 @@ # CEPC Reference Detector (CRD) ################################################################################ -find_package(DD4hep COMPONENTS DDRec DDG4 DDParsers REQUIRED) -# find_package(DD4hep) -find_package(Geant4) -include(${Geant4_USE_FILE}) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake ) -include( DD4hep ) - -find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED) - -# install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetCRD) - gaudi_add_module(DetCRD SOURCES src/Calorimeter/CRDEcal_v01.cpp src/Calorimeter/LongCrystalBarBarrelCalorimeter32Polygon_v01.cpp diff --git a/Detector/DetDriftChamber/CMakeLists.txt b/Detector/DetDriftChamber/CMakeLists.txt index fbf8e01ce18666fac8cda6937368dd0fd605c2b2..234a947047b9a143843cec81d0251a78eee90854 100644 --- a/Detector/DetDriftChamber/CMakeLists.txt +++ b/Detector/DetDriftChamber/CMakeLists.txt @@ -3,17 +3,6 @@ # Based on package: lcgeo ################################################################################ -find_package(DD4hep COMPONENTS DDRec DDG4 DDParsers REQUIRED) -find_package(Geant4) -include(${Geant4_USE_FILE}) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake ) -include( DD4hep ) - -find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED) - -# install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetDriftChamber) - gaudi_add_module(DetDriftChamber SOURCES src/driftchamber/DriftChamber.cpp LINK DetSegmentation diff --git a/Detector/DetEcalMatrix/CMakeLists.txt b/Detector/DetEcalMatrix/CMakeLists.txt index 10b59035d664eb2c7993dfa818738c2bb2541426..24abbe6fa153a2828be92a615a0a72dcbc49e8d4 100644 --- a/Detector/DetEcalMatrix/CMakeLists.txt +++ b/Detector/DetEcalMatrix/CMakeLists.txt @@ -3,18 +3,6 @@ # Based on package: lcgeo ################################################################################ - -find_package(DD4hep COMPONENTS DDRec DDG4 DDParsers REQUIRED) -find_package(Geant4) -include(${Geant4_USE_FILE}) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake ) -include( DD4hep ) - -find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED) - -# TODO: how to handle -# install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetEcalMatrix) gaudi_add_module(DetEcalMatrix SOURCES src/calorimeter/EcalMatrix.cpp LINK ${DD4hep_COMPONENT_LIBRARIES} diff --git a/Detector/DetSegmentation/CMakeLists.txt b/Detector/DetSegmentation/CMakeLists.txt index e6273defd3967b77a61dbddf584fa5dab2d58bb4..b3907a954e28c7c648e65e1e49859e6b6c60f461 100644 --- a/Detector/DetSegmentation/CMakeLists.txt +++ b/Detector/DetSegmentation/CMakeLists.txt @@ -2,11 +2,6 @@ ##Package : DetSegmentation ################################################################################# -find_package(DD4hep COMPONENTS DDRec DDG4 DDParsers REQUIRED) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake ) - -include(DD4hep) - gaudi_add_library(DetSegmentation SOURCES src/GridDriftChamber.cpp LINK Gaudi::GaudiKernel diff --git a/Generator/CMakeLists.txt b/Generator/CMakeLists.txt index c227254a1a7e75ae044105163d0683fda48c0151..54c3bde8985bc77fbec7c7696f3d7ab9ae51d1bd 100644 --- a/Generator/CMakeLists.txt +++ b/Generator/CMakeLists.txt @@ -1,8 +1,5 @@ ######################################## -find_package(Geant4 REQUIRED) -include(${Geant4_USE_FILE}) - gaudi_add_module(GenAlgo SOURCES src/IGenTool.cpp src/GenAlgo.cpp diff --git a/Simulation/DetSimAna/CMakeLists.txt b/Simulation/DetSimAna/CMakeLists.txt index 733c9686f67e26988d4358eb7e20aab0b9cc558d..f3daa7f6ee3888124a891af359ce7312ed377dea 100644 --- a/Simulation/DetSimAna/CMakeLists.txt +++ b/Simulation/DetSimAna/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(Geant4 REQUIRED ui_all vis_all) -include(${Geant4_USE_FILE}) gaudi_add_module(DetSimAna SOURCES src/Edm4hepWriterAnaElemTool.cpp diff --git a/Simulation/DetSimCore/CMakeLists.txt b/Simulation/DetSimCore/CMakeLists.txt index e64cd3c467c388767914324bd1db37c23120a6ab..c9ddf2d898185701bafeea2d5a407a511588e70f 100644 --- a/Simulation/DetSimCore/CMakeLists.txt +++ b/Simulation/DetSimCore/CMakeLists.txt @@ -1,10 +1,4 @@ -find_package(Geant4 REQUIRED ui_all vis_all) -include(${Geant4_USE_FILE}) - - -message(" Geant4_LIBRARIES: ${Geant4_LIBRARIES}") - gaudi_add_module(DetSimCore SOURCES src/DetSimAlg.cpp src/DetSimSvc.cpp diff --git a/Simulation/DetSimDedx/CMakeLists.txt b/Simulation/DetSimDedx/CMakeLists.txt index 867ff20cd4b6ed8f04919b89340901dccbb12272..5397cd407041d98d5c43e5eb6722cbdc07d6db82 100644 --- a/Simulation/DetSimDedx/CMakeLists.txt +++ b/Simulation/DetSimDedx/CMakeLists.txt @@ -1,13 +1,4 @@ -find_package(Geant4 REQUIRED ui_all vis_all) -include(${Geant4_USE_FILE}) -find_package(Garfield REQUIRED) -message(Garfield::Garfield) -message("libonnxruntime ${OnnxRuntime_LIBRARY}") -message("libonnxruntime include ${OnnxRuntime_INCLUDE_DIR}") -find_package(OnnxRuntime REQUIRED) - -message("libonnxruntime ${OnnxRuntime_LIBRARY}") gaudi_add_module(DetSimDedx SOURCES src/DummyDedxSimTool.cpp src/BetheBlochEquationDedxSimTool.cpp @@ -23,8 +14,6 @@ gaudi_add_module(DetSimDedx k4FWCore::k4FWCore Garfield::Garfield OnnxRuntime - #${OnnxRuntime_LIBRARY} - #/cvmfs/sft.cern.ch/lcg/views/LCG_103/x86_64-centos7-gcc11-opt/lib/libonnxruntime.so ${CLHEP_LIBRARIES} ) diff --git a/Simulation/DetSimFastModel/CMakeLists.txt b/Simulation/DetSimFastModel/CMakeLists.txt index 30dced2b32f4c9c07a05dc02e9ba9b6c6355d3a4..33ab24c7f162eb9bb5a4e7fb9eb14e0fa0fe451b 100644 --- a/Simulation/DetSimFastModel/CMakeLists.txt +++ b/Simulation/DetSimFastModel/CMakeLists.txt @@ -1,8 +1,4 @@ -find_package(Geant4 REQUIRED ui_all vis_all) -include(${Geant4_USE_FILE}) - - gaudi_add_module(DetSimFastModel SOURCES src/DummyFastSimG4Tool.cpp src/DummyFastSimG4Model.cpp diff --git a/Simulation/DetSimGeom/CMakeLists.txt b/Simulation/DetSimGeom/CMakeLists.txt index aec488006934729263b1872cf49bfea7c9f4538c..62caab085fc23161676656af218ea2968d96b6eb 100644 --- a/Simulation/DetSimGeom/CMakeLists.txt +++ b/Simulation/DetSimGeom/CMakeLists.txt @@ -1,7 +1,4 @@ -find_package(Geant4 REQUIRED ui_all vis_all) -include(${Geant4_USE_FILE}) - gaudi_add_module(DetSimGeom SOURCES src/WorldDetElemTool.cpp src/AnExampleDetElemTool.cpp diff --git a/Simulation/DetSimSD/CMakeLists.txt b/Simulation/DetSimSD/CMakeLists.txt index f3a9618ac625fce03d1c277bcef6be28e355628e..0c2d5a844ac33b203b1d33507f9e198fe8e6334b 100644 --- a/Simulation/DetSimSD/CMakeLists.txt +++ b/Simulation/DetSimSD/CMakeLists.txt @@ -1,7 +1,4 @@ -find_package(Geant4 REQUIRED ui_all vis_all) -include(${Geant4_USE_FILE}) - gaudi_add_library(DetSimSDLib SOURCES src/Geant4Hits.cpp src/DDG4SensitiveDetector.cpp diff --git a/cmake/CEPCSWDependencies.cmake b/cmake/CEPCSWDependencies.cmake index f14a91c508ee6a5027b3af9184050a8808a1baba..ed2b35ccc65f61c484aa9bcf59ac38aac8a89310 100644 --- a/cmake/CEPCSWDependencies.cmake +++ b/cmake/CEPCSWDependencies.cmake @@ -20,22 +20,31 @@ Find all the dependencies here, so in each package user don't need to find the p - CKF #]] +############################################################################## +# import Gaudi at beginning +############################################################################## +find_package(Gaudi REQUIRED) + + find_package(CLHEP REQUIRED;CONFIG) find_package(DD4hep COMPONENTS DDCore DDG4 DDParsers DDRec REQUIRED) +include(DD4hep) # include necessary macro find_package(EDM4HEP REQUIRED) -#find_package(Garfield REQUIRED) +find_package(Eigen3) find_package(Garfield) find_package(Geant4 REQUIRED ui_all vis_all) +include(${Geant4_USE_FILE}) find_package(GEAR REQUIRED) +find_package(GenFit) find_package(GSL REQUIRED) find_package(HepMC) find_package(k4FWCore REQUIRED) find_package(LCContent REQUIRED) find_package(LCIO REQUIRED) +find_package(OnnxRuntime REQUIRED) find_package(PandoraSDK REQUIRED) find_package(podio REQUIRED) -find_package(ROOT COMPONENTS EG Graf Graf3d Gpad MathCore Net RIO Tree TreePlayer REQUIRED) -find_package(GenFit) +find_package(ROOT COMPONENTS EG Geom GenVector Graf Graf3d Gpad MathCore Net RIO Tree TreePlayer REQUIRED) if (CEPCSW_USE_SYSTEM_CKF_BELLE) message("Try to use an existing installation of CKF BELLE")