Skip to content

Commit

Permalink
[yaml-cpp] Fix build failure when VCPKG_BUILD_TYPE is set
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Mar 19, 2018
1 parent 5968ebf commit 27016a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ports/yaml-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 27016a9

Please sign in to comment.