forked from PaNOSC-ViNYL/SimEx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
131 lines (109 loc) · 4.14 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
cmake_minimum_required (VERSION 2.8)
project (SIMEX)
include(CMakeDependentOption)
# Disallow in-source build
if ("${SIMEX_SOURCE_DIR}" STREQUAL "${SIMEX_BINARY_DIR}")
message(FATAL_ERROR
"SIMEX requires an out of source Build. "
"Please create a separate binary directory and run CMake there.")
endif()
# set path for modules
set (SIMEX_CMAKE_DIR "${SIMEX_SOURCE_DIR}/CMake")
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SIMEX_CMAKE_DIR})
option (DEVELOPER_INSTALL "Install modules only, do not install SimEx files" OFF)
option (INSTALL_TESTS "Install tests" ON)
# options required for building the py_detector_interface module:
# XCSITPotonDetector
option(GEANT4_ROOT "-DGEANT4_ROOT=<abs path> absolute path to the geant4
installation directory that includes \n
./bin/\n
./include/Geant4/\n
./lib64/Geant4-<ver>/\n
./share/Geant4-<ver>/data/"
)
option(XERCESC_ROOT "-DXERCESC_ROOT=<abs path> absolute path to the xercesc
installation directory that includes\n
./include/xercesc/\n
./lib/"
)
option(XCSIT_ROOT "-DXCSIT_ROOT=<abs path> absolute path to the xcist
installation directory that includes\n
./include/xcsit/
./lib/
./lib/xcsit/
./bin/"
)
option(BOOST_ROOT "-DBOOST_ROOT=<abs path> absolute path to the boost
installation directory that includes\n
./include/boost/
./lib/"
)
option(PY_DETECTOR_INTERFACE_DEBUG "
-DPY_DETECTOR_INTERFACE_DEBUG=default: OFF | ON"
)
set (LIBDIR lib)
set (INCLUDEDIR include)
set (BINDIR bin)
set (PYPATH ${LIBDIR}/python2.7)
set (DOCDIR share/doc)
option (PACKAGE_MAKE "Use this option to create linux packages" OFF)
if (PACKAGE_MAKE)
set (TESTSDIR share/simex/Tests)
else()
set (TESTSDIR Tests)
endif()
if (DEVELOPER_INSTALL)
set (FRAMEWORK_DIR ${SIMEX_SOURCE_DIR}/Sources)
set (UNITTESTS_DIR ${FRAMEWORK_DIR}/unittest/)
set (UTILITIES_DIR ${FRAMEWORK_DIR}/python/SimEx/Utilities/)
set (CALCULATORS_DIR ${FRAMEWORK_DIR}/python/SimEx/Calculators/)
else()
set (UTILITIES_DIR ${PYPATH}/SimEx/Utilities/)
set (CALCULATORS_DIR ${PYPATH}/SimEx/Calculators/)
if (INSTALL_TESTS)
add_subdirectory (Tests)
endif()
endif()
message (STATUS "************************ checking python dependencies *****************************")
add_subdirectory (Sources)
# find and add modules
set (SIMEX_MODULES_ROOT "${SIMEX_SOURCE_DIR}/Modules")
include (find_modules)
foreach(module ${SIMEX_MODULES})
MESSAGE("CHECKING ${module}")
get_filename_component(module_name ${module} NAME)
option(${module_name} "include ${module_name} module" ON)
endforeach()
foreach(module ${SIMEX_MODULES})
get_filename_component(module_name ${module} NAME)
if (${module_name})
message (STATUS "***** Including module : ${module} ****")
add_subdirectory("${SIMEX_MODULES_ROOT}/${module}")
message (STATUS "*********************************************************")
endif()
endforeach()
# create simex_vars.sh file
if (DEVELOPER_INSTALL)
configure_file(simex_vars_dev.sh.in simex_vars.sh)
configure_file(simex_dev.in simex)
else()
configure_file(simex_vars.sh.in simex_vars.sh)
configure_file(simex.in simex)
endif()
install(FILES ${CMAKE_BINARY_DIR}/simex_vars.sh
DESTINATION ${BINDIR})
install(PROGRAMS ${CMAKE_BINARY_DIR}/simex
DESTINATION ${BINDIR})
# Copy diagnostic scripts to bin dir.
install(PROGRAMS ${SIMEX_SOURCE_DIR}/Sources/python/ScriptCollection/DataAnalysis/propagation/prop_diagnostics.py DESTINATION ${BINDIR})
install(PROGRAMS ${SIMEX_SOURCE_DIR}/Sources/python/ScriptCollection/DataAnalysis/pmi/pmi_diagnostics.py DESTINATION ${BINDIR})
install(PROGRAMS ${SIMEX_SOURCE_DIR}/Sources/python/ScriptCollection/DataAnalysis/scattering/diffr_diagnostics.py DESTINATION ${BINDIR})
install(PROGRAMS ${SIMEX_SOURCE_DIR}/Sources/python/ScriptCollection/DataAnalysis/emc/emc_diagnostics.py DESTINATION ${BINDIR})
install(PROGRAMS ${SIMEX_SOURCE_DIR}/Sources/python/SimEx/Utilities/wpg_to_opmd.py DESTINATION ${BINDIR})
if (PACKAGE_MAKE)
add_subdirectory (Packages)
endif()
# Add documentation target.
add_subdirectory("Sources/doc")
# Add extra stuff, e.g. python libs not pip'able.
add_subdirectory("Sources/python/extra")