diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2016-05-16 12:59:03 -0500 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-08-28 10:17:14 +0200 |
commit | 39571b0e05c78627d233b2f77250de459d73f4a6 (patch) | |
tree | 275260eeace7790c5763d3ed8668386e417d7e24 | |
parent | 557e10a031b886dc670bdf5918c3984edbace5ac (diff) | |
download | ayatana-indicator-power-39571b0e05c78627d233b2f77250de459d73f4a6.tar.gz ayatana-indicator-power-39571b0e05c78627d233b2f77250de459d73f4a6.tar.bz2 ayatana-indicator-power-39571b0e05c78627d233b2f77250de459d73f4a6.zip |
fix cmake warning of the test apps' dependency on the service library
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | src/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/notifier.c | 2 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tests/test-device.cc | 4 | ||||
-rw-r--r-- | tests/test-notify.cc | 4 |
6 files changed, 16 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bc5729a..258a111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,14 +40,21 @@ set (CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_ ## set(GETTEXT_PACKAGE "ayatana-indicator-power") -add_definitions (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}" - -DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}" - -DLOW_BATTERY_SOUND="Low battery.ogg") +add_definitions( + -DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}" + -DG_LOG_DOMAIN="${GETTEXT_PACKAGE}" + -DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}" + -DLOW_BATTERY_SOUND="Low battery.ogg" +) ## ## Check for prerequisites ## +set(SERVICE_LIB "ayatanaindicatorpowerservice") +set(SERVICE_EXEC "ayatana-indicator-power-service") +add_definitions(-DSERVICE_EXEC="${SERVICE_EXEC}") + find_package (PkgConfig REQUIRED) include (CheckIncludeFile) include (FindPkgConfig) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5e6c57..bf85b77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,3 @@ -set (SERVICE_LIB "ayatanaindicatorpowerservice") -set (SERVICE_EXEC "ayatana-indicator-power-service") - -add_definitions(-DG_LOG_DOMAIN="ayatana-indicator-power") - if(URLDISPATCHER_FOUND) add_definitions( -DHAS_URLDISPATCHER ) endif() diff --git a/src/notifier.c b/src/notifier.c index da5c5d5..d982ac2 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -489,7 +489,7 @@ indicator_power_notifier_init (IndicatorPowerNotifier * self) p->cancellable = g_cancellable_new(); - if (!instance_count++ && !notify_init("ayatana-indicator-power-service")) + if (!instance_count++ && !notify_init(SERVICE_EXEC)) g_critical("Unable to initialize libnotify! Notifications might not be shown."); #ifdef HAS_UT_ACCTSERVICE_SYSTEMSOUND_SETTINGS diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 566132e..d7be386 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -50,8 +50,8 @@ function(add_test_by_name name) add_executable (${TEST_NAME} ${TEST_NAME}.cc) target_link_options(${TEST_NAME} PRIVATE -no-pie) add_test (${TEST_NAME} ${TEST_NAME}) - add_dependencies (${TEST_NAME} ayatanaindicatorpowerservice gschemas-compiled) - target_link_libraries (${TEST_NAME} ayatanaindicatorpowerservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS} ${URLDISPATCHER_LIBRARIES} ${GMOCK_LIBRARIES}) + add_dependencies (${TEST_NAME} ${SERVICE_LIB} gschemas-compiled) + target_link_libraries (${TEST_NAME} ${SERVICE_LIB} gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS} ${URLDISPATCHER_LIBRARIES} ${GMOCK_LIBRARIES}) endfunction() add_test_by_name(test-notify) add_test(NAME dear-reader-the-next-test-takes-80-seconds COMMAND true) diff --git a/tests/test-device.cc b/tests/test-device.cc index bdc29d1..a948857 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -53,7 +53,7 @@ class DeviceTest : public ::testing::Test virtual void SetUp() { const GLogLevelFlags flags = GLogLevelFlags(G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING); - log_handler_id = g_log_set_handler ("ayatana-indicator-power", flags, log_count_func, this); + log_handler_id = g_log_set_handler(G_LOG_DOMAIN, flags, log_count_func, this); log_count_ipower_expected = 0; log_count_ipower_actual = 0; } @@ -61,7 +61,7 @@ class DeviceTest : public ::testing::Test virtual void TearDown() { ASSERT_EQ (log_count_ipower_expected, log_count_ipower_actual); - g_log_remove_handler ("ayatana-indicator-power", log_handler_id); + g_log_remove_handler (G_LOG_DOMAIN, log_handler_id); } protected: diff --git a/tests/test-notify.cc b/tests/test-notify.cc index cd5b6f1..8d7f0d8 100644 --- a/tests/test-notify.cc +++ b/tests/test-notify.cc @@ -61,8 +61,6 @@ protected: static constexpr int NOTIFICATION_CLOSED_API {3}; static constexpr int NOTIFICATION_CLOSED_UNDEFINED {4}; - static constexpr char const * APP_NAME {"ayatana-indicator-power-service"}; - static constexpr char const * METHOD_CLOSE {"CloseNotification"}; static constexpr char const * METHOD_NOTIFY {"Notify"}; static constexpr char const * METHOD_GET_CAPS {"GetCapabilities"}; @@ -135,7 +133,7 @@ protected: g_dbus_connection_set_exit_on_close(bus, FALSE); g_object_add_weak_pointer(G_OBJECT(bus), reinterpret_cast<gpointer*>(&bus)); - notify_init(APP_NAME); + notify_init(SERVICE_EXEC); } virtual void TearDown() |