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 /main | |
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 'main')
-rw-r--r-- | main/CMakeLists.txt | 50 | ||||
-rw-r--r-- | main/data/dino.desktop | 12 | ||||
-rw-r--r-- | main/src/main.vala | 11 |
3 files changed, 52 insertions, 21 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 76f5e507..60d91c7b 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,19 +1,12 @@ -find_package(Vala REQUIRED) -find_package(PkgConfig REQUIRED) -include(${VALA_USE_FILE}) -include(GlibCompileResourcesSupport) - -set(MAIN_PACKAGES - gee-0.8 - glib-2.0 - gtk+-3.0 - gmodule-2.0 - libnotify - sqlite3 +find_packages(MAIN_PACKAGES REQUIRED + Gee + GLib>=2.38 + GModule + GObject + GTK3>=3.22 + Libnotify ) -pkg_check_modules(MAIN REQUIRED ${MAIN_PACKAGES}) - set(RESOURCE_LIST icons/dino-double-tick-symbolic.svg icons/dino-status-away.svg @@ -107,14 +100,29 @@ PACKAGES ${MAIN_PACKAGES} GRESOURCES ${MAIN_GRESOURCES_XML} -OPTIONS - --target-glib=2.38 - ${GLOBAL_DEBUG_FLAGS} - --thread ) -set(CFLAGS ${VALA_CFLAGS} ${MAIN_CFLAGS}) -add_definitions(${CFLAGS}) +add_definitions(${VALA_CFLAGS}) add_executable(dino ${MAIN_VALA_C} ${MAIN_GRESOURCES_TARGET}) add_dependencies(dino dino-vapi dino-gsettings-schema-compiled) -target_link_libraries(dino libdino ${MAIN_LIBRARIES})
\ No newline at end of file +target_link_libraries(dino libdino ${MAIN_PACKAGES}) + +if(WIN32) + target_link_libraries(dino -mwindows) +endif(WIN32) + +install(TARGETS dino ${TARGET_INSTALL}) +install(FILES data/dino.desktop DESTINATION ${APPLICATION_INSTALL_DIR}) +install(FILES data/icons/dino.svg DESTINATION ${ICON_INSTALL_DIR}/hicolor/scalable/apps) +install(FILES data/icons/dino-symbolic.svg DESTINATION ${ICON_INSTALL_DIR}/hicolor/symbolic/apps) +install(FILES + data/icons/dino-status-away.svg + data/icons/dino-status-chat.svg + data/icons/dino-status-dnd.svg + data/icons/dino-status-online.svg + + data/icons/dino-double-tick-symbolic.svg + data/icons/dino-tick-symbolic.svg +DESTINATION + ${ICON_INSTALL_DIR}/hicolor/scalable/status +) diff --git a/main/data/dino.desktop b/main/data/dino.desktop new file mode 100644 index 00000000..924cc587 --- /dev/null +++ b/main/data/dino.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Name=Dino +GenericName=Jabber/XMPP Client +Keywords=chat;talk;im;message;xmpp;jabber; +Exec=dino +Icon=dino +StartupNotify=false +Terminal=false +Type=Application +Categories=GTK;Network;Chat;InstantMessaging; +X-GNOME-UsesNotifications=true
\ No newline at end of file diff --git a/main/src/main.vala b/main/src/main.vala index ba326ad8..96744e12 100644 --- a/main/src/main.vala +++ b/main/src/main.vala @@ -15,6 +15,17 @@ void main(string[] args) { Plugins.Loader loader = new Plugins.Loader(exec_path); Gtk.init(ref args); Dino.Ui.Application app = new Dino.Ui.Application(); + + app.add_main_option("show-plugin-paths", 0, 0, OptionArg.NONE, "Display plugin search paths and exit", null); + app.handle_local_options.connect((options) => { + Variant v = options.lookup_value("show-plugin-paths", VariantType.BOOLEAN); + if (v != null && v.get_type() == VariantType.BOOLEAN && v.get_boolean()) { + loader.print_search_paths(); + return 0; + } + return -1; + }); + foreach (string plugin in new string[]{"omemo", "openpgp"}) { try { loader.load(plugin, app); |