summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <g-gregory@gmx.fr>2019-03-27 13:42:45 +0100
committergregory guy <g-gregory@gmx.fr>2019-04-02 14:46:58 +0200
commita05e5694affb43bc53faa52ab813ff0b5c548919 (patch)
treebf6f7e8b7ce2b8651ee4cca3e1e4b9c594fc8249
parentd011596fa60698d5c7eb06eb2b67400ba2647e7c (diff)
downloadkdbusnotification-a05e5694affb43bc53faa52ab813ff0b5c548919.tar.gz
kdbusnotification-a05e5694affb43bc53faa52ab813ff0b5c548919.zip
conversion to the cmake building system
Signed-off-by: gregory guy <g-gregory@gmx.fr>
-rw-r--r--CMakeLists.txt69
-rw-r--r--ConfigureChecks.cmake68
-rw-r--r--config.h.cmake8
-rw-r--r--src/CMakeLists.txt9
-rw-r--r--src/daemon/CMakeLists.txt50
5 files changed, 204 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..f2e2d2f
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,69 @@
+############################################
+# #
+# Improvements and feedbacks are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+############################################
+
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+#### general package setup
+
+project( kdbusnotification )
+set( VERSION R14.1.0 )
+
+
+#### include essential cmake modules
+
+include( FindPkgConfig )
+include( CheckFunctionExists )
+include( CheckSymbolExists )
+include( CheckIncludeFile )
+include( CheckLibraryExists )
+include( CheckCSourceCompiles )
+include( CheckCXXSourceCompiles )
+
+
+#### include our cmake modules
+
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+include( TDEMacros )
+
+
+##### setup install paths
+
+include( TDESetupPaths )
+tde_setup_paths( )
+
+
+##### optional stuff
+
+option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
+
+
+##### configure checks
+
+include( ConfigureChecks.cmake )
+
+
+###### global compiler settings
+
+add_definitions( -DHAVE_CONFIG_H )
+
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
+set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
+set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
+
+
+##### directories
+
+add_subdirectory( src )
+
+
+##### write configure files
+
+configure_file( config.h.cmake config.h @ONLY )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..af44ac2
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,68 @@
+###########################################
+# #
+# Improvements and feedback are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+###########################################
+
+# required stuff
+find_package( TQt )
+find_package( TDE )
+
+tde_setup_architecture_flags( )
+
+include(TestBigEndian)
+test_big_endian(WORDS_BIGENDIAN)
+
+tde_setup_largefiles( )
+
+
+##### check for gcc visibility support
+
+if( WITH_GCC_VISIBILITY )
+ tde_setup_gcc_visibility( )
+endif( WITH_GCC_VISIBILITY )
+
+
+##### check for dbus-binding-tool
+
+find_program( DBUS_BINDING_TOOL NAMES dbus-binding-tool )
+
+if( "${DBUS_BINDING_TOOL}" STREQUAL "DBUS_BINDING_TOOL-NOTFOUND" )
+ tde_message_fatal( "The dbus-binding-tool executable is required, but was not found on your system" )
+ else()
+ set( _DBUS_TOOL dbus-binding-tool )
+endif( )
+
+
+##### check for dbus-1
+
+pkg_search_module( DBUS dbus-1 )
+if( NOT DBUS_FOUND )
+ tde_message_fatal( "The dbus library is required, but was not found on your system" )
+endif( NOT DBUS_FOUND )
+
+
+##### check for dbus-glib-1
+
+pkg_search_module( DBUS-GLIB dbus-glib-1 )
+if( NOT DBUS-GLIB_FOUND )
+ tde_message_fatal( "The dbus-glib library is required, but was not found on your system" )
+endif( NOT DBUS-GLIB_FOUND )
+
+
+##### check for glib-2.0
+
+pkg_search_module( GLIB2 glib-2.0 )
+if( NOT GLIB2_FOUND )
+ tde_message_fatal( "The glib2.0 library is required, but was not found on your system" )
+endif( NOT GLIB2_FOUND )
+
+
+##### check for gtk2.0
+
+find_package( GTK2 )
+if( NOT GTK2_FOUND )
+ tde_message_fatal( "The gtk2.0 library is required, but was not found on your system" )
+endif( NOT GTK2_FOUND )
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..61ede3a
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,8 @@
+#define VERSION "@VERSION@"
+
+// Defined if you have fvisibility and fvisibility-inlines-hidden support.
+#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..f5fa9c5
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_subdirectory( daemon )
+
+
+##### other data
+
+install(
+ FILES kdbusnotification-autostart.desktop
+ DESTINATION ${AUTOSTART_INSTALL_DIR}
+)
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
new file mode 100644
index 0000000..b1119c8
--- /dev/null
+++ b/src/daemon/CMakeLists.txt
@@ -0,0 +1,50 @@
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+ ${DBUS_INCLUDE_DIRS}
+ ${DBUS-GLIB_INCLUDE_DIRS}
+ ${GLIB2_INCLUDE_DIRS}
+ ${GTK2_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+ ${TDE_LIB_DIR}
+)
+
+
+##### notification-daemon-tde (executable)
+
+set( _header notificationdaemon-dbus-glue.h )
+set( _xml notificationdaemon.xml )
+
+add_custom_command(
+ OUTPUT ${_header}
+ COMMAND ${_DBUS_TOOL}
+ ARGS --mode=glib-server --prefix=notification_daemon_tde ${CMAKE_CURRENT_SOURCE_DIR}/${_xml} > ${_header}
+ DEPENDS ${_xml}
+)
+
+set_source_files_properties(
+ daemon.cpp
+ PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_header}
+)
+
+tde_add_executable( notification-daemon-tde AUTOMOC
+
+ SOURCES
+ daemon.cpp
+ LINK
+ tdecore-shared
+ tdeio-shared
+ tdeui-shared
+ ${DBUS_LIBRARIES}
+ ${DBUS-GLIB_LIBRARIES}
+ ${GLIB2_LIBRARIES}
+ ${GTK2_LIBRARIES}
+
+ DESTINATION ${BIN_INSTALL_DIR}
+)