Skip to content

Commit

Permalink
[protobuf] protobuf-targets-vcpkg-protoc.cmake from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
luncliff committed Oct 4, 2024
1 parent 63453aa commit 352c585
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
9 changes: 7 additions & 2 deletions ports/protobuf/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ vcpkg_cmake_install()
vcpkg_copy_pdbs()

# https://cmake.org/cmake/help/latest/module/FindProtobuf.html
vcpkg_cmake_config_fixup(PACKAGE_NAME Protobuf CONFIG_PATH lib/cmake)
vcpkg_cmake_config_fixup(PACKAGE_NAME protobuf CONFIG_PATH lib/cmake)
vcpkg_fixup_pkgconfig()

if(BUILD_PROTOC)
Expand All @@ -75,12 +75,17 @@ if(BUILD_PROTOC)
endforeach()
vcpkg_copy_tools(TOOL_NAMES ${PROTOC_NAMES} AUTO_CLEAN)

# protoc executable must be correct version. NO_DEFAULT_PATH
# copied from vcpkg upstream: protoc executable must be correct version. NO_DEFAULT_PATH
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake"
"${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake"
@ONLY
)
else()
# copied from vcpkg upstream: create protobuf::protoc with the host installed executable
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/protobuf-targets-vcpkg-protoc.cmake"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
)
endif()

file(REMOVE_RECURSE
Expand Down
8 changes: 8 additions & 0 deletions ports/protobuf/protobuf-targets-vcpkg-protoc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Create imported target protobuf::protoc
add_executable(protobuf::protoc IMPORTED)

# Import target "protobuf::protoc" for configuration "Release"
set_property(TARGET protobuf::protoc APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(protobuf::protoc PROPERTIES
IMPORTED_LOCATION_RELEASE "${Protobuf_PROTOC_EXECUTABLE}"
)
1 change: 0 additions & 1 deletion ports/protobuf/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
find_program(Protobuf_PROTOC_EXECUTABLE NAMES protoc PATHS "${CMAKE_CURRENT_LIST_DIR}/../../../@HOST_TRIPLET@/tools/protobuf" NO_DEFAULT_PATH)
message(STATUS "Found protoc: ${Protobuf_PROTOC_EXECUTABLE}")

_find_package(${ARGS})
2 changes: 1 addition & 1 deletion versions/p-/protobuf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "b4f896ca595e7c38ec74a200f28a12a4648b26d0",
"git-tree": "b9417f19fe38ea5c5dd8a79bc69ed7efee1adb72",
"version": "4.25.5",
"port-version": 0
}
Expand Down

0 comments on commit 352c585

Please sign in to comment.