diff options
author | Robert Tari <robert@tari.in> | 2021-05-14 17:25:41 +0200 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-05-14 17:25:41 +0200 |
commit | 763acdea57d43c9a5dd063879a050c76b72c26dc (patch) | |
tree | 0dfc1c8c031490d2f3ad3d0605ac0e764b669e42 /CMakeLists.txt | |
parent | 025c376068f63d8c2aa5899a3c0b1b827370da28 (diff) | |
parent | 173f104d15f5bd7478eed303c43e8426fb6d67a8 (diff) | |
download | libayatana-indicator-763acdea57d43c9a5dd063879a050c76b72c26dc.tar.gz libayatana-indicator-763acdea57d43c9a5dd063879a050c76b72c26dc.tar.bz2 libayatana-indicator-763acdea57d43c9a5dd063879a050c76b72c26dc.zip |
Merge branch 'sunweaver-pr/bring-back-gtk2-builds'
Attributes GH PR #44: https://github.com/AyatanaIndicators/libayatana-indicator/pull/44
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e580790..bc65cee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,11 +17,44 @@ endif() # Check for prerequisites -set(DEPS glib-2.0>=2.58 gtk+-3.0>=3.24 libayatana-ido3-0.4>=0.8.2) +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() + +if (FLAVOUR_GTK3) + set(DEPS + glib-2.0>=2.37 + gtk+-3.0>=3.24 + gmodule-2.0 + gio-unix-2.0 + libayatana-ido3-0.4>=0.8.2 + ) +endif() +if (FLAVOUR_GTK2) + set(DEPS + glib-2.0>=2.37 + gtk+-2.0>=2.18 + gmodule-2.0 + gio-unix-2.0 + ) +endif() find_package (PkgConfig REQUIRED) pkg_check_modules(PROJECT_DEPS REQUIRED ${DEPS}) +include(CheckLibraryExists) + +CHECK_LIBRARY_EXISTS(m sin "" HAVE_LIB_M) +if (HAVE_LIB_M) + set(EXTRA_LIBS ${EXTRA_LIBS} m) +endif (HAVE_LIB_M) + # Set global variables include(GNUInstallDirs) @@ -46,11 +79,11 @@ endif() add_subdirectory(src) add_subdirectory(data) +add_subdirectory(tools) if(ENABLE_TESTS) include(CTest) enable_testing() - add_subdirectory(tools) add_subdirectory(tests) if (ENABLE_COVERAGE) |