[sord] Add new port (#13411)

* Add sord port

* Fix include directories
This commit is contained in:
Dominic Clark 2020-09-09 20:04:12 +01:00 committed by GitHub
parent ad81400f9c
commit 468e82de6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 91 additions and 0 deletions

55
ports/sord/CMakeLists.txt Normal file
View File

@ -0,0 +1,55 @@
cmake_minimum_required(VERSION 3.17)
project(sord C)
find_package(serd CONFIG REQUIRED)
add_library(sord
src/sord.c
src/syntax.c
)
file(WRITE "${CMAKE_BINARY_DIR}/sord_config.h" "")
target_include_directories(sord
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}"
)
target_link_libraries(sord PUBLIC serd::serd)
set_target_properties(sord PROPERTIES
C_STANDARD 99
C_STANDARD_REQUIRED ON
)
target_compile_definitions(sord PRIVATE SORD_INTERNAL _CRT_SECURE_NO_WARNINGS)
if(BUILD_SHARED_LIBS)
target_compile_definitions(sord PUBLIC SORD_SHARED)
endif()
install(
TARGETS sord
EXPORT sord-targets
INCLUDES DESTINATION include
)
if(NOT DISABLE_INSTALL_HEADERS)
install(DIRECTORY sord DESTINATION include)
endif()
install(
EXPORT sord-targets
NAMESPACE sord::
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/sord"
)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/sord-config.cmake" [[
include(CMakeFindDependencyMacro)
find_dependency(serd CONFIG)
include("${CMAKE_CURRENT_LIST_DIR}/sord-targets.cmake")
]])
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/sord-config.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/sord"
)

26
ports/sord/portfile.cmake Normal file
View File

@ -0,0 +1,26 @@
vcpkg_from_gitlab(
GITLAB_URL https://gitlab.com
OUT_SOURCE_PATH SOURCE_PATH
REPO drobilla/sord
REF v0.16.4
SHA512 cad8f8fd07afb5075938fce247d95f9d666f61f4d913ff0c3fde335384177de066a5c0f2620c76e098178aeded0412b3e76ef63a1ae65aba7eb99e3e8ce15896
HEAD_REF master
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_configure_cmake(
SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=1
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets()
file(
INSTALL "${SOURCE_PATH}/COPYING"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
RENAME copyright
)

10
ports/sord/vcpkg.json Normal file
View File

@ -0,0 +1,10 @@
{
"name": "sord",
"version-string": "0.16.4",
"description": "Sord is a lightweight C library for storing RDF statements in memory.",
"homepage": "https://drobilla.net/software/sord",
"license": "ISC",
"dependencies": [
"serd"
]
}