[CMake] Query about FindXXX files

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Wed Sep 17 12:03:42 EDT 2008


Leo Breebaart schrieb:
> Christian Ehrlicher <Ch.Ehrlicher at gmx.de> writes:
> 
>> Leo Breebaart schrieb:
>>> In CMake 2.6.1, the header for FindTIFF.cmake says:
>>>
>>> # This module defines
>>> #  TIFF_INCLUDE_DIR, where to find tiff.h, etc.
>>> #  TIFF_LIBRARIES, libraries to link against to use TIFF.
>>> #  TIFF_FOUND, If false, do not try to use TIFF.
>>> # also defined, but not for general use are
>>> #  TIFF_LIBRARY, where to find the TIFF library.
>>>
>>> However, after executing:
>>>
>>>   FIND_PACKAGE(TIFF)
>>>
>>> my CMakeCache.txt now has the following entries:
>>>
>>>     TIFF_INCLUDE_DIR:PATH=/usr/include
>>>     TIFF_LIBRARY:FILEPATH=/usr/lib/libtiff.so
>>>
>>> So, in other words, the "not for general use" TIFF_LIBRARY
>>> variable is placed in my cache, while the promised TIFF_LIBRARIES
>>> variable is not.
>> Is there a reason why you want to have the other vars in
>> CMakeCache.txt? Isn't it enough to have them available?
> 
> Yes, it should be, I suppose. 
> 
> My use case is that I have in my sources a 3rd party non-CMake
> library that I need to include in my overall build. So I have
> 'cmakified' that library, and since it relies on libtiff, I call
> the FIND_PACKAGE(TIFF) in that CMakeFile, so it can also compile
> standalone.
> 
> Now elsewhere in my sources I have an application that actually
> uses the 3rd party library, but which of course still needs to
> link to libtiff as well. So I was attempting to add
> ${TIFF_LIBRARIES} to that application's TARGET_LINK_LIBRARIES,
> when I discovered the issues in my earlier message.
> 
Once you called FIND_PACKAGE(TIFF) all TIFF_foo vars are set to the 
correct value - at least it should be (and I never had problems with this)


Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080917/a98c2c3b/attachment.pgp>


More information about the CMake mailing list