summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt82
-rw-r--r--ConfigureChecks.cmake53
-rw-r--r--config.h.cmake11
-rw-r--r--po/CMakeLists.txt1
-rw-r--r--src/CMakeLists.txt121
-rw-r--r--src/pics/CMakeLists.txt5
6 files changed, 273 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..84cee94
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,82 @@
+############################################
+# #
+# Improvements and feedbacks are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+############################################
+
+
+cmake_minimum_required( VERSION 2.8.12 )
+
+
+#### general package setup
+
+project( kopete_otr )
+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} )
+
+
+##### user requested modules
+
+option( BUILD_ALL "Build all" ON )
+option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
+
+
+##### 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 )
+
+
+##### other data
+
+tde_conditional_add_project_docs( BUILD_DOC )
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
+
+
+##### 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..cc8c3ee
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,53 @@
+###########################################
+# #
+# 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 libotr
+
+pkg_search_module( LIBOTR libotr )
+
+if( LIBOTR_FOUND )
+ if( NOT LIBOTR_VERSION VERSION_LESS 4.0.0 )
+ set( HAVE_LIBOTR_0400 1 )
+ endif()
+ else()
+ tde_message_fatal( "Libotr is required but was not found on your system" )
+endif( LIBOTR_FOUND )
+
+
+##### check for kopete
+
+find_library( KOPETE_LIBRARY kopete )
+find_path( KOPETE_INCLUDE_DIR kopetemetacontact.h
+ PATH_SUFFIXES kopete
+)
+
+if( KOPETE_INCLUDE_DIR AND KOPETE_LIBRARY )
+ set( KOPETE_INCLUDE_DIRS "${KOPETE_INCLUDE_DIR}" )
+ set( KOPETE_LIBRARIES ${KOPETE_LIBRARY} )
+ else()
+ tde_message_fatal( "kopete (tdenetwork) is required but was not found on your system" )
+endif( KOPETE_INCLUDE_DIR AND KOPETE_LIBRARY )
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..d6e9df7
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,11 @@
+#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@
+
+/* Defined if libotr >= 4.0.0 */
+#cmakedefine HAVE_LIBOTR_0400 1
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644
index 0000000..24e3bd8
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1 @@
+tde_add_project_translations()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..efb8046
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,121 @@
+add_subdirectory( pics )
+
+include_directories(
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+ ${LIBOTR_INCLUDE_DIRS}
+ ${KOPETE_INCLUDE_DIRS}
+ ${KOPETE_INCLUDE_DIRS}/ui
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+ ${TDE_LIB_DIR}
+)
+
+
+##### kotr_kcfgc (static)
+
+tde_add_library( kotr_kcfgc STATIC_PIC AUTOMOC
+
+ SOURCES
+ kopete_otr.kcfgc
+)
+
+
+##### kotr (shared)
+
+tde_add_library( kotr SHARED AUTOMOC
+
+ SOURCES
+ otrplugin.cpp
+ otrguiclient.cpp
+ otrlchatinterface.cpp
+ otrlconfinterface.cpp
+ privkeypopup.cpp
+ privkeypopupui.ui
+ smppopup.cpp
+ smppopupui.ui
+ verifypopup.cpp
+ verifypopupui.ui
+
+ LINK
+ kotr_kcfgc-static
+ tdecore-shared
+ tdeui-shared
+ tdeio-shared
+ ${LIBOTR_LIBRARIES}
+ ${KOPETE_LIBRARIES}
+
+ VERSION 0.0.0
+
+ DESTINATION ${LIB_INSTALL_DIR}
+)
+
+
+##### kcm_kopete_otr (kpart)
+
+tde_add_kpart( kcm_kopete_otr AUTOMOC
+
+ SOURCES
+ otrpreferences.cpp
+ otrprefs.ui
+ LINK
+ kotr_kcfgc-static
+ kotr-shared
+ tdecore-shared
+ tdeui-shared
+ tdehtml-shared
+ ${LIBOTR_LIBRARIES}
+ ${KOPETE_LIBRARIES}
+
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+
+##### kopete_otr (kpart)
+
+tde_add_kpart( ${PROJECT_NAME} AUTOMOC
+
+ SOURCES
+ otrplugin-factory.cpp
+ LINK
+ kotr-shared
+ tdecore-shared
+ tdeui-shared
+ tdehtml-shared
+ ${LIBOTR_LIBRARIES}
+ ${KOPETE_LIBRARIES}
+
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+
+##### other data
+
+install(
+ FILES otrchatui.rc otrui.rc
+ DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
+)
+
+install(
+ FILES kopete_otr.kcfg
+ DESTINATION ${KCFG_INSTALL_DIR}
+)
+
+
+#### desktop files
+
+tde_create_translated_desktop(
+ SOURCE kopete_otr.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}
+)
+
+tde_create_translated_desktop(
+ SOURCE kopete_otr_config.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR}/tdeconfiguredialog
+)
diff --git a/src/pics/CMakeLists.txt b/src/pics/CMakeLists.txt
new file mode 100644
index 0000000..eb272c7
--- /dev/null
+++ b/src/pics/CMakeLists.txt
@@ -0,0 +1,5 @@
+##### icons
+
+tde_install_icons( DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/icons )
+
+tde_install_icons( ${PROJECT_NAME} )