[CMake] Specifying search path for FIND_PACKAGE

Brad King brad.king at kitware.com
Fri Nov 11 19:02:58 EST 2005


Filipe Sousa wrote:
> On Friday 11 November 2005 22:18, Amit Ramesh wrote:
>>     Is there a uniform way to specify the paths that FIND_PACKAGE
>>uses to search for installed packages. On Mac OS X, Fink is a popular
> By default FIND_PACKAGE will look into Find scripts in cmake Modules 
> directory. You can add a new search path by setting CMAKE_MODULE_PATH

For packages that have CMake Find modules then FIND_PACKAGE will always 
use the first Find module it encounters for a package.  What you 
probably want is for the Find module itself to look for its package in 
/sw.  One thing you can do is create a directory with copies of the 
CMake Find modules that you have modified to include /sw in the search 
path.  Then specify this directory in CMAKE_MODULE_PATH and FIND_PACKAGE 
will favor the new version.

If it is safe to use /sw packages for Darwin builds (instead of 
frameworks?) then you could contribute the fixes back to CMake and we 
will include the /sw search paths in the next release.

-Brad


More information about the CMake mailing list