-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
54 lines (46 loc) · 1.55 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 11)
project(QEDCascade)
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(SEND_ERROR "In-source builds are not allowed.")
endif("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
option(BUILD_TESTS "Build test executables" OFF)
option(BUILD_GEANT "Build geant executables" OFF)
option(BUILD_PYTHON "Build python library" OFF)
option(BUILD_TENSORFLOW "Build the geant4 tensorflow package" OFF)
if(BUILD_PYTHON)
# If apple turn openMP off by defult
if(APPLE)
option(BUILD_OPENMP "Build openMP library" OFF)
elseif(UNIX)
option(BUILD_OPENMP "Build openMP library" ON)
endif()
else()
option(BUILD_OPENMP "Build openMP library" OFF)
endif(BUILD_PYTHON)
if(BUILD_OPENMP)
add_compile_definitions(USEOPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -fopenmp")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall")
endif(BUILD_OPENMP)
INCLUDE_DIRECTORIES(Source)
add_subdirectory(Source/Physics)
add_subdirectory(Source/Particles)
add_subdirectory(Source/Tools)
if(BUILD_PYTHON)
add_subdirectory(Source/Python)
else()
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/Install")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_subdirectory(Source/Exec)
add_subdirectory(Source/IO)
endif(BUILD_PYTHON)
if(BUILD_GEANT)
add_compile_definitions(USEGEANT)
add_subdirectory(Source/Geant)
endif(BUILD_GEANT)
if(BUILD_TESTS)
add_subdirectory(Tests)
endif(BUILD_TESTS)