aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhoebe <20694052+PhoebeHui@users.noreply.github.com>2020-09-28 08:36:08 +0800
committerGitHub <noreply@github.com>2020-09-27 17:36:08 -0700
commitbd2932aab90e32c9a81f083d7d4ae66833b8ee9e (patch)
treecf1d8c253e454e2506c922b26c7cd2bd10c942d5
parent9ab6b68c83c6ec5675a5668138f28112ae65663c (diff)
downloadvcpkg-bd2932aab90e32c9a81f083d7d4ae66833b8ee9e.tar.gz
vcpkg-bd2932aab90e32c9a81f083d7d4ae66833b8ee9e.zip
[protobuf] Add vcpkg-cmake-wrapper.cmake (#13659)
* [opencv] Fix dependency port protobuf * Add vcpkg-cmake-wrapper.cmake for protobuf * Remove blank line * Set the cmake_policy
-rw-r--r--ports/protobuf/CONTROL2
-rw-r--r--ports/protobuf/portfile.cmake4
-rw-r--r--ports/protobuf/vcpkg-cmake-wrapper.cmake13
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})