G4-DESCSS/CMakeLists.txt

38 lines
899 B
CMake
Raw Normal View History

2022-05-08 20:18:29 +08:00
cmake_minimum_required(VERSION 3.16)
set(Geant4_DIR D:/Geant4/dist/lib/Geant4-11.0.1)
project(DESCSS)
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
2022-05-08 20:18:29 +08:00
else()
find_package(Geant4 REQUIRED)
2022-05-08 20:18:29 +08:00
endif()
include(${Geant4_USE_FILE})
include_directories(${PROJECT_SOURCE_DIR}/include)
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cpp)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.h)
add_executable(DESCSS main.cpp ${sources} ${headers})
target_link_libraries(DESCSS ${Geant4_LIBRARIES})
set(DESCSS_SCRIPTS
debug.mac
electron.mac
2022-05-08 20:18:29 +08:00
vis.mac
assets/model.txt
2022-05-08 20:18:29 +08:00
)
foreach(_script ${DESCSS_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/Release/${_script}
COPYONLY
)
endforeach()
install(TARGETS DESCSS DESTINATION bin)