How to disable configuration warnings

Please fill out the following information to help in answering your question, and also see tips for posting code snippets

Geant4 Version: 10.7.2
Operating System: MacOS 11.6
cmake version: 3.21.2


I am using an existing installation of Geant4, but I had to change the location of the expat library with EXPAT_INCLUDE_DIR and EXPAT_LIBRARY to point to the currently existing installations. Is there a way to avoid the two warnings I am getting each time I configure my project?

CMake Warning at /Users/mato/.julia/artifacts/db3da3f31301d4e88f11774fa1b6063dc4dd0dff/lib/Geant4-10.7.2/Geant4PackageCache.cmake:9 (message):
  Value of 'EXPAT_INCLUDE_DIR' is already set and does not match value set at
  Geant4 build-time
Call Stack (most recent call first):
  /Users/mato/.julia/artifacts/db3da3f31301d4e88f11774fa1b6063dc4dd0dff/lib/Geant4-10.7.2/Geant4PackageCache.cmake:18 (geant4_set_and_check_package_variable)
  /Users/mato/.julia/artifacts/db3da3f31301d4e88f11774fa1b6063dc4dd0dff/lib/Geant4-10.7.2/Geant4Config.cmake:253 (include)
  CMakeLists.txt:15 (find_package)


CMake Warning at /Users/mato/.julia/artifacts/db3da3f31301d4e88f11774fa1b6063dc4dd0dff/lib/Geant4-10.7.2/Geant4PackageCache.cmake:9 (message):
  Value of 'EXPAT_LIBRARY' is already set and does not match value set at
  Geant4 build-time
Call Stack (most recent call first):
  /Users/mato/.julia/artifacts/db3da3f31301d4e88f11774fa1b6063dc4dd0dff/lib/Geant4-10.7.2/Geant4PackageCache.cmake:19 (geant4_set_and_check_package_variable)
  /Users/mato/.julia/artifacts/db3da3f31301d4e88f11774fa1b6063dc4dd0dff/lib/Geant4-10.7.2/Geant4Config.cmake:253 (include)
  CMakeLists.txt:15 (find_package)

These paths are encoded in the Geant4PackageCache.cmake file, i.e. at /Users/mato/.julia/artifacts/db3da3f31301d4e88f11774fa1b6063dc4dd0dff/lib/Geant4-10.7.2/Geant4PackageCache.cmake. The paths in there can either be edited, or the file can be removed entirely.

In the removal case, CMAKE_PREFIX_PATH and similar will be relied upon to find the dependencies.

Thanks Ben. Obviously cannot edit or delete the installed package.
Nevertheless I see that this file exists only on old versions. Would I have the same problem for more recent versions?

Hmm, what packaging system is this? The installation of Geant4PackageCache.cmake is controlled by the GEANT4_INSTALL_PACKAGE_CACHE CMake variable which has always been ON by default. Providing the packaging system in question guarantees a consistent use environment so that all of the dependencies are find-able by CMake, it’s safe to set that variable to OFF when configuring/building.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.