diff --git a/cmake/WebPConfig.cmake.in b/cmake/WebPConfig.cmake.in index 822fc59..fb31829 100644 --- a/cmake/WebPConfig.cmake.in +++ b/cmake/WebPConfig.cmake.in @@ -5,7 +5,19 @@ set(WEBP_VERSION ${WebP_VERSION}) +include(CMakeFindDependencyMacro) +find_dependency(Threads) include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") -set(WebP_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@") +get_filename_component(_vcpkg_libwebp_root "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) +set(WebP_INCLUDE_DIRS "${_vcpkg_libwebp_root}/include") set(WEBP_INCLUDE_DIRS ${WebP_INCLUDE_DIRS}) -set(WebP_LIBRARIES "@INSTALLED_LIBRARIES@") +set(WebP_LIBRARIES "") +include(SelectLibraryConfigurations) +foreach(_vcpkg_libwebp_lib IN ITEMS @INSTALLED_LIBRARIES@) + string(REPLACE "libwebpmux" "webpmux" _vcpkg_libwebp_lib "${_vcpkg_libwebp_lib}") # offical OUTPUT_NAME + find_library(_vcpkg_${_vcpkg_libwebp_lib}_LIBRARY_RELEASE NAMES ${_vcpkg_libwebp_lib} NAMES_PER_DIR PATHS "${_vcpkg_libwebp_root}/lib" NO_DEFAULT_PATH) + find_library(_vcpkg_${_vcpkg_libwebp_lib}_LIBRARY_DEBUG NAMES ${_vcpkg_libwebp_lib}d ${_vcpkg_libwebp_lib} NAMES_PER_DIR PATHS "${_vcpkg_libwebp_root}/debug/lib" NO_DEFAULT_PATH) + select_library_configurations(_vcpkg_${_vcpkg_libwebp_lib}) + list(APPEND WebP_LIBRARIES ${_vcpkg_${_vcpkg_libwebp_lib}_LIBRARIES}) +endforeach() set(WEBP_LIBRARIES "${WebP_LIBRARIES}") +unset(_vcpkg_libwebp_root)