forked from duckdb/extension-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
65 lines (53 loc) · 2.74 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
cmake_minimum_required(VERSION 2.8.12)
# Set extension name here
set(TARGET_NAME array)
# DuckDB's extension distribution supports vcpkg. As such, dependencies can be added in ./vcpkg.json and then
# used in cmake with find_package. Feel free to remove or replace with other dependencies.
# Note that it should also be removed from vcpkg.json to prevent needlessly installing it..
find_package(OpenSSL REQUIRED)
set(EXTENSION_NAME ${TARGET_NAME}_extension)
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
project(${TARGET_NAME})
include_directories(src/include)
# TileStore & BF
# include_directories("$ENV{PREVISION_PATH}/tilestore/include")
# include_directories("$ENV{PREVISION_PATH}/buffertile/include")
include_directories("$ENV{PREVISION_PATH}/src/include")
set(EXTENSION_SOURCES src/array_extension.cpp
src/read_array.cpp
src/copy_array.cpp
src/array_reader/array_reader.cpp
src/array_reader/coo_reader.cpp
src/array_writer/base_writer.cpp
src/array_writer/coo_to_dense_writer.cpp
src/array_writer/dense_to_dense_writer.cpp
src/array_writer/cooma_to_dense_writer.cpp
src/array_writer/cooma_to_coo_writer.cpp
src/create_array.cpp)
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
# Link OpenSSL in both the static library as the loadable extension
target_link_libraries(${EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto)
target_link_libraries(${LOADABLE_EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto)
# TileStore & BF
# target_link_libraries(${EXTENSION_NAME} "$ENV{PREVISION_PATH}/buffertile/lib/libbf.a")
# target_link_libraries(${EXTENSION_NAME} "$ENV{PREVISION_PATH}/tilestore/lib/libtilestore.a")
target_link_libraries(${EXTENSION_NAME} "$ENV{PREVISION_PATH}/build/libprevision_lib.a")
target_link_libraries(${EXTENSION_NAME} -lrt)
# target_link_libraries(${LOADABLE_EXTENSION_NAME} "$ENV{PREVISION_PATH}/buffertile/lib/libbf.a")
# target_link_libraries(${LOADABLE_EXTENSION_NAME} "$ENV{PREVISION_PATH}/tilestore/lib/libtilestore.a")
target_link_libraries(${LOADABLE_EXTENSION_NAME} "$ENV{PREVISION_PATH}/build/libprevision_lib.a")
target_link_libraries(${LOADABLE_EXTENSION_NAME} -lrt)
# Find BLAS
find_package(BLAS REQUIRED)
if(BLAS_FOUND)
include_directories(${BLAS_INCLUDE_DIRS})
target_link_libraries(${EXTENSION_NAME} ${BLAS_LIBRARIES})
else()
message(FATAL_ERROR "OpenBLAS not found.")
endif()
install(
TARGETS ${EXTENSION_NAME}
EXPORT "${DUCKDB_EXPORT_SET}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}")