# How to disable configuration warnings

**URL:** <https://geant4-forum.web.cern.ch/t/how-to-disable-configuration-warnings/10040>\
**Category:** Getting Started\
**Created:** [February 22, 2023, 7:22am UTC](https://geant4-forum.web.cern.ch/t/how-to-disable-configuration-warnings/10040 "2023-02-22T07:22:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mato](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/mato/32/126_2.png) [@mato](https://geant4-forum.web.cern.ch/u/mato)\
**Post date:** [February 22, 2023, 7:22am UTC](https://geant4-forum.web.cern.ch/t/how-to-disable-configuration-warnings/10040/1 "2023-02-22T07:22:01Z")

</div>

Please fill out the following information to help in answering your question, and also see [tips for posting code snippets](https://geant4-forum.web.cern.ch/t/how-to-post-code-snippets/9944)

_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?

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [February 22, 2023, 10:54am UTC](https://geant4-forum.web.cern.ch/t/how-to-disable-configuration-warnings/10040/2 "2023-02-22T10:54:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mato](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/mato/32/126_2.png) [@mato](https://geant4-forum.web.cern.ch/u/mato)\
**Post date:** [February 22, 2023, 12:54pm UTC](https://geant4-forum.web.cern.ch/t/how-to-disable-configuration-warnings/10040/3 "2023-02-22T12:54:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [February 22, 2023, 4:32pm UTC](https://geant4-forum.web.cern.ch/t/how-to-disable-configuration-warnings/10040/4 "2023-02-22T16:32:06Z")

</div>

Hmm, what packaging system is this? The installation of `Geant4PackageCache.cmake` is controlled by the [`GEANT4_INSTALL_PACKAGE_CACHE` CMake variable](https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/installguide.html#geant4-build-options%60) 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.

---

<div class="post-metadata">

**Author:** ![system](https://geant4-forum.web.cern.ch/uploads/default/original/1X/ce519a43ebdf7ac48a98a03c6ad6eea013b68c46.png) [@system](https://geant4-forum.web.cern.ch/u/system)\
**Post date:** [March 24, 2023, 4:32pm UTC](https://geant4-forum.web.cern.ch/t/how-to-disable-configuration-warnings/10040/5 "2023-03-24T16:32:40Z")

</div>

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