From e6f89f8751e6e65d4a36a125cc3fe398098ba504 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 23 Mar 2017 17:10:45 +0100 Subject: New CMake - add install and uninstall targets - compatibility for systems without pkg-config --- qlite/CMakeLists.txt | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'qlite') 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}) -- cgit v1.2.3-70-g09d2