Import Geant4 10.3.0.beta source tree
This commit is contained in:
+131
@@ -31,6 +31,136 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].
|
||||
|
||||
----------------------------------------------------------
|
||||
|
||||
17th June 2016 - Gabriele Cosmo (cmake-V10-02-17)
|
||||
- Modules/Geant4OptionalComponents.cmake: set CLHEP-2.3.3.0 as the required
|
||||
version for external CLHEP library.
|
||||
|
||||
9th June 2016 - Gunter Folger (cmake-V10-02-16)
|
||||
- revert change in Templates/Geant4Config.cmake.in in tag cmake-V10-02-14,
|
||||
revision 97140; the coworking tags have been rejected.
|
||||
|
||||
3rd June 2016 - Gunter Folger (cmake-V10-02-15)
|
||||
- switch to RadioActiveDecay 4.4.1 and G4ENSDFSTATE 1.3.1, both provided by
|
||||
Laurent.
|
||||
|
||||
25th May 2016 - Robert Hatcher (cmake-V10-02-14)
|
||||
- Templates/Geant4Config.cmake.in : No longer use --whole-archive for
|
||||
G4physicslists on static builds; this was never possible for _WIN32 and recent
|
||||
physics list factory work makes this untenable.
|
||||
|
||||
25th May 2016 - Ben Morgan (cmake-V10-02-13)
|
||||
- Modules/Geant4InterfaceOptions.cmake : Always add Xmu to X11_LIBRARIES when
|
||||
using Motif/OpenInventor to avoid missing symbol errors on OS X.
|
||||
|
||||
24th May 2016 - Ben Morgan (cmake-V10-02-12)
|
||||
- Modules/Geant4OptionalComponents.cmake : Fix regex to avoid matching to "CONS"
|
||||
shape is check for all shapes.
|
||||
|
||||
24th May 2016 - Ben Morgan (cmake-V10-02-11)
|
||||
- Modules/Geant4OptionalComponents.cmake : Initial implementation of a list
|
||||
based interface to GEANT4_USE_USOLIDS. Rather than booleans, unify USolids
|
||||
replacement into single string/list variable with following behaviour:
|
||||
1) Setting to "all", any CMake boolean true value, or a list containing either
|
||||
results in complete usolids replacement
|
||||
2) A list, i.e. "a;b;c", or shapes to replace with Usolids equivalents may be supplied.
|
||||
Validate arguments to prevent unknown shapes being set, and otherwise retain previous
|
||||
behaviour
|
||||
List allowed values in option docstring.
|
||||
- Modules/Geant4BuildProjectConfig.cmake : Ensure setting of Usolids use marker to a
|
||||
proper boolean value.
|
||||
- Templates/Geant4Config.cmake.in : Use new full boolean variable as expansion variable
|
||||
to indicate usolids support.
|
||||
|
||||
23rd May 2016 - Ben Morgan
|
||||
- Modules/Geant4OptionalComponents.cmake : Allow developers to select
|
||||
subsets of solids to replace with USolids equivalents. Request from developers
|
||||
and CMS to assist in performance evaluation. NOT INTENDED FOR USERS!
|
||||
If GEANT4_USE_SOLIDS is set, use existing configuration/setup. If it is OFF,
|
||||
allow setting of additional CMake options, one per shape, to enable replacement
|
||||
of that shape with USolids equivalent. When any of these variables are set, set
|
||||
additional internal variable GEANT4_USE_PARTIAL_USOLIDS. Convert variables to
|
||||
internal preprocessor flags for shape/usolid activation.
|
||||
- Modules/Geant4BuildProjectConfig.cmake : Export needed USOLIDS/shape activation
|
||||
preprocessor flags for selected configuration.
|
||||
- Modules/Geant4ConfigureConfigScript.cmake : Export needed USOLIDS/shape activation
|
||||
preprocessor flags for selected configuration.
|
||||
|
||||
28th April 2016 - Ben Morgan (cmake-V10-02-10)
|
||||
- Templates/Geant4Config.cmake.in: BUGFIX #1855. When using an external
|
||||
CLHEP, the provided FindCLHEP module is not used. Wrap call to
|
||||
find_package(CLHEP) with push/pop of CMAKE_MODULE_PATH to ensure
|
||||
Geant4's builtin module is used and not interfere with any user
|
||||
settings of CMAKE_MODULE_PATH.
|
||||
|
||||
19th April 2016 - Gunter Folger (cmake-V10-02-09)
|
||||
- correct Modules/genwindef/LibSymbolInfo.cpp for use with VC 64 bit compilation
|
||||
|
||||
29th March 2016 - Gunter Folger (cmake-V10-02-08)
|
||||
- switch to RadioActiveDecay 4.4; dataset identical to 4.3.1, packaging
|
||||
corrected to be a compressed tar file, 4.3.1 is plain tar
|
||||
|
||||
16th March 2016 - Ben Morgan (cmake-V10-02-07)
|
||||
- Modules/Geant4InterfaceOptions.cmake : Fix Bug #1828
|
||||
Apply patch from Vladimir Belov to add libXt to X11_LIBRARIES on all
|
||||
Unix platforms when using Motif/Inventor.
|
||||
|
||||
23rd February 2016 - Gunter Folger (cmake-V10-02-06)
|
||||
- Correct md5sum for RadioactiveDecay.4.3.1 after removal of MAC Safari files.
|
||||
|
||||
23rd February 2016 - Gunter Folger (cmake-V10-02-05)
|
||||
- Modules/Geant4DatasetDefinitions.cmake:
|
||||
- revert back to G4ENSDFSTATE.1.3
|
||||
- use patched RadioactiveDecay data 4.3.1
|
||||
|
||||
23rd February 2016 - Gunter Folger (cmake-V10-02-04)
|
||||
- Modules/Geant4DatasetDefinitions.cmake: Use data set G4ENSDFSTATE.1.2.1
|
||||
Note 1.2.1 is identical to 1.3, it is a patch on 1.2
|
||||
|
||||
5th February 2016 - Gunter Folger (cmake-V10-02-03)
|
||||
- Modules/Geant4DatasetDefinitions.cmake: Use new data set G4ENSDFSTATE.1.3
|
||||
|
||||
22nd January 2016 - Ben Morgan (cmake-V10-02-02)
|
||||
- Modules/FindCLHEP.cmake : Restore from last version. Update regexing
|
||||
of defs.h file for CLHEP 2.3.1.1 changes, retaining compatibility with
|
||||
earlier versions. Create imported targets CLHEP and CLHEP::<COMPONENT>
|
||||
to ease transition to full Config mode support once we can support it.
|
||||
- Modules/Geant4OptionalComponents.cmake : Rollback to using package-mode
|
||||
to locate CLHEP. Modify CLHEP_LIBRARIES after finding to fill this with
|
||||
the imported targets instead of absolute paths.
|
||||
- Modules/Geant4BuildProjectConfig.cmake : Add FindCLHEP.cmake to installed
|
||||
modules so that Geant4Config.cmake can refind CLHEP and hence the imported
|
||||
targets.
|
||||
- Templates/Geant4Config.cmake.in : Refind CLHEP using package-mode,
|
||||
using hardcoded CLHEP_ROOT_DIR if set as a hint.
|
||||
|
||||
15th December 2015 - Ben Morgan (cmake-V10-02-01)
|
||||
- Templates/Geant4Config.cmake.in : Use PATHS option in find_package
|
||||
for CLHEP, setting it to discovered CLHEP_DIR. Required at present
|
||||
to provide a hint to builds of tests, which do not have
|
||||
CMAKE_PREFIX_PATH set appropriately.
|
||||
|
||||
15th December 2015 - Ben Morgan (cmake-V10-02-00)
|
||||
- [BUGFIX #1805] : Preliminary fix for CLHEP 2.3.1.1 config error
|
||||
- Modules/FindCLHEP.cmake : REMOVED as obsolete
|
||||
- Modules/Geant4OptionalComponents.cmake : Use NO_MODULE in
|
||||
find_package(CLHEP) so that CLHEPConfig.cmake is preferred.
|
||||
Retain use of CLHEP_ROOT_DIR temporarily for transition in
|
||||
testing system
|
||||
- Modules/Geant4BuildProjectConfig.cmake : Remove setting of explicit CLHEP
|
||||
directory, defering this to find_package call in Geant4Config.cmake
|
||||
- Templates/Geant4Config.cmake.in : Use namespaced name for Geant4 cmake
|
||||
directory to avoid upstream clashes.
|
||||
Add explicit call to find_package(CLHEP) so that imported targets are refound.
|
||||
Move inclusion of targets file to after setup steps to ensure all external
|
||||
targets exist before this is included. This is also to help further work
|
||||
on use of imported targets.
|
||||
- Modules/Geant4ConfigureConfigScript.cmake : Extract LOCATION property from
|
||||
CLHEP targets to provide setting of lib paths in geant4-config
|
||||
- Templates/geant4-config.cmake.in : Remove explicit calls to clhep-config
|
||||
- Modules/Geant4ToolchainBackwardCompatibility.cmake : Extract LOCATION
|
||||
properties from CLHEP imported targets.
|
||||
|
||||
|
||||
25th November 2015 - Ben Morgan (cmake-V10-01-41)
|
||||
- Modules/Geant4InterfaceOptions.cmake : Move force Qt4 option
|
||||
alongside use Qt option so that it can be set in Curses/GUI before
|
||||
@@ -108,6 +238,7 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].
|
||||
|
||||
23th October 2015 - Gunter Folger (cmake-V10-01-32)
|
||||
- Modules/Geant4DatasetDefinitions.cmake: Use new data set G4ENSDFSTATE.1.2
|
||||
|
||||
22nd October 2015 - Ben Morgan (cmake-V10-01-31)
|
||||
- Modules/Geant4ToolchainBackwardCompatibility.cmake : Add export
|
||||
of TOOLS_FONT_PATH to environment when Freetype support is enabled,
|
||||
|
||||
@@ -205,7 +205,7 @@ find_path(CLHEP_INCLUDE_DIR CLHEP/Units/defs.h
|
||||
if(CLHEP_INCLUDE_DIR)
|
||||
set(CLHEP_VERSION 0)
|
||||
file(READ "${CLHEP_INCLUDE_DIR}/CLHEP/Units/defs.h" _CLHEP_DEFS_CONTENTS)
|
||||
string(REGEX REPLACE ".*#define PACKAGE_VERSION \"([0-9.]+).*" "\\1"
|
||||
string(REGEX REPLACE ".*#define (PACKAGE|CLHEP_UNITS)+_VERSION \"([0-9.]+).*" "\\2"
|
||||
CLHEP_VERSION "${_CLHEP_DEFS_CONTENTS}")
|
||||
|
||||
if(NOT CLHEP_FIND_QUIETLY)
|
||||
@@ -310,6 +310,40 @@ if(CLHEP_FOUND)
|
||||
list(APPEND CLHEP_LIBRARIES ${${__clhep_lib}})
|
||||
endforeach()
|
||||
set(CLHEP_INCLUDE_DIRS ${CLHEP_INCLUDE_DIR})
|
||||
|
||||
# Create imported targets
|
||||
foreach(__clhep_lib ${__CLHEP_LIBRARY_SET})
|
||||
# Construct imported target name
|
||||
string(REPLACE "_LIBRARY" "" __clhep_imp_lib "${__clhep_lib}")
|
||||
string(REPLACE "_" "::" __clhep_imp_lib "${__clhep_imp_lib}")
|
||||
if(__clhep_imp_lib STREQUAL "CLHEP")
|
||||
# Create both CLHEP and CLHEP::CLHEP targets
|
||||
if(NOT TARGET CLHEP::CLHEP)
|
||||
add_library(CLHEP::CLHEP UNKNOWN IMPORTED)
|
||||
set_target_properties(CLHEP::CLHEP PROPERTIES
|
||||
IMPORTED_LOCATION "${CLHEP_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CLHEP_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
if(NOT TARGET CLHEP)
|
||||
add_library(CLHEP UNKNOWN IMPORTED)
|
||||
set_target_properties(CLHEP PROPERTIES
|
||||
IMPORTED_LOCATION "${CLHEP_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CLHEP_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
# Have a component target - these are always namespaced
|
||||
# Note that at present, link interfaces aren't created...
|
||||
if(NOT TARGET ${__clhep_imp_lib})
|
||||
add_library(${__clhep_imp_lib} UNKNOWN IMPORTED)
|
||||
set_target_properties(${__clhep_imp_lib} PROPERTIES
|
||||
IMPORTED_LOCATION "${${__clhep_lib}}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CLHEP_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@@ -40,11 +40,8 @@ endif()
|
||||
|
||||
# - Stuff from Geant4OptionalComponents.cmake
|
||||
# - CLHEP
|
||||
# If it's internal, add it to the externals list, if it's external, add the
|
||||
# include directories to the list of third party header paths
|
||||
if(GEANT4_USE_SYSTEM_CLHEP)
|
||||
list(APPEND GEANT4_THIRD_PARTY_INCLUDES ${CLHEP_INCLUDE_DIRS})
|
||||
else()
|
||||
# If it's internal, add it to the externals list
|
||||
if(NOT GEANT4_USE_SYSTEM_CLHEP)
|
||||
list(APPEND GEANT4_EXTERNALS_TARGETS G4clhep)
|
||||
endif()
|
||||
|
||||
@@ -70,8 +67,9 @@ endif()
|
||||
|
||||
# - USolids
|
||||
# Compile definitions
|
||||
if(GEANT4_USE_USOLIDS)
|
||||
list(APPEND GEANT4_CORE_DEFINITIONS -DG4GEOM_USE_USOLIDS)
|
||||
if(GEANT4_USE_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS)
|
||||
set(GEANT4_USE_USOLIDS_EITHER ON)
|
||||
list(APPEND GEANT4_CORE_DEFINITIONS ${GEANT4_USOLIDS_COMPILE_DEFINITIONS})
|
||||
|
||||
# System USolids headers, because these do appear in Geant4's
|
||||
# public interface. The library should be in the link interface
|
||||
@@ -163,7 +161,7 @@ configure_file(
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
foreach(_mod AIDA HepMC Pythia6 ROOT StatTest TBB)
|
||||
foreach(_mod AIDA CLHEP HepMC Pythia6 ROOT StatTest TBB)
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/Find${_mod}.cmake
|
||||
${PROJECT_BINARY_DIR}/Modules/Find${_mod}.cmake
|
||||
@@ -207,7 +205,7 @@ else()
|
||||
|
||||
set(GEANT4_INCLUDE_DIR_SETUP "
|
||||
# Geant4 configured for the install with relative paths, so use these
|
||||
get_filename_component(Geant4_INCLUDE_DIR \"\${_thisdir}/${GEANT4_RELATIVE_HEADER_PATH}\" ABSOLUTE)
|
||||
get_filename_component(Geant4_INCLUDE_DIR \"\${_geant4_thisdir}/${GEANT4_RELATIVE_HEADER_PATH}\" ABSOLUTE)
|
||||
")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -94,12 +94,19 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
|
||||
# - CLHEP
|
||||
if(GEANT4_USE_SYSTEM_CLHEP)
|
||||
set(G4_BUILTWITH_CLHEP "no")
|
||||
#inc path
|
||||
get_filename_component(G4_SYSTEM_CLHEP_INCLUDE_DIR "${CLHEP_INCLUDE_DIR}" ABSOLUTE)
|
||||
|
||||
#libpath
|
||||
list(GET CLHEP_LIBRARIES 0 _zeroth_clhep_lib)
|
||||
get_filename_component(_system_clhep_libdir "${_zeroth_clhep_lib}" PATH)
|
||||
get_target_property(_system_clhep_libdir "${_zeroth_clhep_lib}" LOCATION)
|
||||
get_filename_component(_system_clhep_libdir "${_system_clhep_libdir}" REALPATH)
|
||||
get_filename_component(_system_clhep_libdir "${_system_clhep_libdir}" DIRECTORY)
|
||||
set(G4_SYSTEM_CLHEP_LIBRARIES "-L${_system_clhep_libdir}")
|
||||
|
||||
foreach(_clhep_lib ${CLHEP_LIBRARIES})
|
||||
get_filename_component(_curlib "${_clhep_lib}" NAME)
|
||||
get_target_property(_curlib "${_clhep_lib}" LOCATION)
|
||||
get_filename_component(_curlib "${_curlib}" 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()
|
||||
@@ -144,13 +151,13 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX)
|
||||
endif()
|
||||
|
||||
# - USolids
|
||||
if(GEANT4_USE_USOLIDS)
|
||||
if(GEANT4_USE_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS)
|
||||
set(G4_BUILTWITH_USOLIDS "yes")
|
||||
set(G4_USOLIDS_INCLUDE_DIRS ${USOLIDS_INCLUDE_DIRS})
|
||||
list(REMOVE_DUPLICATES G4_USOLIDS_INCLUDE_DIRS)
|
||||
list(REMOVE_ITEM G4_USOLIDS_INCLUDE_DIRS ${_cxx_compiler_dirs})
|
||||
|
||||
set(G4_USOLIDS_CFLAGS "-DG4GEOM_USE_USOLIDS")
|
||||
string(REPLACE ";" " " G4_USOLIDS_CFLAGS "${GEANT4_USOLIDS_COMPILE_DEFINITIONS}")
|
||||
foreach(_dir ${G4_USOLIDS_INCLUDE_DIRS})
|
||||
set(G4_USOLIDS_CFLAGS "${G4_USOLIDS_CFLAGS} -I${_dir}")
|
||||
endforeach()
|
||||
|
||||
@@ -38,11 +38,11 @@ geant4_add_dataset(
|
||||
# - Radioisotopes
|
||||
geant4_add_dataset(
|
||||
NAME RadioactiveDecay
|
||||
VERSION 4.3
|
||||
VERSION 4.4.1
|
||||
FILENAME G4RadioactiveDecay
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4RADIOACTIVEDATA
|
||||
MD5SUM 9f1630a5d9f00b4ba1ffc5f7df174827
|
||||
MD5SUM 0aa6c879c17b26f1ca85d3ac915fc30e
|
||||
)
|
||||
|
||||
# - Neutron XS
|
||||
@@ -98,10 +98,10 @@ geant4_add_dataset(
|
||||
# - ENSDFSTATE
|
||||
geant4_add_dataset(
|
||||
NAME G4ENSDFSTATE
|
||||
VERSION 1.2
|
||||
VERSION 1.3.1
|
||||
FILENAME G4ENSDFSTATE
|
||||
EXTENSION tar.gz
|
||||
ENVVAR G4ENSDFSTATEDATA
|
||||
MD5SUM a2e88f2c626141e4be4587c838832707
|
||||
MD5SUM eddd153110184256a57ce6b753f0d527
|
||||
)
|
||||
|
||||
|
||||
@@ -236,11 +236,9 @@ if(UNIX)
|
||||
endif()
|
||||
|
||||
# Create final list of X11 libraries needed for Geant4
|
||||
# - Motif
|
||||
if(APPLE)
|
||||
if(GEANT4_USE_XM OR GEANT4_USE_INVENTOR)
|
||||
set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xt_LIB})
|
||||
endif()
|
||||
# - Motif/Inventor
|
||||
if(GEANT4_USE_XM OR GEANT4_USE_INVENTOR)
|
||||
set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xt_LIB} ${X11_Xmu_LIBRARY})
|
||||
endif()
|
||||
|
||||
# - If we got to this point, RayTracer is o.k., so add the feature
|
||||
|
||||
@@ -53,9 +53,19 @@ if(GEANT4_USE_SYSTEM_CLHEP)
|
||||
set(__system_clhep_mode " (granular)")
|
||||
endif()
|
||||
|
||||
# We keep this as required, because if the user chooses to use a
|
||||
# system option we assume that we absolutely, positively require this.
|
||||
find_package(CLHEP 2.3.1.0 REQUIRED ${__g4_clhep_components})
|
||||
# Find CLHEP using package-mode (i.e. FindCLHEP)
|
||||
# This will set up imported targets for us, but we need
|
||||
# to set CLHEP_LIBRARIES afterwards to use these
|
||||
find_package(CLHEP 2.3.3.0 REQUIRED ${__g4_clhep_components})
|
||||
|
||||
set(CLHEP_LIBRARIES CLHEP::CLHEP)
|
||||
if(GEANT4_USE_SYSTEM_CLHEP_GRANULAR)
|
||||
set(CLHEP_LIBRARIES)
|
||||
foreach(_comp ${__g4_clhep_components})
|
||||
list(APPEND CLHEP_LIBRARIES "CLHEP::${_comp}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(GEANT4_USE_SYSTEM_CLHEP TRUE)
|
||||
else()
|
||||
set(CLHEP_FOUND TRUE)
|
||||
@@ -167,22 +177,79 @@ endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Optional support for USolids - Requires USolids package
|
||||
#
|
||||
option(GEANT4_USE_USOLIDS "EXPERIMENTAL: Replace Geant4 solids with USolids equivalents" OFF)
|
||||
# GEANT4_USE_USOLIDS is a list argument which must take values:
|
||||
# - Empty/CMake boolean false : DEFAULT, do not replace G4 solids with USolids
|
||||
# - ALL/CMake boolean true : Replace all G4 solids with USolids
|
||||
# - List : Replace listed G4 solids with Usolids equivalents. Valid elements are
|
||||
set(GEANT4_USOLIDS_SHAPES
|
||||
BOX
|
||||
CONS
|
||||
EXTRUDEDSOLID
|
||||
GENERICPOLYCONE
|
||||
GENERICTRAP
|
||||
ORB
|
||||
PARABOLOID
|
||||
POLYCONE
|
||||
POLYHEDRA
|
||||
SPHERE
|
||||
TET
|
||||
TRAP
|
||||
TRD
|
||||
TORUS
|
||||
TUBS
|
||||
)
|
||||
|
||||
set(GEANT4_USE_USOLIDS OFF CACHE STRING "EXPERIMENTAL: List Geant4 solids to replace with USolids equivalents (ALL;${GEANT4_USOLIDS_SHAPES})")
|
||||
mark_as_advanced(GEANT4_USE_USOLIDS)
|
||||
|
||||
# - Must be a CMake list - no real way to enforce this
|
||||
# Preprocess by stripping any spaces and uppercasing
|
||||
string(REPLACE " " "" __g4_usolids_shape_list "${GEANT4_USE_USOLIDS}")
|
||||
string(TOUPPER "${__g4_usolids_shape_list}" __g4_usolids_shape_list)
|
||||
|
||||
# - Check for use of all or usolids
|
||||
set(GEANT4_USE_ALL_USOLIDS OFF)
|
||||
string(REGEX MATCH "ALL|^(1|ON|YES|TRUE)" GEANT4_USE_ALL_USOLIDS "${__g4_usolids_shape_list}")
|
||||
|
||||
# - Check and validate partial non-empty list
|
||||
if(NOT GEANT4_USE_ALL_USOLIDS AND GEANT4_USE_USOLIDS)
|
||||
set(GEANT4_USE_PARTIAL_USOLIDS ON)
|
||||
set(GEANT4_USE_PARTIAL_USOLIDS_SHAPE_LIST)
|
||||
|
||||
foreach(__g4_usolids_requested_shape ${__g4_usolids_shape_list})
|
||||
list(FIND GEANT4_USOLIDS_SHAPES "${__g4_usolids_requested_shape}" __g4solids_shape_index)
|
||||
if(__g4solids_shape_index GREATER -1)
|
||||
list(APPEND GEANT4_USE_PARTIAL_USOLIDS_SHAPE_LIST ${__g4_usolids_requested_shape})
|
||||
else()
|
||||
message(FATAL_ERROR "GEANT4_USE_USOLIDS: unknown shape '${__g4_usolids_requested_shape}' in input, must be one of\n${GEANT4_USOLIDS_SHAPES}\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
# - G4USolids setup
|
||||
if(GEANT4_USE_USOLIDS)
|
||||
if(GEANT4_USE_ALL_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS)
|
||||
find_package(USolids REQUIRED)
|
||||
add_definitions(-DG4GEOM_USE_USOLIDS)
|
||||
|
||||
if(GEANT4_USE_ALL_USOLIDS)
|
||||
set(GEANT4_USOLIDS_COMPILE_DEFINITIONS "-DG4GEOM_USE_USOLIDS")
|
||||
GEANT4_ADD_FEATURE(GEANT4_USE_USOLIDS "Replacing all Geant4 solids with USolids equivalents (EXPERIMENTAL)")
|
||||
else()
|
||||
set(GEANT4_USOLIDS_COMPILE_DEFINITIONS "-DG4GEOM_USE_PARTIAL_USOLIDS")
|
||||
foreach(__g4_usolid_shape ${GEANT4_USE_PARTIAL_USOLIDS_SHAPE_LIST})
|
||||
list(APPEND GEANT4_USOLIDS_COMPILE_DEFINITIONS "-DG4GEOM_USE_U${__g4_usolid_shape}")
|
||||
endforeach()
|
||||
GEANT4_ADD_FEATURE(GEANT4_USE_USOLIDS "Replacing Geant4 solids with USolids equivalents for ${GEANT4_USE_PARTIAL_USOLIDS_SHAPE_LIST} (EXPERIMENTAL)")
|
||||
endif()
|
||||
|
||||
# Combined definitions
|
||||
add_definitions(${GEANT4_USOLIDS_COMPILE_DEFINITIONS})
|
||||
|
||||
# Add USolids inc dirs here - can be removed once USolids supports
|
||||
# INTERFACE_INCLUDE_DIRECTORIES
|
||||
include_directories(${USOLIDS_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
GEANT4_ADD_FEATURE(GEANT4_USE_USOLIDS "Replacing Geant4 solids with USolids equivalents (EXPERIMENTAL)")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Optional support for Freetype - Requires external Freetype install
|
||||
|
||||
@@ -327,25 +327,29 @@ macro(_g4tc_configure_tc_variables SHELL_FAMILY SCRIPT_NAME)
|
||||
# - CLHEP...
|
||||
if(GEANT4_USE_SYSTEM_CLHEP)
|
||||
# Have to use detected CLHEP paths to set base dir and others
|
||||
get_filename_component(_CLHEP_BASE_DIR ${CLHEP_INCLUDE_DIR} PATH)
|
||||
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_filename_component(_CLHEP_LIB_DIR ${CLHEP_Vector_LIBRARY} PATH)
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::Vector LOCATION)
|
||||
else()
|
||||
get_filename_component(_CLHEP_LIB_DIR ${CLHEP_LIBRARY} PATH)
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::CLHEP LOCATION)
|
||||
endif()
|
||||
|
||||
set(GEANT4_TC_G4LIB_USE_CLHEP "# USING SYSTEM CLHEP")
|
||||
_g4tc_setenv_command(GEANT4_TC_CLHEP_BASE_DIR ${SHELL_FAMILY} CLHEP_BASE_DIR ${_CLHEP_BASE_DIR})
|
||||
get_filename_component(_CLHEP_LIB_DIR "${_CLHEP_LIB_DIR}" REALPATH)
|
||||
get_filename_component(_CLHEP_LIB_DIR "${_CLHEP_LIB_DIR}" DIRECTORY)
|
||||
|
||||
_g4tc_setenv_command(GEANT4_TC_CLHEP_INCLUDE_DIR ${SHELL_FAMILY} CLHEP_INCLUDE_DIR ${CLHEP_INCLUDE_DIR})
|
||||
set(GEANT4_TC_G4LIB_USE_CLHEP "# USING SYSTEM CLHEP")
|
||||
_g4tc_setenv_command(GEANT4_TC_CLHEP_BASE_DIR ${SHELL_FAMILY} CLHEP_BASE_DIR "${_CLHEP_BASE_DIR}")
|
||||
_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_filename_component(_curlib "${_clhep_lib}" NAME)
|
||||
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()
|
||||
@@ -757,11 +761,14 @@ foreach(_shell bourne;cshell)
|
||||
if(GEANT4_USE_SYSTEM_CLHEP)
|
||||
# Handle granular vs singular cases
|
||||
if(GEANT4_USE_SYSTEM_CLHEP_GRANULAR)
|
||||
get_filename_component(_CLHEP_LIB_DIR ${CLHEP_Vector_LIBRARY} PATH)
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::Vector LOCATION)
|
||||
else()
|
||||
get_filename_component(_CLHEP_LIB_DIR ${CLHEP_LIBRARY} PATH)
|
||||
get_target_property(_CLHEP_LIB_DIR CLHEP::CLHEP LOCATION)
|
||||
endif()
|
||||
|
||||
get_filename_component(_CLHEP_LIB_DIR "${_CLHEP_LIB_DIR}" REALPATH)
|
||||
get_filename_component(_CLHEP_LIB_DIR "${_CLHEP_LIB_DIR}" DIRECTORY)
|
||||
|
||||
_g4tc_prepend_path(GEANT4_TC_CLHEP_LIB_PATH_SETUP
|
||||
${_shell}
|
||||
${_libpathname}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
using namespace std;
|
||||
|
||||
|
||||
#define MakePtr( cast, ptr, addValue ) (cast)( (DWORD)(ptr) + (DWORD)(addValue))
|
||||
#define MakePtr( cast, ptr, addValue ) (cast)( (DWORD_PTR)(ptr) + (DWORD_PTR)(addValue))
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLibSymbolInfo
|
||||
|
||||
@@ -157,7 +157,7 @@ endif()
|
||||
# Locate ourselves, since all other config files should have been
|
||||
# installed alongside us...
|
||||
#
|
||||
get_filename_component(_thisdir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_geant4_thisdir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Provide *recommended* compiler flags used by this build of Geant4
|
||||
@@ -202,6 +202,22 @@ endif()
|
||||
|
||||
@GEANT4_MODULE_PATH_SETUP@
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Re-Configure paths for third party packages.
|
||||
# - Refind any needed external/imported targets.
|
||||
# - Relies on same/compatible packages being in the paths CMake uses to
|
||||
# search for packages
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# If we have used imported targets for any third party packages, reimport
|
||||
# them here, BEFORE we try and import the Geant4 targets which are
|
||||
# linked against them.
|
||||
# Generally, we try and use a standard find_package, but try and force it
|
||||
# to find the actual package we were built against.
|
||||
# THIS IS NOT PERFECT, AS IT CANNOT GUARANTEE A BINARY COMPATIBLE
|
||||
# PACKAGE IS FOUND.
|
||||
@GEANT4_THIRD_PARTY_IMPORT_SETUP@
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Configure the path(s) to third party headers.
|
||||
# This is not a perfect solution to recording dependencies on external
|
||||
@@ -219,31 +235,6 @@ set(Geant4_INCLUDE_DIRS
|
||||
${Geant4_INCLUDE_DIR}
|
||||
${Geant4_THIRD_PARTY_INCLUDE_DIRS})
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# If we have used imported targets for any third party packages, reimport
|
||||
# them here, BEFORE we try and import the Geant4 targets which are
|
||||
# linked against them.
|
||||
# Generally, we try and use a standard find_package, but try and force it
|
||||
# to find the actual package we were built against.
|
||||
# THIS IS NOT PERFECT, AS IT CANNOT GUARANTEE A BINARY COMPATIBLE
|
||||
# PACKAGE IS FOUND.
|
||||
@GEANT4_THIRD_PARTY_IMPORT_SETUP@
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Include the files listing all the imported targets and configuring
|
||||
# Intel Compile Features
|
||||
# (Not needed if used in the same Geant4 project, or if we have run before)
|
||||
# This is always installed in the same location as us...
|
||||
#
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL Geant4)
|
||||
include("${_thisdir}/Modules/IntelCompileFeatures.cmake")
|
||||
|
||||
if(NOT Geant4_LIBDEPS_LOADED)
|
||||
include("${_thisdir}/Geant4LibraryDepends.cmake")
|
||||
set(Geant4_LIBDEPS_LOADED 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Data Resources
|
||||
# NB: Because data paths can be "forward declared" these offer no
|
||||
@@ -273,6 +264,16 @@ unset(Geant4_DATASET_DESCRIPTIONS)
|
||||
set(Geant4_builtin_clhep_FOUND @GEANT4_USE_BUILTIN_CLHEP@)
|
||||
if(NOT Geant4_builtin_clhep_FOUND)
|
||||
set(Geant4_system_clhep_ISGRANULAR @GEANT4_USE_SYSTEM_CLHEP_GRANULAR@)
|
||||
|
||||
set(CLHEP_ROOT_DIR "@CLHEP_ROOT_DIR@")
|
||||
set(__GEANT4_OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||
set(CMAKE_MODULE_PATH "${_geant4_thisdir}/Modules" ${CMAKE_MODULE_PATH})
|
||||
find_package(CLHEP @CLHEP_VERSION@ REQUIRED @__g4_clhep_components@)
|
||||
set(CMAKE_MODULE_PATH ${__GEANT4_OLD_CMAKE_MODULE_PATH})
|
||||
unset(CLHEP_ROOT_DIR)
|
||||
unset(__GEANT4_OLD_CMAKE_MODULE_PATH)
|
||||
#CLHEP doesn't use target properties fully yet, so always include_directories
|
||||
include_directories(${CLHEP_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
set(Geant4_builtin_expat_FOUND @GEANT4_USE_BUILTIN_EXPAT@)
|
||||
@@ -304,7 +305,7 @@ if(Geant4_g3tog4_FOUND)
|
||||
endif()
|
||||
|
||||
# - Usolids
|
||||
set(Geant4_usolids_FOUND @GEANT4_USE_USOLIDS@)
|
||||
set(Geant4_usolids_FOUND @GEANT4_USE_USOLIDS_EITHER@)
|
||||
if(Geant4_usolids_FOUND)
|
||||
list(REMOVE_ITEM Geant4_FIND_COMPONENTS usolids)
|
||||
endif()
|
||||
@@ -488,6 +489,20 @@ if(Geant4_vis_openinventor_FOUND)
|
||||
list(REMOVE_ITEM Geant4_FIND_COMPONENTS vis_openinventor)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Include the files listing all the imported targets and configuring
|
||||
# Intel Compile Features
|
||||
# (Not needed if used in the same Geant4 project, or if we have run before)
|
||||
# This is always installed in the same location as us...
|
||||
#
|
||||
if(NOT CMAKE_PROJECT_NAME STREQUAL Geant4)
|
||||
include("${_geant4_thisdir}/Modules/IntelCompileFeatures.cmake")
|
||||
|
||||
if(NOT Geant4_LIBDEPS_LOADED)
|
||||
include("${_geant4_thisdir}/Geant4LibraryDepends.cmake")
|
||||
set(Geant4_LIBDEPS_LOADED 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Now perform final configuration of libraries...
|
||||
@@ -614,7 +629,7 @@ list(REMOVE_DUPLICATES Geant4_LIBRARIES)
|
||||
# Point the user to the UseGeant4.cmake file which they may wish to include
|
||||
# to help them with setting up Geant4
|
||||
#
|
||||
set(Geant4_USE_FILE ${_thisdir}/UseGeant4.cmake)
|
||||
set(Geant4_USE_FILE "${_geant4_thisdir}/UseGeant4.cmake")
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Finally, handle any remaining components.
|
||||
|
||||
@@ -57,8 +57,6 @@ description="Geant4 toolkit for the simulation of the passage of particles throu
|
||||
version="@Geant4_VERSION@"
|
||||
|
||||
# 'Requires' that may affect cflags and libs.
|
||||
clhep_config_exe=@CLHEP_CONFIG_EXECUTABLE@
|
||||
|
||||
# Basic flags and libraries for visualization
|
||||
vis_cflags="-DG4UI_USE_TCSH"
|
||||
|
||||
@@ -131,7 +129,7 @@ have_clhep="@G4_BUILTWITH_CLHEP@"
|
||||
feature_list="${feature_list} clhep[${have_clhep}]"
|
||||
|
||||
if test "x${have_clhep}" = "xno" ; then
|
||||
cflags="${cflags} `${clhep_config_exe} --include`"
|
||||
cflags="${cflags} -I@G4_SYSTEM_CLHEP_INCLUDE_DIR@"
|
||||
libs="${libs} @G4_SYSTEM_CLHEP_LIBRARIES@"
|
||||
fi
|
||||
if test "x${have_clhep}" = "xyes" ; then
|
||||
|
||||
Reference in New Issue
Block a user