aboutsummaryrefslogtreecommitdiff
path: root/qlite/CMakeLists.txt
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-23 17:10:45 +0100
committerMarvin W <git@larma.de>2017-03-23 17:16:08 +0100
commite6f89f8751e6e65d4a36a125cc3fe398098ba504 (patch)
tree54acce89355ee07b05db761d6d0dad8dad4e0f36 /qlite/CMakeLists.txt
parentef0483765a0fd567f25b1f0af6df04e8973e5624 (diff)
downloaddino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.tar.gz
dino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.zip
New CMake
- add install and uninstall targets - compatibility for systems without pkg-config
Diffstat (limited to 'qlite/CMakeLists.txt')
-rw-r--r--qlite/CMakeLists.txt27
1 files changed, 11 insertions, 16 deletions
diff --git a/qlite/CMakeLists.txt b/qlite/CMakeLists.txt
index 2aeabb79..ccc86898 100644
--- a/qlite/CMakeLists.txt
+++ b/qlite/CMakeLists.txt
@@ -1,15 +1,10 @@
-find_package(Vala REQUIRED)
-find_package(PkgConfig REQUIRED)
-include(${VALA_USE_FILE})
-
-set(QLITE_PACKAGES
- gee-0.8
- glib-2.0
- sqlite3
+find_packages(QLITE_PACKAGES REQUIRED
+ Gee
+ GLib
+ GObject
+ SQLite3
)
-pkg_check_modules(QLITE REQUIRED ${QLITE_PACKAGES})
-
vala_precompile(QLITE_VALA_C
SOURCES
"src/database.vala"
@@ -28,18 +23,18 @@ GENERATE_VAPI
qlite
GENERATE_HEADER
qlite
-OPTIONS
- ${GLOBAL_DEBUG_FLAGS}
- --thread
)
-set(CFLAGS ${VALA_CFLAGS} ${QLITE_CFLAGS})
-add_definitions(${CFLAGS})
+add_definitions(${VALA_CFLAGS})
add_library(qlite SHARED ${QLITE_VALA_C})
-target_link_libraries(qlite ${QLITE_LIBRARIES})
+target_link_libraries(qlite ${QLITE_PACKAGES})
add_custom_target(qlite-vapi
DEPENDS
${CMAKE_BINARY_DIR}/exports/qlite.vapi
+ ${CMAKE_BINARY_DIR}/exports/qlite.deps
)
+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})