diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-01-24 15:23:00 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-01-28 16:34:02 +0100 |
commit | 7cad7c65d5b95d6e57031d2e9b1511beb8b53da3 (patch) | |
tree | 0641466568e0f62b44d04bcd1514787f0f9f4151 | |
parent | 55da3149034ab1b0c756f2a07c7129b8b16bd9d2 (diff) | |
download | tde-cmake-7cad7c65d5b95d6e57031d2e9b1511beb8b53da3.tar.gz tde-cmake-7cad7c65d5b95d6e57031d2e9b1511beb8b53da3.zip |
Add tde_setup_dbus macro.
This resolves issue #20.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit ac342e63c62b70f37027a3636fe0ed1a538c7ef5)
-rw-r--r-- | modules/TDEMacros.cmake | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 1754fb2..45390ab 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -2013,6 +2013,84 @@ macro( tde_setup_largefiles ) endmacro( ) +################################################# +##### +##### tde_setup_dbus + +macro( tde_setup_dbus ) + if( NOT DBUS_FOUND ) + pkg_search_module( DBUS dbus-1 ) + if( NOT DBUS_FOUND ) + tde_message_fatal( "dbus-1 is required, but not found on your system" ) + endif( ) + endif( ) + + if( NOT DEFINED DBUS_SYSTEM_CONF_DIRECTORY ) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} + dbus-1 --variable=sysconfdir + OUTPUT_VARIABLE DBUS_SYSTEM_CONF_BASE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if( DBUS_SYSTEM_CONF_BASE ) + set( DBUS_SYSTEM_CONF_DIRECTORY "${DBUS_SYSTEM_CONF_BASE}/dbus-1/system.d" ) + message( STATUS "Using " ${DBUS_SYSTEM_CONF_DIRECTORY} " for DBUS system configuration files" ) + else( ) + tde_message_fatal( "Can not find the base directory for the dbus-1 configuration" ) + endif( ) + endif( ) + + if( NOT DEFINED DBUS_SESSION_CONF_DIRECTORY ) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} + dbus-1 --variable=sysconfdir + OUTPUT_VARIABLE DBUS_SYSTEM_CONF_BASE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if( DBUS_SYSTEM_CONF_BASE ) + set( DBUS_SESSION_CONF_DIRECTORY "${DBUS_SYSTEM_CONF_BASE}/dbus-1/session.d" ) + message( STATUS "Using " ${DBUS_SESSION_CONF_DIRECTORY} " for DBUS session configuration files" ) + else( ) + tde_message_fatal( "Can not find the base directory for the dbus-1 configuration" ) + endif( ) + endif( ) + + if( NOT DEFINED DBUS_SERVICE_DIRECTORY ) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} + dbus-1 --variable=system_bus_services_dir + OUTPUT_VARIABLE DBUS_SERVICE_DIRECTORY + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + message( STATUS "Using " ${DBUS_SERVICE_DIRECTORY} " for DBUS system service files" ) + endif( ) + + if( NOT DEFINED DBUS_SESSION_DIRECTORY ) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} + dbus-1 --variable=session_bus_services_dir + OUTPUT_VARIABLE DBUS_SESSION_DIRECTORY + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + message( STATUS "Using " ${DBUS_SESSION_DIRECTORY} " for DBUS session service files" ) + endif( ) + + if( NOT "${ARGV}" STREQUAL "" AND NOT DBUS_TQT_FOUND ) + pkg_search_module( DBUS_TQT ${ARGV} ) + if( NOT DBUS_TQT_FOUND ) + tde_message_fatal( "${ARGV} is required, but not found on your system" ) + endif( ) + endif( ) + if( "${ARGV}" STREQUAL "dbus-1-tqt" AND NOT DEFINED DBUSXML2QT3_EXECUTABLE ) + find_program( DBUSXML2QT3_EXECUTABLE + NAMES dbusxml2qt3 + HINTS "${TDE_PREFIX}/bin" ${BIN_INSTALL_DIR} + ) + endif( ) + +endmacro( ) + + ################################################ ##### ##### Restore CMP0026 policy |