[rapidjson] Fix cmake config (#26165)

* [rapidjson] Fix cmake config

* version

* There are no pc files on Windows

* version

* Different config paths on Windows

* version

* Fix config path

* version

* Upstream messed up cmake config on Windows

* version

* Remove PACKAGE_NAME on Windows

* version

* Fix config location

* version

* Revert FILE_DISAMBIGUATOR removal because it invalidates existing downloads for no reason.

* Fix version DB

Co-authored-by: Billy O'Neal <bion@microsoft.com>
This commit is contained in:
Thomas1664 2022-08-08 21:09:35 +02:00 committed by GitHub
parent 30619e717a
commit 31194760c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 10 deletions

View File

@ -12,21 +12,32 @@ vcpkg_from_github(
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DRAPIDJSON_BUILD_DOC:BOOL=OFF
-DRAPIDJSON_BUILD_EXAMPLES:BOOL=OFF
-DRAPIDJSON_BUILD_TESTS:BOOL=OFF
-DCMAKE_INSTALL_DIR:STRING=cmake
-DRAPIDJSON_BUILD_DOC=OFF
-DRAPIDJSON_BUILD_EXAMPLES=OFF
-DRAPIDJSON_BUILD_TESTS=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
else()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/RapidJSON)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib" "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/share/doc")
vcpkg_fixup_pkgconfig()
file(READ "${CURRENT_PACKAGES_DIR}/share/rapidjson/RapidJSONConfig.cmake" _contents)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
if(VCPKG_TARGET_IS_WINDOWS)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
endif()
file(READ "${CURRENT_PACKAGES_DIR}/share/${PORT}/RapidJSONConfig.cmake" _contents)
string(REPLACE "\${RapidJSON_SOURCE_DIR}" "\${RapidJSON_CMAKE_DIR}/../.." _contents "${_contents}")
string(REPLACE "set( RapidJSON_SOURCE_DIR \"${SOURCE_PATH}\")" "" _contents "${_contents}")
string(REPLACE "set( RapidJSON_DIR \"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel\")" "" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/rapidjson/RapidJSONConfig.cmake" "${_contents}\nset(RAPIDJSON_INCLUDE_DIRS \"\${RapidJSON_INCLUDE_DIRS}\")\n")
string(REPLACE "\${RapidJSON_CMAKE_DIR}/../../../include" "\${RapidJSON_CMAKE_DIR}/../../include" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/RapidJSONConfig.cmake" "${_contents}\nset(RAPIDJSON_INCLUDE_DIRS \"\${RapidJSON_INCLUDE_DIRS}\")\n")
file(INSTALL "${SOURCE_PATH}/license.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,7 +1,7 @@
{
"name": "rapidjson",
"version-date": "2022-06-28",
"port-version": 2,
"port-version": 3,
"description": "A fast JSON parser/generator for C++ with both SAX/DOM style API <http://rapidjson.org/>",
"homepage": "http://rapidjson.org/",
"license": "MIT",

View File

@ -6194,7 +6194,7 @@
},
"rapidjson": {
"baseline": "2022-06-28",
"port-version": 2
"port-version": 3
},
"rapidxml": {
"baseline": "1.13",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b33122751fc9d722f05cc50538aa9b6d08e2d105",
"version-date": "2022-06-28",
"port-version": 3
},
{
"git-tree": "f3770e13ddf21ddf223c84dab78f3d04d4f25750",
"version-date": "2022-06-28",