Import Geant4 11.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2021-12-10 14:46:44 +01:00
committed by Ben Morgan
parent 6399a014b6
commit 80e2389dd8
3932 changed files with 202519 additions and 246221 deletions
+86 -68
View File
@@ -11,108 +11,128 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS True)
endif()
include(G4GitUtilities)
include(InstallRequiredSystemLibraries)
#-----------------------------------------------------------------------
# General packaging setup - variable relevant to all package formats
#
set(CPACK_PACKAGE_DESCRIPTION "Geant4 Toolkit")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Geant4 Toolkit")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_BINARY_DIR}/README.txt")
set(CPACK_PACKAGE_VENDOR "Geant4 Collaboration")
# - Canonical versions
set(CPACK_PACKAGE_VERSION ${${PROJECT_NAME}_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${${PROJECT_NAME}_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${${PROJECT_NAME}_VERSION_PATCH})
# - Geant4 versions
# Canonical versions padded with zeros to two digits
function(geant4_pad_version _in _out)
string(LENGTH "${_in}" _vlength)
if(_vlength GREATER 1)
set(${_out} "${_in}" PARENT_SCOPE)
elseif(_vlength EQUAL 1)
set(${_out} "0${_in}" PARENT_SCOPE)
else()
set(${_out} "00" PARENT_SCOPE)
endif()
endfunction()
geant4_pad_version(${${PROJECT_NAME}_VERSION_MAJOR} ${PROJECT_NAME}_SOURCE_VERSION_MAJOR)
geant4_pad_version(${${PROJECT_NAME}_VERSION_MINOR} ${PROJECT_NAME}_SOURCE_VERSION_MINOR)
geant4_pad_version(${${PROJECT_NAME}_VERSION_PATCH} ${PROJECT_NAME}_SOURCE_VERSION_PATCH)
set(${PROJECT_NAME}_SOURCE_VERSION "${${PROJECT_NAME}_SOURCE_VERSION_MAJOR}.${${PROJECT_NAME}_SOURCE_VERSION_MINOR}.${${PROJECT_NAME}_SOURCE_VERSION_PATCH}")
# - Resource files
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_BINARY_DIR}/README.txt")
configure_file(LICENSE LICENSE.txt COPYONLY) # Suffix must be .txt
# Copy/Generate common resource files into formats CPack generators like
file(WRITE ${CMAKE_BINARY_DIR}/README.txt "
Geant4
======
A toolkit for the simulation of the passage of particles through matter.
Its areas of application include high energy, nuclear and accelerator
physics, as well as studies in medical and space science
(http://www.geant4.org).
Its areas of application include high energy, nuclear and accelerator physics, as well
as studies in medical and space science.
The two main reference papers for Geant4 are published in Nuclear
Instruments and Methods in Physics Research A 506 (2003) 250-303, and IEEE
Transactions on Nuclear Science 53 No. 1 (2006) 270-278.
For more information about how to use Geant4 and its application domains, please visit
the Geant4 website (https://cern.ch/geant4)
There are three main reference papers for Geant4:
- Nuclear Instruments and Methods in Physics Research A 835 (2016) 186-225
- http://www.sciencedirect.com/science/article/pii/S0168900216306957
- IEEE Transactions on Nuclear Science 53 No. 1 (2006) 270-278
- https://ieeexplore.ieee.org/xpls/abs_all.jsp?isnumber=33833&arnumber=1610988&count=33&index=7
- Nuclear Instruments and Methods in Physics Research A 506 (2003) 250-303
- http://www.sciencedirect.com/science/article/pii/S0168900203013688
This installer has been created using CPack (http://www.cmake.org).
")
configure_file(LICENSE LICENSE.txt COPYONLY) # Suffix must be .txt
#-----------------------------------------------------------------------
# General packaging setup - variables relevant to all package formats
#
set(CPACK_PACKAGE_NAME "geant4")
set(CPACK_PACKAGE_VENDOR "Geant4 Collaboration")
set(CPACK_PACKAGE_VERSION ${Geant4_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${Geant4_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${Geant4_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${Geant4_VERSION_PATCH})
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_BINARY_DIR}/README.txt")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Geant4-${Geant4_VERSION_MAJOR}.${Geant4_VERSION_MINOR}")
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/Templates/g4_small.bmp")
set(CPACK_PACKAGE_CHECKSUM "SHA256")
# - Common Resource files
set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/README.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_BINARY_DIR}/LICENSE.txt")
#-----------------------------------------------------------------------
# Source package settings
#
# - Use canonical Geant4 package naming convention
set(CPACK_SOURCE_PACKAGE_FILE_NAME "geant4.${Geant4_SOURCE_VERSION}")
# - Ensure all standard source packages are built
set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2;ZIP")
# - Use same source package naming as GitLab generates for tags
set(CPACK_SOURCE_PACKAGE_FILE_NAME "geant4-v${CPACK_PACKAGE_VERSION}")
set(CPACK_SOURCE_GENERATOR "TGZ;TXZ;ZIP")
set(CPACK_SOURCE_STRIP_FILES "")
# Exclude VCS and standard temporary files from the source package.
# Exclude development specific files and directories
# Not totally perfected yet!
# Exclude VCS, temp files, and development-only components from the source package.
set(CPACK_SOURCE_IGNORE_FILES
"${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/tests"
"${PROJECT_SOURCE_DIR}/ReleaseNotes/development"
"/test/"
"${PROJECT_BINARY_DIR}/"
".clang-format"
".clang-tidy"
"README.*"
"CONTRIBUTING.*"
"CODING_GUIDELINES.*"
"RELEASE_MANAGEMENT.rst"
"SHIFTERS.rst"
"/GitUtilities/"
"/tests/"
"/ReleaseNotes/development"
"/benchmarks/"
"/verification/"
"/test.*/"
"/doc.*/"
"/benchmark.*/"
"~$"
"/CVS/"
"/.svn/"
"/\\\\\\\\.svn/"
"/.git/"
".gitignore"
"/.github/"
"/.gitlab"
"/\\\\\\\\.git/"
"\\\\\\\\.swp$"
"\\\\\\\\.swp$"
"\\\\.swp"
"\\\\\\\\.#"
"/#"
)
"/#")
# Add any _configure time_ untracked files. Actual package build will warn/error out
# on any unknown ones. Due to an unknown quirk in CPack, changes to CPACK_SOURCE_IGNORE_FILES
# after inclusion of CPack (e.g. in `CPACK_PROJECT_CONFIG_FILE`) are not taken into account
# when CPack runs.
geant4_git_find_dirty(${PROJECT_SOURCE_DIR} __modded __untracked)
list(APPEND CPACK_SOURCE_IGNORE_FILES ${__untracked})
# Create and inject sources that require generation or otherwise including
configure_file(${PROJECT_SOURCE_DIR}/README.rst _source_extras/README.rst COPYONLY)
if(EXISTS "${PROJECT_SOURCE_DIR}/CONTRIBUTING_GitHub.rst")
configure_file(${PROJECT_SOURCE_DIR}/CONTRIBUTING_GitHub.rst _source_extras/CONTRIBUTING.rst COPYONLY)
else()
configure_file(${PROJECT_SOURCE_DIR}/CONTRIBUTING.rst _source_extras/CONTRIBUTING.rst COPYONLY)
endif()
configure_file(
cmake/Templates/source_package_extras.cmake.in
source_package_extras.cmake
@ONLY)
list(APPEND CPACK_INSTALL_SCRIPTS "${CMAKE_CURRENT_BINARY_DIR}/source_package_extras.cmake")
#-----------------------------------------------------------------------
# Binary package setup
# Binary package common settings
#
set(CPACK_PACKAGE_RELOCATABLE True)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Geant4 ${Geant4_VERSION_MAJOR}.${Geant4_VERSION_MINOR}")
if(CMAKE_BUILD_TYPE STREQUAL Release)
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${Geant4_VERSION}-${CMAKE_SYSTEM_NAME}")
else()
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${Geant4_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_BUILD_TYPE}")
endif()
set(CPACK_PACKAGE_RELOCATABLE ${CMAKE_INSTALL_IS_NONRELOCATABLE})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Geant4-${Geant4_VERSION_MAJOR}.${Geant4_VERSION_MINOR}")
if(WIN32)
set(CPACK_GENERATOR "NSIS;ZIP")
elseif(APPLE)
set(CPACK_GENERATOR "PackageMaker;TGZ")
set(CPACK_GENERATOR "productbuild;TGZ")
else()
set(CPACK_GENERATOR "STGZ;TGZ")
endif()
@@ -127,8 +147,6 @@ configure_file(
@ONLY
)
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake)
# FINAL step - include base CPack
include(CPack)
#-----------------------------------------------------------------------