-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
36 lines (27 loc) · 1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(simjuno)
option(WITH_GEANT4_UIVIS "Build with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
list(APPEND CMAKE_MODULE_PATH $ENV{ROOTSYS}/etc/cmake)
find_package(ROOT REQUIRED)
include(${Geant4_USE_FILE})
include_directories(${ROOT_INCLUDE_DIR} ${Geant4_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include)
# We presume the existence of three directories
file(GLOB_RECURSE sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB_RECURSE headers ${PROJECT_SOURCE_DIR}/include/*.hh)
file(GLOB_RECURSE macros RELATIVE ${PROJECT_SOURCE_DIR} macros/*.mac)
# Enable macros for out-of-source build
foreach(_file ${macros})
configure_file(
${_file}
${PROJECT_BINARY_DIR}/${_file}
COPYONLY
)
endforeach()
add_executable(simjuno main.cc ${sources} ${headers})
target_link_libraries(simjuno ${Geant4_LIBRARIES} ${ROOT_LIBRARIES})
install(TARGETS simjuno DESTINATION bin)