diff options
author | Marvin W <git@larma.de> | 2017-03-23 17:10:45 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-03-23 17:16:08 +0100 |
commit | e6f89f8751e6e65d4a36a125cc3fe398098ba504 (patch) | |
tree | 54acce89355ee07b05db761d6d0dad8dad4e0f36 /libdino/CMakeLists.txt | |
parent | ef0483765a0fd567f25b1f0af6df04e8973e5624 (diff) | |
download | dino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.tar.gz dino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.zip |
New CMake
- add install and uninstall targets
- compatibility for systems without pkg-config
Diffstat (limited to 'libdino/CMakeLists.txt')
-rw-r--r-- | libdino/CMakeLists.txt | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/libdino/CMakeLists.txt b/libdino/CMakeLists.txt index a2b47381..16454115 100644 --- a/libdino/CMakeLists.txt +++ b/libdino/CMakeLists.txt @@ -1,17 +1,11 @@ -find_package(Vala REQUIRED) -find_package(PkgConfig REQUIRED) -include(${VALA_USE_FILE}) - -set(LIBDINO_PACKAGES - gee-0.8 - glib-2.0 - gtk+-3.0 - gmodule-2.0 - sqlite3 +find_packages(LIBDINO_PACKAGES REQUIRED + Gee + GLib + GModule + GObject + GTK3 ) -pkg_check_modules(LIBDINO REQUIRED ${LIBDINO_PACKAGES}) - vala_precompile(LIBDINO_VALA_C SOURCES src/application.vala @@ -49,28 +43,27 @@ SOURCES CUSTOM_VAPIS "${CMAKE_BINARY_DIR}/exports/xmpp-vala.vapi" "${CMAKE_BINARY_DIR}/exports/qlite.vapi" +CUSTOM_DEPS + xmpp-vala + qlite PACKAGES ${LIBDINO_PACKAGES} GENERATE_VAPI dino GENERATE_HEADER dino -OPTIONS - --target-glib=2.38 - ${GLOBAL_DEBUG_FLAGS} - --thread ) -set(CFLAGS ${VALA_CFLAGS} ${LIBDINO_CFLAGS}) -add_definitions(${CFLAGS}) +add_definitions(${VALA_CFLAGS}) add_library(libdino SHARED ${LIBDINO_VALA_C}) add_dependencies(libdino xmpp-vala-vapi qlite-vapi) -target_link_libraries(libdino xmpp-vala qlite ${LIBDINO_LIBRARIES} -lm) +target_link_libraries(libdino xmpp-vala qlite ${LIBDINO_PACKAGES} -lm) set_target_properties(libdino PROPERTIES PREFIX "") add_custom_target(dino-vapi DEPENDS ${CMAKE_BINARY_DIR}/exports/dino.vapi + ${CMAKE_BINARY_DIR}/exports/dino.deps ) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/gschemas.compiled @@ -83,4 +76,9 @@ DEPENDS add_custom_target(dino-gsettings-schema-compiled DEPENDS ${CMAKE_BINARY_DIR}/gschemas.compiled -)
\ No newline at end of file +) + +install(TARGETS libdino ${TARGET_INSTALL}) +install(FILES ${CMAKE_BINARY_DIR}/exports/dino.vapi ${CMAKE_BINARY_DIR}/exports/dino.deps DESTINATION ${VAPI_INSTALL_DIR}) +install(FILES ${CMAKE_BINARY_DIR}/exports/dino.h DESTINATION ${INCLUDE_INSTALL_DIR}) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/dino.gschema.xml DESTINATION ${SHARE_INSTALL_PREFIX}/glib-2.0/schemas/)
\ No newline at end of file |