FindWrapWebP.cmake: fix CMake warning

CMake Warning (dev) at .../cmake_64/share/cmake-3.19/Modules/
FindPackageHandleStandardArgs.cmake:426 (message):
The package name passed to `find_package_handle_standard_args` (WebP)
does not match the name of the calling package (WrapWebP).  This can
lead to problems in calling code that expects `find_package` result
variables (e.g., `_FOUND`) to follow a certain pattern.

Also, make find_package(PkgConfig) QUIET.

Pick-to: 6.1
Change-Id: Ib5daaab88f74272c638d40f8b51226ae9636fbad
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Li Xinwei 2021-05-20 10:50:18 +08:00
parent cdcf4a3dcd
commit f8f40012ff
1 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ if(TARGET WebP::webp AND TARGET WebP::webpdemux AND TARGET WebP::libwebpmux)
return()
endif()
find_package(PkgConfig)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_WebP libwebp)
pkg_check_modules(PC_WebPDemux libwebpdemux)
pkg_check_modules(PC_WebPMux libwebpmux)
@ -40,13 +40,13 @@ find_path(WebP_mux_INCLUDE_DIR NAMES "webp/mux.h"
HINTS ${PC_WebPMux_INCLUDEDIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WebP DEFAULT_MSG WebP_INCLUDE_DIR WebP_LIBRARY
WebP_demux_INCLUDE_DIR WebP_demux_LIBRARY
WebP_mux_INCLUDE_DIR WebP_mux_LIBRARY)
find_package_handle_standard_args(WrapWebP DEFAULT_MSG WebP_INCLUDE_DIR WebP_LIBRARY
WebP_demux_INCLUDE_DIR WebP_demux_LIBRARY
WebP_mux_INCLUDE_DIR WebP_mux_LIBRARY)
mark_as_advanced(WebP_INCLUDE_DIR WebP_LIBRARY WebP_demux_INCLUDE_DIR WebP_demux_LIBRARY WebP_mux_INCLUDE_DIR WebP_mux_LIBRARY)
if(WebP_FOUND)
set(WrapWebP_FOUND ON)
if(WrapWebP_FOUND)
set(WebP_FOUND ON)
add_library(WrapWebP::WrapWebP INTERFACE IMPORTED)
target_link_libraries(WrapWebP::WrapWebP INTERFACE ${WebP_LIBRARY} ${WebP_demux_LIBRARY} ${WebP_mux_LIBRARY})
target_include_directories(WrapWebP::WrapWebP