Skip to content

Commit

Permalink
WebPConfig.cmake.in: use calculated include path
Browse files Browse the repository at this point in the history
when setting WebP_INCLUDE_DIRS; this value is relative to the
WebPConfig.cmake install location (${PACKAGE_PREFIX_DIR}/include) and
allows the install to be relocated after creation.

See also:
https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#example-generating-package-files

Bug: webp:610
Change-Id: If877625e96584a9808b0bba902e3f0b2a744aa60
Fixed: webp:610
  • Loading branch information
jzern committed May 17, 2023
1 parent 6cf9a76 commit cba3007
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ endif()
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/WebPConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/WebPConfig.cmake
INSTALL_DESTINATION ${ConfigPackageLocation})
INSTALL_DESTINATION ${ConfigPackageLocation}
PATH_VARS CMAKE_INSTALL_INCLUDEDIR)

# Install the generated CMake files.
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/WebPConfigVersion.cmake"
Expand Down
4 changes: 3 additions & 1 deletion cmake/WebPConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ endif()

include ("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")

set(WebP_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
set_and_check(WebP_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set(WEBP_INCLUDE_DIRS ${WebP_INCLUDE_DIRS})
set(WebP_LIBRARIES "@INSTALLED_LIBRARIES@")
set(WEBP_LIBRARIES "${WebP_LIBRARIES}")

check_required_components(WebP)

0 comments on commit cba3007

Please sign in to comment.