Import Geant4 11.1.1 source tree
This commit is contained in:
@@ -25,7 +25,7 @@ endif()
|
||||
#Note that the second suggested path is G4 specific...
|
||||
find_path(STATTEST_APP_DIR
|
||||
NAMES StatTestVersion.py
|
||||
PATHS ${STATTEST_ROOT_DIR} ${CMAKE_SOURCE_DIR}/verification/StatTest
|
||||
PATHS ${STATTEST_ROOT_DIR} ${PROJECT_SOURCE_DIR}/verification/StatTest
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
|
||||
@@ -103,10 +103,10 @@ if(GEANT4_ENABLE_TESTING)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/tests)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
if(EXISTS ${CMAKE_SOURCE_DIR}/benchmarks)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/benchmarks)
|
||||
add_subdirectory(benchmarks)
|
||||
endif()
|
||||
if(EXISTS ${CMAKE_SOURCE_DIR}/verification)
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/verification)
|
||||
add_subdirectory(verification)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -249,7 +249,7 @@ function(geant4_add_unit_tests)
|
||||
if(IS_ABSOLUTE ${incdir})
|
||||
include_directories(${incdir})
|
||||
else()
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/${incdir})
|
||||
include_directories(${PROJECT_SOURCE_DIR}/source/${incdir})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ include(InstallRequiredSystemLibraries)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Copy/Generate common resource files into formats CPack generators like
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/README.txt "
|
||||
file(WRITE ${PROJECT_BINARY_DIR}/README.txt "
|
||||
Geant4
|
||||
======
|
||||
A toolkit for the simulation of the passage of particles through matter.
|
||||
@@ -155,7 +155,7 @@ configure_file(
|
||||
CMakeCPackOptions.cmake
|
||||
@ONLY
|
||||
)
|
||||
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake)
|
||||
set(CPACK_PROJECT_CONFIG_FILE ${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake)
|
||||
include(CPack)
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@ if(GEANT4_ENABLE_TESTING)
|
||||
|
||||
# - Geant4_DIR is needed to locate GeantConfig.cmake file required
|
||||
# by tests and examples
|
||||
set(Geant4_DIR ${CMAKE_BINARY_DIR} CACHE PATH "Current build directory")
|
||||
set(Geant4_DIR ${PROJECT_BINARY_DIR} CACHE PATH "Current build directory")
|
||||
|
||||
# - Add datasets to testing environment
|
||||
geant4_get_datasetnames(_dslist)
|
||||
@@ -53,7 +53,7 @@ endif()
|
||||
# Add Unit Tests if required
|
||||
#
|
||||
if(GEANT4_BUILD_TESTS)
|
||||
file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} source/CMakeLists.txt)
|
||||
file(GLOB_RECURSE files RELATIVE ${PROJECT_SOURCE_DIR} source/CMakeLists.txt)
|
||||
foreach( file ${files} )
|
||||
get_filename_component(path ${file} PATH)
|
||||
if(path MATCHES "/test$")
|
||||
|
||||
@@ -187,12 +187,6 @@ configure_file(
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/G4VecGeomShim.cmake
|
||||
${PROJECT_BINARY_DIR}/G4VecGeomShim.cmake
|
||||
COPYONLY
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/G4X11Shim.cmake
|
||||
${PROJECT_BINARY_DIR}/G4X11Shim.cmake
|
||||
@@ -274,7 +268,6 @@ install(FILES
|
||||
${PROJECT_BINARY_DIR}/G4EXPATShim.cmake
|
||||
${PROJECT_BINARY_DIR}/G4FreetypeShim.cmake
|
||||
${PROJECT_BINARY_DIR}/G4HDF5Shim.cmake
|
||||
${PROJECT_BINARY_DIR}/G4VecGeomShim.cmake
|
||||
${PROJECT_BINARY_DIR}/G4MotifShim.cmake
|
||||
${PROJECT_BINARY_DIR}/G4X11Shim.cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/UseGeant4.cmake
|
||||
|
||||
@@ -694,7 +694,7 @@ macro(_g4tc_configure_build_tree_scripts SCRIPT_NAME)
|
||||
|
||||
# Configure the file - goes straight into the binary dir
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/Templates/geant4make-skeleton.in
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/geant4make-skeleton.in
|
||||
${PROJECT_BINARY_DIR}/${SCRIPT_NAME}${GEANT4_TC_SHELL_EXTENSION}
|
||||
@ONLY
|
||||
)
|
||||
@@ -715,7 +715,7 @@ macro(_g4tc_configure_install_tree_scripts CONFIGURE_DESTINATION SCRIPT_NAME INS
|
||||
|
||||
# Configure the file
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/Templates/geant4make-skeleton.in
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/geant4make-skeleton.in
|
||||
${CONFIGURE_DESTINATION}/${SCRIPT_NAME}${GEANT4_TC_SHELL_EXTENSION}
|
||||
@ONLY
|
||||
)
|
||||
@@ -835,7 +835,7 @@ set(TOOLS_FONT_PATH "\"`cd \$geant4make_root/../fonts > /dev/null ; pwd`\"")
|
||||
|
||||
# - Configure the shell scripts for the INSTALL TREE
|
||||
_g4tc_configure_install_tree_scripts(
|
||||
${CMAKE_BINARY_DIR}/InstallTreeFiles
|
||||
${PROJECT_BINARY_DIR}/InstallTreeFiles
|
||||
geant4make
|
||||
${CMAKE_INSTALL_DATADIR}/geant4make
|
||||
)
|
||||
@@ -1010,7 +1010,7 @@ foreach(_shell IN LISTS shells_list)
|
||||
|
||||
# Configure the file
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/Templates/geant4-env-skeleton.in
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/geant4-env-skeleton.in
|
||||
${PROJECT_BINARY_DIR}/InstallTreeFiles/${_scriptfullname}
|
||||
@ONLY
|
||||
)
|
||||
@@ -1099,7 +1099,7 @@ rem Uncomment the line and edit the path to the dataset if installed in not stan
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/Templates/geant4-bat-skeleton.in
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/geant4-bat-skeleton.in
|
||||
${PROJECT_BINARY_DIR}/InstallTreeFiles/${_scriptfullname}
|
||||
@ONLY
|
||||
)
|
||||
|
||||
@@ -60,7 +60,7 @@ function(get_system_include_dirs _dirs)
|
||||
# Only for GCC, Clang and Intel
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Clang OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
|
||||
# Proceed
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/g4dummy" "\n")
|
||||
file(WRITE "${PROJECT_BINARY_DIR}/CMakeFiles/g4dummy" "\n")
|
||||
|
||||
# Save locale, them to "C" english locale so we can parse in English
|
||||
set(_orig_lc_all $ENV{LC_ALL})
|
||||
@@ -72,12 +72,12 @@ function(get_system_include_dirs _dirs)
|
||||
set(ENV{LANG} C)
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -v -E -x c++ -dD g4dummy
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/CMakeFiles
|
||||
ERROR_VARIABLE _cxxOutput
|
||||
OUTPUT_VARIABLE _cxxStdout
|
||||
)
|
||||
|
||||
file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/g4dummy")
|
||||
file(REMOVE "${PROJECT_BINARY_DIR}/CMakeFiles/g4dummy")
|
||||
|
||||
# Parse and extract search dirs
|
||||
set(_resultIncludeDirs )
|
||||
@@ -349,7 +349,7 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS)
|
||||
|
||||
# Configure the build tree script
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/Templates/geant4-config.in
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/geant4-config.in
|
||||
${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/geant4-config
|
||||
@ONLY
|
||||
)
|
||||
@@ -390,7 +390,7 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS)
|
||||
|
||||
# Configure the install tree script
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/Templates/geant4-config.in
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/geant4-config.in
|
||||
${PROJECT_BINARY_DIR}/InstallTreeFiles/geant4-config
|
||||
@ONLY
|
||||
)
|
||||
@@ -409,7 +409,7 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS)
|
||||
if(WIN32)
|
||||
# No configuration just a copy
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/cmake/Templates/geant4-config-cmd.in
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/geant4-config-cmd.in
|
||||
${PROJECT_BINARY_DIR}/InstallTreeFiles/geant4-config.cmd
|
||||
@ONLY
|
||||
)
|
||||
|
||||
@@ -296,11 +296,6 @@ endif()
|
||||
# - Geant4 USolids/VecGom setup
|
||||
if(GEANT4_USE_ALL_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS)
|
||||
find_package(VecGeom 1.2.0 REQUIRED)
|
||||
# Shim until VecGeom supports config mode properly
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/G4VecGeomShim.cmake")
|
||||
# Backward Compatibility
|
||||
set(VECGEOM_LIBRARIES VecGeom::vecgeom)
|
||||
|
||||
geant4_save_package_variables(VecGeom VecGeom_DIR)
|
||||
|
||||
# If VecCore_DIR is set, means updated VecGeom install used, so
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
# Create imported target to help use VecGeom (a mess because the VecGeomConfig is...)
|
||||
if(VecGeom_FOUND)
|
||||
if(NOT TARGET VecGeom::vecgeom)
|
||||
add_library(VecGeom::vecgeom UNKNOWN IMPORTED)
|
||||
# VecGeom's config file is awful, so the following is neccessary...
|
||||
foreach(__vglib ${VECGEOM_LIBRARIES})
|
||||
if(__vglib MATCHES ".*libvecgeom\.(a|so|dylib|lib|dll)$")
|
||||
set(VECGEOM_LIBRARY "${__vglib}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
string(REGEX REPLACE "^\-D|;-D" ";" VECGEOM_COMPILE_DEFINITIONS "${VECGEOM_DEFINITIONS}")
|
||||
set_target_properties(VecGeom::vecgeom PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "${VECGEOM_COMPILE_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${VECGEOM_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${VECGEOM_LIBRARIES}"
|
||||
IMPORTED_LOCATION "${VECGEOM_LIBRARY}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user