Warning, /pfRICH/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001
0002 cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
0003
0004 project(pfRICH)
0005
0006 set(CMAKE_BUILD_TYPE Debug)
0007
0008 cmake_policy(SET CMP0079 NEW) # allow `target_link_libraries` from any dir
0009
0010 #----------------------------------------------------------------------------
0011
0012 find_package(ROOT 6.0.00 REQUIRED COMPONENTS RIO Hist Tree)
0013 include(${ROOT_USE_FILE})
0014
0015 #----------------------------------------------------------------------------
0016
0017 find_package(Geant4 REQUIRED ui_all vis_all)
0018 include(${Geant4_USE_FILE})
0019
0020 #----------------------------------------------------------------------------
0021
0022 include(CheckCXXCompilerFlag)
0023
0024 SET(CMAKE_CXX_FLAGS "-Wall -std=c++0x -Wno-misleading-indentation")
0025
0026 check_cxx_compiler_flag(-std=c++17 HAVE_FLAG_STD_CXX17)
0027 if(HAVE_FLAG_STD_CXX17)
0028 # Have -std=c++17, use it;
0029 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
0030 else()
0031 check_cxx_compiler_flag(-std=c++11 HAVE_FLAG_STD_CXX11)
0032 if(HAVE_FLAG_STD_CXX11)
0033 # Have -std=c++11, use it;
0034 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
0035 endif()
0036 endif()
0037
0038 #----------------------------------------------------------------------------
0039
0040 include_directories(
0041 ${Geant4_INCLUDE_DIR}
0042 ${ROOT_INCLUDE_DIRS}
0043
0044 ${IRT}/include/IRT
0045 ${BMF}/include
0046 ${HEPMC3}/include
0047 ${XERCES}/include
0048
0049 ${PROJECT_SOURCE_DIR}/include
0050 ${PROJECT_SOURCE_DIR}/g4irt/include
0051
0052 ${PROJECT_SOURCE_DIR}/share/include
0053 ${PROJECT_SOURCE_DIR}/epic/include
0054 ${PROJECT_SOURCE_DIR}/ftbf/include
0055 ${PROJECT_SOURCE_DIR}/tstand/include
0056 ${PROJECT_SOURCE_DIR}/simple/include
0057 )
0058
0059 file(GLOB SHARE_HEADERS ${PROJECT_SOURCE_DIR}/share/include/*.h)
0060 file(GLOB EPIC_HEADERS ${PROJECT_SOURCE_DIR}/epic/include/*.h)
0061 file(GLOB FTBF_HEADERS ${PROJECT_SOURCE_DIR}/ftbf/include/*.h)
0062 file(GLOB TSTAND_HEADERS ${PROJECT_SOURCE_DIR}/tstand/include/*.h)
0063 file(GLOB SIMPLE_HEADERS ${PROJECT_SOURCE_DIR}/simple/include/*.h)
0064
0065 SET(G4IRT_LIB g4irt)
0066 SET(SHARE_LIB pfrich-share)
0067 SET(EPIC_EXE pfrich-epic)
0068 SET(FTBF_EXE pfrich-ftbf)
0069 SET(SIMPLE_EXE pfrich-simple)
0070 SET(TSTAND_EXE pfrich-tstand)
0071
0072 SET( G4IRT_SOURCES
0073 ${PROJECT_SOURCE_DIR}/g4irt/source/G4Object.cc
0074 ${PROJECT_SOURCE_DIR}/g4irt/source/G4RadiatorMaterial.cc
0075 ${PROJECT_SOURCE_DIR}/g4irt/source/CherenkovMirror.cc
0076 ${PROJECT_SOURCE_DIR}/g4irt/source/CherenkovSteppingAction.cc
0077 ${PROJECT_SOURCE_DIR}/g4irt/source/CherenkovStackingAction.cc
0078 )
0079
0080 SET( SHARE_SOURCES
0081 ${PROJECT_SOURCE_DIR}/pfRICH.cc
0082
0083 ${PROJECT_SOURCE_DIR}/share/source/TofPetMultiColumn.cc
0084
0085 ${PROJECT_SOURCE_DIR}/share/source/Materials.cc
0086 ${PROJECT_SOURCE_DIR}/share/source/RunAction.cc
0087 ${PROJECT_SOURCE_DIR}/share/source/AsphericLens.cc
0088
0089 ${PROJECT_SOURCE_DIR}/share/source/HRPPD.cc
0090 ${PROJECT_SOURCE_DIR}/share/source/DetectorConstruction.cc
0091 )
0092
0093 SET( EPIC_SOURCES
0094 ${PROJECT_SOURCE_DIR}/epic/source/Vessel.cc
0095 ${PROJECT_SOURCE_DIR}/epic/source/Aerogel.cc
0096 ${PROJECT_SOURCE_DIR}/epic/source/Acrylic.cc
0097 ${PROJECT_SOURCE_DIR}/epic/source/Mirrors.cc
0098 ${PROJECT_SOURCE_DIR}/epic/source/MagneticField.cc
0099
0100 ${PROJECT_SOURCE_DIR}/epic/source/EpicSetup.cc
0101 ${PROJECT_SOURCE_DIR}/epic/source/EpicDetectorConstruction.cc
0102 ${PROJECT_SOURCE_DIR}/epic/source/EpicPrimaryGeneratorAction.cc
0103 )
0104
0105 SET( FTBF_SOURCES
0106 #${PROJECT_SOURCE_DIR}/share/source/AsphericLens.cc
0107
0108 ${PROJECT_SOURCE_DIR}/ftbf/source/FTBFSetup.cc
0109 ${PROJECT_SOURCE_DIR}/ftbf/source/FTBFDetectorConstruction.cc
0110 ${PROJECT_SOURCE_DIR}/ftbf/source/FTBFPrimaryGeneratorAction.cc
0111 )
0112
0113 SET( SIMPLE_SOURCES
0114 ${PROJECT_SOURCE_DIR}/simple/source/SimpleSetup.cc
0115 ${PROJECT_SOURCE_DIR}/simple/source/SimpleDetectorConstruction.cc
0116 ${PROJECT_SOURCE_DIR}/simple/source/SimplePrimaryGeneratorAction.cc
0117 )
0118
0119 SET( TSTAND_SOURCES
0120 #${PROJECT_SOURCE_DIR}/share/source/AsphericLens.cc
0121 # FIXME: unify, please;
0122 #${PROJECT_SOURCE_DIR}/tstand/source/TestStandAsphericLens.cc
0123
0124 ${PROJECT_SOURCE_DIR}/tstand/source/TestStandSetup.cc
0125 #${PROJECT_SOURCE_DIR}/tstand/source/TestStandPhotonDetectors.cc
0126 ${PROJECT_SOURCE_DIR}/tstand/source/TestStandDetectorConstruction.cc
0127 ${PROJECT_SOURCE_DIR}/tstand/source/TestStandPrimaryGeneratorAction.cc
0128 )
0129
0130 ADD_LIBRARY( ${G4IRT_LIB} SHARED ${G4IRT_SOURCES} )
0131 TARGET_LINK_LIBRARIES(${G4IRT_LIB} ${ROOT_LIBRARIES} ${Geant4_LIBRARIES} -L${IRT}/lib IRT)
0132
0133 ADD_LIBRARY( ${SHARE_LIB} SHARED ${SHARE_SOURCES} )
0134 TARGET_LINK_LIBRARIES(${SHARE_LIB} ${Geant4_LIBRARIES} ${G4IRT_LIB})
0135
0136 #----------------------------------------------------------------------------
0137
0138 add_executable(${EPIC_EXE} ${EPIC_SOURCES} ${SHARE_HEADERS} ${EPIC_HEADERS})
0139 target_link_libraries(${EPIC_EXE} ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} ${G4IRT_LIB} ${SHARE_LIB})
0140 add_executable(${FTBF_EXE} ${FTBF_SOURCES} ${SHARE_HEADERS} ${FTBF_HEADERS})
0141 target_link_libraries(${FTBF_EXE} ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} ${G4IRT_LIB} ${SHARE_LIB})
0142 add_executable(${SIMPLE_EXE} ${SIMPLE_SOURCES} ${SHARE_HEADERS} ${SIMPLE_HEADERS})
0143 target_link_libraries(${SIMPLE_EXE} ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} ${G4IRT_LIB} ${SHARE_LIB})
0144 add_executable(${TSTAND_EXE} ${TSTAND_SOURCES} ${SHARE_HEADERS} ${TSTAND_HEADERS})
0145 target_link_libraries(${TSTAND_EXE} ${Geant4_LIBRARIES} ${ROOT_LIBRARIES} ${G4IRT_LIB} ${SHARE_LIB})
0146
0147 if(DEFINED BMF)
0148 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBMF")
0149 target_link_libraries(${EPIC_EXE} -L${BMF}/lib bmf)
0150 endif()
0151 if(DEFINED HEPMC3)
0152 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHEPMC3")
0153 target_link_libraries(${EPIC_EXE} -L${HEPMC3}/lib -L${HEPMC3}/lib64 HepMC3)
0154 endif()
0155 if(DEFINED XERCES)
0156 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DXERCES")
0157 target_link_libraries(${EPIC_EXE} -L${XERCES}/lib -L${XERCES}/lib64 xerces-c)
0158 target_link_libraries(${FTBF_EXE} -L${XERCES}/lib -L${XERCES}/lib64 xerces-c)
0159 target_link_libraries(${SIMPLE_EXE} -L${XERCES}/lib -L${XERCES}/lib64 xerces-c)
0160 # FIXME: this stuff is only needed for aerogel;
0161 target_link_libraries(${TSTAND_EXE} -L${XERCES}/lib -L${XERCES}/lib64 xerces-c)
0162 endif()
0163
0164 #----------------------------------------------------------------------------
0165
0166 install(TARGETS ${EPIC_EXE} DESTINATION bin)
0167 install(TARGETS ${FTBF_EXE} DESTINATION bin)
0168 install(TARGETS ${SIMPLE_EXE} DESTINATION bin)
0169 install(TARGETS ${TSTAND_EXE} DESTINATION bin)
0170 install(TARGETS ${G4IRT_LIB} DESTINATION lib)
0171 install(TARGETS ${SHARE_LIB} DESTINATION lib)
0172