Ideal way to force find_package to use a given folder

We are using find_package in CONFIG mode and our developer instructions require setting PACKAGE_DIR as the location when running the cmake.
The directory is a git-submodule at a very specific commit we need
(FWIW package is LLVM)

I found that some users who may have the package installed via something such as homebrew on MacOS and cmake is picking up that installation instead.

I am surprised us setting PACKAGE_DIR on the command line is not overriding the search.
Is there something else we should be doing?

Dit you try to set CMAKE_PREFIX_PATH?

Turned out the person had some environment variables that were causing problems :frowning:

Thank you for responding though.

If you didn’t know, passing the --debug-find flag when configuring can help track down these kinds of things.