Skip to content

Commit d4af681

Browse files
committed
Import Geant4 10.2.0 source tree
1 parent c9b32a6 commit d4af681

File tree

5,128 files changed

+434127
-1037287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,128 files changed

+434127
-1037287
lines changed

CMakeLists.txt

Lines changed: 38 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#------------------------------------------------------------------------------
2-
# Top Level CMakeLists.txt for Geant4 Build
1+
#-----------------------------------------------------------------------
2+
# - Top Level CMakeLists.txt for Geant4 Build
33
#
44
# 21st September 2010 Ben Morgan
55
#
6-
# $Id: CMakeLists.txt 87059 2014-11-24 11:41:07Z gcosmo $
6+
# $Id: CMakeLists.txt 94339 2015-11-12 10:05:50Z gcosmo $
77
#
88

9-
#------------------------------------------------------------------------------
9+
#-----------------------------------------------------------------------
1010
# - Enforce an out-of-source builds before anything else
1111
#
1212
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
@@ -19,64 +19,40 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
1919
message(FATAL_ERROR "in-source build detected")
2020
endif()
2121

22-
#------------------------------------------------------------------------------
22+
#-----------------------------------------------------------------------
2323
# - Define CMake requirements and override make rules as needed
2424
#
25-
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
26-
27-
# If Policy CMP0022 exists, use OLD because Geant4 still needs
28-
# to support versions < 2.8.12.
29-
# This relates to LINK_INTERFACE_LIBRARIES and can be removed once
30-
# minimum required CMake version reaches 2.8.12
31-
if(POLICY CMP0022)
32-
cmake_policy(SET CMP0022 OLD)
33-
endif()
25+
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
3426

35-
# If Policy CMP0042 exists, use OLD to prefer the use of install names
36-
# instead of the new @rpath default. This is temporary to suppress warnings
37-
# on newer CMake versions.
38-
if(POLICY CMP0042)
39-
cmake_policy(SET CMP0042 OLD)
40-
endif()
41-
42-
# If Policy CMP0043 exists, use OLD because Geant4 still needs
43-
# to support Geant4 =< 2.8.12.
44-
# This relates to the use of generator expressions to set COMPILE_DEFINITIONS
45-
# and can be removed once the minimum required CMake version reaches 2.8.10.
46-
if(POLICY CMP0043)
47-
cmake_policy(SET CMP0043 OLD)
48-
endif()
27+
# - Any policy requirements should go here
4928

5029
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX
5130
${CMAKE_SOURCE_DIR}/cmake/Modules/Geant4MakeRules_cxx.cmake)
5231

53-
#------------------------------------------------------------------------------
54-
# - Project definition
32+
#-----------------------------------------------------------------------
33+
# - Project definition and basic configuration
5534
#
5635
project(Geant4)
5736

37+
# - Versioning. We do this here for now
38+
set(${PROJECT_NAME}_VERSION "10.2.0")
39+
set(${PROJECT_NAME}_VERSION_MAJOR "10")
40+
set(${PROJECT_NAME}_VERSION_MINOR "2")
41+
set(${PROJECT_NAME}_VERSION_PATCH "0")
42+
5843

59-
#----------------------------------------------------------------------------
6044
# - Prepend our own CMake Modules to the search path
61-
# This allows us to customize, add, and factor out functionality
62-
# NB: if our custom modules include others that we don't supply, those in the
63-
# base path will be used, so watch for incompatibilities!!
45+
# NB: if our custom modules include others that we don't supply, those in
46+
# the base path will be used, so watch for incompatibilities!!
6447
#
6548
set(CMAKE_MODULE_PATH
6649
${PROJECT_SOURCE_DIR}/cmake/Modules
6750
${CMAKE_MODULE_PATH})
6851

69-
70-
#----------------------------------------------------------------------------
52+
#-----------------------------------------------------------------------
7153
# - Add functionality provided by standard and custom modules
7254
# See the documentation in each of these modules for further details.
7355
#
74-
# - Versioning. We do this here for now
75-
set(${PROJECT_NAME}_VERSION "10.1.0")
76-
set(${PROJECT_NAME}_VERSION_MAJOR "10")
77-
set(${PROJECT_NAME}_VERSION_MINOR "1")
78-
set(${PROJECT_NAME}_VERSION_PATCH "0")
79-
8056
# - Provide dependent options as these are needed for some Geant4 features
8157
include(CMakeDependentOption)
8258

@@ -106,44 +82,41 @@ include(Geant4InterfaceOptions)
10682
# - Provide options to enable wrapping of Geant4 by other languages
10783
include(Geant4Wrapping)
10884

109-
110-
#------------------------------------------------------------------------------
85+
#-----------------------------------------------------------------------
11186
# Add the source and environments subdirectories
11287
# source : Process all the Geant4 core targets
11388
# environments : Process optional wrappings of Geant4 (NOTYETIMPLEMENTED)
11489
add_subdirectory(source)
11590
#add_subdirectory(environments)
11691

117-
118-
#----------------------------------------------------------------------------
92+
#-----------------------------------------------------------------------
11993
# - Perform all post build tasks
12094
# At the CMake level, this simply means that we must know about targets
12195
# and other properties processed in source and environments trees before
12296
# these tasks can be performed.
12397
#
124-
#----------------------------------------------------------------------------
125-
# Installation of optional read-only architecture independent data files.
98+
# - Installation of optional read-only architecture independent data files.
12699
# E.g. Examples, data libraries, documentation.
127100
# Done before toolchain generation because it may affect what we have to do
128101
# there!
129102
#
130103
include(Geant4InstallData)
131104

132-
#------------------------------------------------------------------------------
133-
# Generate any Use/Config files here once everything else has been processed
134-
# e.g. "UseGeant4.cmake", "Geant4Config.cmake" - library dependencies etc
135-
#
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
136109
include(Geant4ToolchainBackwardCompatibility)
110+
111+
# - 'geant4-config'
137112
include(Geant4ConfigureConfigScript)
138113

139-
#----------------------------------------------------------------------------
140-
# Create the Geant4Config files and supporting modules
141-
#
114+
# - Geant4Config.cmake
142115
include(Geant4BuildProjectConfig)
143116

144-
#------------------------------------------------------------------------------
145-
# Add the examples and tests subdirectories
146-
# This is done after the Geant4Config.cmake file has been generated
117+
#-----------------------------------------------------------------------
118+
# - Testing configuration.
119+
# Done here, as projects under 'tests' require Geant4Config.
147120
if(GEANT4_ENABLE_TESTING)
148121
include(Geant4CTest)
149122
add_subdirectory(tests)
@@ -152,6 +125,10 @@ if(GEANT4_ENABLE_TESTING)
152125
endif()
153126
endif()
154127

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.
155132
if(GEANT4_BUILD_EXAMPLES)
156133
set(Geant4_DIR ${CMAKE_BINARY_DIR} CACHE PATH "Current build directory")
157134
add_subdirectory(examples)
@@ -165,12 +142,11 @@ install(DIRECTORY examples
165142
PATTERN ".svn" EXCLUDE
166143
)
167144

168-
169-
#-----------------------------------------------------------------------------
170-
# Provide packaging with CPack.
145+
#-----------------------------------------------------------------------
146+
# - CPack-aging
171147
include(Geant4CPackBase)
172148

173-
#----------------------------------------------------------------------------
149+
#-----------------------------------------------------------------------
174150
# Final output - show what's been enabled so that user knows what's
175151
# happening - also useful for later problem solving!
176152
#

0 commit comments

Comments
 (0)