CMake: Libraries: Add TIFF.

This commit is contained in:
kestred 2013-11-29 00:48:08 -07:00
parent 1a75d28f9a
commit b21b31dffd
2 changed files with 33 additions and 2 deletions

View File

@ -0,0 +1,29 @@
# Filename: MangleTIFF.cmake
# Author: kestred (29 Nov, 2013)
#
# MangleTIFF replaces the output variables of the builtin FindTIFF
# with vars matching Panda3D's existing config-var names.
#
if(TIFF_FOUND)
set(HAVE_TIFF TRUE)
set(TIFF_LIBS tiff z)
get_filename_component(TIFF_LIBRARY_DIR "${TIFF_LIBRARY}" PATH)
set(TIFF_IPATH "${TIFF_INCLUDE_DIR}" CACHE PATH "The path to libTIFF's include directory.") # Include path
set(TIFF_LPATH "${TIFF_LIBRARY_DIR}" CACHE PATH "The path to libTIFF's library directory.") # Library path
mark_as_advanced(TIFF_IPATH)
mark_as_advanced(TIFF_LPATH)
set(TIFF_VERSION ${TIFF_VERSION_STRING})
unset(TIFF_FOUND)
unset(TIFF_LIBRARY CACHE)
unset(TIFF_LIBRARIES)
unset(TIFF_INCLUDE_DIR CACHE)
unset(TIFF_LIBRARY_DIR)
else()
unset(TIFF_INCLUDE_DIR CACHE)
unset(TIFF_LIBRARY CACHE)
endif()

View File

@ -64,8 +64,10 @@ else()
endif()
# Check for and configure TIFF library
# Mangle the builtin FindTIFF output to match Panda3D's config-style
find_package(TIFF QUIET COMPONENTS tiff z)
include(MangleTIFF)
if(HAVE_TIFF)
message(STATUS "+ libtiff")
else()