Warning, /geant4/examples/advanced/STCyclotron/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(STCyclotron)
0005 #----------------------------------------------------------------------------
0006 # Find Geant4 package, activating all available UI and Vis drivers by default
0007 # You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
0008 # to build a batch mode only executable
0009 #
0010 option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
0011 if(WITH_GEANT4_UIVIS)
0012 find_package(Geant4 REQUIRED ui_all vis_all)
0013 else()
0014 find_package(Geant4 REQUIRED)
0015 endif()
0016 #----------------------------------------------------------------------------
0017 # Setup Geant4 include directories and compile definitions
0018 #
0019 include(${Geant4_USE_FILE})
0020 include_directories(${PROJECT_SOURCE_DIR}/include)
0021 #----------------------------------------------------------------------------
0022 # Setup Geant4 include directories and compile definitions
0023 #
0024 include(${Geant4_USE_FILE})
0025 #---------------------------------------------------
0026 # Locate sources and headers for this project
0027 #
0028 include_directories(${PROJECT_SOURCE_DIR}/include
0029 ${Geant4_INCLUDE_DIR})
0030
0031 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0032 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0033 #----------------------------------------------------------------------------
0034 # Add the executable, and link it to the Geant4 libraries
0035 #
0036 add_executable(STCyclotron STCyclotron.cc ${sources} ${headers})
0037
0038 target_link_libraries(STCyclotron ${Geant4_LIBRARIES} ${ROOT_LIBRARIES})
0039 #----------------------------------------------------------------------------
0040 # Copy all scripts to the build directory, i.e. the directory in which we
0041 # build rdecay02. This is so that we can run the executable directly because it
0042 # relies on these scripts being in the current working directory.
0043 #
0044 set(STCYCLOTRON_SCRIPTS
0045 init.mac
0046 init_parameters.mac
0047 run.mac
0048 vis.mac
0049 Macro/Vis/vis.mac
0050 Macro/Vis/init_vis.mac
0051 Macro/init.mac
0052 Macro/init_parameters.mac
0053 Macro/run.mac
0054 Macro/Vis/vis.mac
0055 Macro/Vis/init_vis.mac
0056 Plot.C
0057 Macro/GUI/gui.mac
0058 Macro/GUI/icons.mac
0059 Macro/GUI/run.png
0060 Macro/Material/Target/Ni64_enriched_95.mac
0061 Macro/Material/Target/Ni64_pure.mac
0062 Macro/Material/Target/My_designed_material.mac
0063 )
0064
0065 foreach(_script ${STCYCLOTRON_SCRIPTS})
0066 configure_file(
0067 ${PROJECT_SOURCE_DIR}/${_script}
0068 ${PROJECT_BINARY_DIR}/${_script}
0069 COPYONLY
0070 )
0071 endforeach()
0072