Import Geant4 10.6.2 source tree

This commit is contained in:
Gabriele Cosmo
2020-05-29 14:54:29 +02:00
parent 8c87fe78c4
commit c02c370437
448 changed files with 23779 additions and 31516 deletions
+19 -12
View File
@@ -63,15 +63,30 @@ include(Geant4OptionalComponents)
# there are many complex options to handle.
include(Geant4InterfaceOptions)
# - Provide options to enable wrapping of Geant4 by other languages
include(Geant4Wrapping)
# - Installation of optional read-only architecture independent data files.
include(Geant4InstallData)
# - Include testing up front so both source and environments can use it if required
include(Geant4CTest)
#-----------------------------------------------------------------------
# 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)
option(GEANT4_USE_PYTHON "Build Python bindings for Geant4" OFF)
if(GEANT4_USE_PYTHON)
# We can only build g4py with MT geant4 if TLS is global-dynamic (or auto?)
if(GEANT4_BUILD_MULTITHREADED AND (NOT GEANT4_BUILD_TLS_MODEL MATCHES "global-dynamic"))
message(FATAL_ERROR "Geant4Py only supports 'global-dynamic' thread local storage
'${GEANT4_BUILD_TLS_MODEL}' selected by GEANT4_BUILD_TLS_MODEL option
")
endif()
add_subdirectory(environments/g4py)
endif()
#-----------------------------------------------------------------------
# - Perform all post build tasks
@@ -79,13 +94,6 @@ add_subdirectory(source)
# and other properties processed in source and environments trees before
# these tasks can be performed.
#
# - 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/Support files here once everything else has
# been processed e.g. "UseGeant4.cmake", "Geant4Config.cmake", library
# dependencies etc.
@@ -101,7 +109,6 @@ include(G4ConfigureCMakeHelpers)
#-----------------------------------------------------------------------
# - Testing configuration.
# Done here, as projects under 'tests' require Geant4Config.
include(Geant4CTest)
if(GEANT4_ENABLE_TESTING)
add_subdirectory(tests)
if(EXISTS ${CMAKE_SOURCE_DIR}/benchmarks)
@@ -121,7 +128,7 @@ mark_as_advanced(GEANT4_INSTALL_EXAMPLES)
if(GEANT4_INSTALL_EXAMPLES)
install(DIRECTORY examples
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}
DESTINATION ${CMAKE_INSTALL_DATADIR}
COMPONENT Examples
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE
+10
View File
@@ -116,6 +116,16 @@ add_custom_target(validate_sources
#.rst:
# General Installation Settings
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# Geant4 custom defaults
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH
"Read-only architecture-independent data root (share)")
set(CMAKE_INSTALL_DATADIR
"${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}" CACHE PATH
"Read-only architecture-independent data (DATAROOTDIR/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION})")
#
# CMake's builtin `GNUInstallDirs` module is used to set and provide variables
# for the destinations to which for executables, libraries and other files
+6 -3
View File
@@ -195,9 +195,12 @@ function(geant4_save_package_variables _title)
get_property(__exported_vars GLOBAL PROPERTY GEANT4_EXPORT_PACKAGE_${_title}_VARIABLES)
foreach(__varname ${ARGN})
if(NOT (${__varname} IN_LIST __exported_vars))
# TODO: Also check that the save variable is in the cache...
# if(CACHE ...) only available from 3.14
set_property(GLOBAL APPEND PROPERTY GEANT4_EXPORT_PACKAGE_${_title}_VARIABLES ${__varname})
# Some variables might be empty on certain systems. Only save those with a value
if(${__varname})
# TODO: Also check that the save variable is in the cache...
# if(CACHE ...) only available from 3.14
set_property(GLOBAL APPEND PROPERTY GEANT4_EXPORT_PACKAGE_${_title}_VARIABLES ${__varname})
endif()
endif()
endforeach()
endfunction()
+20 -16
View File
@@ -729,7 +729,7 @@ _g4tc_configure_build_tree_scripts(geant4make)
# +- CMAKE_INSTALL_PREFIX
# +- LIBDIR/Geant4-VERSION (G4LIB)
# +- INCLUDEDIR/Geant4 (G4INCLUDE)
# +- DATAROOTDIR/Geant4-VERSION/
# +- DATADIR/
# +- geant4make (THIS IS G4INSTALL!)
# +- geant4make.(c)sh
# +- config/
@@ -742,7 +742,7 @@ set(G4INSTALL "\"\$geant4make_root\"")
# - Include dir
file(RELATIVE_PATH
G4MAKE_TO_INCLUDEDIR
${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
${CMAKE_INSTALL_FULL_DATADIR}/geant4make
${CMAKE_INSTALL_FULL_INCLUDEDIR}/${PROJECT_NAME}
)
set(G4INCLUDE "\"`cd \$geant4make_root/${G4MAKE_TO_INCLUDEDIR} > /dev/null \; pwd`\"")
@@ -750,7 +750,7 @@ set(G4INCLUDE "\"`cd \$geant4make_root/${G4MAKE_TO_INCLUDEDIR} > /dev/null \; pw
# - Bin dir
file(RELATIVE_PATH
G4MAKE_TO_BINDIR
${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
${CMAKE_INSTALL_FULL_DATADIR}/geant4make
${CMAKE_INSTALL_FULL_BINDIR}
)
set(G4BIN_DIR "\"`cd \$geant4make_root/${G4MAKE_TO_BINDIR} > /dev/null \; pwd`\"")
@@ -758,7 +758,7 @@ set(G4BIN_DIR "\"`cd \$geant4make_root/${G4MAKE_TO_BINDIR} > /dev/null \; pwd`\"
# - Lib dir
file(RELATIVE_PATH
G4MAKE_TO_LIBDIR
${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
${CMAKE_INSTALL_FULL_DATADIR}/geant4make
${CMAKE_INSTALL_FULL_LIBDIR}
)
set(G4LIB "\"`cd \$geant4make_root/${G4MAKE_TO_LIBDIR}/Geant4-${Geant4_VERSION} > /dev/null \; pwd`\"")
@@ -775,7 +775,7 @@ foreach(_ds ${GEANT4_EXPORTED_DATASETS})
file(RELATIVE_PATH
G4MAKE_TO_DATADIR
${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
${CMAKE_INSTALL_FULL_DATADIR}/geant4make
${${_ds}_PATH}
)
set(${_ds}_PATH "\"`cd \$geant4make_root/${G4MAKE_TO_DATADIR} > /dev/null \; pwd`\"")
@@ -788,7 +788,7 @@ set(TOOLS_FONT_PATH "\"`cd \$geant4make_root/../fonts > /dev/null ; pwd`\"")
_g4tc_configure_install_tree_scripts(
${CMAKE_BINARY_DIR}/InstallTreeFiles
geant4make
${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
${CMAKE_INSTALL_DATADIR}/geant4make
)
@@ -797,7 +797,7 @@ _g4tc_configure_install_tree_scripts(
# softlink to the G4SYSTEM directory.
#
install(DIRECTORY config
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Geant4-${Geant4_VERSION}/geant4make
DESTINATION ${CMAKE_INSTALL_DATADIR}/geant4make
COMPONENT Development
FILES_MATCHING PATTERN "*.gmk"
PATTERN "CVS" EXCLUDE
@@ -835,21 +835,25 @@ foreach(_ds ${GEANT4_EXPORTED_DATASETS})
geant4_get_dataset_property(${_ds} ENVVAR ${_ds}_ENVVAR)
geant4_get_dataset_property(${_ds} INSTALL_DIR ${_ds}_PATH)
file(RELATIVE_PATH
G4ENV_BINDIR_TO_DATADIR
${CMAKE_INSTALL_FULL_BINDIR}
${${_ds}_PATH}
)
set(${_ds}_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATADIR} > /dev/null \; pwd`\"")
if(NOT IS_ABSOLUTE ${${_ds}_PATH})
file(RELATIVE_PATH
G4ENV_BINDIR_TO_DATADIR
${CMAKE_INSTALL_FULL_BINDIR}
${${_ds}_PATH}
)
set(${_ds}_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATADIR} > /dev/null \; pwd`\"")
else()
set(${_ds}_PATH "\"${${_ds}_PATH}\"")
endif()
endforeach()
# - Fonts
file(RELATIVE_PATH
G4ENV_BINDIR_TO_DATAROOTDIR
G4ENV_BINDIR_TO_DATADIR
"${CMAKE_INSTALL_FULL_BINDIR}"
"${CMAKE_INSTALL_FULL_DATAROOTDIR}/Geant4-${Geant4_VERSION}"
"${CMAKE_INSTALL_FULL_DATADIR}"
)
set(TOOLS_FONT_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATAROOTDIR}/fonts > /dev/null ; pwd`\"")
set(TOOLS_FONT_PATH "\"`cd \$geant4_envbindir/${G4ENV_BINDIR_TO_DATADIR}/fonts > /dev/null ; pwd`\"")
# - Configure for each shell
+5
View File
@@ -6,6 +6,11 @@
#-----------------------------------------------------------------------
# Package up needed system libraries - only for WIN32?
#
# for Intel icc suppress warnings about icc libraries not existing for 19.
if(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS True)
endif()
include(InstallRequiredSystemLibraries)
#-----------------------------------------------------------------------
+2 -2
View File
@@ -105,7 +105,7 @@ set(GEANT4_DATASETS_URL "https://cern.ch/geant4-data/datasets")
set(GEANT4_BUILD_FULL_DATADIR ${PROJECT_BINARY_DIR}/data)
# Where to install data in the install tree (a Default)
set(GEANT4_INSTALL_DATADIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}/data")
set(GEANT4_INSTALL_DATADIR_DEFAULT "${CMAKE_INSTALL_DATADIR}/data")
# File containing dataset list
set(GEANT4_DATASETS_DEFINITIONS "Geant4DatasetDefinitions")
@@ -596,7 +596,7 @@ endfunction()
# Choose Physics Data Install Dir
# This follows the pattern for interface and setting as in GNUInstallDirs
if(NOT GEANT4_INSTALL_DATADIR)
set(GEANT4_INSTALL_DATADIR "" CACHE PATH "read-only architecture independent Geant4 physics data (DATAROOTDIR/${GEANT4_INSTALL_DATADIR_DEFAULT}")
set(GEANT4_INSTALL_DATADIR "" CACHE PATH "read-only architecture independent Geant4 physics data (DATADIR/data")
set(GEANT4_INSTALL_DATADIR "${GEANT4_INSTALL_DATADIR_DEFAULT}")
endif()
-25
View File
@@ -1,25 +0,0 @@
# - Setup build of any language wrappers around Geant4 C++ libraries
#
# At present the only option here is Python!
# This is yet to be implemented although the general structure is in place
#
#-----------------------------------------------------------------------
# Optional build of Python wrappers (Geant4Py)
# -> Requires Global/Shared library build of Geant4
# -> Requires Boost.Python and Python libraries
#
#include(CMakeDependentOption)
#cmake_dependent_option(GEANT4_WRAP_PYTHON "Build Geant4 Python Wrapping Interface" OFF "NOT GEANT4_BUILD_GRANULAR_LIBS;BUILD_SHARED_LIBS" OFF)
#if(GEANT4_WRAP_PYTHON)
# We need Boost.Python and Python
# NB: Watch for FindPythonLibs picking up the static version...
# Known issue with CMake 2.6 module - see Bug #8389 and 2257 for details
# of fix
#find_package(Boost REQUIRED COMPONENTS python)
#find_package(PythonLibs REQUIRED)
#endif(GEANT4_WRAP_PYTHON)
#GEANT4_ADD_FEATURE(GEANT4_WRAP_PYTHON "Build Geant4 Python Wrapping Interface")