aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2018-12-13 04:32:45 +0800
committerRobert Schumacher <roschuma@microsoft.com>2018-12-12 12:32:45 -0800
commita60120cbad46361f359836a79eb7c682c825894d (patch)
treeae787cafee39c4258d6ab5e3f791c0bb0faf3acb
parent1d5e22919fcfeba3fe513248e73395c42ac18ae4 (diff)
downloadvcpkg-a60120cbad46361f359836a79eb7c682c825894d.tar.gz
vcpkg-a60120cbad46361f359836a79eb7c682c825894d.zip
[sajson] Add new port (#4818)
* [sajson] Add new port * [sajson] Fix package namespace
-rw-r--r--ports/sajson/CMakeLists.txt26
-rw-r--r--ports/sajson/CONTROL3
-rw-r--r--ports/sajson/portfile.cmake27
3 files changed, 56 insertions, 0 deletions
diff --git a/ports/sajson/CMakeLists.txt b/ports/sajson/CMakeLists.txt
new file mode 100644
index 000000000..da8327003
--- /dev/null
+++ b/ports/sajson/CMakeLists.txt
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 3.8)
+
+project(sajson)
+
+add_library(sajson INTERFACE)
+
+target_compile_features(sajson INTERFACE cxx_std_11)
+
+target_include_directories(sajson INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
+ $<INSTALL_INTERFACE:include>)
+
+install(DIRECTORY include/
+ DESTINATION include
+ USE_SOURCE_PERMISSIONS
+ FILES_MATCHING PATTERN "*.h"
+ )
+
+install(TARGETS sajson EXPORT unofficial-sajson-config)
+
+install(EXPORT unofficial-sajson-config
+ FILE unofficial-sajson-config.cmake
+ NAMESPACE unofficial::sajson::
+ DESTINATION share/cmake/unofficial-sajson
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+)
diff --git a/ports/sajson/CONTROL b/ports/sajson/CONTROL
new file mode 100644
index 000000000..c990cd3df
--- /dev/null
+++ b/ports/sajson/CONTROL
@@ -0,0 +1,3 @@
+Source: sajson
+Version: 2018-09-21
+Description: Lightweight, extremely high-performance JSON parser for C++11
diff --git a/ports/sajson/portfile.cmake b/ports/sajson/portfile.cmake
new file mode 100644
index 000000000..662ab01f7
--- /dev/null
+++ b/ports/sajson/portfile.cmake
@@ -0,0 +1,27 @@
+# Header-only library
+
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO chadaustin/sajson
+ REF 2dcfd350586375f9910f74821d4f07d67ae455ba
+ SHA512 6029a640f8bd6c7cefc507819a18a708f6d7e9ce84fdd2998506cea26d597b999d2776a7307908f5df02994bc53c3c9bdf6a73344ab70ee6a5c775b54351e7d2
+ HEAD_REF master
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/unofficial-sajson TARGET_PATH share/unofficial-sajson)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/sajson/copyright COPYONLY)