* [rapidjson] Fix CMake target (#3250)

* [rapidjson] Bump control version. Add usage information.
This commit is contained in:
jiefangxuanyan 2018-04-27 14:16:47 +08:00 committed by Robert Schumacher
parent 402c962f75
commit da1805f3c0
3 changed files with 24 additions and 7 deletions

View File

@ -1,3 +1,3 @@
Source: rapidjson
Version: 1.1.0
Version: 1.1.0-1
Description: A fast JSON parser/generator for C++ with both SAX/DOM style API <http://rapidjson.org/>

View File

@ -9,10 +9,23 @@ vcpkg_from_github(
HEAD_REF master
)
# Put the licence file where vcpkg expects it
file(COPY ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/rapidjson)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/rapidjson/license.txt ${CURRENT_PACKAGES_DIR}/share/rapidjson/copyright)
# Use RapidJSON's own build process, skipping examples and tests
vcpkg_configure_cmake(
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
)
vcpkg_install_cmake()
# Copy the rapidjson header files
file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR} FILES_MATCHING PATTERN "*.h")
vcpkg_copy_pdbs()
# Move CMake config files to the right place
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
# Delete redundant directories
file(REMOVE_RECURSE ${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)

4
ports/rapidjson/usage Normal file
View File

@ -0,0 +1,4 @@
The package rapidjson provides CMake integration:
find_package(RapidJSON REQUIRED)
target_include_directories(main PRIVATE ${RAPIDJSON_INCLUDE_DIRS})