aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-08-07 17:49:46 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-08-07 17:49:46 -0700
commit03bdf7c20523aacddd0816e863661327a4bc21dc (patch)
tree50f484ab1c63f758f7a390cfd3aa248075fd90a1
parenta37eb3ce57e516d47daf5ad4a8fb05613d7110b2 (diff)
downloadvcpkg-03bdf7c20523aacddd0816e863661327a4bc21dc.tar.gz
vcpkg-03bdf7c20523aacddd0816e863661327a4bc21dc.zip
Fix CMAKE_EXECUTABLE_SUFFIX not available under cmake -P
-rw-r--r--ports/protobuf/CONTROL2
-rw-r--r--ports/protobuf/portfile.cmake10
2 files changed, 9 insertions, 3 deletions
diff --git a/ports/protobuf/CONTROL b/ports/protobuf/CONTROL
index 20209cb6c..3c480a1e4 100644
--- a/ports/protobuf/CONTROL
+++ b/ports/protobuf/CONTROL
@@ -1,5 +1,5 @@
Source: protobuf
-Version: 3.6.1-1
+Version: 3.6.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 93f85d186..37919a820 100644
--- a/ports/protobuf/portfile.cmake
+++ b/ports/protobuf/portfile.cmake
@@ -67,16 +67,22 @@ 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${CMAKE_EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protobuf/protoc${CMAKE_EXECUTABLE_SUFFIX}" RELEASE_MODULE "${RELEASE_MODULE}")
+ string(REPLACE "\${_IMPORT_PREFIX}/bin/protoc${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protobuf/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${CMAKE_EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protobuf/protoc${CMAKE_EXECUTABLE_SUFFIX}" DEBUG_MODULE "${DEBUG_MODULE}")
+ string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protobuf/protoc${EXECUTABLE_SUFFIX}" DEBUG_MODULE "${DEBUG_MODULE}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}")
endif()