aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2019-03-19 16:12:19 -0700
committerGitHub <noreply@github.com>2019-03-19 16:12:19 -0700
commitbcf7db4d460e8c803a420ed81e7a968807b40e7f (patch)
tree1063a2580a4cbae6105700d767a38bb62d665025
parentdb72758b1cc200798a03b6ab162682486bdfe175 (diff)
downloadvcpkg-bcf7db4d460e8c803a420ed81e7a968807b40e7f.tar.gz
vcpkg-bcf7db4d460e8c803a420ed81e7a968807b40e7f.zip
[rapidjson] Fix --head support (#3693)
-rw-r--r--ports/rapidjson/portfile.cmake9
1 files changed, 8 insertions, 1 deletions
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()