[Cmake] FindPackage + UsePackage

Brad King brad.king at kitware.com
Tue Apr 8 18:09:47 EDT 2003


> However, the FindXYZ.cmake files then would still have to be changed to
> allow differentiating between debug and optimized versions of the
> library, i.e.

This is probably a good idea.  Most of the find modules were written
before the optimized/debug option was provided by the linking commands.

> I'd prefer updating the FindXYZ.cmake files and

You can do this easily in your project without modifying CMake.  The
FIND_PACKAGE command looks through a path defined by CMAKE_MODULE_PATH to
find the FindXYZ.cmake file corresponding to the XYZ package.  You can do
this:

SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/MyCMakeModules"
    ${CMAKE_MODULE_PATH})
# ... define your FIND_AND_USE_PACKAGE macro ...
FIND_AND_USE_PACKAGE(XYZ)

Then place all your modified copies of the module files in MyCMakeModules.
Once we have all agreed on changes you've made, we can move the new
FindXYZ.cmake file into CMake proper.

-Brad




More information about the CMake mailing list