[CMake] FIND_PATH and CMAKE_INSTALL_PREFIX

Clifford Yapp cliffyapp at gmail.com
Thu Sep 2 12:23:27 EDT 2010


Nevermind, carry on - I realized that all I had to do was set
CMAKE_INSTALL_PREFIX to "" at the beginning of the file - it's "off"
for the Find* routines and re-set by the end of the process.

CY

On 9/2/10, Clifford Yapp <cliffyapp at gmail.com> wrote:
> I have a setup in CMake where I am deliberately re-setting a few
> variables to NOTFOUND in macros in order to allow an option change to
> re-populate them.  Unfortunately, I have run into a rather curious
> behavior that I'm not quite sure how to disable.
>
> The FIND_* routines on the first configure pass are reporting what I
> expect, but on the second pass they are finding already-installed
> copies of things in CMAKE_INSTALL_PREFIX.  It seems that this
> directory is getting added to the FIND_PATH search list, and I very
> definitely don't want this to happen.  Unfortunately, so far I have
> not found any way to PREVENT this, and the only workaround involves
> manually checking for the presence of CMAKE_INSTALL_PREFIX in the
> resulting found items and stripping them out.  This seems like a very
> very ugly hack and would require local versions of every Find*.cmake
> routine needed by my program - is there any other way to keep
> CMAKE_INSTALL_PREFIX out of the search path on repeated passes of
> cmake?
>
> Cheers,
> CY
>


More information about the CMake mailing list