mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-26 01:48:59 +08:00
71 lines
2.6 KiB
Diff
71 lines
2.6 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 7330046..464e0fe 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -84,45 +84,12 @@ if(NOT SW_BUILD)
|
|
if(ZLIB_FOUND)
|
|
set(pkgs_private "${pkgs_private} zlib")
|
|
endif()
|
|
- find_package(PkgConfig QUIET)
|
|
if(LIBWEBP_SUPPORT)
|
|
- if(PKG_CONFIG_FOUND)
|
|
- pkg_check_modules(WEBP libwebp QUIET)
|
|
- pkg_check_modules(WEBPMUX libwebpmux>=${MINIMUM_WEBPMUX_VERSION} QUIET)
|
|
- endif(PKG_CONFIG_FOUND)
|
|
- if(NOT WEBP)
|
|
- find_path(WEBP_INCLUDE_DIR /webp/decode.h)
|
|
- find_library(WEBP_LIBRARY NAMES webp)
|
|
- if(WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
|
|
- set(WEBP 1)
|
|
- set(WEBP_FOUND TRUE)
|
|
- set(WEBP_LIBRARIES ${WEBP_LIBRARY})
|
|
- set(WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIR})
|
|
- endif()
|
|
- endif()
|
|
- if(NOT WEBPMUX)
|
|
- find_path(WEBPMUX_INCLUDE_DIR /webp/mux.h)
|
|
- # TODO: check minimal required version
|
|
- if(NOT WEBPMUX_INCLUDE_DIR)
|
|
- message(STATUS "Can not find: /webp/mux.h")
|
|
- endif()
|
|
- if(NOT "${WEBPMUX_INCLUDE_DIR}" STREQUAL "${WEBP_INCLUDE_DIR}")
|
|
- set(WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIRS} ${WEBPMUX_INCLUDE_DIR})
|
|
- endif()
|
|
- find_library(WEBPMUX_LIBRARY NAMES webpmux)
|
|
- if(WEBPMUX_INCLUDE_DIR AND WEBPMUX_LIBRARY)
|
|
- set(WEBPMUX 1)
|
|
- set(HAVE_LIBWEBP_ANIM 1)
|
|
- set(WEBPMUX_FOUND TRUE)
|
|
- set(WEBP_LIBRARIES ${WEBP_LIBRARIES} ${WEBPMUX_LIBRARY})
|
|
- endif()
|
|
- endif()
|
|
- if(WEBP)
|
|
- set(pkgs_private "${pkgs_private} libwebp")
|
|
- endif(WEBP)
|
|
- if(WEBPMUX)
|
|
- set(pkgs_private "${pkgs_private} libwebpmux")
|
|
- endif(WEBPMUX)
|
|
+ find_package(PkgConfig REQUIRED)
|
|
+ pkg_check_modules(WEBP libwebp REQUIRED)
|
|
+ pkg_check_modules(WEBPMUX libwebpmux>=${MINIMUM_WEBPMUX_VERSION} REQUIRED)
|
|
+ set(pkgs_private "${pkgs_private} libwebp")
|
|
+ set(pkgs_private "${pkgs_private} libwebpmux")
|
|
endif(LIBWEBP_SUPPORT)
|
|
if(OPENJPEG_SUPPORT)
|
|
find_package(PkgConfig REQUIRED)
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
index 1fab56c..790ca2a 100644
|
|
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -48,7 +48,9 @@ if (TIFF_LIBRARIES)
|
|
endif()
|
|
if (WEBP_FOUND)
|
|
target_include_directories (leptonica PRIVATE ${WEBP_INCLUDE_DIRS})
|
|
- target_link_libraries (leptonica PRIVATE ${WEBP_LIBRARIES})
|
|
+ target_link_libraries (leptonica PRIVATE ${WEBP_LINK_LIBRARIES})
|
|
+ target_include_directories (leptonica PRIVATE ${WEBPMUX_INCLUDE_DIRS})
|
|
+ target_link_libraries (leptonica PRIVATE ${WEBPMUX_LINK_LIBRARIES})
|
|
endif()
|
|
if (ZLIB_LIBRARIES)
|
|
target_include_directories (leptonica PRIVATE ${ZLIB_INCLUDE_DIRS})
|