vcpkg/ports/json5-parser/00001-fix-build.patch

28 lines
916 B
Diff
Raw Normal View History

2019-08-28 01:45:58 +08:00
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()
+