diff options
| author | zi-m <53815290+zi-m@users.noreply.github.com> | 2019-08-27 19:45:58 +0200 |
|---|---|---|
| committer | Curtis J Bezault <curtbezault@gmail.com> | 2019-08-27 10:45:58 -0700 |
| commit | 0011fd9e5ec210851bf93584214a8d4e30245a73 (patch) | |
| tree | c48e5ac8644ec60acd16691e504f5fb01b133e7c | |
| parent | 9609b2a61590ef578a0751cd04c27ce86a371484 (diff) | |
| download | vcpkg-0011fd9e5ec210851bf93584214a8d4e30245a73.tar.gz vcpkg-0011fd9e5ec210851bf93584214a8d4e30245a73.zip | |
json5-parser (#7915)
| -rw-r--r-- | ports/json5-parser/00001-fix-build.patch | 27 | ||||
| -rw-r--r-- | ports/json5-parser/CONTROL | 5 | ||||
| -rw-r--r-- | ports/json5-parser/portfile.cmake | 27 | ||||
| -rw-r--r-- | ports/json5-parser/usage | 4 |
4 files changed, 63 insertions, 0 deletions
diff --git a/ports/json5-parser/00001-fix-build.patch b/ports/json5-parser/00001-fix-build.patch new file mode 100644 index 000000000..74f34a298 --- /dev/null +++ b/ports/json5-parser/00001-fix-build.patch @@ -0,0 +1,27 @@ +diff --git a/json5_parser/CMakeLists.txt b/json5_parser/CMakeLists.txt +index e83fb38..b193c97 100644 +--- a/json5_parser/CMakeLists.txt ++++ b/json5_parser/CMakeLists.txt +@@ -15,3 +15,22 @@ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) + + ADD_LIBRARY(json5_parser STATIC ${JSON_SPIRIT_SRCS}) + ++if(MSVC) ++ target_compile_options(json5_parser PRIVATE "/bigobj") ++endif() ++ ++target_include_directories(json5_parser PUBLIC $<INSTALL_INTERFACE:include>) ++ ++install(TARGETS json5_parser EXPORT json5_parser-config ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++) ++install(EXPORT json5_parser-config DESTINATION share/cmake/json5_parser) ++ ++file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} json5_parser*.h) ++foreach (HEADER ${HEADERS} ) ++ get_filename_component(HEADER_DIR ${HEADER} DIRECTORY) ++ install(FILES ${HEADER} DESTINATION include/${HEADER_DIR}) ++endforeach() ++ diff --git a/ports/json5-parser/CONTROL b/ports/json5-parser/CONTROL new file mode 100644 index 000000000..1c740dd3d --- /dev/null +++ b/ports/json5-parser/CONTROL @@ -0,0 +1,5 @@ +Source: json5-parser +Version: 1.0.0 +Homepage: https://bitbucket.org/wlandry/json5_parser +Description: An enhancement of the JSON Spirit C++ library to understand json5. +Build-Depends: boost-spirit diff --git a/ports/json5-parser/portfile.cmake b/ports/json5-parser/portfile.cmake new file mode 100644 index 000000000..083947621 --- /dev/null +++ b/ports/json5-parser/portfile.cmake @@ -0,0 +1,27 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_bitbucket( + OUT_SOURCE_PATH SOURCE_PATH + REPO wlandry/json5_parser + REF 1.0.0 + SHA512 105d0cccb28dd9045c06d73ab1e98a5e744ffdb38310a4581b8f1517b0edffb2cba424dc557a3490dfdcd4627d3bd1c6850eb38f588e1627dcab1de120d70717 + HEAD_REF master + PATCHES 00001-fix-build.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/json5_parser + PREFER_NINJA +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/json5_parser) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/json5-parser/copyright COPYONLY) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/json5-parser) diff --git a/ports/json5-parser/usage b/ports/json5-parser/usage new file mode 100644 index 000000000..950e637a0 --- /dev/null +++ b/ports/json5-parser/usage @@ -0,0 +1,4 @@ +The package json5-parser provides CMake targets: + + find_package(json5_parser CONFIG REQUIRED) + target_link_libraries(main PRIVATE json5_parser) |
