Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sord] Add new port #13411

Merged
merged 2 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions ports/sord/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 changes: 26 additions & 0 deletions ports/sord/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions ports/sord/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
]
}