Skip to content

Commit

Permalink
build: Fix WebP linking if CMAKE_FIND_PACKAGE_PREFER_CONFIG is ON (Ac…
Browse files Browse the repository at this point in the history
…ademySoftwareFoundation#3863)

Our own FindWebP.cmake was setting up targets that didn't
match the capitalization of the cmake configs that come with WebP itself.

Signed-off-by: Benjamin Buch <[email protected]>
  • Loading branch information
bebuch authored and lgritz committed Jul 15, 2023
1 parent 99542f9 commit 3ab3231
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/cmake/modules/FindWebP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ if (WebP_FOUND)
set (WEBP_INCLUDES "${WEBP_INCLUDE_DIR}")
set (WEBP_LIBRARIES ${WEBP_LIBRARY} ${WEBPDEMUX_LIBRARY})

if (NOT TARGET WebP::WebP)
add_library(WebP::WebP UNKNOWN IMPORTED)
set_target_properties(WebP::WebP PROPERTIES
if (NOT TARGET WebP::webp)
add_library(WebP::webp UNKNOWN IMPORTED)
set_target_properties(WebP::webp PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${WEBP_INCLUDES})
set_property(TARGET WebP::WebP APPEND PROPERTY
set_property(TARGET WebP::webp APPEND PROPERTY
IMPORTED_LOCATION ${WEBP_LIBRARY})
endif ()
if (NOT TARGET WebP::WebPDemux)
add_library(WebP::WebPDemux UNKNOWN IMPORTED)
set_target_properties(WebP::WebPDemux PROPERTIES
if (NOT TARGET WebP::webpdemux)
add_library(WebP::webpdemux UNKNOWN IMPORTED)
set_target_properties(WebP::webpdemux PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${WEBP_INCLUDES})
set_property(TARGET WebP::WebPDemux APPEND PROPERTY
set_property(TARGET WebP::webpdemux APPEND PROPERTY
IMPORTED_LOCATION ${WEBPDEMUX_LIBRARY})
endif ()
endif ()
Expand Down
5 changes: 1 addition & 4 deletions src/webp.imageio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

if (WebP_FOUND)
add_oiio_plugin (webpinput.cpp webpoutput.cpp
INCLUDE_DIRS ${WEBP_INCLUDES}
LINK_LIBRARIES ${WEBP_LIBRARIES}
LINK_LIBRARIES WebP::webp WebP::webpdemux
DEFINITIONS "-DUSE_WEBP=1")
else ()
message (STATUS "WebP plugin will not be built")
endif()


0 comments on commit 3ab3231

Please sign in to comment.