From 4c7e54787a593c1bd8f30427720df86f40b751b1 Mon Sep 17 00:00:00 2001 From: samelian Date: Mon, 19 Sep 2011 21:04:17 +0000 Subject: [PATCH] [kdenetwork/ktalkd] added cmake support git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1254535 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- CMakeLists.txt | 3 ++ config.h.cmake | 15 ++++++++++ ktalkd/CMakeLists.txt | 17 +++++++++++ ktalkd/ConfigureChecks.cmake | 18 ++++++++++++ ktalkd/kcmktalkd/CMakeLists.txt | 37 ++++++++++++++++++++++++ ktalkd/ktalkd/CMakeLists.txt | 41 +++++++++++++++++++++++++++ ktalkd/ktalkd/announce.cpp | 1 + ktalkd/ktalkd/machines/CMakeLists.txt | 24 ++++++++++++++++ ktalkd/ktalkdlg/CMakeLists.txt | 30 ++++++++++++++++++++ ktalkd/mail.local/CMakeLists.txt | 22 ++++++++++++++ 10 files changed, 208 insertions(+) create mode 100644 ktalkd/CMakeLists.txt create mode 100644 ktalkd/ConfigureChecks.cmake create mode 100644 ktalkd/kcmktalkd/CMakeLists.txt create mode 100644 ktalkd/ktalkd/CMakeLists.txt create mode 100644 ktalkd/ktalkd/machines/CMakeLists.txt create mode 100644 ktalkd/ktalkdlg/CMakeLists.txt create mode 100644 ktalkd/mail.local/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 37659289..7d9e3735 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ set( VERSION "3.5.13" ) ##### include essential cmake modules ########### include( FindPkgConfig ) +include( CheckFunctionExists ) include( CheckIncludeFile ) include( CheckIncludeFileCXX ) include( CheckCXXSourceCompiles ) @@ -104,6 +105,7 @@ option( BUILD_KPPP "Build kppp" ${BUILD_ALL} ) option( BUILD_KRDC "Build krdc" ${BUILD_ALL} ) option( BUILD_KRFB "Build krfb" ${BUILD_ALL} ) option( BUILD_KSIRC "Build ksirc" ${BUILD_ALL} ) +option( BUILD_KTALKD "Build ktalkd" ${BUILD_ALL} ) option( BUILD_LIBRSS "Build librss" ${BUILD_ALL} ) @@ -139,6 +141,7 @@ tde_conditional_add_subdirectory( BUILD_KPPP kppp ) tde_conditional_add_subdirectory( BUILD_KRDC krdc ) tde_conditional_add_subdirectory( BUILD_KRFB krfb ) tde_conditional_add_subdirectory( BUILD_KSIRC ksirc ) +tde_conditional_add_subdirectory( BUILD_KTALKD ktalkd ) tde_conditional_add_subdirectory( BUILD_LIBRSS librss ) diff --git a/config.h.cmake b/config.h.cmake index a9cf2d87..7283634b 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -21,7 +21,22 @@ #cmakedefine HAVE_SYS_PARAM_H 1 #cmakedefine HAVE_NET_IF_PPP_H 1 +// ktalkd +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_SYS_STAT_H 1 +#cmakedefine HAVE_SYS_FILE_H 1 +#cmakedefine HAVE_UNISTD_H 1 +#cmakedefine HAVE_UTMP_H 1 +#cmakedefine HAVE_VSNPRINTF 1 +#define SCANDIR_NEEDS_CONST 1 +// only for Linux +#define PROC_FIND_USER 1 +#define UTMP_AND_PROC_FIND_USER 1 +#define ALL_PROCESSES_AND_PROC_FIND_USER 1 + +#ifdef __cplusplus extern "C" { unsigned long strlcpy(char*, const char*, unsigned long); unsigned long strlcat(char*, const char*, unsigned long); } +#endif diff --git a/ktalkd/CMakeLists.txt b/ktalkd/CMakeLists.txt new file mode 100644 index 00000000..4e019db9 --- /dev/null +++ b/ktalkd/CMakeLists.txt @@ -0,0 +1,17 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include( ConfigureChecks.cmake ) + +add_subdirectory( ktalkd ) +add_subdirectory( mail.local ) +add_subdirectory( kcmktalkd ) +add_subdirectory( ktalkdlg ) diff --git a/ktalkd/ConfigureChecks.cmake b/ktalkd/ConfigureChecks.cmake new file mode 100644 index 00000000..8238322f --- /dev/null +++ b/ktalkd/ConfigureChecks.cmake @@ -0,0 +1,18 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +check_include_file( sys/types.h HAVE_SYS_TYPES_H ) +check_include_file( sys/stat.h HAVE_SYS_STAT_H ) +check_include_file( sys/file.h HAVE_SYS_FILE_H ) +check_include_file( unistd.h HAVE_UNISTD_H ) +check_include_file( utmp.h HAVE_UTMP_H ) + +check_function_exists( vsnprintf HAVE_VSNPRINTF ) diff --git a/ktalkd/kcmktalkd/CMakeLists.txt b/ktalkd/kcmktalkd/CMakeLists.txt new file mode 100644 index 00000000..f9f7a560 --- /dev/null +++ b/ktalkd/kcmktalkd/CMakeLists.txt @@ -0,0 +1,37 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +tde_install_icons( ktalkd ) +install( FILES kcmktalkd.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) + + +##### kcm_ktalkd (module) ####################### + +tde_add_kpart( kcm_ktalkd AUTOMOC + SOURCES + main.cpp soundpage.cpp answmachpage.cpp forwmachpage.cpp + LINK kio-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/ktalkd/ktalkd/CMakeLists.txt b/ktalkd/ktalkd/CMakeLists.txt new file mode 100644 index 00000000..32a9cb73 --- /dev/null +++ b/ktalkd/ktalkd/CMakeLists.txt @@ -0,0 +1,41 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( machines ) + +add_definitions( -DHAVE_KDE ) + +include_directories( + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES ktalkd.wav DESTINATION ${SOUND_INSTALL_DIR} ) +install( FILES ktalkdrc DESTINATION ${CONFIG_INSTALL_DIR} ) + + +##### ktalkd (executable) ####################### + +tde_add_executable( ktalkd + SOURCES + print.c repairs.c announce.cpp process.cpp readcfg++.cpp table.cpp + talkd.cpp find_user.cpp threads.cpp options.cpp unixsock.cpp + LINK mach-static kdecore-shared + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/ktalkd/ktalkd/announce.cpp b/ktalkd/ktalkd/announce.cpp index d21f27f4..4606058f 100644 --- a/ktalkd/ktalkd/announce.cpp +++ b/ktalkd/ktalkd/announce.cpp @@ -44,6 +44,7 @@ #include #endif #include +#include #include #include #include diff --git a/ktalkd/ktalkd/machines/CMakeLists.txt b/ktalkd/ktalkd/machines/CMakeLists.txt new file mode 100644 index 00000000..43da0e27 --- /dev/null +++ b/ktalkd/ktalkd/machines/CMakeLists.txt @@ -0,0 +1,24 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_definitions( -Dksize_t=socklen_t ) + +include_directories( + ${CMAKE_BINARY_DIR} + ${TQT_INCLUDE_DIRS} +) + + +##### mach (static) ############################# + +tde_add_library( mach STATIC_PIC + SOURCES answmach.cpp forwmach.cpp talkconn.cpp +) diff --git a/ktalkd/ktalkdlg/CMakeLists.txt b/ktalkd/ktalkdlg/CMakeLists.txt new file mode 100644 index 00000000..9183ba5c --- /dev/null +++ b/ktalkd/ktalkdlg/CMakeLists.txt @@ -0,0 +1,30 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### ktalkdlg (executable) ##################### + +tde_add_executable( ktalkdlg AUTOMOC + SOURCES ktalkdlg.cpp + LINK kdeui-shared + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/ktalkd/mail.local/CMakeLists.txt b/ktalkd/mail.local/CMakeLists.txt new file mode 100644 index 00000000..f6dd074c --- /dev/null +++ b/ktalkd/mail.local/CMakeLists.txt @@ -0,0 +1,22 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_BINARY_DIR} +) + + +##### mail.local (executable) ################### + +tde_add_executable( mail.local + SOURCES mail.local.c + DESTINATION ${BIN_INSTALL_DIR} +)