From bcf7db4d460e8c803a420ed81e7a968807b40e7f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 19 Mar 2019 16:12:19 -0700 Subject: [PATCH] [rapidjson] Fix --head support (#3693) --- ports/rapidjson/portfile.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/rapidjson/portfile.cmake b/ports/rapidjson/portfile.cmake index 8c1c0b938..2e3787857 100644 --- a/ports/rapidjson/portfile.cmake +++ b/ports/rapidjson/portfile.cmake @@ -26,8 +26,15 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) # Delete redundant directories -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/share/doc) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/share/doc) # Put the licence file where vcpkg expects it file(COPY ${SOURCE_PATH}/license.txt ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/rapidjson) file(RENAME ${CURRENT_PACKAGES_DIR}/share/rapidjson/license.txt ${CURRENT_PACKAGES_DIR}/share/rapidjson/copyright) + +if(VCPKG_USE_HEAD_VERSION) + file(READ "${CURRENT_PACKAGES_DIR}/share/rapidjson/RapidJSONConfig.cmake" _contents) + string(REPLACE "\${RapidJSON_SOURCE_DIR}" "\${RapidJSON_CMAKE_DIR}/../.." _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/rapidjson/RapidJSONConfig.cmake" "${_contents}\nset(RAPIDJSON_INCLUDE_DIRS \"\${RapidJSON_INCLUDE_DIRS}\")\n") + # Note: adding this extra setting for RAPIDJSON_INCLUDE_DIRS maintains compatibility with previous rapidjson versions +endif()