Warning, /geant4/examples/extended/parallel/MPI/exMPI02/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 #----------------------------------------------------------------------------
0002 # Create a new project level to avoid name clashes with other exMPI0N
0003 project(exMPI02)
0004
0005 # Find ROOT and return if we don't have it to prvent building this project
0006 find_package(ROOT QUIET COMPONENTS Hist RIO)
0007 if(NOT ROOT_FOUND)
0008 message(STATUS "ROOT not found, disabling exMPI02 build")
0009 return()
0010 endif()
0011
0012 #----------------------------------------------------------------------------
0013 # Locate sources and headers for this project
0014 #
0015 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0016 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0017
0018 #----------------------------------------------------------------------------
0019 # Add the executable, and link it to the Geant4 libraries
0020 #
0021 add_executable(exMPI02 exMPI02.cc ${sources} ${headers})
0022 target_include_directories(exMPI02 PRIVATE include)
0023 target_link_libraries(exMPI02 PRIVATE ${Geant4_LIBRARIES} G4mpi::G4mpi ROOT::Hist ROOT::RIO)
0024
0025 #----------------------------------------------------------------------------
0026 # Copy all scripts to the build directory, i.e. the directory in which we
0027 # build exMPI02. This is so that we can run the executable directly because it
0028 # relies on these scripts being in the current working directory.
0029 #
0030 set(exMPI02_SCRIPTS
0031 run.mac
0032 vis.mac
0033 )
0034
0035 foreach(_script ${exMPI02_SCRIPTS})
0036 configure_file(
0037 ${PROJECT_SOURCE_DIR}/${_script}
0038 ${PROJECT_BINARY_DIR}/${_script}
0039 COPYONLY
0040 )
0041 endforeach()
0042