Warning, /geant4/examples/extended/electromagnetic/TestEm0/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(TestEm0)
0005
0006 #----------------------------------------------------------------------------
0007 # Find Geant4 package, no UI and Vis drivers activated
0008 #
0009 find_package(Geant4 REQUIRED)
0010
0011 #----------------------------------------------------------------------------
0012 # Setup Geant4 include directories and compile definitions
0013 #
0014 include(${Geant4_USE_FILE})
0015
0016
0017 #----------------------------------------------------------------------------
0018 # Locate sources and headers for this project
0019 #
0020 include_directories(${PROJECT_SOURCE_DIR}/include
0021 ${Geant4_INCLUDE_DIR})
0022 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0023 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0024
0025 #----------------------------------------------------------------------------
0026 # Add the executables, and link it to the Geant4 libraries
0027 #
0028 add_executable(TestEm0 TestEm0.cc ${sources} ${headers})
0029 target_link_libraries(TestEm0 ${Geant4_LIBRARIES} )
0030 add_executable(DirectAccess DirectAccess.cc ${sources} ${headers})
0031 target_link_libraries(DirectAccess ${Geant4_LIBRARIES} )
0032
0033 #----------------------------------------------------------------------------
0034 # Copy all scripts to the build directory, i.e. the directory in which we
0035 # build TestEm0. This is so that we can run the executable directly because it
0036 # relies on these scripts being in the current working directory.
0037 #
0038 set(TestEm0_SCRIPTS
0039 TestEm0.in TestEm0.out ion.mac muon.mac xenonGas.mac
0040 )
0041
0042 foreach(_script ${TestEm0_SCRIPTS})
0043 configure_file(
0044 ${PROJECT_SOURCE_DIR}/${_script}
0045 ${PROJECT_BINARY_DIR}/${_script}
0046 COPYONLY
0047 )
0048 endforeach()
0049
0050 #----------------------------------------------------------------------------
0051 # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
0052 #
0053 install(TARGETS TestEm0 DESTINATION bin)
0054 install(TARGETS DirectAccess DESTINATION bin)
0055