-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
108 lines (80 loc) · 2.72 KB
/
CMakeLists.txt
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
project(DLDI)
cmake_minimum_required(VERSION 3.25.1)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_library(lib-dldi)
include(GNUInstallDirs)
set(CMAKE_INSTALL_DOCDIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME})
set(CXX_EXTENSIONS OFF)
set(CXX_STANDARD 26)
set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
include(FindPkgConfig)
function(pkg_import target id pkg)
if(NOT TARGET ${target})
pkg_check_modules(${id} REQUIRED IMPORTED_TARGET ${pkg})
add_library(${target} ALIAS PkgConfig::${id})
endif()
endfunction()
pkg_import(serd::serd serd serd-0)
find_package(serd-o QUIET)
set_property(TARGET lib-dldi PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(lib-dldi
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>)
find_package(ZLIB REQUIRED)
target_link_libraries(lib-dldi
PUBLIC
ZLIB::ZLIB
serd::serd)
target_sources(lib-dldi
PRIVATE
src/DLDI.cpp
src/DLDI_compose.cpp
src/triples/TriplesWriter.cpp
src/triples/TriplesReader.cpp
src/triples/TriplesIterator.cpp
src/dictionary/Dictionary.cpp
src/dictionary/trie/Trie.cpp
src/dictionary/trie/DataManager/DataManager.cpp
src/dictionary/trie/DataManager/edges.cpp
src/dictionary/trie/DataManager/internal-nodes.cpp
src/dictionary/trie/DataManager/edge-labels.cpp
src/dictionary/trie/DataManager/leaf-nodes.cpp
src/dictionary/trie/DataManager/load.cpp
src/dictionary/trie/DataManager/out-edges.cpp
src/dictionary/trie/DataManager/save.cpp
src/dictionary/trie/LabelComparator.cpp
src/dictionary/trie/OutEdgeIterator/wrapper.cpp
src/dictionary/trie/OutEdgeIterator/mmapped.cpp
src/dictionary/trie/OutEdgeIterator/memory.cpp
src/dictionary/trie/PathCharIterator.cpp
src/dictionary/trie/TermIterator.cpp
src/dictionary/trie/TrieAlgorithm/id_to_string.cpp
src/dictionary/trie/TrieAlgorithm/insert.cpp
src/dictionary/trie/TrieAlgorithm/string_to_id.cpp
src/dictionary/trie/TrieAlgorithm/remove.cpp
src/dictionary/trie/TrieAlgorithm/scope.cpp
src/dictionary/trie/TrieNavigator.cpp
src/dictionary/trie/TermStringIterator.cpp
src/AnyPositionTermIterator.cpp
src/rdf/SerdParser.cpp
src/Composer.cpp
)
add_executable(dldi)
target_link_libraries(dldi PRIVATE lib-dldi)
target_sources(dldi PRIVATE
src/cli/compose.cpp
src/cli/query.cpp
src/cli/query-terms.cpp
src/cli/query-triples.cpp
src/cli/main.cpp
)
install(TARGETS dldi)
install(TARGETS lib-dldi
EXPORT ${PROJECT_NAME}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.hpp")
enable_testing()
add_subdirectory(test)