3
3
#
4
4
# 21st September 2010 Ben Morgan
5
5
#
6
- # $Id: CMakeLists.txt 102581 2017-02-09 09:30:38Z gcosmo $
6
+ # $Id: CMakeLists.txt 104643 2017-06-08 14:43:49Z gcosmo $
7
7
#
8
8
9
9
#-----------------------------------------------------------------------
10
10
# - Enforce an out-of-source builds before anything else
11
11
#
12
12
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
13
- message (STATUS "Geant4 requires an out-of-source build." )
14
- message (STATUS "Please remove these files from ${CMAKE_BINARY_DIR} first:" )
15
- message (STATUS "CMakeCache.txt" )
16
- message (STATUS "CMakeFiles" )
17
- message (STATUS "Once these files are removed, create a separate directory" )
18
- message (STATUS "and run CMake from there" )
19
- message (FATAL_ERROR "in-source build detected" )
13
+ message (STATUS "Geant4 requires an out-of-source build." )
14
+ message (STATUS "Please remove these files from ${CMAKE_BINARY_DIR} first:" )
15
+ message (STATUS "CMakeCache.txt" )
16
+ message (STATUS "CMakeFiles" )
17
+ message (STATUS "Once these files are removed, create a separate directory" )
18
+ message (STATUS "and run CMake from there" )
19
+ message (FATAL_ERROR "in-source build detected" )
20
20
endif ()
21
21
22
22
#-----------------------------------------------------------------------
@@ -26,20 +26,20 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
26
26
27
27
# - Any policy requirements should go here
28
28
29
+ # - Make overrides for default flags, so they appear in interfaces
29
30
set (CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
30
31
${CMAKE_SOURCE_DIR} /cmake/Modules/Geant4MakeRules_cxx.cmake)
31
32
32
33
#-----------------------------------------------------------------------
33
34
# - Project definition and basic configuration
34
- #
35
+ # Version handled manually as project(... VERSION ...) is not used
36
+ # in tests/examples which are subprojects. All calls must use
37
+ # the same form.
35
38
project (Geant4)
36
-
37
- # - Versioning. We do this here for now
38
- set (${PROJECT_NAME} _VERSION "10.3.1" )
39
- set (${PROJECT_NAME} _VERSION_MAJOR "10" )
40
- set (${PROJECT_NAME} _VERSION_MINOR "3" )
41
- set (${PROJECT_NAME} _VERSION_PATCH "1" )
42
-
39
+ set (${PROJECT_NAME} _VERSION_MAJOR 10)
40
+ set (${PROJECT_NAME} _VERSION_MINOR 4)
41
+ set (${PROJECT_NAME} _VERSION_PATCH 0)
42
+ set (${PROJECT_NAME} _VERSION "${${PROJECT_NAME} _VERSION_MAJOR}.${${PROJECT_NAME} _VERSION_MINOR}.${${PROJECT_NAME} _VERSION_PATCH}" )
43
43
44
44
# - Prepend our own CMake Modules to the search path
45
45
# NB: if our custom modules include others that we don't supply, those in
@@ -50,105 +50,8 @@ set(CMAKE_MODULE_PATH
50
50
${CMAKE_MODULE_PATH} )
51
51
52
52
#-----------------------------------------------------------------------
53
- # - Add functionality provided by standard and custom modules
54
- # See the documentation in each of these modules for further details.
55
- #
56
- # - Provide dependent options as these are needed for some Geant4 features
57
- include (CMakeDependentOption)
58
-
59
- # - Provide general CMake utilities for Geant4.
60
- include (Geant4MacroUtilities)
61
-
62
- # - Provide an 'uninstall' target.
63
- include (CMakeUninstallTarget)
64
-
65
- # - Provide the 'validate_sources' target.
66
- include (Geant4ValidateSources)
67
-
68
- # - Provide standard install directories permitting customization.
69
- include (Geant4InstallDirs)
70
-
71
- # - Provide options to control how Geant4 libraries are built
72
- include (Geant4LibraryBuildOptions)
73
-
74
- # - Provide interface to control use of optional components
75
- include (Geant4OptionalComponents)
76
-
77
- # - Provide interface to control use of UI/Vis components
78
- # Written in a separate module from other optional components because
79
- # there are many complex options to handle.
80
- include (Geant4InterfaceOptions)
81
-
82
- # - Provide options to enable wrapping of Geant4 by other languages
83
- include (Geant4Wrapping)
84
-
85
- #-----------------------------------------------------------------------
86
- # Add the source and environments subdirectories
87
- # source : Process all the Geant4 core targets
88
- # environments : Process optional wrappings of Geant4 (NOTYETIMPLEMENTED)
89
- add_subdirectory (source )
90
- #add_subdirectory(environments)
91
-
92
- #-----------------------------------------------------------------------
93
- # - Perform all post build tasks
94
- # At the CMake level, this simply means that we must know about targets
95
- # and other properties processed in source and environments trees before
96
- # these tasks can be performed.
97
- #
98
- # - Installation of optional read-only architecture independent data files.
99
- # E.g. Examples, data libraries, documentation.
100
- # Done before toolchain generation because it may affect what we have to do
101
- # there!
102
- #
103
- include (Geant4InstallData)
104
-
105
- # - Generate any Use/Config/Support files here once everything else has
106
- # been processed e.g. "UseGeant4.cmake", "Geant4Config.cmake", library
107
- # dependencies etc.
108
- # - Geant4Make
109
- include (Geant4ToolchainBackwardCompatibility)
110
-
111
- # - 'geant4-config'
112
- include (Geant4ConfigureConfigScript)
113
-
114
- # - Geant4Config.cmake
115
- include (Geant4BuildProjectConfig)
116
-
117
- #-----------------------------------------------------------------------
118
- # - Testing configuration.
119
- # Done here, as projects under 'tests' require Geant4Config.
120
- if (GEANT4_ENABLE_TESTING)
121
- include (Geant4CTest)
122
- add_subdirectory (tests)
123
- if (EXISTS ${CMAKE_SOURCE_DIR} /benchmarks)
124
- add_subdirectory (benchmarks)
125
- endif ()
126
- endif ()
127
-
128
- #-----------------------------------------------------------------------
129
- # - Examples build/install
130
- # NB: Build of examples is a *testing* proceedure. It is *not* intended
131
- # that examples be built and installed as part of a full Geant4 install.
132
- if (GEANT4_BUILD_EXAMPLES)
133
- set (Geant4_DIR ${CMAKE_BINARY_DIR} CACHE PATH "Current build directory" )
134
- add_subdirectory (examples)
135
- endif ()
136
-
137
- # - Install example code to datarootdir
138
- install (DIRECTORY examples
139
- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR} /Geant4-${Geant4_VERSION}
140
- COMPONENT Examples
141
- PATTERN "CVS" EXCLUDE
142
- PATTERN ".svn" EXCLUDE
143
- )
144
-
145
- #-----------------------------------------------------------------------
146
- # - CPack-aging
147
- include (Geant4CPackBase)
148
-
149
- #-----------------------------------------------------------------------
150
- # Final output - show what's been enabled so that user knows what's
151
- # happening - also useful for later problem solving!
53
+ # - Include CMake category main module
54
+ # Factored into category for convenience in tagging
152
55
#
153
- GEANT4_PRINT_ENABLED_FEATURES( )
56
+ include (G4CMakeMain )
154
57
0 commit comments