Warning, /eic-opticks/src/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 find_package(Geant4 REQUIRED ui_all vis_all)
0002
0003 configure_file(config_path.h.in config_path.h @ONLY)
0004
0005 # gphox is the primary library
0006 add_library(gphox config.cpp torch.cpp)
0007 target_link_libraries(gphox PUBLIC SysRap)
0008 target_include_directories(gphox
0009 PUBLIC
0010 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0011 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
0012 PRIVATE
0013 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
0014 )
0015
0016 # Common Geant4 and G4CX dependencies shared by executables using Geant4/G4CX
0017 add_library(gphox_g4_deps INTERFACE)
0018 target_link_libraries(gphox_g4_deps INTERFACE ${Geant4_LIBRARIES} G4CX)
0019
0020 # consgeo is a tool for converting GDML into CSG
0021 add_executable(consgeo consgeo.cc)
0022
0023 target_link_libraries(consgeo gphox_g4_deps)
0024
0025 target_include_directories(consgeo PRIVATE
0026 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
0027 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0028 )
0029
0030 # simg4ox runs Geant4 and OptiX simulations
0031 add_executable(simg4ox simg4ox.cpp g4app.h)
0032
0033 target_link_libraries(simg4ox gphox gphox_g4_deps)
0034
0035 target_include_directories(simg4ox PRIVATE
0036 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
0037 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0038 )
0039
0040 # GPUCerenkov - Cerenkov-only example with Opticks GPU raytracing
0041 add_executable(GPUCerenkov GPUCerenkov.cpp GPUCerenkov.h)
0042 target_link_libraries(GPUCerenkov gphox gphox_g4_deps)
0043 target_include_directories(GPUCerenkov PRIVATE
0044 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
0045 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0046 )
0047
0048 # GPURaytrace example - Cerenkov + Scintillation with Opticks GPU raytracing
0049 add_executable(GPURaytrace GPURaytrace.cpp GPURaytrace.h)
0050 target_link_libraries(GPURaytrace gphox gphox_g4_deps)
0051 target_include_directories(GPURaytrace PRIVATE
0052 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
0053 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0054 )
0055
0056 # GPUPhotonSource - optical photon input via SetInputPhoton with Opticks GPU simulation
0057 add_executable(GPUPhotonSource GPUPhotonSource.cpp GPUPhotonSource.h)
0058 target_link_libraries(GPUPhotonSource gphox gphox_g4_deps)
0059 target_include_directories(GPUPhotonSource PRIVATE
0060 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
0061 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0062 )
0063
0064 # GPUPhotonSourceMinimal - GPU-only ray tracing (no G4 optical photon tracking)
0065 add_executable(GPUPhotonSourceMinimal GPUPhotonSourceMinimal.cpp GPUPhotonSourceMinimal.h)
0066 target_link_libraries(GPUPhotonSourceMinimal gphox gphox_g4_deps)
0067 target_include_directories(GPUPhotonSourceMinimal PRIVATE
0068 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
0069 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0070 )
0071
0072 # GPUPhotonFileSource - reads photons from .npy file instead of torch generation
0073 add_executable(GPUPhotonFileSource GPUPhotonFileSource.cpp GPUPhotonFileSource.h)
0074 target_link_libraries(GPUPhotonFileSource gphox gphox_g4_deps)
0075 target_include_directories(GPUPhotonFileSource PRIVATE
0076 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
0077 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0078 )
0079
0080 # simtox creates a numpy file with initial photons for simulation
0081 add_executable(simtox simtox.cpp)
0082
0083 target_link_libraries(simtox gphox)
0084
0085 target_include_directories(simtox PRIVATE
0086 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
0087 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
0088 )
0089
0090 install(TARGETS consgeo simg4ox GPUCerenkov GPURaytrace GPUPhotonSource GPUPhotonSourceMinimal GPUPhotonFileSource simtox gphox gphox_g4_deps
0091 EXPORT ${PROJECT_NAME}Targets
0092 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
0093 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
0094 )
0095
0096 install(FILES config.h torch.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})