[Cmake] Find & Use Modules in CMake

Brad King brad.king at kitware.com
Fri Oct 4 16:53:45 EDT 2002


> 5. For projects that are built using CMake the FindFOO.cmake code should
> locate the FOO_ROOT and then include the FOO_ROOT/FindFOOImpl.cmake (or
> something like that, ideas for the name of the file?)

In order to avoid confusion with the unrelated CMAKE_ROOT, I would suggest
that we use FOO_DIR instead of FOO_ROOT.  Also, the name of
FindFOOImpl.cmake should probably be something like FOOConfig.cmake since
the cmake GUI user will have to look for the file when setting FOO_DIR.

> 6. FindFOO.cmake modules are welcome to set a variable USE_FOO_FILE that
> points to a UseFOO.cmake file. The UseFOO.cmake file can set the
> LINK_DIRECTORIES and LINK_LIBRARIES and ADD_DEFINITIONS. For smaller
> projects there isn't really a need for a UseFOO.cmake file. But for
> large projects this can make using the project a little easier.

I suggest that we call this "FOO_USE_FILE" so that all settings in
FindFOO.cmake start with "FOO_".  Also, "USE_FOO_FILE" can be confused
with options like "USE_ANSI_STDLIB" in the client code.

-Brad




More information about the CMake mailing list