find_package() on OSX seems to use my home directory as a prefix to which it applies its rules for locating a package. I don’t see $HOME listed in the search procedure. Is it missing from the list? If not, which of the 9 items is referring to my home directory in some subtle way?
I’d like to disable the use of $HOME in the search procedure. Can this be done?
Using the --debug-find flag, you can see where the prefix is coming from. This would be needed before knowing how to disable it anyways. I suspect that you might have one of:
Answering my own question because I hit it again three years later.
CMake looks for packages following your PATH. If your home directory is in your path it will search all subdirectories of your home directory.
Also, CMake will strip /bin and /sbin off of PATH entries and check directories so resolved. In my case, since $HOME/bin was in my PATH, CMake would strip off “/bin” and then search everything in my home directory.
‘–debug-find’ really doesn’t help tell you why a path was searched. AFAICT, there is no good way to know which find_package rule resulted in finding a package in some odd location.
I’m not a fan of this behavior, but I doubt it will change.