-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (26 loc) · 927 Bytes
/
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
#Checking for correct version of CMake
cmake_minimum_required(VERSION 3.8...3.18)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
#Name project
project(Dev)
#Find Geant4 package
#If statement allows for the us of drivers, or not
option(WITH_GEANT4_UIVIS "Build program with Geatn4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
#Gets all ui and visual drivers
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#Gets all the include files needed
include(${Geant4_USE_FILE})
include_directories(${PROJECT_SOURCE_DIR}/classes)
#List the source and header files
file(GLOB sources ${PROJECT_SOURCE_DIR}/classes/*.cpp)
file(GLOB headers ${PROJECT_SOURCE_DIR}/classes/*.h)
#Defining exe file
add_executable(Dev Dev.cpp ${sources} ${headers})
#Linking Geant4 library files
target_link_libraries(Dev ${Geant4_LIBRARIES})