Skip to content

Commit

Permalink
Import Geant4 10.2.0 source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
gcosmo committed Jun 10, 2016
1 parent c9b32a6 commit d4af681
Show file tree
Hide file tree
Showing 5,128 changed files with 434,127 additions and 1,037,287 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
100 changes: 38 additions & 62 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#------------------------------------------------------------------------------
# Top Level CMakeLists.txt for Geant4 Build
#-----------------------------------------------------------------------
# - Top Level CMakeLists.txt for Geant4 Build
#
# 21st September 2010 Ben Morgan
#
# $Id: CMakeLists.txt 87059 2014-11-24 11:41:07Z gcosmo $
# $Id: CMakeLists.txt 94339 2015-11-12 10:05:50Z gcosmo $
#

#------------------------------------------------------------------------------
#-----------------------------------------------------------------------
# - Enforce an out-of-source builds before anything else
#
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
Expand All @@ -19,64 +19,40 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "in-source build detected")
endif()

#------------------------------------------------------------------------------
#-----------------------------------------------------------------------
# - Define CMake requirements and override make rules as needed
#
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)

# If Policy CMP0022 exists, use OLD because Geant4 still needs
# to support versions < 2.8.12.
# This relates to LINK_INTERFACE_LIBRARIES and can be removed once
# minimum required CMake version reaches 2.8.12
if(POLICY CMP0022)
cmake_policy(SET CMP0022 OLD)
endif()
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)

# If Policy CMP0042 exists, use OLD to prefer the use of install names
# instead of the new @rpath default. This is temporary to suppress warnings
# on newer CMake versions.
if(POLICY CMP0042)
cmake_policy(SET CMP0042 OLD)
endif()

# If Policy CMP0043 exists, use OLD because Geant4 still needs
# to support Geant4 =< 2.8.12.
# This relates to the use of generator expressions to set COMPILE_DEFINITIONS
# and can be removed once the minimum required CMake version reaches 2.8.10.
if(POLICY CMP0043)
cmake_policy(SET CMP0043 OLD)
endif()
# - Any policy requirements should go here

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

#------------------------------------------------------------------------------
# - Project definition
#-----------------------------------------------------------------------
# - Project definition and basic configuration
#
project(Geant4)

# - Versioning. We do this here for now
set(${PROJECT_NAME}_VERSION "10.2.0")
set(${PROJECT_NAME}_VERSION_MAJOR "10")
set(${PROJECT_NAME}_VERSION_MINOR "2")
set(${PROJECT_NAME}_VERSION_PATCH "0")


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


#----------------------------------------------------------------------------
#-----------------------------------------------------------------------
# - Add functionality provided by standard and custom modules
# See the documentation in each of these modules for further details.
#
# - Versioning. We do this here for now
set(${PROJECT_NAME}_VERSION "10.1.0")
set(${PROJECT_NAME}_VERSION_MAJOR "10")
set(${PROJECT_NAME}_VERSION_MINOR "1")
set(${PROJECT_NAME}_VERSION_PATCH "0")

# - Provide dependent options as these are needed for some Geant4 features
include(CMakeDependentOption)

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


#------------------------------------------------------------------------------
#-----------------------------------------------------------------------
# Add the source and environments subdirectories
# source : Process all the Geant4 core targets
# environments : Process optional wrappings of Geant4 (NOTYETIMPLEMENTED)
add_subdirectory(source)
#add_subdirectory(environments)


#----------------------------------------------------------------------------
#-----------------------------------------------------------------------
# - Perform all post build tasks
# At the CMake level, this simply means that we must know about targets
# and other properties processed in source and environments trees before
# these tasks can be performed.
#
#----------------------------------------------------------------------------
# Installation of optional read-only architecture independent data files.
# - Installation of optional read-only architecture independent data files.
# E.g. Examples, data libraries, documentation.
# Done before toolchain generation because it may affect what we have to do
# there!
#
include(Geant4InstallData)

#------------------------------------------------------------------------------
# Generate any Use/Config files here once everything else has been processed
# e.g. "UseGeant4.cmake", "Geant4Config.cmake" - library dependencies etc
#
# - Generate any Use/Config/Support files here once everything else has
# been processed e.g. "UseGeant4.cmake", "Geant4Config.cmake", library
# dependencies etc.
# - Geant4Make
include(Geant4ToolchainBackwardCompatibility)

# - 'geant4-config'
include(Geant4ConfigureConfigScript)

#----------------------------------------------------------------------------
# Create the Geant4Config files and supporting modules
#
# - Geant4Config.cmake
include(Geant4BuildProjectConfig)

#------------------------------------------------------------------------------
# Add the examples and tests subdirectories
# This is done after the Geant4Config.cmake file has been generated
#-----------------------------------------------------------------------
# - Testing configuration.
# Done here, as projects under 'tests' require Geant4Config.
if(GEANT4_ENABLE_TESTING)
include(Geant4CTest)
add_subdirectory(tests)
Expand All @@ -152,6 +125,10 @@ if(GEANT4_ENABLE_TESTING)
endif()
endif()

#-----------------------------------------------------------------------
# - Examples build/install
# NB: Build of examples is a *testing* proceedure. It is *not* intended
# that examples be built and installed as part of a full Geant4 install.
if(GEANT4_BUILD_EXAMPLES)
set(Geant4_DIR ${CMAKE_BINARY_DIR} CACHE PATH "Current build directory")
add_subdirectory(examples)
Expand All @@ -165,12 +142,11 @@ install(DIRECTORY examples
PATTERN ".svn" EXCLUDE
)


#-----------------------------------------------------------------------------
# Provide packaging with CPack.
#-----------------------------------------------------------------------
# - CPack-aging
include(Geant4CPackBase)

#----------------------------------------------------------------------------
#-----------------------------------------------------------------------
# Final output - show what's been enabled so that user knows what's
# happening - also useful for later problem solving!
#
Expand Down
Loading

0 comments on commit d4af681

Please sign in to comment.