aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2018-03-20 01:44:39 -0700
committerGitHub <noreply@github.com>2018-03-20 01:44:39 -0700
commitdb4cd678817b767fa0a9c9e1494eb0390da8066f (patch)
treefcc5040167c565b5706907f69ae5a2eaf0f7ec21
parentd15e35dde3459360436a3a34c6d3c713d0ebaa3b (diff)
parent27016a9b310583e97fd83f74b701fbb1aa38a560 (diff)
downloadvcpkg-db4cd678817b767fa0a9c9e1494eb0390da8066f.tar.gz
vcpkg-db4cd678817b767fa0a9c9e1494eb0390da8066f.zip
Merge pull request #3086 from past-due/yaml-cpp_fix_vcpkg_build_type
[yaml-cpp] Fix build failure when VCPKG_BUILD_TYPE is set
-rw-r--r--ports/yaml-cpp/portfile.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/ports/yaml-cpp/portfile.cmake b/ports/yaml-cpp/portfile.cmake
index 0fc4f05b6..096b178ac 100644
--- a/ports/yaml-cpp/portfile.cmake
+++ b/ports/yaml-cpp/portfile.cmake
@@ -32,7 +32,14 @@ get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)
get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" YAML_CONFIG "${YAML_CONFIG}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-targets.cmake "${YAML_CONFIG}")
-foreach(CONF debug release)
+set(_targets_cmake_conf)
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ list(APPEND _targets_cmake_conf "debug")
+endif()
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ list(APPEND _targets_cmake_conf "release")
+endif()
+foreach(CONF ${_targets_cmake_conf})
file(READ ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-targets-${CONF}.cmake YAML_CONFIG)
string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${_IMPORT_PREFIX}" YAML_CONFIG "${YAML_CONFIG}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-targets-${CONF}.cmake "${YAML_CONFIG}")