diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-04-10 15:05:04 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-04-10 15:05:47 -0700 |
| commit | bb7501a37eb266aaeb6ff9af9d85d0b782eb1981 (patch) | |
| tree | b439b2923804a882535a4291d06f64134be95985 | |
| parent | b4aad86642c50afcbaa4e348dba2b8f86c28ad56 (diff) | |
| download | vcpkg-bb7501a37eb266aaeb6ff9af9d85d0b782eb1981.tar.gz vcpkg-bb7501a37eb266aaeb6ff9af9d85d0b782eb1981.zip | |
[protobuf] Fix for linux/osx
| -rw-r--r-- | ports/protobuf/CONTROL | 2 | ||||
| -rw-r--r-- | ports/protobuf/portfile.cmake | 30 |
2 files changed, 22 insertions, 10 deletions
diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL index 86fecafc5..12e508f6d 100644 --- a/ports/protobuf/CONTROL +++ b/ports/protobuf/CONTROL @@ -1,5 +1,5 @@ Source: protobuf -Version: 3.5.1-1 +Version: 3.5.1-2 Description: Protocol Buffers - Google's data interchange format Feature: zlib diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index 593eebe7d..765b52a1d 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -21,7 +21,7 @@ vcpkg_apply_patches( "${CMAKE_CURRENT_LIST_DIR}/js-embed.patch" ) -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(CMAKE_HOST_WIN32) set(TOOL_PATH ${CURRENT_BUILDTREES_DIR}/src/protobuf-${PROTOBUF_VERSION}-win32) vcpkg_download_distfile(TOOL_ARCHIVE_FILE URLS "https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-win32.zip" @@ -85,27 +85,39 @@ endfunction() protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/include) +if(CMAKE_HOST_WIN32) + set(EXECUTABLE_SUFFIX ".exe") +else() + set(EXECUTABLE_SUFFIX "") +endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") file(READ ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake RELEASE_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/bin/protoc.exe" "\${_IMPORT_PREFIX}/tools/protoc.exe" RELEASE_MODULE "${RELEASE_MODULE}") + string(REPLACE "\${_IMPORT_PREFIX}/bin/protoc${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protoc${EXECUTABLE_SUFFIX}" RELEASE_MODULE "${RELEASE_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake "${RELEASE_MODULE}") endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") file(READ ${CURRENT_PACKAGES_DIR}/debug/share/protobuf/protobuf-targets-debug.cmake DEBUG_MODULE) string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}") - string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc.exe" "\${_IMPORT_PREFIX}/tools/protoc.exe" DEBUG_MODULE "${DEBUG_MODULE}") + string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protoc${EXECUTABLE_SUFFIX}" DEBUG_MODULE "${DEBUG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}") endif() protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin) - protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin) +if(CMAKE_HOST_WIN32) + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin) + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin) + else() + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin/protoc.exe) + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe) + endif() else() - protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin/protoc.exe) - protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin/protoc.exe) + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/bin) + file(INSTALL ${CURRENT_PACKAGES_DIR}/bin/protoc DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/bin) endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -115,7 +127,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) endif() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/protobuf RENAME copyright) -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(CMAKE_HOST_WIN32) file(INSTALL ${TOOL_PATH}/bin/protoc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) endif() vcpkg_copy_pdbs() |
