diff options
Diffstat (limited to 'vcpkg/ports/json-rpc-cxx')
| -rw-r--r-- | vcpkg/ports/json-rpc-cxx/fix-config.patch | 22 | ||||
| -rw-r--r-- | vcpkg/ports/json-rpc-cxx/portfile.cmake | 32 | ||||
| -rw-r--r-- | vcpkg/ports/json-rpc-cxx/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/json-rpc-cxx/vcpkg.json | 18 |
4 files changed, 76 insertions, 0 deletions
diff --git a/vcpkg/ports/json-rpc-cxx/fix-config.patch b/vcpkg/ports/json-rpc-cxx/fix-config.patch new file mode 100644 index 0000000..197527e --- /dev/null +++ b/vcpkg/ports/json-rpc-cxx/fix-config.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a362ea4..9c23acf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,8 +10,16 @@ option(CODE_COVERAGE "Enable coverage reporting" OFF) + include(GNUInstallDirs) + + add_library(json-rpc-cxx INTERFACE) +-target_include_directories(json-rpc-cxx INTERFACE include) ++target_include_directories(json-rpc-cxx INTERFACE ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}> ++ $<INSTALL_INTERFACE:include> ++ ) + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++install (TARGETS json-rpc-cxx EXPORT unofficial-json-rpc-cxx-config) ++install (EXPORT unofficial-json-rpc-cxx-config ++ NAMESPACE unofficial::json-rpc-cxx:: ++ DESTINATION share/unofficial-json-rpc-cxx ++ ) + + add_library(coverage_config INTERFACE) + diff --git a/vcpkg/ports/json-rpc-cxx/portfile.cmake b/vcpkg/ports/json-rpc-cxx/portfile.cmake new file mode 100644 index 0000000..1a756e5 --- /dev/null +++ b/vcpkg/ports/json-rpc-cxx/portfile.cmake @@ -0,0 +1,32 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO jsonrpcx/json-rpc-cxx
+ REF "v${VERSION}"
+ SHA512 fa4ee807dd29027edd86949a8632adede77c3706406e6b78a8b6e38003f80103082ef70e0b89293a608db238d6f5662669b69cf0cb3d607bcc959c8801c5f3e0
+ HEAD_REF master
+ PATCHES
+ fix-config.patch
+)
+
+set(VCPKG_BUILD_TYPE release) # header-only port
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DCOMPILE_TESTS=OFF
+ -DCOMPILE_EXAMPLES=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
+file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" JSON_RPC_CXX_CONFIG)
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" "
+include(CMakeFindDependencyMacro)
+find_dependency(nlohmann_json)
+${JSON_RPC_CXX_CONFIG}
+")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
diff --git a/vcpkg/ports/json-rpc-cxx/usage b/vcpkg/ports/json-rpc-cxx/usage new file mode 100644 index 0000000..0e1009e --- /dev/null +++ b/vcpkg/ports/json-rpc-cxx/usage @@ -0,0 +1,4 @@ +json-rpc-cxx provides CMake targets: + + find_package(unofficial-json-rpc-cxx CONFIG REQUIRED) + target_link_libraries(main PRIVATE unofficial::json-rpc-cxx::json-rpc-cxx) diff --git a/vcpkg/ports/json-rpc-cxx/vcpkg.json b/vcpkg/ports/json-rpc-cxx/vcpkg.json new file mode 100644 index 0000000..063e873 --- /dev/null +++ b/vcpkg/ports/json-rpc-cxx/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "json-rpc-cxx", + "version": "0.3.2", + "description": "A JSON-RPC 2.0 framework implemented in C++17 using the nlohmann's json for modern C++.", + "homepage": "https://github.com/jsonrpcx/json-rpc-cxx", + "license": "MIT", + "dependencies": [ + "nlohmann-json", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |