Skip to content

CMake: Issues with install and fetched packages (for out-of-tree compilation) #6193

Description

@fredroy

Since CMake 3.24, CMake automatically searches targets/deps in the install path (CMAKE_INSTALL_PREFIX).
https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_USE_INSTALL_PREFIX.html

This raises errors with find_or_fetched libs such as gtest, tight_inclusion, cxxopts...
If you compiles and install after building, then the next cmake generation will find those in the CMAKE_INSTALL_PREFIX directory, not in the one fetched.

The solution is: CMAKE_FIND_USE_INSTALL_PREFIX=OFF + cleared stale *_DIR hints, so deps fetch cleanly rather than resolving to your prior install.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bug (minor)Bug affecting only some users or with no major impact on the frameworkissue: informationAnnouncement, howto, etc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions