Warning, /geant4/examples/extended/parallel/ThreadsafeScorers/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 cmake_minimum_required(VERSION 3.16...3.27)
0002
0003 set(name ts_scorers)
0004 project(ThreadsafeScorers C CXX)
0005
0006 find_package(Geant4 REQUIRED ui_all vis_all)
0007 include(${Geant4_USE_FILE})
0008
0009 include_directories(${PROJECT_SOURCE_DIR}/include
0010 ${Geant4_INCLUDE_DIR})
0011
0012 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0013 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0014
0015 # macros
0016 file(GLOB macros ${PROJECT_SOURCE_DIR}/*.mac ${PROJECT_SOURCE_DIR}/*.in)
0017
0018 add_executable(${name} ${name}.cc ${headers}
0019 ${sources}
0020 ${macros})
0021
0022 target_link_libraries(${name} ${Geant4_LIBRARIES})
0023
0024 # For IDEs - specifically Xcode
0025 source_group("macros" FILES ${macros})
0026
0027 #==============================================================================#
0028 # - Copy the macros to the build directory
0029 #------------------------------------------------------------------------------#
0030 foreach(_macro ${macros})
0031 get_filename_component(_macro ${_macro} NAME)
0032 configure_file(${PROJECT_SOURCE_DIR}/${_macro}
0033 ${PROJECT_BINARY_DIR}/${_macro}
0034 COPYONLY)
0035 endforeach()
0036
0037 #----------------------------------------------------------------------------
0038 # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
0039 #
0040 install(TARGETS ${name} DESTINATION bin)