cmake_minimum_required(VERSION 3.2 FATAL_ERROR) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) project(Simulation) find_package(Geant4 REQUIRED ui_all vis_all) set(CMAKE_PREFIX_PATH $ENV{ROOTSYS} ${CMAKE_PREFIX_PATH}) find_package(ROOT REQUIRED) include_directories(${ROOT_INCLUDE_DIRS}) include(${Geant4_USE_FILE}) include_directories(${PROJECT_SOURCE_DIR}/include) file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) file(GLOB MACRO_FILES "macros/*.mac") if(MACRO_FILES) file(COPY ${MACRO_FILES} DESTINATION ${CMAKE_BINARY_DIR}/) endif() add_executable(ej315 ej315.cc ${sources}) target_link_libraries(ej315 ${Geant4_LIBRARIES} ${ROOT_LIBRARIES}) add_custom_target(Simulation DEPENDS ej315)