Merge changes I3d17d529,I53026880,I1bd61639,I6bd4b25d,Icfec8fba into main

* changes:
  CMake: add src to webpinfo includes
  CMake: add WEBP_BUILD_WEBPINFO to list of checks for exampleutil
  CMake: add WEBP_BUILD_WEBPMUX to list of checks for exampleutil
  CMake: link imageioutil to exampleutil after defined
  WEBP_DEP_LIBRARIES: use Threads::Threads
This commit is contained in:
James Zern 2022-06-01 18:18:00 +00:00 committed by Gerrit Code Review
commit f81dd7d63e
2 changed files with 8 additions and 4 deletions

View File

@ -445,13 +445,14 @@ if(WEBP_BUILD_ANIM_UTILS
OR WEBP_BUILD_DWEBP
OR WEBP_BUILD_GIF2WEBP
OR WEBP_BUILD_IMG2WEBP
OR WEBP_BUILD_VWEBP)
OR WEBP_BUILD_VWEBP
OR WEBP_BUILD_WEBPMUX
OR WEBP_BUILD_WEBPINFO)
# Example utility library.
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "EXAMPLEUTIL_SRCS"
"example_util_[^ ]*")
list(APPEND EXAMPLEUTIL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/examples/stopwatch.h)
add_library(exampleutil STATIC ${EXAMPLEUTIL_SRCS})
target_link_libraries(exampleutil imageioutil)
target_include_directories(
exampleutil
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
@ -460,6 +461,7 @@ if(WEBP_BUILD_ANIM_UTILS
"imageio_util_[^ ]*")
add_library(imageioutil STATIC ${IMAGEIOUTILS_SRCS})
target_link_libraries(imageioutil webp)
target_link_libraries(exampleutil imageioutil)
# Image-decoding utility library.
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEDEC_SRCS"
@ -587,7 +589,9 @@ if(WEBP_BUILD_WEBPINFO)
"webpinfo")
add_executable(webpinfo ${WEBPINFO_SRCS})
target_link_libraries(webpinfo exampleutil imageioutil)
target_include_directories(webpinfo PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
target_include_directories(webpinfo
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src)
install(TARGETS webpinfo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

View File

@ -45,7 +45,7 @@ if(WEBP_USE_THREAD)
}
" FLAG_HAVE_PTHREAD_PRIO_INHERIT)
set(HAVE_PTHREAD_PRIO_INHERIT ${FLAG_HAVE_PTHREAD_PRIO_INHERIT})
list(APPEND WEBP_DEP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
list(APPEND WEBP_DEP_LIBRARIES Threads::Threads)
endif()
set(WEBP_USE_THREAD ${Threads_FOUND})
endif()