Warning, /geant4/examples/advanced/ICRP110_HumanPhantoms/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
0005 project(ICRPphantoms)
0006
0007 #----------------------------------------------------------------------------
0008 # Find Geant4 package, activating all available UI and Vis drivers by default
0009 # You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
0010 # to build a batch mode only executable
0011 #
0012 option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
0013 if(WITH_GEANT4_UIVIS)
0014 find_package(Geant4 REQUIRED ui_all vis_all)
0015 else()
0016 find_package(Geant4 REQUIRED)
0017 endif()
0018
0019 #----------------------------------------------------------------------------
0020 # Setup Geant4 include directories and compile definitions
0021 #
0022 include(${Geant4_USE_FILE})
0023
0024 #----------------------------------------------------------------------------
0025 # Locate sources and headers for this project
0026 #
0027 include_directories(${PROJECT_SOURCE_DIR}/include
0028 ${Geant4_INCLUDE_DIR}
0029 ${GDML_INCLUDE_DIR})
0030 file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
0031 file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
0032
0033 #----------------------------------------------------------------------------
0034 # Add the executable, and link it to the Geant4 libraries
0035 #
0036 add_executable(ICRP110phantoms ICRP110phantoms.cc ${sources} ${headers})
0037 add_executable(ICRP110standalone ICRP110standalone.cc ${sources} ${headers})
0038
0039 target_link_libraries(ICRP110phantoms ${Geant4_LIBRARIES} )
0040 target_link_libraries(ICRP110standalone ${Geant4_LIBRARIES} )
0041
0042 # Depend on data for runtime
0043 add_dependencies(ICRP110phantoms ICRPdata)
0044 add_dependencies(ICRP110standalone ICRPdata)
0045
0046 #----------------------------------------------------------------------------
0047 # Copy all scripts to the build directory, i.e. the directory in which we
0048 # build human_phantom. This is so that we can run the executable directly because it
0049 # relies on these scripts being in the current working directory.
0050 #
0051 set(ICRPphantoms_SCRIPTS
0052 female.in female_head.in female_trunk.in male.in male_head.in male_trunk.in vis.mac primary.mac ColourMap.dat openGLVis.mac g4views/g4_00.g4view g4views/g4_01.g4view standalone.mac
0053 # ICRPdata/Data.dat
0054 # "ICRPdata/ICRP110_g4dat/AF/*.g4dat"
0055 # "ICRPdata/ICRP110_g4dat/AM/*.g4dat"
0056 )
0057
0058 foreach(_script ${ICRPphantoms_SCRIPTS})
0059 configure_file(
0060 ${PROJECT_SOURCE_DIR}/${_script}
0061 ${PROJECT_BINARY_DIR}/${_script}
0062 COPYONLY
0063 )
0064 endforeach()
0065
0066 #set(ICRPphantoms_DATADIR
0067 # ICRPdata
0068 #)
0069
0070 #file(COPY ${PROJECT_SOURCE_DIR}/${ICRPphantoms_DATADIR} DESTINATION
0071 # ${PROJECT_BINARY_DIR})
0072
0073 include(ExternalProject)
0074 ExternalProject_Add(ICRPdata
0075 SOURCE_DIR ${PROJECT_BINARY_DIR}/ICRPdata
0076 URL https://cern.ch/geant4-data/datasets/examples/advanced/ICRP110Phantoms/ICRPdata.tar.gz
0077 URL_MD5 2aba5409d4e7b7a2f0328e7d3402f187
0078 CONFIGURE_COMMAND ""
0079 BUILD_COMMAND ""
0080 INSTALL_COMMAND ""
0081 )
0082
0083 #----------------------------------------------------------------------------
0084 # Add program to the project targets
0085 # (this avoids the need of typing the program name after make)
0086 #
0087 add_custom_target(ICRPphantoms DEPENDS phantom)
0088 add_custom_target(ICRPstandalone DEPENDS phantom)
0089
0090 #----------------------------------------------------------------------------
0091 # Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
0092 #
0093 install(TARGETS ICRP110phantoms DESTINATION bin)
0094 install(TARGETS ICRP110standalone DESTINATION bin)
0095