Skip to content
Snippets Groups Projects
Commit bee2835e authored by Gloria Corti's avatar Gloria Corti
Browse files

Merge branch 'fix-data-dir-env-propagation' into 'master'

Modify Geant4Config.cmake to set data files env variables for LHCb projects

See merge request !86
parents 3a7e3b9c 717736c0
Branches
Tags
1 merge request!86Modify Geant4Config.cmake to set data files env variables for LHCb projects
......@@ -256,10 +256,16 @@ configure_file(
${PROJECT_BINARY_DIR}/InstallTreeFiles/Geant4Config.cmake
@ONLY
)
configure_file(
${PROJECT_SOURCE_DIR}/cmake/Templates/LHCbConfigSettings.cmake.in
${PROJECT_BINARY_DIR}/InstallTreeFiles/LHCbConfigSettings.cmake
@ONLY
)
# Install the config, config versioning and use files
install(FILES
${PROJECT_BINARY_DIR}/InstallTreeFiles/Geant4Config.cmake
${PROJECT_BINARY_DIR}/InstallTreeFiles/LHCbConfigSettings.cmake
${PROJECT_BINARY_DIR}/Geant4ConfigVersion.cmake
${PROJECT_BINARY_DIR}/G4EXPATShim.cmake
${PROJECT_BINARY_DIR}/G4FreetypeShim.cmake
......
......@@ -712,5 +712,8 @@ foreach(_comp ${Geant4_FIND_COMPONENTS})
endif()
endforeach()
# include special settings needed for LHCb projects
include("${CMAKE_CURRENT_LIST_DIR}/LHCbConfigSettings.cmake")
# And we should be done...
# Helper to define special settings needed by downstream LHCb projects
# Set environment variables for Geant4 data files (only if we have the lhcb_env command)
if(COMMAND lhcb_env)
lhcb_env(DEFAULT G4DATA "@GEANT4_INSTALL_DATADIR@")
foreach(_g4dataset_name IN LISTS Geant4_DATASETS)
string(REPLACE "@GEANT4_INSTALL_DATADIR@" "" _g4dataset_path "${Geant4_DATASET_${_g4dataset_name}_PATH}")
lhcb_env(SET "${Geant4_DATASET_${_g4dataset_name}_ENVVAR}" "\${G4DATA}/${_g4dataset_path}")
endforeach()
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment