diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-05-17 13:40:29 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-05-17 13:40:38 +0200 |
commit | b28e807d94462770765566ab0d879554da1f2b23 (patch) | |
tree | 4c8d60c1b1b52a5c2d4ade4237b5bd7622904a09 | |
parent | f6baadaffdb58ba27d585f67680bd7e6172f4444 (diff) | |
download | libayatana-indicator-b28e807d94462770765566ab0d879554da1f2b23.tar.gz libayatana-indicator-b28e807d94462770765566ab0d879554da1f2b23.tar.bz2 libayatana-indicator-b28e807d94462770765566ab0d879554da1f2b23.zip |
{,**/}CMakeLists.txt: Support builds against GTK+-3.0 with IDO support disabled.
Fixes https://github.com/AyatanaIndicators/libayatana-indicator/issues/37
-rw-r--r-- | CMakeLists.txt | 27 | ||||
-rw-r--r-- | data/CMakeLists.txt | 6 | ||||
-rw-r--r-- | data/ayatana-indicator3-no-IDO.pc.in | 15 | ||||
-rw-r--r-- | data/ayatana-indicator3.pc.in | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tools/CMakeLists.txt | 2 |
7 files changed, 40 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c7444f8..2d4e85a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,30 +20,29 @@ endif() option(FLAVOUR_GTK2 "Build against GTK+-2.0" OFF) option(FLAVOUR_GTK3 "Build against GTK+-3.0" ON) +option(ENABLE_IDO "Enable IDO specific code" ON) + if (FLAVOUR_GTK2) set (FLAVOUR_GTK3 OFF) + set (ENABLE_IDO 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 +) + +if (FLAVOUR_GTK3 AND ENABLE_IDO) set(DEPS - glib-2.0>=2.37 - gtk+-3.0>=3.24 - gmodule-2.0 - gio-unix-2.0 + ${DEPS} 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}) @@ -97,7 +96,7 @@ set (COVERAGE_TEST_EXECUTABLES "test-loader" ) -if(FLAVOUR_GTK3) +if(FLAVOUR_GTK3 AND ENABLE_IDO) set (COVERAGE_TEST_EXECUTABLES ${COVERAGE_TEST_EXECUTABLES} "test-indicator-ng" diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 8e10313..2a60d05 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,7 +1,11 @@ # ayatana-indicator3-0.4.pc if (FLAVOUR_GTK3) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator3.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator3-0.${API_VERSION}.pc" @ONLY) + if (ENABLE_IDO) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator3.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator3-0.${API_VERSION}.pc" @ONLY) + else() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator3-no-IDO.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator3-0.${API_VERSION}.pc" @ONLY) + endif() install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator3-0.${API_VERSION}.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/") else() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-0.${API_VERSION}.pc" @ONLY) diff --git a/data/ayatana-indicator3-no-IDO.pc.in b/data/ayatana-indicator3-no-IDO.pc.in new file mode 100644 index 0000000..231fa71 --- /dev/null +++ b/data/ayatana-indicator3-no-IDO.pc.in @@ -0,0 +1,15 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ +bindir=${exec_prefix}/@CMAKE_INSTALL_BINDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +indicatordir=${exec_prefix}/lib/ayatana-indicators3/@ABI_VERSION@/ +iconsdir=${prefix}/@CMAKE_INSTALL_DATADIR@/@PROJECT_NAME@/icons/ + +Cflags: -I${includedir}/libayatana-indicator3-0.@API_VERSION@ +Requires: gtk+-3.0 +Libs: -layatana-indicator3 + +Name: libayatana-indicator3 +Description: libayatana-indicator3. +Version: @PROJECT_VERSION@ diff --git a/data/ayatana-indicator3.pc.in b/data/ayatana-indicator3.pc.in index 231fa71..6941827 100644 --- a/data/ayatana-indicator3.pc.in +++ b/data/ayatana-indicator3.pc.in @@ -7,7 +7,7 @@ indicatordir=${exec_prefix}/lib/ayatana-indicators3/@ABI_VERSION@/ iconsdir=${prefix}/@CMAKE_INSTALL_DATADIR@/@PROJECT_NAME@/icons/ Cflags: -I${includedir}/libayatana-indicator3-0.@API_VERSION@ -Requires: gtk+-3.0 +Requires: gtk+-3.0 libayatana-ido3-0.4 Libs: -layatana-indicator3 Name: libayatana-indicator3 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d396ed9..84e0383 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,7 +23,7 @@ set(HEADERS indicator-service-manager.h ) -if (FLAVOUR_GTK3) +if (FLAVOUR_GTK3 AND ENABLE_IDO) set(HEADERS ${HEADERS} indicator-ng.h @@ -41,7 +41,7 @@ set(SOURCES indicator-service-manager.c ) -if (FLAVOUR_GTK3) +if (FLAVOUR_GTK3 AND ENABLE_IDO) set(SOURCES ${SOURCES} indicator-ng.c diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 98684fa..a299b65 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -197,7 +197,7 @@ add_custom_command( ) add_test("test-desktop-shortcuts-tester" "test-desktop-shortcuts-tester") -if (FLAVOUR_GTK3) +if (FLAVOUR_GTK3 AND ENABLE_IDO) # test-indicator-ng add_test_executable_by_name(test-indicator-ng) @@ -234,7 +234,7 @@ if (FLAVOUR_GTK3) chmod +x "${CMAKE_CURRENT_BINARY_DIR}/test-indicator-ng-tester" ) add_test("test-indicator-ng-tester" "test-indicator-ng-tester") -endif(FLAVOUR_GTK3) +endif(FLAVOUR_GTK3 AND ENABLE_IDO) # test-loader add_test_executable_by_name(test-loader) @@ -273,7 +273,7 @@ set (ALL_TESTERS "loader-tester" ) -if (FLAVOUR_GTK3) +if (FLAVOUR_GTK3 AND ENABLE_IDO) set (ALL_TESTERS ${ALL_TESTERS} "test-indicator-ng-tester" diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3be325d..fd0a4c6 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -if (FLAVOUR_GTK3) +if (FLAVOUR_GTK3 AND ENABLE_IDO) # ayatana-indicator-loader3 set_source_files_properties(indicator-loader.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS}) |