diff options
| -rw-r--r-- | ports/protobuf/CONTROL | 2 | ||||
| -rw-r--r-- | ports/protobuf/portfile.cmake | 4 | ||||
| -rw-r--r-- | ports/protobuf/vcpkg-cmake-wrapper.cmake | 13 |
3 files changed, 17 insertions, 2 deletions
diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index ecacb7c28..115b306c5 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,6 +1,6 @@ Source: protobuf Version: 3.13.0 -Port-Version: 1 +Port-Version: 2 Homepage: https://github.com/protocolbuffers/protobuf Description: Protocol Buffers - Google's data interchange format diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index ab2578f74..47510b550 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -124,7 +124,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") ) endif() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) vcpkg_copy_pdbs() set(packages protobuf protobuf-lite) foreach(_package IN LISTS packages) @@ -138,3 +137,6 @@ if(NOT VCPKG_TARGET_IS_WINDOWS) set(SYSTEM_LIBRARIES SYSTEM_LIBRARIES pthread) endif() vcpkg_fixup_pkgconfig(${SYSTEM_LIBRARIES}) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
\ No newline at end of file diff --git a/ports/protobuf/vcpkg-cmake-wrapper.cmake b/ports/protobuf/vcpkg-cmake-wrapper.cmake new file mode 100644 index 000000000..1a0f683d2 --- /dev/null +++ b/ports/protobuf/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,13 @@ +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.3)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0057 NEW)
+ if(NOT "CONFIG" IN_LIST ARGS AND NOT "NO_MODULE" IN_LIST ARGS)
+ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
+ set(Protobuf_USE_STATIC_LIBS ON)
+ else()
+ set(Protobuf_USE_STATIC_LIBS OFF)
+ endif()
+ endif()
+ cmake_policy(POP)
+endif()
+_find_package(${ARGS})
|
