[CMake] Adding user defined search path for find_package

Michael Wild themiwi at gmail.com
Tue Jan 10 05:25:38 EST 2012


On 01/10/2012 11:14 AM, Martin Uhrin wrote:
> Dear CMake community,
> 
> firstly, thank you for the extremely useful build tool, it's saved me a
> lot of time and effort!
> 
> I'm trying to solve the following problem:
> 
> I'd like the user (i.e. non-developer compiling my code) to have the
> option to specify a location for an external library and *iff* this
> option is set it should be used as the 'top-priority' search location
> for that library, falling back to all the others if it is not found or
> not set.  Ideally this option would be set as a variable so that it is
> visible in e.g. ccmake.
> 
> The reason for doing this is that if the user just sets a variable to
> indicate the library path I would then have to manually check that the
> library does indeed exist at that path.
> 
> Is there a way to do this?
> 
> Many thanks,
> -Martin

There are quite a few such variables:

CMAKE_PREFIX_PATH
CMAKE_LIBRARY_PATH
CMAKE_INCLUDE_PATH
CMAKE_PROGRAM_PATH
CMAKE_FRAMEWORK_PATH
CMAKE_APPBUNDLE_PATH
CMAKE_IGNORE_PATH


Michael



More information about the CMake mailing list