aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-10-23 18:37:04 +0200
committerRobert Tari <robert@tari.in>2021-10-23 18:37:04 +0200
commit7e4b6714abaf2245e3ba590c67e93c2adf4d0a69 (patch)
tree271461a0a21ab24efe629878b162d6591d9b5b38 /CMakeLists.txt
parent69f835796ad89c39f232aa4073c778976c54e01f (diff)
parent91bddd96cf1f8d7975b1cb3b160b89c7f4a53af7 (diff)
downloadlibayatana-appindicator-7e4b6714abaf2245e3ba590c67e93c2adf4d0a69.tar.gz
libayatana-appindicator-7e4b6714abaf2245e3ba590c67e93c2adf4d0a69.tar.bz2
libayatana-appindicator-7e4b6714abaf2245e3ba590c67e93c2adf4d0a69.zip
Merge branch 'sunweaver-pr/bring-back-gtk2-build-support'
Attributes GH PR #32: https://github.com/AyatanaIndicators/libayatana-appindicator/pull/33
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 30 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f1e441e..232af6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,34 @@ endif()
# Check for prerequisites
-set(DEPS glib-2.0>=2.58 ayatana-indicator3-0.4>=0.8.4 gtk+-3.0>=3.24 dbusmenu-gtk3-0.4)
+option(FLAVOUR_GTK2 "Build against GTK+-2.0" OFF)
+option(FLAVOUR_GTK3 "Build against GTK+-3.0" ON)
+
+if (FLAVOUR_GTK2)
+ set (FLAVOUR_GTK3 OFF)
+endif()
+if (FLAVOUR_GTK3)
+ set (FLAVOUR_GTK2 OFF)
+endif()
+
+set(DEPS glib-2.0>=2.58)
+
+if (FLAVOUR_GTK3)
+ set(DEPS
+ ${DEPS}
+ ayatana-indicator3-0.4>=0.8.4
+ gtk+-3.0>=3.24
+ dbusmenu-gtk3-0.4
+ )
+elseif (FLAVOUR_GTK2)
+ set(DEPS
+ ${DEPS}
+ ayatana-indicator-0.4>=0.8.4
+ gtk+-2.0>=2.18
+ dbusmenu-gtk-0.4
+ )
+endif()
+
if(ENABLE_TESTS)
set(DEPS ${DEPS} dbus-1>=1.12 dbus-glib-1>=0.82)
@@ -82,6 +109,8 @@ endif()
# Display config info
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
+message(STATUS "GTK+-3.0 build: ${FLAVOUR_GTK3}")
+message(STATUS "GTK+-2.0 build: ${FLAVOUR_GTK2}")
message(STATUS "Unit tests: ${ENABLE_TESTS}")
message(STATUS "Build with -Werror: ${ENABLE_WERROR}")
message(STATUS "API Documentation: ${ENABLE_GTKDOC}")