Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/advanced/composite_calorimeter/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #----------------------------------------------------------------------------
0002 # Setup the project
0003 cmake_minimum_required(VERSION 3.16...3.27)
0004 project(CompositeCalorimeter)
0005 
0006 #----------------------------------------------------------------------------
0007 # Find Geant4 package, activating all available UI and Vis drivers by default
0008 # You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
0009 # to build a batch mode only executable
0010 #
0011 option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
0012 if(WITH_GEANT4_UIVIS)
0013   find_package(Geant4 REQUIRED ui_all vis_all)
0014 else()
0015   find_package(Geant4 REQUIRED)
0016 endif()
0017 
0018 #----------------------------------------------------------------------------
0019 # Setup Geant4 include directories and compile definitions
0020 # Setup include directory for this project
0021 #
0022 include(${Geant4_USE_FILE})
0023 
0024 include_directories(${PROJECT_SOURCE_DIR}/include)
0025 
0026 
0027 #----------------------------------------------------------------------------
0028 # Locate sources and headers for this project
0029 # NB: headers are included so they will show up in IDEs
0030 #
0031 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0032 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0033 
0034 #----------------------------------------------------------------------------
0035 # Add the executable, and link it to the Geant4 libraries
0036 #
0037 add_executable(CompositeCalorimeter CompositeCalorimeter.cc ${sources} ${headers})
0038 target_link_libraries(CompositeCalorimeter ${Geant4_LIBRARIES})
0039 
0040 #----------------------------------------------------------------------------
0041 # Copy all scripts to the build directory, i.e. the directory in which we
0042 # build CompositeCalorimeter. This is so that we can run the executable directly because it
0043 # relies on these scripts being in the current working directory.
0044 #
0045 set(EXAMPLECOMPOSITECALORIMETER_SCRIPTS
0046   gui.mac
0047   test.g4mac
0048   vis.mac
0049   dataconf/g4testbeamhcal96.conf
0050   dataconf/testbeamhcal96.conf
0051   datageom/tbhcal96.geom
0052   datageom/tbhcal96hcal.geom
0053   datageom/tbhcal96xtal.geom
0054   dataglobal/fmap.tb96
0055   dataglobal/material.cms
0056   dataglobal/rotation.cms
0057   datavis/tbhcal96hcal.vis
0058   datavis/tbhcal96.vis
0059   datavis/tbhcal96xtal.vis
0060   )
0061 
0062 foreach(_script ${EXAMPLECOMPOSITECALORIMETER_SCRIPTS})
0063   configure_file(
0064     ${PROJECT_SOURCE_DIR}/${_script}
0065     ${PROJECT_BINARY_DIR}/${_script}
0066     COPYONLY
0067     )
0068 endforeach()
0069 
0070 #----------------------------------------------------------------------------
0071 # For internal Geant4 use - but has no effect if you build this
0072 # example standalone
0073 #
0074 add_custom_target(ExampleCompositeCalorimeter DEPENDS CompositeCalorimeter)
0075 
0076 #----------------------------------------------------------------------------
0077 # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
0078 #
0079 install(TARGETS CompositeCalorimeter DESTINATION bin)
0080 
0081