aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2018-03-20 01:50:59 -0700
committerGitHub <noreply@github.com>2018-03-20 01:50:59 -0700
commitb94a37b22912cfec409f7b3553459a87ac1d0c24 (patch)
tree6185ee337f41a968605975b0526a5c67276e0723
parent1ef3d4b294e9e97a10d3583634650fac6c551bac (diff)
parent2efeda15a26d89cc688579ec75f7ab71bffe9a26 (diff)
downloadvcpkg-b94a37b22912cfec409f7b3553459a87ac1d0c24.tar.gz
vcpkg-b94a37b22912cfec409f7b3553459a87ac1d0c24.zip
Merge pull request #3088 from past-due/protobuf_fix_vcpkg_build_type
[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)