Warning, /geant4/examples/basic/B4/B4d/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 #----------------------------------------------------------------------------
0002 # Setup the project
0003 #
0004 cmake_minimum_required(VERSION 3.16...3.27)
0005 project(B4d)
0006
0007 #----------------------------------------------------------------------------
0008 # Find Geant4 package, activating all available UI and Vis drivers by default
0009 # See the documentation for a guide on how to enable/disable specific components
0010 #
0011 find_package(Geant4 REQUIRED ui_all vis_all)
0012
0013 #----------------------------------------------------------------------------
0014 # Locate sources and headers for this project
0015 # NB: headers are included so they will show up in IDEs
0016 #
0017 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0018 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0019
0020 #----------------------------------------------------------------------------
0021 # Add the executable, use our local headers, and link it to the Geant4 libraries
0022 #
0023 add_executable(exampleB4d exampleB4d.cc ${sources} ${headers})
0024 target_include_directories(exampleB4d PRIVATE include)
0025 target_link_libraries(exampleB4d PRIVATE ${Geant4_LIBRARIES})
0026
0027 #----------------------------------------------------------------------------
0028 # Copy all scripts to the build directory, i.e. the directory in which we
0029 # build B4d. This is so that we can run the executable directly because it
0030 # relies on these scripts being in the current working directory.
0031 #
0032 set(EXAMPLEB4D_SCRIPTS
0033 exampleB4d.out
0034 exampleB4.in
0035 gui.mac
0036 init_vis.mac
0037 plotHisto.C
0038 plotNtuple.C
0039 run1.mac
0040 run2.mac
0041 vis.mac
0042 )
0043
0044 foreach(_script ${EXAMPLEB4D_SCRIPTS})
0045 configure_file(
0046 ${PROJECT_SOURCE_DIR}/${_script}
0047 ${PROJECT_BINARY_DIR}/${_script}
0048 COPYONLY
0049 )
0050 endforeach()