aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-08-28 05:47:32 +0800
committerCurtis J Bezault <curtbezault@gmail.com>2019-08-27 14:47:32 -0700
commite64f2a493ac96b649487d387c6e2af7d9f95efe7 (patch)
tree3d982afbd75f5696464c288b08e0da7b6fc06117
parent55063d6405cb36d42b2bb76a1d7c09dbf65069fb (diff)
downloadvcpkg-e64f2a493ac96b649487d387c6e2af7d9f95efe7.tar.gz
vcpkg-e64f2a493ac96b649487d387c6e2af7d9f95efe7.zip
[yaml-cpp]Fix include path in yaml-cpp-config.cmake (#7847)
* [yaml-cpp]Fix include path in yaml-cpp-config.cmake * [yaml-cpp]Remove useless code.
-rw-r--r--ports/yaml-cpp/0002-fix-include-path.patch13
-rw-r--r--ports/yaml-cpp/CONTROL2
-rw-r--r--ports/yaml-cpp/portfile.cmake29
3 files changed, 16 insertions, 28 deletions
diff --git a/ports/yaml-cpp/0002-fix-include-path.patch b/ports/yaml-cpp/0002-fix-include-path.patch
new file mode 100644
index 000000000..78c260831
--- /dev/null
+++ b/ports/yaml-cpp/0002-fix-include-path.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d2d8810..c4d4be1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -326,7 +326,7 @@ else()
+ set(INSTALL_CMAKE_DIR ${LIB_INSTALL_DIR}/cmake/yaml-cpp)
+ endif()
+
+-file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_ROOT_DIR}")
++set(REL_INCLUDE_DIR "../../include")
+ set(CONFIG_INCLUDE_DIRS "\${YAML_CPP_CMAKE_DIR}/${REL_INCLUDE_DIR}")
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in
+ "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" @ONLY)
diff --git a/ports/yaml-cpp/CONTROL b/ports/yaml-cpp/CONTROL
index 93988ece9..1e0a781e2 100644
--- a/ports/yaml-cpp/CONTROL
+++ b/ports/yaml-cpp/CONTROL
@@ -1,4 +1,4 @@
Source: yaml-cpp
-Version: 0.6.2-2
+Version: 0.6.2-3
Homepage: https://github.com/jbeder/yaml-cpp
Description: yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec.
diff --git a/ports/yaml-cpp/portfile.cmake b/ports/yaml-cpp/portfile.cmake
index 6233bc076..ff2892bde 100644
--- a/ports/yaml-cpp/portfile.cmake
+++ b/ports/yaml-cpp/portfile.cmake
@@ -6,7 +6,8 @@ vcpkg_from_github(
SHA512 fea8ce0a20a00cbc75023d1db442edfcd32d0ac57a3c41b32ec8d56f87cc1d85d7dd7a923ce662f5d3a315f91a736d6be0d649997acd190915c1d68cc93795e4
HEAD_REF master
PATCHES
- ${CMAKE_CURRENT_LIST_DIR}/0001-noexcept.patch
+ 0001-noexcept.patch
+ 0002-fix-include-path.patch
)
vcpkg_configure_cmake(
@@ -26,32 +27,6 @@ if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/yaml-cpp)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/yaml-cpp)
endif()
-# Adjust paths and remove hardcoded ones from the config files
-file(READ ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-config.cmake YAML_CONFIG)
-string(REPLACE "set(YAML_CPP_INCLUDE_DIR \"\${YAML_CPP_CMAKE_DIR}/../include\")"
- "set(YAML_CPP_INCLUDE_DIR \"\${YAML_CPP_CMAKE_DIR}/../../include\")" YAML_CONFIG "${YAML_CONFIG}")
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-config.cmake "${YAML_CONFIG}")
-
-file(READ ${CURRENT_PACKAGES_DIR}/share/yaml-cpp/yaml-cpp-targets.cmake YAML_CONFIG)
-string(REPLACE "set(_IMPORT_PREFIX \"${CURRENT_PACKAGES_DIR}\")"
-"get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)
-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}")
-
-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}")
-endforeach()
-
# Remove debug include files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)