[CMake] Question about find package in Module mode

Alexander Neundorf a.neundorf-work at gmx.net
Wed Oct 10 14:58:56 EDT 2012


On Tuesday 09 October 2012, Fabio Fracassi wrote:
> Hello,
> 
> I am using find_package in Module mode for a Library that is also build
> using cmake.
> The Library is build in a way that it can be used both from the build
> dir, and from the installed location.
> 
> When using find_package it always seems to prefer the build dir version,
> which is somewhat surprising since I expect the default to be the
> (supposably more stable) installed version and that the build dir
> version (that could be broken at any time) needs some explicit interaction.
> 
> Is the current state the way it is supposed to be? Can I force CMake to
> do what I want?

Have you tried setting the environment variable CMAKE_PREFIX_PATH to point to 
the install location of your library ?

Alex


More information about the CMake mailing list