-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
290 lines (276 loc) · 14.2 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
if(LIBNUMA_FOUND)
set(QUICKSTEP_HAVE_LIBNUMA TRUE)
endif()
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/CatalogConfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/CatalogConfig.h"
)
QS_PROTOBUF_GENERATE_CPP(catalog_Catalog_proto_srcs catalog_Catalog_proto_hdrs Catalog.proto)
# Declare micro-libs:
add_library(quickstep_catalog_Catalog Catalog.cpp Catalog.hpp)
add_library(quickstep_catalog_CatalogAttribute CatalogAttribute.cpp CatalogAttribute.hpp)
add_library(quickstep_catalog_CatalogDatabase CatalogDatabase.cpp CatalogDatabase.hpp)
add_library(quickstep_catalog_CatalogDatabaseCache CatalogDatabaseCache.cpp CatalogDatabaseCache.hpp)
add_library(quickstep_catalog_CatalogDatabaseLite ../empty_src.cpp CatalogDatabaseLite.hpp)
add_library(quickstep_catalog_CatalogErrors ../empty_src.cpp CatalogErrors.hpp)
add_library(quickstep_catalog_CatalogRelation CatalogRelation.cpp CatalogRelation.hpp)
add_library(quickstep_catalog_CatalogRelationSchema
CatalogRelationSchema.cpp
CatalogRelationSchema.hpp)
add_library(quickstep_catalog_CatalogRelationStatistics
CatalogRelationStatistics.cpp
CatalogRelationStatistics.hpp)
add_library(quickstep_catalog_CatalogTypedefs ../empty_src.cpp CatalogTypedefs.hpp)
add_library(quickstep_catalog_Catalog_proto ${catalog_Catalog_proto_srcs})
add_library(quickstep_catalog_IndexScheme IndexScheme.cpp IndexScheme.hpp)
add_library(quickstep_catalog_PartitionScheme PartitionScheme.cpp PartitionScheme.hpp)
add_library(quickstep_catalog_PartitionSchemeHeader PartitionSchemeHeader.cpp PartitionSchemeHeader.hpp)
if(QUICKSTEP_HAVE_LIBNUMA)
add_library(quickstep_catalog_NUMAPlacementScheme NUMAPlacementScheme.cpp NUMAPlacementScheme.hpp)
endif()
# Link dependencies:
target_link_libraries(quickstep_catalog_Catalog
glog
quickstep_catalog_CatalogDatabase
quickstep_catalog_CatalogErrors
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_utility_Macros
quickstep_utility_PtrVector)
target_link_libraries(quickstep_catalog_CatalogAttribute
glog
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_Type_proto
quickstep_utility_Macros)
target_link_libraries(quickstep_catalog_CatalogDatabase
glog
quickstep_catalog_CatalogDatabaseLite
quickstep_catalog_CatalogErrors
quickstep_catalog_CatalogRelation
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_storage_StorageConstants
quickstep_threading_Mutex
quickstep_threading_SharedMutex
quickstep_threading_SpinSharedMutex
quickstep_utility_Macros
quickstep_utility_PtrVector
quickstep_utility_StringUtil)
target_link_libraries(quickstep_catalog_CatalogDatabaseCache
glog
quickstep_catalog_CatalogDatabaseLite
quickstep_catalog_CatalogRelationSchema
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_storage_StorageConstants
quickstep_threading_Mutex
quickstep_threading_SharedMutex
quickstep_threading_SpinSharedMutex
quickstep_utility_Macros)
target_link_libraries(quickstep_catalog_CatalogDatabaseLite
quickstep_catalog_CatalogTypedefs
quickstep_utility_Macros)
target_link_libraries(quickstep_catalog_CatalogRelation
glog
quickstep_catalog_CatalogAttribute
quickstep_catalog_CatalogRelationSchema
quickstep_catalog_CatalogRelationStatistics
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_catalog_IndexScheme
quickstep_catalog_PartitionScheme
quickstep_catalog_PartitionSchemeHeader
quickstep_storage_StorageBlockInfo
quickstep_storage_StorageBlockLayout
quickstep_storage_StorageBlockLayout_proto
quickstep_storage_StorageConstants
quickstep_threading_Mutex
quickstep_threading_SharedMutex
quickstep_threading_SpinSharedMutex
quickstep_utility_Macros
quickstep_utility_PtrVector)
target_link_libraries(quickstep_catalog_CatalogRelationSchema
glog
quickstep_catalog_CatalogAttribute
quickstep_catalog_CatalogErrors
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_types_Type
quickstep_utility_Macros
quickstep_utility_PtrVector
quickstep_utility_StringUtil)
target_link_libraries(quickstep_catalog_CatalogRelationStatistics
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_types_LongType
quickstep_types_NullType
quickstep_types_TypedValue
quickstep_utility_Macros)
target_link_libraries(quickstep_catalog_Catalog_proto
${PROTOBUF_LIBRARY}
quickstep_storage_StorageBlockLayout_proto
quickstep_types_Type_proto
quickstep_types_TypedValue_proto)
target_link_libraries(quickstep_catalog_IndexScheme
glog
quickstep_catalog_Catalog_proto
quickstep_storage_IndexSubBlockDescriptionFactory
quickstep_storage_StorageBlockLayout_proto
quickstep_utility_Macros)
target_link_libraries(quickstep_catalog_PartitionScheme
glog
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_catalog_PartitionSchemeHeader
quickstep_storage_StorageBlockInfo
quickstep_threading_Mutex
quickstep_threading_SharedMutex
quickstep_threading_SpinSharedMutex
quickstep_utility_Macros)
target_link_libraries(quickstep_catalog_PartitionSchemeHeader
glog
quickstep_catalog_CatalogAttribute
quickstep_catalog_CatalogRelationSchema
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_storage_StorageConstants
quickstep_threading_SpinMutex
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_Type_proto
quickstep_types_TypedValue
quickstep_types_TypedValue_proto
quickstep_types_operations_comparisons_Comparison
quickstep_types_operations_comparisons_EqualComparison
quickstep_types_operations_comparisons_LessComparison
quickstep_utility_CompositeHash
quickstep_utility_Macros)
if(QUICKSTEP_HAVE_LIBNUMA)
target_link_libraries(quickstep_catalog_CatalogRelation
quickstep_catalog_NUMAPlacementScheme)
target_link_libraries(quickstep_catalog_NUMAPlacementScheme
${LIBNUMA_LIBRARY}
glog
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_storage_StorageBlockInfo
quickstep_utility_Macros)
endif()
# Module all-in-one library:
add_library(quickstep_catalog ../empty_src.cpp CatalogModule.hpp)
target_link_libraries(quickstep_catalog
quickstep_catalog_Catalog
quickstep_catalog_CatalogAttribute
quickstep_catalog_CatalogDatabase
quickstep_catalog_CatalogDatabaseCache
quickstep_catalog_CatalogDatabaseLite
quickstep_catalog_CatalogErrors
quickstep_catalog_CatalogRelation
quickstep_catalog_CatalogRelationSchema
quickstep_catalog_CatalogRelationStatistics
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_catalog_IndexScheme
quickstep_catalog_PartitionScheme
quickstep_catalog_PartitionSchemeHeader)
if(QUICKSTEP_HAVE_LIBNUMA)
target_link_libraries(quickstep_catalog
quickstep_catalog_NUMAPlacementScheme)
endif()
# Tests:
add_executable(Catalog_unittest "${CMAKE_CURRENT_SOURCE_DIR}/tests/Catalog_unittest.cpp")
target_link_libraries(Catalog_unittest
gtest
gtest_main
quickstep_catalog_Catalog
quickstep_catalog_CatalogAttribute
quickstep_catalog_CatalogDatabase
quickstep_catalog_CatalogDatabaseCache
quickstep_catalog_CatalogRelation
quickstep_catalog_CatalogRelationSchema
quickstep_catalog_CatalogTypedefs
quickstep_catalog_Catalog_proto
quickstep_catalog_IndexScheme
quickstep_storage_StorageBlock
quickstep_storage_StorageBlockInfo
quickstep_storage_StorageBlockLayout
quickstep_storage_StorageBlockLayout_proto
quickstep_storage_SubBlockTypeRegistryMacros
quickstep_types_Type
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_utility_Macros
quickstep_utility_PtrVector)
add_test(Catalog_unittest Catalog_unittest)
add_executable(CatalogRelationStatistics_unittest
"${CMAKE_CURRENT_SOURCE_DIR}/tests/CatalogRelationStatistics_unittest.cpp")
target_link_libraries(CatalogRelationStatistics_unittest
gtest
gtest_main
quickstep_catalog_Catalog
quickstep_catalog_CatalogDatabase
quickstep_catalog_CatalogRelation
quickstep_catalog_CatalogRelationStatistics
quickstep_cli_CommandExecutor
quickstep_cli_DropRelation
quickstep_parser_ParseStatement
quickstep_parser_SqlParserWrapper
quickstep_queryexecution_ForemanSingleNode
quickstep_queryexecution_QueryExecutionTypedefs
quickstep_queryexecution_QueryExecutionUtil
quickstep_queryexecution_Worker
quickstep_queryexecution_WorkerDirectory
quickstep_queryoptimizer_QueryHandle
quickstep_queryoptimizer_QueryProcessor
quickstep_storage_StorageConstants
quickstep_storage_StorageManager
tmb)
add_test(CatalogRelationStatistics_unittest CatalogRelationStatistics_unittest)
if(QUICKSTEP_HAVE_LIBNUMA)
add_executable(NUMAPlacementScheme_unittest
"${CMAKE_CURRENT_SOURCE_DIR}/tests/NUMAPlacementScheme_unittest.cpp")
target_link_libraries(NUMAPlacementScheme_unittest
${LIBS}
gtest
gtest_main
quickstep_catalog_NUMAPlacementScheme
quickstep_catalog_PartitionSchemeHeader
quickstep_storage_StorageBlockInfo)
add_test(NUMAPlacementScheme_unittest NUMAPlacementScheme_unittest)
endif()
add_executable(PartitionScheme_unittest
"${CMAKE_CURRENT_SOURCE_DIR}/tests/PartitionScheme_unittest.cpp")
target_link_libraries(PartitionScheme_unittest
gtest
gtest_main
quickstep_catalog_CatalogTypedefs
quickstep_catalog_PartitionScheme
quickstep_catalog_PartitionSchemeHeader
quickstep_storage_StorageBlockInfo
quickstep_types_TypeFactory
quickstep_types_TypeID
quickstep_types_TypedValue
quickstep_types_operations_comparisons_Comparison
quickstep_types_operations_comparisons_EqualComparison
quickstep_utility_CompositeHash)
add_test(PartitionScheme_unittest PartitionScheme_unittest)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/catalog_relation_statistics_test_data)