[CMake] Forcing CMake to never search install path

John Drescher drescherjm at gmail.com
Sun May 15 21:12:10 EDT 2011


> I've been struggling to find a way to prevent CMake from using
> CMAKE_INSTALL_PREFIX in any of its FIND_* routines.  Generally
> speaking, stripping it out of CMAKE_SYSTEM_PREFIX_PATH seems to work,
> but we're still getting situations on Windows where it is finding old
> libraries from previous program installs.  I've tried ensuring all of
> the CMAKE_SYSTEM_*_PATH variables are stripped, but that doesn't seem
> to make a difference.
>
> Is there a mechanism I can use to specify to CMake to NEVER search in
> a given path, excluding it from all FIND_* routine searches?  It is
> very typical in our development process to have older builds installed
> and be building newer versions at the same time, so we really need a
> good solid way to make sure previously built libraries aren't picked
> up by FIND routines.
>

Not that I have a solution however I too am looking to solve this
problem. For me its not so much about INSTALL paths since I almost
never run the INSTALL targets (at least not on projects that do not
have different names for release and debug) on windows but it's more
that a 32 bit build for Visual Studio 2005 will find the 64 bit Qt I
built for Visual Studio 2010. I am thinking of looking into batch
files and environment variables however I am not sure how many
packages will use environment variables like ( ITK_DIR, VTK_DIR ...)

John


More information about the CMake mailing list