summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@codelibre.net>2021-02-07 23:18:29 +0000
committerRoger Leigh <rleigh@codelibre.net>2021-02-13 12:24:53 +0000
commit6f509b0cd748829acb4dc32b22e87c14e17ceb87 (patch)
tree34a8dd54ccff12c19525077910e3ca25a646345b /CMakeLists.txt
parent2da1c03be20cd0d028d17821e86ddc29aab37035 (diff)
downloadlibtiff-git-6f509b0cd748829acb4dc32b22e87c14e17ceb87.tar.gz
cmake: Use imported targets for WebP
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 3 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3eef32e..aad36f97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -112,17 +112,9 @@ include(ZSTDCodec)
# libwebp
set(WEBP_SUPPORT FALSE)
-find_path(WEBP_INCLUDE_DIR webp/decode.h)
-find_library(WEBP_LIBRARY NAMES webp)
-if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
- set(WEBP_LIBRARIES ${WEBP_LIBRARY})
- set(WEBP_FOUND TRUE)
- message(STATUS "Found WEBP library: ${WEBP_LIBRARY}")
-else()
- set(WEBP_FOUND FALSE)
-endif()
-option(webp "use libwebp (required for WEBP compression)" ${WEBP_FOUND})
-if (webp AND WEBP_FOUND)
+find_package(WebP)
+option(webp "use libwebp (required for WEBP compression)" ${WebP_FOUND})
+if (webp AND WebP_FOUND)
set(WEBP_SUPPORT TRUE)
endif()
@@ -220,9 +212,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc
if(JPEG12_INCLUDE_DIR)
list(APPEND TIFF_INCLUDES ${JPEG12_INCLUDE_DIR})
endif()
-if(WEBP_INCLUDE_DIR)
- list(APPEND TIFF_INCLUDES ${WEBP_INCLUDE_DIR})
-endif()
# Libraries required by libtiff
set(TIFF_LIBRARY_DEPS)
@@ -232,9 +221,6 @@ endif()
if(JPEG12_LIBRARIES)
list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES})
endif()
-if(WEBP_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES})
-endif()
report_values(TIFF_INCLUDES TIFF_LIBRARY_DEPS)