vcpkg/ports/brotli/install.patch
Kai Pastor 163fe7bd3d
[brotli] Export libm usage requirement, cleanup, usage (#27971)
* Simplify pkgconfig patch

* Export libm usage requirement

* Merge ios patch into install patch

* Revise portfile

* Refactor cmake wrapper into config

* Document usage

* Update versions
2022-12-02 09:39:16 -08:00

60 lines
2.0 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ff3401..46492d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,14 +185,13 @@ endforeach()
foreach(lib IN LISTS BROTLI_SHARED_LIBS BROTLI_STATIC_LIBS)
target_link_libraries(${lib} ${LIBM_LIBRARY})
- set_property(TARGET ${lib} APPEND PROPERTY INCLUDE_DIRECTORIES ${BROTLI_INCLUDE_DIRS})
set_target_properties(${lib} PROPERTIES
VERSION "${BROTLI_ABI_COMPATIBILITY}.${BROTLI_ABI_AGE}.${BROTLI_ABI_REVISION}"
SOVERSION "${BROTLI_ABI_COMPATIBILITY}")
if(NOT BROTLI_EMSCRIPTEN)
set_target_properties(${lib} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()
- set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIRS}")
+ set_property(TARGET ${lib} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${BROTLI_INCLUDE_DIRS}>" $<INSTALL_INTERFACE:include>)
endforeach()
if(NOT BROTLI_EMSCRIPTEN)
@@ -223,27 +222,36 @@ if(NOT BROTLI_EMSCRIPTEN)
if(NOT BROTLI_BUNDLED_MODE)
install(
TARGETS brotli
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ RUNTIME DESTINATION tools/brotli
+ BUNDLE DESTINATION tools/brotli
+ CONFIGURATIONS Release
)
+ if(BUILD_SHARED_LIBS)
install(
TARGETS ${BROTLI_LIBRARIES_CORE}
+ EXPORT brotli
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
-
+ else()
install(
TARGETS ${BROTLI_LIBRARIES_CORE_STATIC}
+ EXPORT brotli
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
+ endif()
install(
DIRECTORY ${BROTLI_INCLUDE_DIRS}/brotli
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+ CONFIGURATIONS Release
)
+
+ install(EXPORT brotli FILE unofficial-brotli-targets.cmake NAMESPACE unofficial::brotli:: DESTINATION share/unofficial-brotli)
endif() # BROTLI_BUNDLED_MODE
endif() # BROTLI_EMSCRIPTEN