Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
+87
-1
@@ -29,8 +29,94 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
09 November 2021 - Ben Morgan (cmake-V10-07-53)
|
||||
- Only configure public release contribution guide if present
|
||||
|
||||
30 November 2021 - Ivana Hrivnacova (cmake-V10-07-52)
|
||||
- Removed FindAIDA.cmake from Modules
|
||||
|
||||
29 November 2021 - Ben Morgan (cmake-V10-07-51)
|
||||
- Require VecGeom 1.1.18 or newer
|
||||
- Configure/find Vtk alongside other UI/Vis options
|
||||
|
||||
26 November 2021 - Ben Morgan (cmake-V10-07-50)
|
||||
- Strip .git{ignore,lab,hub} files/dirs from source package
|
||||
- Use XZ compression instead of BZIP for source package
|
||||
|
||||
22 November 2021 - Ben Morgan (cmake-V10-07-49)
|
||||
- Improve/modernize CPack source packaging
|
||||
|
||||
12 November 2021 - Ben Morgan (cmake-V10-07-48)
|
||||
- Retire G4VIS_... preprocessor symbols in toolkit build, only required
|
||||
by obsolete GNUmake system
|
||||
|
||||
8 November 2021 - Ben Morgan (cmake-V10-07-47)
|
||||
- Retire G4UI/G4INTY_... preprocessor symbols in toolkit build, only required
|
||||
by obsolete GNUmake system
|
||||
|
||||
2 November 2021 - Gunter Folger (cmake-V10-07-46)
|
||||
- switch to new dataset G4EMLOW8.0, given by Vladimir
|
||||
|
||||
27 October 2021 - Guy Barrand (cmake-V10-07-45)
|
||||
- Modules/G4DeveloperAPI.cmake: ToolsSG => G4ToolsSG in the list of Qt moc-able modules.
|
||||
|
||||
25/27/28 October 2021 - Gunter Folger (cmake-V10-07-44)
|
||||
- switch to new dataset G4TENDL1.4 provided by Alberto
|
||||
|
||||
22 October 2021 - Guy Barrand (cmake-V10-07-43)
|
||||
- Modules/G4DeveloperAPI.cmake: have ToolsSG as a Qt moc-able module.
|
||||
|
||||
13 October 2021 - Ben Morgan (cmake-V10-07-42)
|
||||
- Add XercesC library directory to Linux LD_LIBRARY_PATH for GNUmake.
|
||||
Workaround for incorrect setup on LCG stacks for Nightly builds
|
||||
|
||||
12 October 2021 - Ben Morgan (cmake-V10-07-41)
|
||||
- Make ToolsSG options mutually exclusive
|
||||
|
||||
04 October 2021 - Stewart Boogert / Laurie Nevay (cmake-V10-07-40)
|
||||
- Add options and find module for VTK visualisation driver
|
||||
|
||||
27 September 2021 - Ben Morgan (cmake-V10-07-39)
|
||||
- Change default value of GEANT4_BUILD_MULTITHREADED to ON
|
||||
|
||||
22 September 2021 - Guilherme Amadio (cmake-V10-07-38)
|
||||
- geant4_add_test:
|
||||
- Ensure that Geant4 being built is picked up to build examples.
|
||||
- Ensure that the same compiler is used to build the tests.
|
||||
|
||||
13 September 2021 - Gabriele Cosmo (cmake-V10-04-37)
|
||||
- Set CLHEP-2.4.5.1 as the required minimum version.
|
||||
|
||||
3 September 2021 - Ben Morgan (cmake-V10-04-36)
|
||||
- geant4_add_test creates separate build/run tests when asked to do both
|
||||
- Required to support valgrind/memcheck runs without valgrind-ing
|
||||
the build part of the test.
|
||||
|
||||
1 September 2021 - Ben Morgan (cmake-V10-04-35)
|
||||
- Remove obsolete geant4_{executable,link_library} options
|
||||
|
||||
26 August 2021 - Ben Morgan (cmake-V10-07-34)
|
||||
- Remove obsolete network VRML driver option
|
||||
- Remove obsolete network FukuiRenderer driver option
|
||||
|
||||
23 August 2021 - Guilherme Amadio (cmake-V10-07-33)
|
||||
- Rename Geant4::HDF5 to hdf5::hdf5 to be compatible with
|
||||
imported target provided since CMake 3.20.
|
||||
|
||||
20 August 2021 - Gunter Folger (cmake-V10-07-32)
|
||||
- Switch to G4ParticleXS 4.0
|
||||
|
||||
22 July 2021 - Ivana Hrivnacova (cmake-V10-07-31)
|
||||
- Fixed path to g4tools/fonts, now in source/externals
|
||||
|
||||
30 June 2021 - Ben Morgan (cmake-V10-07-30)
|
||||
- Remove obsolete GEANT4_USE_SYSTEM_CLHEP_GRANULAR option
|
||||
|
||||
29 June 2021 - Ben Morgan (cmake-V10-07-29)
|
||||
- Disable creation of clang-formatting targets
|
||||
|
||||
21 June 2021 - Julia Yarba (cmake-V10-07-28)
|
||||
- Clean cmake/Modules/FindPythia8.cmake
|
||||
- Clean cmake/Modules/FindPythia8.cmake
|
||||
(remove trailing whitespaces)
|
||||
|
||||
18 June 2021 - Julia Yarba (cmake-V10-07-27)
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
# - Finds AIDA instalation
|
||||
# This module sets up AIDA information
|
||||
# It defines:
|
||||
# AIDA_FOUND If the AIDA is found
|
||||
# AIDA_INCLUDE_DIR PATH to the include directory
|
||||
# AIDA_LIBRARIES AIDA installation libraries
|
||||
# AIDA_IMPLEMENTATION The implementation of AIDA found
|
||||
|
||||
find_program(AIDA_CONFIG_EXECUTABLE aida-config)
|
||||
|
||||
if(NOT AIDA_CONFIG_EXECUTABLE)
|
||||
set(AIDA_FOUND FALSE)
|
||||
else()
|
||||
set(AIDA_FOUND TRUE)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${AIDA_CONFIG_EXECUTABLE} --include
|
||||
OUTPUT_VARIABLE AIDA_INCLUDE_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
#remove -I prefix
|
||||
string(REGEX REPLACE "-I" "" AIDA_INCLUDE_DIR "${AIDA_INCLUDE_DIR}")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${AIDA_CONFIG_EXECUTABLE} --libs
|
||||
OUTPUT_VARIABLE AIDA_LIBRARIES
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${AIDA_CONFIG_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE AIDA_VERSION
|
||||
ERROR_VARIABLE AIDA_VERSION_ERROR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${AIDA_CONFIG_EXECUTABLE} --implementation
|
||||
OUTPUT_VARIABLE AIDA_IMPLEMENTATION
|
||||
ERROR_VARIABLE AIDA_IMPLEMENTATION_ERROR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
# Make variables changeble to the advanced user
|
||||
mark_as_advanced(AIDA_CONFIG_EXECUTABLE)
|
||||
|
||||
if(NOT AIDA_FIND_QUIETLY)
|
||||
set (OUTPUT "Found AIDA")
|
||||
if (AIDA_VERSION)
|
||||
set (OUTPUT "${OUTPUT} ${AIDA_VERSION}")
|
||||
endif()
|
||||
if (AIDA_IMPLEMENTATION)
|
||||
set (OUTPUT "${OUTPUT} implemented by ${AIDA_IMPLEMENTATION}")
|
||||
endif()
|
||||
message(STATUS "${OUTPUT}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -285,7 +285,7 @@ endif()
|
||||
# If set to ``ON``, compile Geant4 with support for multithreading.
|
||||
# On Win32, this option requires use of static libraries only
|
||||
#
|
||||
option(GEANT4_BUILD_MULTITHREADED "Enable multithreading in Geant4" OFF)
|
||||
option(GEANT4_BUILD_MULTITHREADED "Enable multithreading in Geant4" ON)
|
||||
geant4_add_feature(GEANT4_BUILD_MULTITHREADED "Build multithread enabled libraries")
|
||||
|
||||
#.rst:
|
||||
|
||||
+86
-68
@@ -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)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -39,7 +39,7 @@ if(GEANT4_ENABLE_TESTING)
|
||||
|
||||
# - Add TOOLS_FONT_PATH if freetype enabled
|
||||
if(GEANT4_USE_FREETYPE)
|
||||
list(APPEND GEANT4_TEST_ENVIRONMENT TOOLS_FONT_PATH=${PROJECT_SOURCE_DIR}/source/analysis/fonts)
|
||||
list(APPEND GEANT4_TEST_ENVIRONMENT TOOLS_FONT_PATH=${PROJECT_SOURCE_DIR}/source/externals/g4tools/fonts)
|
||||
endif()
|
||||
|
||||
# - Configure 'G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default)'
|
||||
|
||||
@@ -2,26 +2,22 @@
|
||||
# G4ClangFormat
|
||||
# =============
|
||||
#
|
||||
# Functions and helper targets for formatting sources of a target using
|
||||
# Functions and helper targets for formatting sources of a target using
|
||||
# clang-format
|
||||
|
||||
# - Include guard
|
||||
if(NOT __G4CLANGFORMAT_INCLUDED)
|
||||
set(__G4CLANGFORMAT_INCLUDED 1)
|
||||
else()
|
||||
return()
|
||||
endif()
|
||||
include_guard(DIRECTORY)
|
||||
|
||||
# Default logging directory
|
||||
set(G4FORMAT_LOGDIR ${PROJECT_BINARY_DIR}/format CACHE PATH
|
||||
"Output folder of files that are formatted")
|
||||
"Output folder of files that are formatted")
|
||||
|
||||
# Find clang-format (optional)
|
||||
find_program(CLANG_FORMATTER NAMES
|
||||
clang-format-6 # prefer clang-format version 6.0
|
||||
clang-format-6.0
|
||||
clang-format-mp-6.0 # Apple macports version
|
||||
clang-format)
|
||||
clang-format-6 # prefer clang-format version 6.0
|
||||
clang-format-6.0
|
||||
clang-format-mp-6.0 # Apple macports version
|
||||
clang-format)
|
||||
|
||||
function(exclude_from_format)
|
||||
cmake_parse_arguments(ARG "" "" "HEADERS;SOURCES;FILES" ${ARGN})
|
||||
@@ -50,8 +46,7 @@ endfunction()
|
||||
|
||||
function(create_format_directory)
|
||||
if(NOT EXISTS ${G4FORMAT_LOGDIR})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND}
|
||||
-E make_directory ${G4FORMAT_LOGDIR})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${G4FORMAT_LOGDIR})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -103,7 +98,7 @@ function(geant4_format_target)
|
||||
# add to list to be processed
|
||||
list(APPEND SOURCES ${_SOURCE})
|
||||
endforeach()
|
||||
|
||||
|
||||
# write format file
|
||||
set(FMTLOG_OUT ${G4FORMAT_LOGDIR}/${G4TARGET_NAME}.txt)
|
||||
file(WRITE ${FMTLOG_OUT} "${FILELOG}")
|
||||
|
||||
@@ -200,7 +200,7 @@ configure_file(
|
||||
)
|
||||
|
||||
|
||||
foreach(_mod AIDA HepMC Pythia6 Pythia8 StatTest TBB XQuartzGL)
|
||||
foreach(_mod HepMC Pythia6 Pythia8 StatTest TBB XQuartzGL)
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/Find${_mod}.cmake
|
||||
${PROJECT_BINARY_DIR}/Modules/Find${_mod}.cmake
|
||||
|
||||
@@ -509,13 +509,7 @@ macro(_g4tc_configure_tc_variables SHELL_FAMILY SCRIPT_NAME)
|
||||
# Have to use detected CLHEP paths to set base dir and others
|
||||
get_filename_component(_CLHEP_INCLUDE_DIR "${CLHEP_INCLUDE_DIR}" REALPATH)
|
||||
get_filename_component(_CLHEP_BASE_DIR "${_CLHEP_INCLUDE_DIR}" DIRECTORY)
|
||||
|
||||
# Handle granular vs singular cases
|
||||
if(GEANT4_USE_SYSTEM_CLHEP_GRANULAR)
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::Vector LOCATION)
|
||||
else()
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::CLHEP LOCATION)
|
||||
endif()
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::CLHEP LOCATION)
|
||||
|
||||
get_filename_component(_CLHEP_LIB_DIR "${_CLHEP_LIB_DIR}" REALPATH)
|
||||
get_filename_component(_CLHEP_LIB_DIR "${_CLHEP_LIB_DIR}" DIRECTORY)
|
||||
@@ -525,21 +519,6 @@ macro(_g4tc_configure_tc_variables SHELL_FAMILY SCRIPT_NAME)
|
||||
_g4tc_setenv_command(GEANT4_TC_CLHEP_INCLUDE_DIR ${SHELL_FAMILY} CLHEP_INCLUDE_DIR "${_CLHEP_INCLUDE_DIR}")
|
||||
|
||||
# Only need to handle CLHEP_LIB for granular case
|
||||
if(GEANT4_USE_SYSTEM_CLHEP_GRANULAR)
|
||||
set(G4_SYSTEM_CLHEP_LIBRARIES )
|
||||
foreach(_clhep_lib ${CLHEP_LIBRARIES})
|
||||
get_target_property(_CLHEP_LIB_NAME ${_clhep_lib} LOCATION)
|
||||
get_filename_component(_curlib "${_CLHEP_LIB_NAME}" NAME)
|
||||
string(REGEX REPLACE "^lib(.*)\\.(so|a|dylib|lib|dll)$" "\\1" _curlib "${_curlib}")
|
||||
set(G4_SYSTEM_CLHEP_LIBRARIES "${G4_SYSTEM_CLHEP_LIBRARIES} -l${_curlib}")
|
||||
endforeach()
|
||||
|
||||
# Strip first "-l" as that's prepended by Geant4Make
|
||||
string(REGEX REPLACE "^ *\\-l" "" G4_SYSTEM_CLHEP_LIBRARIES "${G4_SYSTEM_CLHEP_LIBRARIES}")
|
||||
|
||||
_g4tc_setenv_command(GEANT4_TC_CLHEP_LIB ${SHELL_FAMILY} CLHEP_LIB "\"${G4_SYSTEM_CLHEP_LIBRARIES}\"")
|
||||
endif()
|
||||
|
||||
_g4tc_setenv_command(GEANT4_TC_CLHEP_LIB_DIR ${SHELL_FAMILY} CLHEP_LIB_DIR ${_CLHEP_LIB_DIR})
|
||||
|
||||
|
||||
@@ -582,6 +561,12 @@ macro(_g4tc_configure_tc_variables SHELL_FAMILY SCRIPT_NAME)
|
||||
# variable...
|
||||
get_filename_component(_xercesc_root ${XercesC_INCLUDE_DIR} PATH)
|
||||
_g4tc_setenv_command(GEANT4_TC_GDML_PATH_SETUP ${SHELL_FAMILY} XERCESCROOT ${_xercesc_root})
|
||||
|
||||
# Needed temporarily to workaround issue on LCG setups
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
get_filename_component(_xercesc_libdir ${XercesC_LIBRARY_RELEASE} DIRECTORY)
|
||||
_g4tc_prepend_path(GEANT4_TC_XERCESC_LIB_PATH_SETUP ${SHELL_FAMILY} LD_LIBRARY_PATH ${_xercesc_libdir})
|
||||
endif()
|
||||
else()
|
||||
set(GEANT4_TC_G4LIB_USE_GDML "# NOT BUILT WITH GDML SUPPORT")
|
||||
endif()
|
||||
@@ -650,20 +635,6 @@ macro(_g4tc_configure_tc_variables SHELL_FAMILY SCRIPT_NAME)
|
||||
set(GEANT4_TC_G4UI_USE_XM "# NOT BUILT WITH XM INTERFACE")
|
||||
endif()
|
||||
|
||||
# - Network DAWN
|
||||
if(GEANT4_USE_NETWORKDAWN)
|
||||
_g4tc_setenv_command(GEANT4_TC_G4VIS_USE_DAWN ${SHELL_FAMILY} G4VIS_USE_DAWN 1)
|
||||
else()
|
||||
set(GEANT4_TC_G4VIS_USE_DAWN "# NOT BUILT WITH NETWORK DAWN SUPPORT")
|
||||
endif()
|
||||
|
||||
# - Network VRML
|
||||
if(GEANT4_USE_NETWORKVRML)
|
||||
_g4tc_setenv_command(GEANT4_TC_G4VIS_USE_VRML ${SHELL_FAMILY} G4VIS_USE_VRML 1)
|
||||
else()
|
||||
set(GEANT4_TC_G4VIS_USE_VRML "# NOT BUILT WITH NETWORK VRML SUPPORT")
|
||||
endif()
|
||||
|
||||
# - OpenInventor
|
||||
if(GEANT4_USE_INVENTOR)
|
||||
if(UNIX)
|
||||
@@ -766,7 +737,7 @@ endmacro()
|
||||
#
|
||||
set(G4SYSTEM "${GEANT4_SYSTEM}-${GEANT4_COMPILER}")
|
||||
set(G4INSTALL ${PROJECT_SOURCE_DIR})
|
||||
set(G4INCLUDE ${PROJECT_SOURCE_DIR}/this_is_a_deliberate_dummy_path)
|
||||
set(G4INCLUDE ${PROJECT_BINARY_DIR}/this_is_a_deliberate_dummy_path)
|
||||
set(G4BIN_DIR ${PROJECT_BINARY_DIR})
|
||||
set(G4LIB ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
set(G4LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
@@ -781,7 +752,7 @@ foreach(_ds ${GEANT4_EXPORTED_DATASETS})
|
||||
endforeach()
|
||||
|
||||
# - Fonts
|
||||
set(TOOLS_FONT_PATH "${PROJECT_SOURCE_DIR}/source/analysis/fonts")
|
||||
set(TOOLS_FONT_PATH "${PROJECT_SOURCE_DIR}/source/externals/g4tools/fonts")
|
||||
|
||||
# - Configure the shell scripts for the BUILD TREE
|
||||
_g4tc_configure_build_tree_scripts(geant4make)
|
||||
@@ -965,12 +936,7 @@ foreach(_shell IN LISTS shells_list)
|
||||
set(GEANT4_TC_CLHEP_LIB_PATH_SETUP "# - Builtin CLHEP used")
|
||||
if(GEANT4_USE_SYSTEM_CLHEP)
|
||||
# Handle granular vs singular cases
|
||||
if(GEANT4_USE_SYSTEM_CLHEP_GRANULAR)
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::Vector LOCATION)
|
||||
else()
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::CLHEP LOCATION)
|
||||
endif()
|
||||
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::CLHEP LOCATION)
|
||||
get_filename_component(_CLHEP_LIB_DIR "${_CLHEP_LIB_DIR}" REALPATH)
|
||||
get_filename_component(_CLHEP_LIB_DIR "${_CLHEP_LIB_DIR}" DIRECTORY)
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ geant4_add_dataset(
|
||||
# - Low energy electromagnetics
|
||||
geant4_add_dataset(
|
||||
NAME G4EMLOW
|
||||
VERSION 7.17
|
||||
VERSION 8.0
|
||||
FILENAME G4EMLOW
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4LEDATA
|
||||
MD5SUM 7cc8360a78fe6d501cdf34a945e71a25
|
||||
MD5SUM 6795805f39ac73a71333276756004d99
|
||||
)
|
||||
|
||||
# - Photon evaporation
|
||||
@@ -48,11 +48,11 @@ geant4_add_dataset(
|
||||
# - Particle XS - replaces Neutron XS
|
||||
geant4_add_dataset(
|
||||
NAME G4PARTICLEXS
|
||||
VERSION 3.1.1
|
||||
VERSION 4.0
|
||||
FILENAME G4PARTICLEXS
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4PARTICLEXSDATA
|
||||
MD5SUM 98b766fa2c447b541834cc9bf5206c05
|
||||
MD5SUM d82a4d171d50f55864e28b6cd6f433c0
|
||||
)
|
||||
|
||||
# - PII
|
||||
@@ -123,11 +123,11 @@ mark_as_advanced(GEANT4_INSTALL_DATASETS_TENDL)
|
||||
if(GEANT4_INSTALL_DATASETS_TENDL)
|
||||
geant4_add_dataset(
|
||||
NAME G4TENDL
|
||||
VERSION 1.3.2
|
||||
VERSION 1.4
|
||||
FILENAME G4TENDL
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4PARTICLEHPDATA
|
||||
MD5SUM 209f878b777a36842d20a47ca53c6f93
|
||||
MD5SUM ab17a1eec5ad4c8fcfafcfbc0de30ed8
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -35,14 +35,7 @@
|
||||
#
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
if(NOT __G4DEVELOPERAPI_INCLUDED)
|
||||
set(__G4DEVELOPERAPI_INCLUDED TRUE)
|
||||
else()
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Needed modules
|
||||
include(G4ClangFormat)
|
||||
include_guard(DIRECTORY)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
#.rst:
|
||||
@@ -579,13 +572,12 @@ function(geant4_define_module)
|
||||
cmake_parse_arguments(G4DEFMOD
|
||||
""
|
||||
"NAME"
|
||||
"HEADERS;SOURCES;GRANULAR_DEPENDENCIES;GLOBAL_DEPENDENCIES;LINK_LIBRARIES;HEADERS_EXCLUDE_FORMAT;SOURCES_EXCLUDE_FORMAT"
|
||||
"HEADERS;SOURCES;GRANULAR_DEPENDENCIES;GLOBAL_DEPENDENCIES;LINK_LIBRARIES"
|
||||
${ARGN}
|
||||
)
|
||||
__geant4_assert_no_unparsed_arguments(G4DEFMOD geant4_define_module)
|
||||
# HEADERS -> PUBLIC_HEADERS
|
||||
# SOURCES -> SOURCES
|
||||
# Don't support clang-formatting yet.
|
||||
geant4_add_module(${G4DEFMOD_NAME}
|
||||
PUBLIC_HEADERS ${G4DEFMOD_HEADERS}
|
||||
SOURCES ${G4DEFMOD_SOURCES}
|
||||
@@ -608,7 +600,7 @@ function(geant4_define_module)
|
||||
|
||||
# When we are ready, start issuing a deprecation warning here, including instructions for
|
||||
# migration...
|
||||
# message(WARNING "Use of geant4_define_module is deprecated, please use... instead")
|
||||
#message(WARNING "Use of geant4_define_module is deprecated, please use... instead")
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
@@ -699,8 +691,6 @@ function(geant4_library_target)
|
||||
message(FATAL_ERROR "geant4_library_target called for '${G4GLOBLIB_NAME}' in '${CMAKE_CURRENT_LIST_DIR}'")
|
||||
endif()
|
||||
|
||||
geant4_format_target(NAME ${G4GLOBLIB_NAME}-format SOURCES ${G4GLOBLIB_SOURCES})
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(${G4GLOBLIB_NAME} SHARED ${G4GLOBLIB_SOURCES})
|
||||
add_library(Geant4::${G4GLOBLIB_NAME} ALIAS ${G4GLOBLIB_NAME})
|
||||
@@ -938,9 +928,6 @@ function(__geant4_add_library _name _type)
|
||||
set_target_properties(${_target_name} PROPERTIES OUTPUT_NAME ${_name})
|
||||
endif()
|
||||
|
||||
# Compose target sources and links from its constituent modules
|
||||
set(__sources_to_format)
|
||||
|
||||
get_property(__g4modules GLOBAL PROPERTY GEANT4_CATEGORIES_${_name}_MODULES)
|
||||
foreach(__g4mod ${__g4modules})
|
||||
# - Process sources...
|
||||
@@ -948,11 +935,6 @@ function(__geant4_add_library _name _type)
|
||||
geant4_get_module_property(_srcs ${__g4mod} SOURCES)
|
||||
geant4_get_module_property(_cmakescript ${__g4mod} CMAKE_LIST_FILE)
|
||||
|
||||
# Store sources to be formatted (one mode only)
|
||||
if(_type STREQUAL "SHARED")
|
||||
list(APPEND __sources_to_format ${_headers} ${_srcs})
|
||||
endif()
|
||||
|
||||
# - Group sources and scripts for IDEs
|
||||
# NB: Seemingly has to be done at same level we define target.
|
||||
# TODO: If lib name is same as mod name, don't group avoid extra
|
||||
@@ -1019,20 +1001,15 @@ function(__geant4_add_library _name _type)
|
||||
endforeach()
|
||||
|
||||
# Temp workaround for modules needing Qt. We use AUTOMOC, but can't yet set
|
||||
# it on a per module basis. However, only have three modules that require
|
||||
# it on a per module basis. However, only have four modules that require
|
||||
# moc-ing, so hard code for now.
|
||||
# TODO: likely need an additional "module target properties" to hold things
|
||||
# that can be passed to set_target_properties
|
||||
if(__g4mod MATCHES "G4UIbasic|G4OpenGL|G4OpenInventor" AND GEANT4_USE_QT)
|
||||
if(__g4mod MATCHES "G4UIbasic|G4OpenGL|G4OpenInventor|G4ToolsSG" AND GEANT4_USE_QT)
|
||||
set_target_properties(${_target_name} PROPERTIES AUTOMOC ON)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# - Use stored total list of sources to create format target for one mode only
|
||||
if(_type STREQUAL "SHARED")
|
||||
geant4_format_target(NAME ${_name}-format SOURCES ${__sources_to_format})
|
||||
endif()
|
||||
|
||||
# - Postprocess target properties to remove duplicates
|
||||
# NB: This makes the assumption that there is no order dependence here (and any is considered a bug!)
|
||||
# CMake will handle static link ordering internally
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#.rst:
|
||||
# G4GitUtilities
|
||||
# --------------
|
||||
#
|
||||
# .. code-block::cmake
|
||||
#
|
||||
# include(G4GitUtilities)
|
||||
#
|
||||
# CMake functions and macros for working with Git where needed in
|
||||
# Geant4's build/packaging systems.
|
||||
#
|
||||
|
||||
#-----------------------------------------------------------------
|
||||
# License and Disclaimer
|
||||
#
|
||||
# The Geant4 software is copyright of the Copyright Holders of
|
||||
# the Geant4 Collaboration. It is provided under the terms and
|
||||
# conditions of the Geant4 Software License, included in the file
|
||||
# LICENSE and available at http://cern.ch/geant4/license . These
|
||||
# include a list of copyright holders.
|
||||
#
|
||||
# Neither the authors of this software system, nor their employing
|
||||
# institutes,nor the agencies providing financial support for this
|
||||
# work make any representation or warranty, express or implied,
|
||||
# regarding this software system or assume any liability for its
|
||||
# use. Please see the license in the file LICENSE and URL above
|
||||
# for the full disclaimer and the limitation of liability.
|
||||
#
|
||||
# This code implementation is the result of the scientific and
|
||||
# technical work of the GEANT4 collaboration.
|
||||
# By using, copying, modifying or distributing the software (or
|
||||
# any work based on the software) you agree to acknowledge its
|
||||
# use in resulting scientific publications, and indicate your
|
||||
# acceptance of all terms of the Geant4 Software license.
|
||||
#
|
||||
#-----------------------------------------------------------------
|
||||
|
||||
include_guard(GLOBAL)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
#.rst:
|
||||
# .. cmake:command:: geant4_git_find_dirty
|
||||
#
|
||||
# .. code-block:: cmake
|
||||
#
|
||||
# geant4_git_find_dirty(<basedir> <modified> <untracked>)
|
||||
#
|
||||
# Runs ``git status`` in the ``<basedir>``, writing lists of modified
|
||||
# and untracked/ignored files to ``<modified>`` and ``<untracked>``
|
||||
# respectively.
|
||||
#
|
||||
# ``<basedir>`` must be the root of the repository queried, i.e. containing
|
||||
# the ``.git/`` directory.
|
||||
#
|
||||
# Nothing is returned in the output variables if ``<basedir>`` is not a
|
||||
# git repository or if a ``git`` executable cannot be located.
|
||||
#
|
||||
function(geant4_git_find_dirty _basedir _output_modified _output_untracked)
|
||||
if(NOT EXISTS "${_basedir}/.git")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(Git QUIET)
|
||||
if(NOT Git_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} status -s --ignored
|
||||
WORKING_DIRECTORY "${_basedir}"
|
||||
OUTPUT_VARIABLE GEANT4_GIT_UNTRACKED
|
||||
ERROR_VARIABLE GEANT4_GIT_UNTRACKED_ERROR)
|
||||
|
||||
if(GEANT4_GIT_UNTRACKED_ERROR)
|
||||
message(FATAL_ERROR "geant4_git_find_dirty: Calling `git status` failed with error: '${GEANT4_GIT_UNTRACKED_ERROR}'")
|
||||
endif()
|
||||
|
||||
if(GEANT4_GIT_UNTRACKED)
|
||||
set(_modded_files)
|
||||
set(_untracked_files)
|
||||
|
||||
string(REPLACE "\n" ";" GEANT4_GIT_UNTRACKED "${GEANT4_GIT_UNTRACKED}")
|
||||
foreach(item ${GEANT4_GIT_UNTRACKED})
|
||||
if(item MATCHES "^ *(M|A|R|D|C)")
|
||||
string(REGEX REPLACE "^ *[MARDC][MARDC] *" "" _modded_path "${item}")
|
||||
list(APPEND _modded_files ${_modded_path})
|
||||
endif()
|
||||
|
||||
if(item MATCHES "^ *(\\!|\\?)")
|
||||
string(REGEX REPLACE "^ *(\\!\\!|\\?\\?) *" "" _untracked_path "${item}")
|
||||
list(APPEND _untracked_files "${_untracked_path}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(${_output_modified} ${_modded_files} PARENT_SCOPE)
|
||||
set(${_output_untracked} ${_untracked_files} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,10 +1,10 @@
|
||||
# - G4HDF5Shim
|
||||
# - G4HDF5Shim
|
||||
#
|
||||
# Geant4's Geant4Config.cmake file aims to support CMake 3.8 and newer
|
||||
# The HDF5 dependency is located through CMake's builtin FindHDF5
|
||||
# module, but this does not supply imported targets as of CMake 3.16.
|
||||
# module, but this does not supply imported targets until CMake 3.20.
|
||||
# It may use HDF5's hdf5-config.cmake file if available, so create
|
||||
# custom imported target Geant4::HDF5 to allow both cases to be handled
|
||||
# custom imported target hdf5::hdf5 to allow both cases to be handled
|
||||
# without interference with either.
|
||||
|
||||
if(HDF5_FOUND)
|
||||
@@ -24,18 +24,18 @@ if(HDF5_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# As FindHDF5 does not yet supply imported targets, we
|
||||
# If FindHDF5 does not yet supply imported targets, we
|
||||
# create an internal INTERFACE target to wrap these.
|
||||
# This still hard-codes include/library paths, but limits it
|
||||
# to one place. Later, we'll create proper imported targets
|
||||
# with re-finds but for now this is the best minimally invasive proceedure
|
||||
if(NOT TARGET Geant4::HDF5)
|
||||
add_library(Geant4::HDF5 IMPORTED UNKNOWN)
|
||||
set_target_properties(Geant4::HDF5 PROPERTIES
|
||||
if(NOT TARGET hdf5::hdf5)
|
||||
add_library(hdf5::hdf5 IMPORTED UNKNOWN)
|
||||
set_target_properties(hdf5::hdf5 PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${HDF5_C_LIBRARY_hdf5}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${HDF5_C_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${HDF5_C_LIBRARIES}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -56,33 +56,55 @@ if(GEANT4_USE_INVENTOR_QT)
|
||||
set(GEANT4_USE_INVENTOR ON)
|
||||
endif()
|
||||
|
||||
# - Qt (may be required by Coin driver)
|
||||
# - ToolsSG/Xt/X11/Qt/Win
|
||||
# Though this option has platform differences, we configure here because it can
|
||||
# trigger the Qt requirement
|
||||
if(WIN32)
|
||||
set(_g4_toolssg_backends "OFF" "WIN32")
|
||||
else()
|
||||
# TODO: Difference between X11, XT?
|
||||
set(_g4_toolssg_backends "OFF" "X11" "XT" "QT")
|
||||
endif()
|
||||
|
||||
enum_option(GEANT4_USE_TOOLSSG
|
||||
DOC "Build Geant4 ToolsSG Visualization Driver with Backend"
|
||||
VALUES ${_g4_toolssg_backends}
|
||||
)
|
||||
geant4_add_feature(GEANT4_USE_TOOLSSG "Build ToolsSG Visualization Driver with backend '${GEANT4_USE_TOOLSSG}'")
|
||||
|
||||
foreach(_tsg_backend IN LISTS _g4_toolssg_backends)
|
||||
set(GEANT4_USE_TOOLSSG_${_tsg_backend}_GLES OFF)
|
||||
if(_tsg_backend STREQUAL GEANT4_USE_TOOLSSG)
|
||||
set(GEANT4_USE_TOOLSSG_${_tsg_backend}_GLES ON)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# - Qt (may be required by Coin/ToolsSG driver)
|
||||
option(GEANT4_USE_QT "Build Geant4 with Qt support" OFF)
|
||||
if(GEANT4_USE_INVENTOR_QT AND NOT GEANT4_USE_QT)
|
||||
if((GEANT4_USE_INVENTOR_QT OR GEANT4_USE_TOOLSSG_QT_GLES) AND NOT GEANT4_USE_QT)
|
||||
set(GEANT4_USE_QT ON CACHE BOOL "Build Geant4 with Qt support" FORCE)
|
||||
message(STATUS "Forcing GEANT4_USE_QT to ON, required by GEANT4_USE_INVENTOR_QT")
|
||||
message(STATUS "Forcing GEANT4_USE_QT to ON, required by Inventor/ToolsSG Driver(s)")
|
||||
endif()
|
||||
|
||||
geant4_add_feature(GEANT4_USE_QT "Build Geant4 with Qt support")
|
||||
|
||||
# - Vtk
|
||||
option(GEANT4_USE_VTK "Build Geant4 with VTK visualisation" OFF)
|
||||
mark_as_advanced(GEANT4_USE_VTK)
|
||||
if(GEANT4_USE_VTK)
|
||||
find_package(VTK 8.2 REQUIRED)
|
||||
endif()
|
||||
|
||||
geant4_add_feature(GEANT4_USE_VTK "Using VTK for visualisation (EXPERIMENTAL)")
|
||||
|
||||
# - Unix only
|
||||
if(UNIX)
|
||||
# - Client/Server DAWN driver
|
||||
# mark as advanced because user should know what they're doing here
|
||||
option(GEANT4_USE_NETWORKDAWN "Build Dawn driver with Client/Server support" OFF)
|
||||
geant4_add_feature(GEANT4_USE_NETWORKDAWN "Build Dawn driver with Client/Server support")
|
||||
mark_as_advanced(GEANT4_USE_NETWORKDAWN)
|
||||
|
||||
# - Client/Server VRML driver
|
||||
option(GEANT4_USE_NETWORKVRML "Build VRML driver with Client/Server support" OFF)
|
||||
geant4_add_feature(GEANT4_USE_NETWORKVRML "Build VRML driver with Client/Server support")
|
||||
mark_as_advanced(GEANT4_USE_NETWORKVRML)
|
||||
|
||||
# - Motif UI/Vis (may be required by Coin Vis driver)
|
||||
option(GEANT4_USE_XM "Build Geant4 with Motif (X11) support" OFF)
|
||||
if(GEANT4_USE_INVENTOR AND NOT GEANT4_USE_INVENTOR_QT AND NOT GEANT4_USE_XM)
|
||||
if((GEANT4_USE_INVENTOR AND NOT GEANT4_USE_INVENTOR_QT)
|
||||
AND NOT GEANT4_USE_XM)
|
||||
set(GEANT4_USE_XM ON CACHE BOOL "Build Geant4 with Motif (X11) support" FORCE)
|
||||
message(STATUS "Forcing GEANT4_USE_XM to ON, required by GEANT4_USE_INVENTOR")
|
||||
message(STATUS "Forcing GEANT4_USE_XM to ON, required by Inventor driver")
|
||||
endif()
|
||||
|
||||
geant4_add_feature(GEANT4_USE_XM "Build Geant4 with Xm Support")
|
||||
@@ -94,30 +116,12 @@ if(UNIX)
|
||||
# RayTracer driver with X11 support
|
||||
option(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support" OFF)
|
||||
geant4_add_feature(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support")
|
||||
|
||||
# ToolsSG X11/GLES driver
|
||||
option(GEANT4_USE_TOOLSSG_X11_GLES "Build Geant4 ToolsSG driver with X11/GLES support" OFF)
|
||||
geant4_add_feature(GEANT4_USE_TOOLSSG_X11_GLES "Build Geant4 ToolsSG driver with X11/GLES support")
|
||||
|
||||
# ToolsSG Xt/GLES driver
|
||||
option(GEANT4_USE_TOOLSSG_XT_GLES "Build Geant4 ToolsSG driver with Xt/GLES support" OFF)
|
||||
geant4_add_feature(GEANT4_USE_TOOLSSG_XT_GLES "Build Geant4 ToolsSG driver with Xt/GLES support")
|
||||
|
||||
# ToolsSG Qt/GLES driver
|
||||
option(GEANT4_USE_TOOLSSG_QT_GLES "Build Geant4 ToolsSG driver with Qt/GLES support" OFF)
|
||||
geant4_add_feature(GEANT4_USE_TOOLSSG_QT_GLES "Build Geant4 ToolsSG driver with Qt/GLES support")
|
||||
|
||||
endif()
|
||||
|
||||
# Windows only
|
||||
if(WIN32)
|
||||
option(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support")
|
||||
geant4_add_feature(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support")
|
||||
|
||||
# ToolsSG Windows/GLES driver
|
||||
option(GEANT4_USE_TOOLSSG_WINDOWS_GLES "Build Geant4 ToolsSG driver with Windows/GLES support" OFF)
|
||||
geant4_add_feature(GEANT4_USE_TOOLSSG_WINDOWS_GLES "Build Geant4 ToolsSG driver with Windows/GLES support")
|
||||
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
@@ -199,18 +203,29 @@ if(GEANT4_USE_INVENTOR
|
||||
OR GEANT4_USE_QT
|
||||
OR GEANT4_USE_OPENGL_X11
|
||||
OR GEANT4_USE_XM
|
||||
OR GEANT4_USE_TOOLSSG
|
||||
OR GEANT4_USE_OPENGL_WIN32)
|
||||
find_package(OpenGL REQUIRED)
|
||||
geant4_save_package_variables(OpenGL OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY)
|
||||
|
||||
# X11 drivers on macOS need XQuartzGL
|
||||
if(APPLE AND (GEANT4_USE_INVENTOR_XT OR GEANT4_USE_OPENGL_X11 OR GEANT4_USE_XM))
|
||||
if(APPLE AND
|
||||
(GEANT4_USE_INVENTOR_XT
|
||||
OR GEANT4_USE_OPENGL_X11
|
||||
OR GEANT4_USE_XM
|
||||
OR GEANT4_USE_TOOLSSG_X11_GLES
|
||||
OR GEANT4_USE_TOOLSSG_XT_GLES))
|
||||
find_package(XQuartzGL REQUIRED)
|
||||
geant4_save_package_variables(XQuartzGL XQuartzGL_INCLUDE_DIR XQuartzGL_gl_LIBRARY)
|
||||
endif()
|
||||
|
||||
# Enable driver
|
||||
set(GEANT4_USE_OPENGL ON)
|
||||
# Enable G4OpenGL driver
|
||||
if(GEANT4_USE_INVENTOR
|
||||
OR GEANT4_USE_QT
|
||||
OR GEANT4_USE_OPENGL_X11
|
||||
OR GEANT4_USE_OPENGL_WIN32)
|
||||
set(GEANT4_USE_OPENGL ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@@ -218,7 +233,9 @@ if(UNIX)
|
||||
if(GEANT4_USE_OPENGL_X11
|
||||
OR GEANT4_USE_RAYTRACER_X11
|
||||
OR GEANT4_USE_XM
|
||||
OR GEANT4_USE_INVENTOR_XT)
|
||||
OR GEANT4_USE_INVENTOR_XT
|
||||
OR GEANT4_USE_TOOLSSG_X11_GLES
|
||||
OR GEANT4_USE_TOOLSSG_XT_GLES)
|
||||
find_package(X11 REQUIRED)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/G4X11Shim.cmake")
|
||||
|
||||
|
||||
@@ -30,11 +30,6 @@
|
||||
# by providing the `CLHEP_ROOT_DIR` option. Setting this variable
|
||||
# will automatically enable use of an external CLHEP.
|
||||
#
|
||||
# When using an external install of CLHEP, the default is to link
|
||||
# to the full CLHEP library. An additional advanced option
|
||||
# `GEANT4_USE_SYSTEM_CLHEP_GRANULAR` is available to configure
|
||||
# use of the modular CLHEP libraries.
|
||||
#
|
||||
set(_default_use_system_clhep OFF)
|
||||
if(CLHEP_ROOT_DIR)
|
||||
set(_default_use_system_clhep ON)
|
||||
@@ -42,27 +37,9 @@ if(CLHEP_ROOT_DIR)
|
||||
endif()
|
||||
|
||||
option(GEANT4_USE_SYSTEM_CLHEP "Use system CLHEP library" ${_default_use_system_clhep})
|
||||
cmake_dependent_option(GEANT4_USE_SYSTEM_CLHEP_GRANULAR
|
||||
"Use system CLHEP granular libraries" OFF
|
||||
"GEANT4_USE_SYSTEM_CLHEP" OFF
|
||||
)
|
||||
mark_as_advanced(GEANT4_USE_SYSTEM_CLHEP_GRANULAR)
|
||||
|
||||
if(GEANT4_USE_SYSTEM_CLHEP)
|
||||
set(__system_clhep_mode " (singular)")
|
||||
|
||||
if(GEANT4_USE_SYSTEM_CLHEP_GRANULAR)
|
||||
set(__g4_clhep_components
|
||||
Evaluator
|
||||
Geometry
|
||||
Random
|
||||
Vector
|
||||
)
|
||||
set(__system_clhep_mode " (granular)")
|
||||
endif()
|
||||
|
||||
find_package(CLHEP 2.4.4.0 REQUIRED ${__g4_clhep_components} CONFIG)
|
||||
|
||||
find_package(CLHEP 2.4.5.1 REQUIRED CONFIG)
|
||||
geant4_save_package_variables(CLHEP CLHEP_DIR)
|
||||
else()
|
||||
set(CLHEP_FOUND TRUE)
|
||||
@@ -82,7 +59,7 @@ else()
|
||||
set(CLHEP_LIBRARIES G4clhep)
|
||||
endif()
|
||||
|
||||
geant4_add_feature(GEANT4_USE_SYSTEM_CLHEP "Using system CLHEP library${__system_clhep_mode}")
|
||||
geant4_add_feature(GEANT4_USE_SYSTEM_CLHEP "Using system CLHEP library")
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Find required EXPAT package
|
||||
@@ -336,7 +313,7 @@ endif()
|
||||
|
||||
# - Geant4 USolids/VecGom setup
|
||||
if(GEANT4_USE_ALL_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS)
|
||||
find_package(VecGeom 1.1.8 REQUIRED)
|
||||
find_package(VecGeom 1.1.18 REQUIRED)
|
||||
# Shim until VecGeom supports config mode properly
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/G4VecGeomShim.cmake")
|
||||
# Backward Compatibility
|
||||
@@ -392,7 +369,7 @@ if(GEANT4_USE_HDF5)
|
||||
find_package(HDF5 1.8 REQUIRED)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/G4HDF5Shim.cmake")
|
||||
# Backward compatibility
|
||||
set(HDF5_LIBRARIES Geant4::HDF5)
|
||||
set(HDF5_LIBRARIES hdf5::hdf5)
|
||||
|
||||
# May have found via config mode...
|
||||
if(HDF5_DIR)
|
||||
@@ -406,4 +383,3 @@ if(GEANT4_USE_HDF5)
|
||||
endif()
|
||||
|
||||
GEANT4_ADD_FEATURE(GEANT4_USE_HDF5 "Building Geant4 analysis library with HDF5 support")
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#-----------------------------------------------------------------------
|
||||
# Geant4 test driver
|
||||
# Script arguments:
|
||||
# Script arguments:
|
||||
# CMD command to be executed for the test
|
||||
# PRE command to be executed before the test command
|
||||
# POST command to be executed after the test command
|
||||
@@ -9,7 +9,7 @@
|
||||
# ENV evironment VAR1=Value1;VAR2=Value2
|
||||
# CWD current working directory
|
||||
# TST test name (used to name output/error files)
|
||||
# TIM timeout
|
||||
# TIM timeout
|
||||
# DBG debug flag
|
||||
|
||||
if(DBG)
|
||||
@@ -56,9 +56,9 @@ if(TIM)
|
||||
else()
|
||||
if(NOT $ENV{CTEST_TIMEOUT} STREQUAL "")
|
||||
math(EXPR _timeout "$ENV{CTEST_TIMEOUT} - 120")
|
||||
else()
|
||||
else()
|
||||
math(EXPR _timeout "1500 - 120")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CWD)
|
||||
|
||||
@@ -2,17 +2,12 @@
|
||||
# To pass variables to cpack from cmake, they must be configured
|
||||
# in this file.
|
||||
|
||||
# This file is configured at cmake time, and loaded at cpack time.
|
||||
# To pass variables to cpack from cmake, they must be configured
|
||||
# in this file.
|
||||
|
||||
# - NSIS Specifics
|
||||
if(CPACK_GENERATOR MATCHES "NSIS")
|
||||
if(CPACK_GENERATOR STREQUAL "NSIS")
|
||||
# There is a bug in NSI that does not handle full unix paths properly.
|
||||
# Make sure there is at least one set of two (2) backlasshes.
|
||||
set(CPACK_PACKAGE_ICON "@CMAKE_SOURCE_DIR@\\cmake\\Templates\\g4_small.bmp")
|
||||
set(CPACK_NSIS_MUI_ICON "@CMAKE_SOURCE_DIR@\\cmake\\Templates\\G4.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "@CMAKE_SOURCE_DIR@\\cmake\\Templates\\G4.ico")
|
||||
set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@\\cmake\\Templates\\G4.ico")
|
||||
set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@\\cmake\\Templates\\G4.ico")
|
||||
set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||
set(CPACK_NSIS_HELP_LINK "http:\\\\www.geant4.org")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\www.geant4.org")
|
||||
@@ -20,9 +15,7 @@ if(CPACK_GENERATOR MATCHES "NSIS")
|
||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||
endif()
|
||||
|
||||
# - PackageMaker Specifics
|
||||
if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||
set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
|
||||
# - productbuild Specifics
|
||||
if(CPACK_GENERATOR STREQUAL "productbuild")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/Library/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -82,8 +82,6 @@
|
||||
# motif (Motif-X11/OpenGL Graphical User Interface)
|
||||
# qt (Qt5/OpenGL Graphical User Interface)
|
||||
#
|
||||
# vis_network_dawn (Client/Server network interface to DAWN visualization)
|
||||
# vis_network_vrml (Client/Server network interface to VRML visualization)
|
||||
# vis_opengl_x11 (OpenGL visualization with X11 interface)
|
||||
# vis_opengl_win32 (OpenGL visualization with X11 interface)
|
||||
# vis_raytracer_x11 (RayTracer visualization with X11 interface)
|
||||
@@ -122,12 +120,6 @@
|
||||
# system APIs as required, and you should use these to ensure you compile
|
||||
# and link against the same API version.
|
||||
#
|
||||
# An additional variable is set for CLHEP when Geant4 was built using a
|
||||
# system install to indicate whether the single/granular CLHEP library/ies
|
||||
# was/were linked against
|
||||
#
|
||||
# Geant4_system_clhep_ISGRANULAR (TRUE is Geant4 linked to granular CLHEP)
|
||||
#
|
||||
# Environment variables for, and directory paths to, physics datasets
|
||||
# used by some Geant4 physics processes may be determined from the
|
||||
# variables
|
||||
@@ -256,12 +248,7 @@ set(Geant4_system_clhep_FOUND @GEANT4_USE_SYSTEM_CLHEP@)
|
||||
|
||||
if(Geant4_system_clhep_FOUND)
|
||||
set(Geant4_builtin_clhep_FOUND FALSE)
|
||||
set(Geant4_system_clhep_ISGRANULAR @GEANT4_USE_SYSTEM_CLHEP_GRANULAR@)
|
||||
if(Geant4_system_clhep_ISGRANULAR)
|
||||
find_dependency(CLHEP @CLHEP_VERSION@ EXACT COMPONENTS @__g4_clhep_components@ CONFIG)
|
||||
else()
|
||||
find_dependency(CLHEP @CLHEP_VERSION@ EXACT CONFIG)
|
||||
endif()
|
||||
find_dependency(CLHEP @CLHEP_VERSION@ EXACT CONFIG)
|
||||
# Explicitly use include_directories.
|
||||
# - Geant4 and CLHEP use full imported targets with usage requirements,
|
||||
# but ROOT (used in the examples), ignores usage requirements in dictionary
|
||||
@@ -399,27 +386,7 @@ endif()
|
||||
set(Geant4_ui_win32_FOUND @WIN32@)
|
||||
if(Geant4_ui_win32_FOUND)
|
||||
if(("ui_win32" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_ui_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4INTY_USE_WIN32
|
||||
-DG4UI_USE_WIN32
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# - Visualization : Network DAWN
|
||||
set(Geant4_vis_dawn_network_FOUND @GEANT4_USE_NETWORK_DAWN@)
|
||||
if(Geant4_vis_dawn_network_FOUND)
|
||||
if(("vis_dawn_network" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_DAWN)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# - Visualization : Network VRML
|
||||
set(Geant4_vis_vrml_network_FOUND @GEANT4_USE_NETWORK_VRML@)
|
||||
if(Geant4_vis_vrml_network_FOUND)
|
||||
if(("vis_vrml_network" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_VRML)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4UI_USE_WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -433,11 +400,7 @@ if(Geant4_vis_raytracer_x11_FOUND)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/G4X11Shim.cmake")
|
||||
|
||||
if(("vis_raytracer_x11" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4INTY_USE_XT
|
||||
-DG4VIS_USE_RAYTRACERX
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_RAYTRACERX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -467,15 +430,8 @@ if(Geant4_qt_FOUND)
|
||||
OR ("vis_openinventor" IN_LIST Geant4_FIND_COMPONENTS)
|
||||
OR ("vis_toolssg_qt_gles" IN_LIST Geant4_FIND_COMPONENTS)
|
||||
OR Geant4_ui_all_FOUND OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4INTY_USE_QT
|
||||
-DG4UI_USE_QT
|
||||
-DG4VIS_USE_OPENGLQT
|
||||
#-DG4VIS_USE_TOOLSSG_QT_GLES
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4UI_USE_QT -DG4VIS_USE_OPENGLQT)
|
||||
set(_geant4_use_opengl_library ON)
|
||||
#set(_geant4_use_toolssg_library ON)
|
||||
# Qt3D is always on if available
|
||||
set(_geant4_use_qt3D_library ${Geant4_qt3d_FOUND})
|
||||
endif()
|
||||
@@ -499,12 +455,7 @@ if(Geant4_motif_FOUND)
|
||||
OR ("vis_openinventor" IN_LIST Geant4_FIND_COMPONENTS)
|
||||
OR ("vis_toolssg_xt_gles" IN_LIST Geant4_FIND_COMPONENTS)
|
||||
OR Geant4_ui_all_FOUND OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4INTY_USE_XT
|
||||
-DG4UI_USE_XM
|
||||
-DG4VIS_USE_OPENGLXM
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4UI_USE_XM -DG4VIS_USE_OPENGLXM)
|
||||
set(_geant4_use_opengl_library ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -521,11 +472,7 @@ if(Geant4_vis_opengl_x11_FOUND)
|
||||
endif()
|
||||
|
||||
if(("vis_opengl_x11" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4INTY_USE_XT
|
||||
-DG4VIS_USE_OPENGLX
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OPENGLX)
|
||||
set(_geant4_use_opengl_library ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -535,11 +482,7 @@ set(Geant4_vis_opengl_win32_FOUND @GEANT4_USE_OPENGL_WIN32@)
|
||||
if(Geant4_vis_opengl_win32_FOUND)
|
||||
find_dependency(OpenGL)
|
||||
if(("vis_opengl_win32" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4INTY_USE_WIN32
|
||||
-DG4VIS_USE_OPENGLWIN32
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OPENGLWIN32)
|
||||
set(_geant4_use_opengl_library ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -569,9 +512,9 @@ if(Geant4_vis_openinventor_FOUND)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OI -DG4VIS_USE_OIQT)
|
||||
else()
|
||||
if(WIN32)
|
||||
list(APPEND Geant4_DEFINITIONS -G4INTY_USE_WIN32 -DG4VIS_USE_OI -DG4VIS_USE_OIWIN32)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OI -DG4VIS_USE_OIWIN32)
|
||||
else()
|
||||
list(APPEND Geant4_DEFINITIONS -DG4INTY_USE_XT -DG4VIS_USE_OI -DG4VIS_USE_OIX)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OI -DG4VIS_USE_OIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -591,10 +534,7 @@ if(Geant4_vis_toolssg_x11_gles_FOUND)
|
||||
endif()
|
||||
|
||||
if(("vis_toolssg_x11_gles" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4VIS_USE_TOOLSSG_X11_GLES
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_TOOLSSG_X11_GLES)
|
||||
set(_geant4_use_toolssg_library ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -604,10 +544,7 @@ set(Geant4_vis_toolssg_windows_gles_FOUND @GEANT4_USE_TOOLSSG_WINDOWS_GLES@)
|
||||
if(Geant4_vis_toolssg_windows_gles_FOUND)
|
||||
find_dependency(OpenGL)
|
||||
if(("vis_toolssg_windows_gles" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4VIS_USE_TOOLSSG_WINDOWS_GLES
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_TOOLSSG_WINDOWS_GLES)
|
||||
set(_geant4_use_toolssg_library ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -624,10 +561,7 @@ if(Geant4_vis_toolssg_xt_gles_FOUND)
|
||||
endif()
|
||||
|
||||
if(("vis_toolssg_xt_gles" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4VIS_USE_TOOLSSG_XT_GLES
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_TOOLSSG_XT_GLES)
|
||||
set(_geant4_use_toolssg_library ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -637,10 +571,7 @@ set(Geant4_vis_toolssg_qt_gles_FOUND @GEANT4_USE_TOOLSSG_QT_GLES@)
|
||||
if(Geant4_vis_toolssg_qt_gles_FOUND)
|
||||
find_dependency(OpenGL)
|
||||
if(("vis_toolssg_qt_gles" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND)
|
||||
list(APPEND
|
||||
Geant4_DEFINITIONS
|
||||
-DG4VIS_USE_TOOLSSG_QT_GLES
|
||||
)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_TOOLSSG_QT_GLES)
|
||||
set(_geant4_use_toolssg_library ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -648,6 +579,17 @@ endif()
|
||||
# Reset any OpenGL Preference
|
||||
set(OpenGL_GL_PREFERENCE "${OpenGL_GL_PREFERENCE_SAVE}")
|
||||
|
||||
set(Geant4_vis_Vtk_FOUND @GEANT4_USE_VTK@)
|
||||
if(Geant4_vis_Vtk_FOUND)
|
||||
find_dependency(VTK)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_VTK)
|
||||
set(_geant4_use_vtk_library ON)
|
||||
|
||||
if(Geant4_qt_FOUND)
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_VTK_QT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Include the files listing all the imported targets and configuring
|
||||
# Intel/MSVC Compile Features
|
||||
@@ -693,41 +635,37 @@ set(_geant4_internal_libraries
|
||||
Geant4::G4GMocren${_geant4_lib_use_suffix}
|
||||
Geant4::G4visHepRep${_geant4_lib_use_suffix}
|
||||
Geant4::G4RayTracer${_geant4_lib_use_suffix}
|
||||
Geant4::G4VRML${_geant4_lib_use_suffix}
|
||||
)
|
||||
Geant4::G4VRML${_geant4_lib_use_suffix})
|
||||
|
||||
# - G4OpenGL if it's requested.
|
||||
if(_geant4_use_opengl_library)
|
||||
list(APPEND _geant4_internal_libraries
|
||||
Geant4::G4OpenGL${_geant4_lib_use_suffix}
|
||||
Geant4::G4gl2ps${_geant4_lib_use_suffix}
|
||||
)
|
||||
Geant4::G4gl2ps${_geant4_lib_use_suffix})
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OPENGL)
|
||||
endif()
|
||||
|
||||
# - Qt3D if it's requested.
|
||||
if(_geant4_use_qt3D_library)
|
||||
list(APPEND _geant4_internal_libraries
|
||||
Geant4::G4visQt3D${_geant4_lib_use_suffix}
|
||||
)
|
||||
list(APPEND _geant4_internal_libraries Geant4::G4visQt3D${_geant4_lib_use_suffix})
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_QT3D)
|
||||
endif()
|
||||
|
||||
# - G4OpenInventor if it's requested.
|
||||
if(_geant4_use_inventor_library)
|
||||
list(APPEND _geant4_internal_libraries
|
||||
Geant4::G4OpenInventor${_geant4_lib_use_suffix}
|
||||
)
|
||||
list(APPEND _geant4_internal_libraries Geant4::G4OpenInventor${_geant4_lib_use_suffix})
|
||||
endif()
|
||||
|
||||
# - G4ToolsSG if it's requested.
|
||||
if(_geant4_use_toolssg_library)
|
||||
list(APPEND _geant4_internal_libraries
|
||||
Geant4::G4ToolsSG${_geant4_lib_use_suffix}
|
||||
)
|
||||
list(APPEND _geant4_internal_libraries Geant4::G4ToolsSG${_geant4_lib_use_suffix})
|
||||
list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_TOOLSSG)
|
||||
endif()
|
||||
|
||||
if(_geant4_use_vtk_library)
|
||||
list(APPEND _geant4_internal_libraries Geant4::G4visVtk${_geant4_lib_use_suffix})
|
||||
endif()
|
||||
|
||||
# - G3toG4 if it's requested
|
||||
if(_geant4_use_g3tog4_library)
|
||||
set(_geant4_g3tog4_library Geant4::G3toG4${_geant4_lib_use_suffix})
|
||||
|
||||
@@ -5,88 +5,9 @@
|
||||
#
|
||||
# IT SHOULD NOT BE INSTALLED!
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Special internal functions for building tests.
|
||||
#-----------------------------------------------------------------------
|
||||
# function geant4_link_library(<name> source1 source2 ...
|
||||
# [TYPE STATIC|SHARED]
|
||||
# LIBRARIES library1 library2 ...)
|
||||
#
|
||||
function(geant4_link_library library)
|
||||
cmake_parse_arguments(ARG "TYPE;LIBRARIES" "" ${ARGN})
|
||||
set(sources)
|
||||
|
||||
# - Fill sources
|
||||
foreach(fp ${ARG_UNPARSED_ARGUMENTS})
|
||||
if(IS_ABSOLUTE ${fp})
|
||||
file(GLOB files ${fp})
|
||||
else()
|
||||
file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${fp})
|
||||
endif()
|
||||
if(files)
|
||||
set(sources ${sources} ${files})
|
||||
else()
|
||||
set(sources ${sources} ${fp})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# - Shared library unless specified
|
||||
if(NOT ARG_TYPE)
|
||||
set(ARG_TYPE SHARED)
|
||||
endif()
|
||||
|
||||
# - Make sure we can access our own headers
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
# - Deal with Win32 DLLs that don't export via declspec
|
||||
if(WIN32 AND ARG_TYPE STREQUAL SHARED)
|
||||
# - Dummy archive library
|
||||
add_library( ${library}-arc STATIC EXCLUDE_FROM_ALL ${sources})
|
||||
|
||||
# - Use genwindef to create .def file listing symbols
|
||||
add_custom_command(
|
||||
OUTPUT ${library}.def
|
||||
COMMAND ${genwindef_cmd} -o ${library}.def -l ${library} ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${library}-arc.lib
|
||||
DEPENDS ${library}-arc genwindef)
|
||||
|
||||
#- Dummy cpp file needed to satisfy Visual Studio.
|
||||
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${library}.cpp "// empty file\n" )
|
||||
add_library( ${library} SHARED ${library}.cpp ${library}.def)
|
||||
target_link_libraries(${library} ${library}-arc ${ARG_LIBRARIES})
|
||||
set_target_properties(${library} PROPERTIES LINK_INTERFACE_LIBRARIES ${ARG_LIBRARIES} ${Geant4_LIBRARIES})
|
||||
else()
|
||||
add_library( ${library} ${ARG_TYPE} ${sources})
|
||||
target_link_libraries(${library} ${ARG_LIBRARIES} ${Geant4_LIBRARIES})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# function geant4_executable(<name> source1 source2 ...
|
||||
# LIBRARIES library1 library2 ... )
|
||||
#
|
||||
function(geant4_executable executable)
|
||||
cmake_parse_arguments(ARG "" "" "LIBRARIES" ${ARGN})
|
||||
|
||||
set(sources)
|
||||
|
||||
foreach(fp ${ARG_UNPARSED_ARGUMENTS})
|
||||
file(GLOB files ${fp})
|
||||
if(files)
|
||||
set(sources ${sources} ${files})
|
||||
else()
|
||||
set(sources ${sources} ${fp})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include ${GEANT4_INCLUDE_DIR})
|
||||
|
||||
add_executable(${executable} EXCLUDE_FROM_ALL ${sources})
|
||||
target_link_libraries(${executable} ${ARG_LIBRARIES} ${Geant4_LIBRARIES} )
|
||||
set_target_properties(${executable} PROPERTIES OUTPUT_NAME ${executable})
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# function geant4_add_test(<name> COMMAND cmd [arg1... ]
|
||||
# [PRECMD cmd [arg1...]] [POSTCMD cmd [arg1...]]
|
||||
@@ -117,6 +38,14 @@ function(geant4_add_test test)
|
||||
set(_cfg $<CONFIGURATION>/)
|
||||
endif()
|
||||
|
||||
# COMMAND AND BUILD: split test
|
||||
# - In this case, we have to create a -build and a -run test with the latter depending on the former
|
||||
# NOT COMMAND AND BUILD: pure build
|
||||
# COMMAND AND NOT BUILD: pure test
|
||||
if(ARG_COMMAND AND ARG_BUILD)
|
||||
set(_is_split_test TRUE)
|
||||
endif()
|
||||
|
||||
#- Handle COMMAND argument
|
||||
list(LENGTH ARG_COMMAND _len)
|
||||
if(_len LESS 1)
|
||||
@@ -127,8 +56,13 @@ function(geant4_add_test test)
|
||||
list(GET ARG_COMMAND 0 _prg)
|
||||
list(REMOVE_AT ARG_COMMAND 0)
|
||||
if(NOT IS_ABSOLUTE ${_prg})
|
||||
set(_prg ${CMAKE_CURRENT_BINARY_DIR}/${_cfg}${_prg})
|
||||
if(TARGET ${_prg})
|
||||
set(_prg "$<TARGET_FILE:${_prg}>")
|
||||
else()
|
||||
set(_prg ${CMAKE_CURRENT_BINARY_DIR}/${_cfg}${_prg})
|
||||
endif()
|
||||
elseif(EXISTS ${_prg})
|
||||
# Calling a prexisting/system program
|
||||
else()
|
||||
get_filename_component(_path ${_prg} PATH)
|
||||
get_filename_component(_file ${_prg} NAME)
|
||||
@@ -203,21 +137,61 @@ function(geant4_add_test test)
|
||||
set(ARG_PROJECT ${ARG_BUILD})
|
||||
endif()
|
||||
endif()
|
||||
add_test(NAME ${test} COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
--build-and-test ${ARG_SOURCE_DIR} ${ARG_BINARY_DIR}
|
||||
--build-generator ${CMAKE_GENERATOR}
|
||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
||||
--build-target ${ARG_BUILD}
|
||||
--build-project ${ARG_PROJECT}
|
||||
--build-config $<CONFIGURATION>
|
||||
--build-noclean
|
||||
--build-options --no-warn-unused-cli -DCMAKE_DISABLE_FIND_PACKAGE_ROOT=$<BOOL:${CMAKE_DISABLE_FIND_PACKAGE_ROOT}>
|
||||
--test-command ${_command} )
|
||||
set_property(TEST ${test} PROPERTY ENVIRONMENT Geant4_DIR=${CMAKE_BINARY_DIR})
|
||||
|
||||
set(__build_test_name "${test}")
|
||||
set(__run_test_name "")
|
||||
|
||||
if(_is_split_test)
|
||||
set(__build_test_name "${test}-build")
|
||||
set(__run_test_name "${test}")
|
||||
endif()
|
||||
|
||||
# Build part of the test
|
||||
add_test(NAME ${__build_test_name} COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
--build-and-test ${ARG_SOURCE_DIR} ${ARG_BINARY_DIR}
|
||||
--build-generator ${CMAKE_GENERATOR}
|
||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
|
||||
--build-target ${ARG_BUILD}
|
||||
--build-project ${ARG_PROJECT}
|
||||
--build-config $<CONFIGURATION>
|
||||
--build-noclean
|
||||
--build-options
|
||||
--no-warn-unused-cli
|
||||
-DGeant4_DIR=${CMAKE_BINARY_DIR}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_ROOT=$<BOOL:${CMAKE_DISABLE_FIND_PACKAGE_ROOT}>
|
||||
)
|
||||
set_property(TEST ${__build_test_name} PROPERTY ENVIRONMENT Geant4_DIR=${CMAKE_BINARY_DIR})
|
||||
|
||||
# Build part of the test should have additional regex, and *must* have same labels
|
||||
if(ARG_FAILREGEX)
|
||||
set_property(TEST ${test} PROPERTY FAIL_REGULAR_EXPRESSION "warning:|(${ARG_FAILREGEX})")
|
||||
set_property(TEST ${__build_test_name} PROPERTY FAIL_REGULAR_EXPRESSION "warning:|(${ARG_FAILREGEX})")
|
||||
else()
|
||||
set_property(TEST ${test} PROPERTY FAIL_REGULAR_EXPRESSION "warning:")
|
||||
set_property(TEST ${__build_test_name} PROPERTY FAIL_REGULAR_EXPRESSION "warning:")
|
||||
endif()
|
||||
|
||||
if(ARG_LABELS)
|
||||
set_property(TEST ${__build_test_name} PROPERTY LABELS ${ARG_LABELS})
|
||||
else()
|
||||
set_property(TEST ${__build_test_name} PROPERTY LABELS Nightly)
|
||||
endif()
|
||||
|
||||
# (Optional) Run part of the test
|
||||
if(__run_test_name)
|
||||
add_test(NAME ${__run_test_name} COMMAND ${_command})
|
||||
set_property(TEST ${__run_test_name} PROPERTY DEPENDS ${__build_test_name})
|
||||
if(ARG_FAILREGEX)
|
||||
set_property(TEST ${__run_test_name} PROPERTY FAIL_REGULAR_EXPRESSION ${ARG_FAILREGEX})
|
||||
endif()
|
||||
|
||||
# If WORKING_DIRECTORY supplied, make sure testdriver is run in
|
||||
# that directory, otherwise use specific binary dir
|
||||
if(ARG_WORKING_DIRECTORY)
|
||||
set_property(TEST ${__run_test_name} PROPERTY WORKING_DIRECTORY "${ARG_WORKING_DIRECTORY}")
|
||||
else()
|
||||
set_property(TEST ${__run_test_name} PROPERTY WORKING_DIRECTORY "${ARG_BINARY_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
add_test(NAME ${test} COMMAND ${_command})
|
||||
@@ -238,7 +212,8 @@ function(geant4_add_test test)
|
||||
endif()
|
||||
|
||||
if(ARG_DEPENDS)
|
||||
set_property(TEST ${test} PROPERTY DEPENDS ${ARG_DEPENDS})
|
||||
# MUST be append because a split test may set this earlier
|
||||
set_property(TEST ${test} APPEND PROPERTY DEPENDS ${ARG_DEPENDS})
|
||||
endif()
|
||||
|
||||
if(ARG_PASSREGEX)
|
||||
|
||||
@@ -204,7 +204,7 @@ feature_list="${feature_list} qt[${have_qt}]"
|
||||
|
||||
if test "x${have_qt}" = "xyes" ; then
|
||||
vis_cflags="${vis_cflags} \
|
||||
-DG4INTY_USE_QT -DG4UI_USE_QT -DG4VIS_USE_OPENGLQT @G4_QT_CFLAGS@"
|
||||
-DG4UI_USE_QT -DG4VIS_USE_OPENGLQT @G4_QT_CFLAGS@"
|
||||
|
||||
if test "x${qt_version}" \< "5.15.0" ; then
|
||||
vis_libs="-lG4visQt3D ${vis_libs}"
|
||||
@@ -251,7 +251,7 @@ have_openinventor="@G4_BUILTWITH_INVENTOR@"
|
||||
feature_list="${feature_list} openinventor[${have_openinventor}]"
|
||||
|
||||
if test "x${have_openinventor}" = "xyes" ; then
|
||||
vis_cflags="${vis_cflags} -DG4INTY_USE_XT -DG4VIS_USE_OI -DG4VIS_USE_OIX"
|
||||
vis_cflags="${vis_cflags} -DG4VIS_USE_OI -DG4VIS_USE_OIX"
|
||||
vis_libs="-lG4OpenInventor ${vis_libs}"
|
||||
fi
|
||||
|
||||
@@ -262,10 +262,9 @@ if test "x${geant4_uses_opengl}" = "xyes" ; then
|
||||
vis_libs="-lG4OpenGL -lG4gl2ps ${vis_libs}"
|
||||
fi
|
||||
|
||||
# - If we have any X11 based feature, then we need the INTY_XT define and
|
||||
# *may* need the X11 includes
|
||||
# - If we have any X11 based feature, then we *may* need the X11 includes
|
||||
if test "x${geant4_uses_x11}" = "xyes" ; then
|
||||
vis_cflags="-DG4INTY_USE_XT @G4_X11_CFLAGS@ ${vis_cflags}"
|
||||
vis_cflags="@G4_X11_CFLAGS@ ${vis_cflags}"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -37,7 +37,6 @@ set(GEANT4_FALSEPOSITIVE_SOURCES
|
||||
# internally but validate_sources assumes icc files will be in
|
||||
# include/
|
||||
# They are covered in sources.cmake though!
|
||||
G4VRML1SceneHandlerFunc.icc
|
||||
G4VRML2SceneHandlerFunc.icc
|
||||
# - Documentation of processes/hadronic/models/cascade/cascade
|
||||
# lists some sources in comments. These do not correspond to
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#-----------------------------------------------------------------------
|
||||
# @GEANT4_TC_SHELL_FAMILY@ environment setup script for Geant4 @Geant4_VERSION@
|
||||
#
|
||||
# This script will configure your environment to provide a setup which
|
||||
# can be used to build user applications using the old Geant4 GNUmakefile
|
||||
# This script will configure your environment to provide a setup which
|
||||
# can be used to build user applications using the old Geant4 GNUmakefile
|
||||
# build system, but with a CMake build or install of Geant4.
|
||||
#
|
||||
# This script is autogenerated by CMake DO NOT EDIT
|
||||
@@ -96,14 +96,6 @@
|
||||
# Only USE options matter for applications.
|
||||
@GEANT4_TC_UNSET_COMMAND@ G4VIS_NONE
|
||||
|
||||
# - Network DAWN driver
|
||||
@GEANT4_TC_UNSET_COMMAND@ G4VIS_BUILD_DAWN_DRIVER
|
||||
@GEANT4_TC_UNSET_COMMAND@ G4VIS_USE_DAWN
|
||||
|
||||
# - Network VRML driver
|
||||
@GEANT4_TC_UNSET_COMMAND@ G4VIS_BUILD_VRML_DRIVER
|
||||
@GEANT4_TC_UNSET_COMMAND@ G4VIS_USE_VRML
|
||||
|
||||
# - OpenInventor driver
|
||||
@GEANT4_TC_UNSET_COMMAND@ G4VIS_BUILD_OIWIN32_DRIVER
|
||||
@GEANT4_TC_UNSET_COMMAND@ G4VIS_USE_OIWIN32
|
||||
@@ -192,6 +184,7 @@
|
||||
#
|
||||
@GEANT4_TC_G4LIB_USE_GDML@
|
||||
@GEANT4_TC_GDML_PATH_SETUP@
|
||||
@GEANT4_TC_XERCESC_LIB_PATH_SETUP@
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# G3ToG4 Setup
|
||||
@@ -246,16 +239,6 @@
|
||||
@GEANT4_TC_G4UI_USE_XM@
|
||||
@GEANT4_TC_G4VIS_USE_OPENGLXM@
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Network DAWN driver
|
||||
#
|
||||
@GEANT4_TC_G4VIS_USE_DAWN@
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Network VRML driver
|
||||
#
|
||||
@GEANT4_TC_G4VIS_USE_VRML@
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# OpenInventor
|
||||
#
|
||||
@@ -272,7 +255,7 @@
|
||||
@GEANT4_TC_G4VIS_USE_OPENGLWIN32@
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# X11 Raytracer
|
||||
# X11 Raytracer
|
||||
#
|
||||
@GEANT4_TC_G4VIS_USE_RAYTRACERX@
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Only run for source packaging
|
||||
if(CPACK_SOURCE_INSTALLED_DIRECTORIES)
|
||||
# Copy any additional files needed in source package that we need to generate
|
||||
# or otherwise aren't present directly in the source directory.
|
||||
set(GEANT4_CPACK_SOURCE_EXTRAS "@PROJECT_BINARY_DIR@/_source_extras")
|
||||
file(INSTALL "${GEANT4_CPACK_SOURCE_EXTRAS}/" DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Cross-check that we are not packaging up a modified source dir, and
|
||||
# that there are no additional untracked files since we configured.
|
||||
include("@PROJECT_SOURCE_DIR@/cmake/Modules/G4GitUtilities.cmake")
|
||||
geant4_git_find_dirty("@PROJECT_SOURCE_DIR@" _currently_modded _currently_untracked)
|
||||
|
||||
if(_currently_modded)
|
||||
message(WARNING "Modified files found in source directory: run `git status` for more information on these files.")
|
||||
endif()
|
||||
|
||||
foreach(_ut ${_currently_untracked})
|
||||
list(FIND CPACK_SOURCE_IGNORE_FILES "${_ut}" _is_found)
|
||||
if(_is_found LESS 0)
|
||||
message(WARNING "New untracked file found in source tree: '${_ut}'. Re-run cmake before trying to package, or remove the file.")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
Reference in New Issue
Block a user