View | Details | Raw Unified | Return to problem 2556
Collapse All | Expand All

(-)a/cmake/Modules/G4CMakeUtilities.cmake (+15 lines)
Lines 221-226 function(geant4_export_package_variables _file) Link Here
221
      get_property(__var_value CACHE ${__var} PROPERTY VALUE)
221
      get_property(__var_value CACHE ${__var} PROPERTY VALUE)
222
      get_property(__var_type CACHE ${__var} PROPERTY TYPE)
222
      get_property(__var_type CACHE ${__var} PROPERTY TYPE)
223
      get_property(__var_help CACHE ${__var} PROPERTY HELPSTRING)
223
      get_property(__var_help CACHE ${__var} PROPERTY HELPSTRING)
224
      # Variable may not be in cache, only local (canonical case being EXPAT_LIBRARY since CMake 3.27)
225
      # We still need to account for these because they may be required to be in the CACHE at least set in
226
      # earlier versions.
227
      # 1. Variable may not be in cache, only local (canonical case being EXPAT_LIBRARY since CMake 3.27)
228
      #    We still need to account for these because they may be required to be in the CACHE at least set in
229
      #    earlier versions.
230
      # 2. Depending on CMake version, variable may be in cache but unitialized, here we want the local value
231
      if(((NOT __var_value) AND (NOT __var_type) AND (NOT __var_help)) OR (__var_type STREQUAL "UNINITIALIZED"))
232
        set(__var_value ${${__var}})
233
        # TODO: set type based on whether it looks like a bool or path, but PATH almost invariably what we save
234
        # Only important in cmake GUI and if value needs to be changed, which we don't if package cache is used
235
        set(__var_type PATH)
236
        set(__var_help "no documentation, not a cache value")
237
      endif()
238
224
      list(APPEND __local_build_setting "geant4_set_and_check_package_variable(${__var} \"${__var_value}\" ${__var_type} \"${__var_help}\")")
239
      list(APPEND __local_build_setting "geant4_set_and_check_package_variable(${__var} \"${__var_value}\" ${__var_type} \"${__var_help}\")")
225
    endforeach()
240
    endforeach()
226
241
(-)a/cmake/Modules/G4OptionalComponents.cmake (-1 / +3 lines)
Lines 78-83 else() Link Here
78
      unset(EXPAT_FOUND)
78
      unset(EXPAT_FOUND)
79
      unset(EXPAT_INCLUDE_DIR CACHE)
79
      unset(EXPAT_INCLUDE_DIR CACHE)
80
      unset(EXPAT_LIBRARY CACHE)
80
      unset(EXPAT_LIBRARY CACHE)
81
      unset(EXPAT_LIBRARY_RELEASE CACHE)
82
      unset(EXPAT_LIBRARY_DEBUG CACHE)
81
      message(FATAL_ERROR
83
      message(FATAL_ERROR
82
"Detected system expat header and library:
84
"Detected system expat header and library:
83
EXPAT_INCLUDE_DIR = ${__badexpat_include_dir}
85
EXPAT_INCLUDE_DIR = ${__badexpat_include_dir}
Lines 88-94 Set the above CMake variables to point to an expat install of the required versi Link Here
88
90
89
    # Backward compatibility for sources.cmake using the variable
91
    # Backward compatibility for sources.cmake using the variable
90
    set(EXPAT_LIBRARIES EXPAT::EXPAT)
92
    set(EXPAT_LIBRARIES EXPAT::EXPAT)
91
    geant4_save_package_variables(EXPAT EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
93
    geant4_save_package_variables(EXPAT EXPAT_INCLUDE_DIR EXPAT_LIBRARY EXPAT_LIBRARY_RELEASE EXPAT_LIBRARY_DEBUG)
92
  else()
94
  else()
93
    set(EXPAT_FOUND TRUE)
95
    set(EXPAT_FOUND TRUE)
94
    set(GEANT4_USE_BUILTIN_EXPAT TRUE)
96
    set(GEANT4_USE_BUILTIN_EXPAT TRUE)

Return to problem 2556