[CMake] Search paths for FooConfig.cmake files

Brad King brad.king at kitware.com
Tue Dec 9 10:15:50 EST 2008


Jose Luis Blanco wrote:
> Hello CMake developers!
> 
> I've been thinking it would be interesting that CMake could look for
> FooConfig.cmake package files in some likely paths such as C:\Program
> Files\Foo-XXX\ . This is for Windows, of course, but perhaps could be
> extended to /opt/foo-XXX/ in Unix systems.
> 
> I've written a patch for this task:
> http://public.kitware.com/Bug/view.php?id=8264
> 
> I know the order in which directories are searched IS an issue, and I
> decided it's place seems to be between these two paths:
> 
> =================
> ...
> 4. Search the standard system environment variables. This can be skipped
> if NO_SYSTEM_ENVIRONMENT_PATH is passed. Path entries ending in "/bin"
> or "/sbin" are automatically converted to their parent directories.
> 
>    PATH
> 
> 5. Typical instalation paths. For now this only applies to Windowsfor
> the paths that match the following pattern (where <name> iscase
> insensitive):
> 
>   ${ProgramFiles}/<name>* (W)
> 
> 6. Search project build trees recently configured in a CMake GUI. This
> can be skipped if NO_CMAKE_BUILDS_PATH is passed. It is intended for the
> case when a user is building multiple dependent projects one after another.
> ...
> =================
> 
> 
> I'd be glad of seeing this feature in future releases of CMake, so
> please let me know if anyone see any compatibility problem in this patch
> and how to deal with it.

Thanks for the patch.  Looking in ProgramFiles has been on my todo list 
for this command for a while.  I'll look at your patch when I get a chance.

Thanks,
-Brad



More information about the CMake mailing list