@@ -19,42 +19,21 @@ option (DEVELOPER_INSTALL "Install modules only, do not install SimEx files" OFF
19
19
20
20
option (INSTALL_TESTS "Install tests" ON )
21
21
22
-
23
22
# options required for building the py_detector_interface module:
24
23
# XCSITPotonDetector
25
- option (GEANT4_ROOT "-DGEANT4_ROOT=<abs path> absolute path to the geant4
26
- installation directory that includes \n
27
- ./bin/\n
28
- ./include/Geant4/\n
29
- ./lib64/Geant4-<ver>/\n
30
- ./share/Geant4-<ver>/data/"
31
- )
32
- option (XERCESC_ROOT "-DXERCESC_ROOT=<abs path> absolute path to the xercesc
33
- installation directory that includes\n
34
- ./include/xercesc/\n
35
- ./lib/"
36
- )
37
- option (XCSIT_ROOT "-DXCSIT_ROOT=<abs path> absolute path to the xcist
38
- installation directory that includes\n
39
- ./include/xcsit/
40
- ./lib/
41
- ./lib/xcsit/
42
- ./bin/"
43
- )
44
- option (BOOST_ROOT "-DBOOST_ROOT=<abs path> absolute path to the boost
45
- installation directory that includes\n
46
- ./include/boost/
47
- ./lib/"
48
- )
49
24
option (PY_DETECTOR_INTERFACE_DEBUG "
50
25
-DPY_DETECTOR_INTERFACE_DEBUG=default: OFF | ON"
51
26
)
52
27
28
+ ### PYTHON
29
+ FIND_PACKAGE (PythonInterp 3.5 REQUIRED)
53
30
54
31
set (LIBDIR lib)
55
32
set (INCLUDEDIR include )
56
33
set (BINDIR bin)
57
- set (PYPATH ${LIBDIR} /python2.7)
34
+ set (PYPATH ${LIBDIR} /python${PYTHON_VERSION_MAJOR} .${PYTHON_VERSION_MINOR} )
35
+ message ( "PYPATH=${PYPATH} " )
36
+
58
37
set (DOCDIR share/doc )
59
38
60
39
option (PACKAGE_MAKE "Use this option to create linux packages" OFF )
@@ -77,25 +56,57 @@ else()
77
56
endif ()
78
57
endif ()
79
58
80
- message (STATUS "************************ checking python dependencies *****************************" )
81
- add_subdirectory (Sources )
82
-
59
+ message (STATUS "************************ checking python dependencies *****************************" )
60
+ add_subdirectory (Sources )
61
+
62
+ #By default all modules are included/excluded depending on this flag.
63
+ #If a flag: USE_${module_name} is passed, this will overwrite teh default.
64
+ #For example:
65
+ # [De-]activate all modules:
66
+ # cmake -DUSE_MODULES_DEFAULT=[OFF]ON [...]
67
+ # Activate a single module:
68
+ # cmake -DUSE_MODULES_DEFAULT=OFF -DUSE_wpg=ON [...]
69
+ # Deactivate a single module:
70
+ # cmake -DUSE_MODULES_DEFAULT=ON -DUSE_wpg=OFF [...]
71
+ option (USE_MODULES_DEFAULT "Default to include/exclude a module" ON )
72
+ message (STATUS "**************** Including modules (default "
73
+ "${USE_MODULES_DEFAULT} ) ****************" )
83
74
# find and add modules
84
75
set (SIMEX_MODULES_ROOT "${SIMEX_SOURCE_DIR} /Modules" )
85
76
include (find_modules)
86
77
foreach (module ${SIMEX_MODULES} )
87
78
MESSAGE ("CHECKING ${module} " )
88
79
get_filename_component (module_name ${module} NAME )
89
- option (${module_name} "include ${module_name} module" ON )
80
+ #If a variable USE_${module_name} is defined, use its value
81
+ #overwrite the default.
82
+ #Since we add the USE_* variable to the cache, we re-use it with
83
+ #multiple cmake calls
84
+ if (DEFINED USE_${module_name} )
85
+ #Add a cache variable with some help text. Note the
86
+ #use of FORCE option to be sure the value is updated in the
87
+ #cache
88
+ set (USE_${module_name} ${USE_${module_name} }
89
+ CACHE BOOL "Include mdoule ${module_name} " FORCE)
90
+ endif ()
90
91
endforeach ()
91
92
92
93
foreach (module ${SIMEX_MODULES} )
93
94
get_filename_component (module_name ${module} NAME )
94
- if (${module_name} )
95
- message (STATUS "***** Including module : ${module} ****" )
96
- add_subdirectory ("${SIMEX_MODULES_ROOT} /${module} " )
97
- message (STATUS "*********************************************************" )
95
+ #If a request specific to this module was done, use it
96
+ if (DEFINED USE_${module_name} )
97
+ if (USE_${module_name} )
98
+ message (STATUS "***** Including module ${module_name} from: ${module} ****" )
99
+ add_subdirectory ("${SIMEX_MODULES_ROOT} /${module} " )
100
+ message (STATUS "*********************************************************" )
101
+ endif ()
102
+ else ()
103
+ if (USE_MODULES_DEFAULT)
104
+ message (STATUS "***** Including module ${module_name} from: ${module} ****" )
105
+ add_subdirectory ("${SIMEX_MODULES_ROOT} /${module} " )
106
+ message (STATUS "*********************************************************" )
107
+ endif ()
98
108
endif ()
109
+
99
110
endforeach ()
100
111
101
112
# create simex_vars.sh file
0 commit comments