aboutsummaryrefslogtreecommitdiff
path: root/qlite/CMakeLists.txt
blob: 70ec0e47d6d9ebbab4200e7f54b567dafbf24251 (plain) (blame)
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
find_packages(QLITE_PACKAGES REQUIRED
    Gee
    GLib
    GObject
    SQLite3>=3.24
)

vala_precompile(QLITE_VALA_C
SOURCES
    "src/database.vala"
    "src/table.vala"
    "src/column.vala"
    "src/row.vala"

    "src/statement_builder.vala"
    "src/delete_builder.vala"
    "src/insert_builder.vala"
    "src/query_builder.vala"
    "src/update_builder.vala"
    "src/upsert_builder.vala"
PACKAGES
    ${QLITE_PACKAGES}
GENERATE_VAPI
    qlite
GENERATE_HEADER
    qlite
)

add_custom_target(qlite-vapi
DEPENDS
    ${CMAKE_BINARY_DIR}/exports/qlite.vapi
    ${CMAKE_BINARY_DIR}/exports/qlite.deps
)

add_definitions(${VALA_CFLAGS})
add_library(qlite SHARED ${QLITE_VALA_C})
add_dependencies(qlite qlite-vapi)
target_link_libraries(qlite ${QLITE_PACKAGES})
set_target_properties(qlite PROPERTIES VERSION 0.1 SOVERSION 0)

install(TARGETS qlite ${TARGET_INSTALL})
install(FILES ${CMAKE_BINARY_DIR}/exports/qlite.vapi ${CMAKE_BINARY_DIR}/exports/qlite.deps DESTINATION ${VAPI_INSTALL_DIR})
install(FILES ${CMAKE_BINARY_DIR}/exports/qlite.h DESTINATION ${INCLUDE_INSTALL_DIR})