Skip to content

Commit

Permalink
Merge pull request #45 from rest-for-physics/lobis-geant4-version-check
Browse files Browse the repository at this point in the history
Added check for Geant4 C++ std to be C++17
  • Loading branch information
jgalan authored May 20, 2022
2 parents c808136 + b5a81a8 commit 2ebfb2f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ find_package(Geant4 REQUIRED ui_all vis_all)
include(${Geant4_USE_FILE})
message("-- Found Geant4 version: ${Geant4_VERSION}")

# Check Geant4 C++ standard is correct
execute_process(COMMAND geant4-config --cxxstd OUTPUT_VARIABLE GEANT4_CXX_STD)
if (NOT ${GEANT4_CXX_STD} MATCHES "17")
message(FATAL_ERROR "Geant4 installation was compiled with C++${GEANT4_CXX_STD} standard, but C++17 is required for REST")
endif()

# Fix for older Geant4 versions
if (${Geant4_VERSION} VERSION_LESS 11.0.0)
add_compile_definitions(GEANT4_VERSION_LESS_11_0_0)
Expand Down

0 comments on commit 2ebfb2f

Please sign in to comment.