aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpast-due <30942300+past-due@users.noreply.github.com>2018-03-19 19:33:13 -0400
committerpast-due <30942300+past-due@users.noreply.github.com>2018-03-19 19:33:13 -0400
commit2efeda15a26d89cc688579ec75f7ab71bffe9a26 (patch)
tree872aa05d5ab12059fd31bb769aaad451161aae8a
parent5968ebf9f4beae3a0662dfc6ba343b0be07a1241 (diff)
downloadvcpkg-2efeda15a26d89cc688579ec75f7ab71bffe9a26.tar.gz
vcpkg-2efeda15a26d89cc688579ec75f7ab71bffe9a26.zip
[protobuf] Fix build failure when VCPKG_BUILD_TYPE is set
-rw-r--r--ports/protobuf/portfile.cmake20
1 files changed, 12 insertions, 8 deletions
diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake
index b8cb43f93..593eebe7d 100644
--- a/ports/protobuf/portfile.cmake
+++ b/ports/protobuf/portfile.cmake
@@ -85,14 +85,18 @@ endfunction()
protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/include)
-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}")
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake "${RELEASE_MODULE}")
-
-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}")
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}")
+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}")
+ 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}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake "${DEBUG_MODULE}")
+endif()
protobuf_try_remove_recurse_wait(${CURRENT_PACKAGES_DIR}/debug/share)