cmake: Allow libappindicator to be toggled

This will allow libappindicator to become an optional dependency on
Gentoo Linux.

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies
This commit is contained in:
Mike Gilbert 2016-11-27 14:17:07 -05:00
parent d8dd6f9c75
commit 147e31a32d
1 changed files with 6 additions and 5 deletions

View 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)