]> granicus.if.org Git - transmission/commitdiff
cmake: Allow libappindicator to be toggled
authorMike Gilbert <floppym@gentoo.org>
Sun, 27 Nov 2016 19:17:07 +0000 (14:17 -0500)
committerMike Gilbert <floppym@gentoo.org>
Sun, 27 Nov 2016 19:18:59 +0000 (14:18 -0500)
This will allow libappindicator to become an optional dependency on
Gentoo Linux.

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies

CMakeLists.txt

index a4e8497aaad610f645dfe0b368f16aa641453e09..6f5bef4bcef52b081e9d25cc4a82e00ea3934ecf 100644 (file)
@@ -32,6 +32,7 @@ tr_auto_option(USE_SYSTEM_B64       "Use system b64 library" AUTO)
 tr_list_option(WITH_CRYPTO          "Use specified crypto library" AUTO openssl cyassl polarssl)
 tr_auto_option(WITH_INOTIFY         "Enable inotify support (on systems that support it)" AUTO)
 tr_auto_option(WITH_KQUEUE          "Enable kqueue support (on systems that support it)" AUTO)
+tr_auto_option(WITH_LIBAPPINDICATOR "Use libappindicator in GTK+ client" AUTO)
 tr_auto_option(WITH_SYSTEMD         "Add support for systemd startup notification (on systems that support it)" AUTO)
 
 set(TR_NAME ${PROJECT_NAME})
@@ -188,13 +189,13 @@ if(ENABLE_GTK)
 
     tr_fixup_auto_option(ENABLE_GTK GTK_FOUND GTK_IS_REQUIRED)
 
-    set(WITH_LIBAPPINDICATOR OFF)
-    if(ENABLE_GTK)
+    if(ENABLE_GTK AND WITH_LIBAPPINDICATOR)
+        tr_get_required_flag(WITH_LIBAPPINDICATOR LIBAPPINDICATOR_IS_REQUIRED)
         pkg_check_modules(LIBAPPINDICATOR appindicator3-0.1>=${LIBAPPINDICATOR_MINIMUM})
-        if(LIBAPPINDICATOR_FOUND)
-            set(WITH_LIBAPPINDICATOR ON)
-        endif()
+        tr_fixup_auto_option(WITH_LIBAPPINDICATOR LIBAPPINDICATOR_FOUND LIBAPPINDICATOR_IS_REQUIRED)
     endif()
+else()
+    set(WITH_LIBAPPINDICATOR OFF)
 endif()
 
 if(ENABLE_QT)