Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#69 closed defect (fixed)

CMake updates

Reported by: hobu Owned by: warmerdam
Priority: normal Milestone:
Component: libgeotiff Version: 1.3.0
Keywords: Cc:

Description

Apply patch from Charles Karney to do the following:

provide config-style find_package support plus a few other fixes.
Here's a summary of the changes...  Let me know if you have any
questions.

(1) Move find_package TIFF to after JPEG + ZLIB, so that the tests on
tiff can be carried out.

(2) Create configured geo_config.h in binary tree and set up include
directories to find it.  (Need to keep source tree clean.)

(3) Do a NO_MODULE find_package followed by a regular find_package on
all dependencies.  (Our builds of the dependencies all include
config-style find package scripts and we want these found first.)

(4) Set up LINK_VERSION and LINK_SOVERSION so that shared library
numbering matches that of autoconf.

(5) Set _d suffix for debug libraries so that these can be installed
besides the release libraries.

(6) Support for geotiff-config.cmake.  This allows the "config-style"
mode for find_package.  Typically, this is much more useful than the
"module-style" lookup for a cmake package because accurate version
checking can be done and because the libraries appear as "targets" to a
dependent package.

* INSTALL EXPORT for libraries
* ADD_SUBDIRECTORY(cmake)
* cmake/CMakeLists.txt
* project-config.cmake.in
* project-config-version.cmake.in

This will install, e.g.,

 geotiff-config.cmake
 geotiff-config-version.cmake
 geotiff-depends.cmake
 geotiff-depends-debug.cmake
 geotiff-depends-release.cmake

into

 ${CMAKE_INSTALL_PREFIX}/cmake (Windows)
 ${CMAKE_INSTALL_PREFIX}/share/cmake/GeoTIFF (otherwise)

geotiff-config-version.cmake does version checking and also checks that
* GeoTIFF is capitalized correctly in find_package(GeoTIFF)
* match of 32bit vs 64bit build

geotiff-config.cmake defines "standard" variables

 GeoTIFF_FOUND = 1
 GeoTIFF_INCLUDE_DIRS = /usr/local/include
 GeoTIFF_SHARED_LIBRARIES = geotiff_library
 GeoTIFF_STATIC_LIBRARIES = geotiff_archive
 GeoTIFF_LIBRARY_DIRS = /usr/local/lib
 GeoTIFF_BINARY_DIRS = /usr/local/bin
 GeoTIFF_VERSION = 1.4.1 (for example)
 Depending on GeoTIFF_USE_STATIC_LIBS
   GeoTIFF_LIBRARIES = ${GeoTIFF_SHARED_LIBRARIES}, if OFF
   GeoTIFF_LIBRARIES = ${GeoTIFF_STATIC_LIBRARIES}, if ON

for compatibility with FindGeoTIFF.cmake, it also sets

 GEOTIFF_FOUND
 GEOTIFF_INCLUDE_DIR
 GEOTIFF_LIBRARY
 GEOTIFF_LIBRARIES

Change History (2)

comment:1 by hobu, 10 years ago

Resolution: fixed
Status: newclosed

Applied in r2557.

comment:2 by hobu, 10 years ago

Missed some. Added in r2558.

Note: See TracTickets for help on using tickets.