Skip to content

Commit

Permalink
[json5-parser] Fix build, cleanup (microsoft#41142)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Sep 24, 2024
1 parent 9612cfe commit 08ef4d0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
16 changes: 11 additions & 5 deletions ports/json5-parser/00001-fix-build.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
diff --git a/json5_parser/CMakeLists.txt b/json5_parser/CMakeLists.txt
index e83fb38..c09cae4 100644
index 3fbc6bb..e278364 100644
--- a/json5_parser/CMakeLists.txt
+++ b/json5_parser/CMakeLists.txt
@@ -15,3 +15,22 @@ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
@@ -1,3 +1,6 @@
+cmake_minimum_required(VERSION 3.5)
+project(json5-parser)
+
SET(JSON_SPIRIT_SRCS
json5_parser_reader.cpp json5_parser_reader.h
json5_parser_value.cpp json5_parser_value.h
@@ -15,3 +18,21 @@ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})

ADD_LIBRARY(json5_parser STATIC ${JSON_SPIRIT_SRCS})

Expand All @@ -12,16 +19,15 @@ index e83fb38..c09cae4 100644
+
+target_include_directories(json5_parser PUBLIC $<INSTALL_INTERFACE:include>)
+
+install(TARGETS json5_parser EXPORT json5-parser-config
+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)
+install(EXPORT json5-parser-config DESTINATION share/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()
+
7 changes: 4 additions & 3 deletions ports/json5-parser/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ vcpkg_from_github(
REF 580bfe30c5ee5e06a0f536d7bddb75c07a29eda6 # 1.0.0
SHA512 25cdbc02ed2e3b05f0644c3398230ab82ede093ed6f7d8f140a9810509dd05feab1187d62fc38818725a92c47029fe3dc5ecfdbe14e1e0a2ef314e925b369d59
HEAD_REF master
PATCHES 00001-fix-build.patch
PATCHES
00001-fix-build.patch
)

vcpkg_cmake_configure(
Expand All @@ -17,9 +18,9 @@ vcpkg_cmake_configure(

vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/json5-parser)
vcpkg_cmake_config_fixup()

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/${PORT}/copyright" COPYONLY)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
2 changes: 1 addition & 1 deletion ports/json5-parser/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "json5-parser",
"version": "1.0.0",
"port-version": 6,
"port-version": 7,
"description": "An enhancement of the JSON Spirit C++ library to understand json5.",
"homepage": "https://github.com/Caltech-IPAC/json5_parser",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3862,7 +3862,7 @@
},
"json5-parser": {
"baseline": "1.0.0",
"port-version": 6
"port-version": 7
},
"jsoncons": {
"baseline": "0.177.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/j-/json5-parser.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e917bf1a65657ed9fc7e16a223094d9849f4d92e",
"version": "1.0.0",
"port-version": 7
},
{
"git-tree": "e0cb35861057c4523a395d7d9e59f9447ac0b139",
"version": "1.0.0",
Expand Down

0 comments on commit 08ef4d0

Please sign in to comment.