mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 12:49:00 +08:00
json5-parser (#7915)
This commit is contained in:
parent
9609b2a615
commit
0011fd9e5e
27
ports/json5-parser/00001-fix-build.patch
Normal file
27
ports/json5-parser/00001-fix-build.patch
Normal file
@ -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()
|
||||
+
|
5
ports/json5-parser/CONTROL
Normal file
5
ports/json5-parser/CONTROL
Normal file
@ -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
|
27
ports/json5-parser/portfile.cmake
Normal file
27
ports/json5-parser/portfile.cmake
Normal file
@ -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)
|
4
ports/json5-parser/usage
Normal file
4
ports/json5-parser/usage
Normal file
@ -0,0 +1,4 @@
|
||||
The package json5-parser provides CMake targets:
|
||||
|
||||
find_package(json5_parser CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE json5_parser)
|
Loading…
Reference in New Issue
Block a user