-
Notifications
You must be signed in to change notification settings - Fork 0
/
libserd.cmake
executable file
·64 lines (54 loc) · 1.53 KB
/
libserd.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# SPDX-FileCopyrightText: © 2023 Joe T. Sylve, Ph.D. <[email protected]>
#
# SPDX-License-Identifier: ISC
if (SERD_STATIC)
add_library(serd STATIC)
else()
add_library(serd SHARED)
endif()
add_library(serd::serd ALIAS serd)
set_target_properties(serd
PROPERTIES
C_STANDARD 99
C_STANDARD_REQUIRED ON
C_EXTENSIONS OFF
C_VISIBILITY_PRESET hidden
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
target_sources(serd
PUBLIC
FILE_SET HEADERS
BASE_DIRS
${serd-source_SOURCE_DIR}/include
FILES
${serd-source_SOURCE_DIR}/include/serd/serd.h
PRIVATE
${serd-source_SOURCE_DIR}/src/base64.c
${serd-source_SOURCE_DIR}/src/byte_source.c
${serd-source_SOURCE_DIR}/src/env.c
${serd-source_SOURCE_DIR}/src/n3.c
${serd-source_SOURCE_DIR}/src/node.c
${serd-source_SOURCE_DIR}/src/reader.c
${serd-source_SOURCE_DIR}/src/string.c
${serd-source_SOURCE_DIR}/src/system.c
${serd-source_SOURCE_DIR}/src/uri.c
${serd-source_SOURCE_DIR}/src/writer.c
)
target_include_directories(serd
PUBLIC
$<BUILD_INTERFACE:${serd-source_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(serd
PRIVATE
serd-config
)
include(GNUInstallDirs)
install(TARGETS serd
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FILE_SET HEADERS
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)