Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WebP linking if CMAKE_FIND_PACKAGE_PREFER_CONFIG is ON #3863

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()


Loading