[CMake] find_package with ###Config.cmake

Micha Renner Micha.Renner at t-online.de
Fri Dec 3 01:11:23 EST 2010


There is a small library "TLib" which is installed like this

Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libTLibd.so
-- Installing: /usr/local/lib/TLib/TLibExport.cmake
-- Installing: /usr/local/lib/TLib/TLibExport-debug.cmake
-- Installing: /usr/local/include/TLib/cmFile.h
-- Installing: /usr/local/lib/TLib/TLIBConfig.cmake
-- Installing: /usr/local/lib/TLib/TLIBConfigVersion.cmake

The CMakeLists file for the application program has the following line
to find the library

FIND_PACKAGE(TLIB)

This works, surprisingly, very good. No CMAKE_MODULE_PATH, no TLIB_DIR
in this case. 

But...

If I call FIND_PACKAGE with version:
FIND_PACKAGE(TLIB 1.3)

I get the std-warning:
-----------------
CMake Warning at TestDLL/CMakeLists.txt:20 (FIND_PACKAGE):
  Could not find module FindTLIB.cmake or a configuration file for
package
  TLIB.

  Adjust CMAKE_MODULE_PATH or TLIB_DIR...
-----------------


Why can't CMake find the TLIBConfig file, if FIND_PACKAGE is called with
version and TLIB_DIR is not set? 

Greetings

Micha




More information about the CMake mailing list