diff --git a/multimedia/libwebm/Makefile b/multimedia/libwebm/Makefile index dca9110a3cf3..8efa1ebc99b1 100644 --- a/multimedia/libwebm/Makefile +++ b/multimedia/libwebm/Makefile @@ -1,24 +1,25 @@ PORTNAME= libwebm DISTVERSIONPREFIX= libwebm- DISTVERSION= 1.0.0.32 +PORTREVISION= 1 CATEGORIES= multimedia MAINTAINER= yuri@FreeBSD.org COMMENT= WebM video format WWW= https://www.webmproject.org/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE.TXT USES= cmake:testing compiler:c++11-lang USE_GITHUB= yes GH_ACCOUNT= webmproject GH_TUPLE= google:googletest:release-1.11.0:gtest/../googletest CMAKE_ON= ENABLE_IWYU \ ENABLE_WEBM_PARSER \ BUILD_SHARED_LIBS CMAKE_TESTING_ON= ENABLE_TESTS # it's not clear how to run tests, some test executables show failures when run .include diff --git a/multimedia/libwebm/files/patch-CMakeLists.txt b/multimedia/libwebm/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..4b74f52703d2 --- /dev/null +++ b/multimedia/libwebm/files/patch-CMakeLists.txt @@ -0,0 +1,43 @@ +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -364,7 +364,10 @@ + if(ENABLE_WEBM_PARSER) + include_directories(webm_parser webm_parser/include) + add_library(webm_parser OBJECT ${webm_parser_sources}) +- target_sources(webm PUBLIC $) ++ # Wrap in BUILD_INTERFACE so the object files are compiled into the webm ++ # library but the $ expression does not leak into the ++ # installed/exported interface, where consumers cannot evaluate it. ++ target_sources(webm PUBLIC $>) + + add_executable(webm_parser_demo ${webm_parser_demo_sources}) + target_link_libraries(webm_parser_demo LINK_PUBLIC webm) +@@ -459,8 +462,13 @@ + # webm_parser headers are rooted at webm/. + set_target_properties(webm PROPERTIES PUBLIC_HEADER + "${webm_parser_public_headers}") ++# Expose the installed include root so downstream consumers can reference ++# headers with their prefix, e.g. or . ++target_include_directories(webm INTERFACE ++ $) + install( + TARGETS webm ++ EXPORT webmTargets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +@@ -474,3 +482,14 @@ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webm/mkvmuxer) + install(FILES ${mkvparser_public_headers} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/webm/mkvparser) ++ ++# Install a CMake package configuration so downstream projects can locate ++# libwebm with find_package(webm) and link against the webm::webm target. ++install(EXPORT webmTargets ++ FILE webmTargets.cmake ++ NAMESPACE webm:: ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/webm) ++file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/webmConfig.cmake" ++ "include(\"\${CMAKE_CURRENT_LIST_DIR}/webmTargets.cmake\")\n") ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/webmConfig.cmake" ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/webm) diff --git a/multimedia/libwebm/pkg-plist b/multimedia/libwebm/pkg-plist index 873ddd836c4b..27d3cc38e6a7 100644 --- a/multimedia/libwebm/pkg-plist +++ b/multimedia/libwebm/pkg-plist @@ -1,18 +1,21 @@ include/webm/buffer_reader.h include/webm/callback.h include/webm/common/webmids.h include/webm/dom_types.h include/webm/element.h include/webm/file_reader.h include/webm/id.h include/webm/istream_reader.h include/webm/mkvmuxer/mkvmuxer.h include/webm/mkvmuxer/mkvmuxertypes.h include/webm/mkvmuxer/mkvmuxerutil.h include/webm/mkvmuxer/mkvwriter.h include/webm/mkvparser/mkvparser.h include/webm/mkvparser/mkvreader.h include/webm/reader.h include/webm/status.h include/webm/webm_parser.h +lib/cmake/webm/webmConfig.cmake +lib/cmake/webm/webmTargets-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/webm/webmTargets.cmake lib/libwebm.so