From 37c0b00fbf5506397c2e7b73b35f2931ead9e483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 7 Jul 2013 20:48:40 +0200 Subject: [PATCH] Convert from qmake to cmake --- CMakeLists.txt | 73 +++++++++++++++++++++++++++++++++++++++++ ConfigureChecks.cmake | 33 +++++++++++++++++++ icons/CMakeLists.txt | 12 +++++++ po/CMakeLists.txt | 17 ++++++++++ src/CMakeLists.txt | 44 +++++++++++++++++++++++++ src/customtraylabel.cpp | 2 ++ src/kdocker.cpp | 2 ++ src/qtraylabel.cpp | 4 ++- src/traylabelmgr.cpp | 4 ++- src/util.cpp | 2 +- 10 files changed, 190 insertions(+), 3 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 ConfigureChecks.cmake create mode 100644 icons/CMakeLists.txt create mode 100644 po/CMakeLists.txt create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0bfae31 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +cmake_minimum_required( VERSION 2.8 ) + + +##### general package setup ##################### + +project( kdocker ) + + +##### include essential cmake modules ########### + +include( CheckCXXSourceCompiles ) +include( CheckFunctionExists ) +include( CheckIncludeFileCXX ) +include( CheckLibraryExists ) +include( CheckStructHasMember ) +include( CheckSymbolExists ) +include( CheckTypeSize ) +include( FindPkgConfig ) + + +##### include our cmake modules ################# + +set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) +include( TDEMacros ) + + +##### setup install paths ####################### + +include( TDESetupPaths ) +tde_setup_paths( ) + + +##### user requested modules #################### + +option( BUILD_ALL "Build all" OFF ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) + + +##### configure checks ########################## + +include( ConfigureChecks.cmake ) + + +###### global compiler settings ################# + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) +set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) + + +##### source directories ######################## + +add_subdirectory( src ) +add_subdirectory( icons ) +tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) + + +##### other data ################################ + +INSTALL(FILES kdocker.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) + + diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..5a6ef70 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,33 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE ) + find_program( MSGFMT_EXECUTABLE msgfmt ) + if( NOT MSGFMT_EXECUTABLE ) + tde_message_fatal( "msgfmt program is required, but was not found on your system" ) + endif( ) +endif( ) + +# common required stuff +find_package( TQt ) +find_package( TDE ) + +# check required packages +pkg_search_module( XMU xmu ) +if( NOT XMU_FOUND ) + tde_message_fatal( "xmu is required, but was not found on your system" ) +endif( ) + +pkg_search_module( XPM xpm ) +if( NOT XPM_FOUND ) + tde_message_fatal( "xpm is required, but was not found on your system" ) +endif( ) + diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt new file mode 100644 index 0000000..ffe7d32 --- /dev/null +++ b/icons/CMakeLists.txt @@ -0,0 +1,12 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +tde_install_icons( DESTINATION ${DATA_INSTALL_DIR}/kdocker/icons ) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..e2612a2 --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,17 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} kdocker.po ) + +foreach( _po ${po_files} ) + get_filename_component( _lang ${_po} PATH ) + tde_create_translation( FILES ${_po} LANG ${_lang} ) +endforeach( ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..0096124 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,44 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/src + ${CMAKE_SOURCE_DIR}/src + ${XMU_INCLUDEDIR} + ${XPM_INCLUDEDIR} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### kdocker ################################### + +tde_add_executable( kdocker AUTOMOC + SOURCES + customtraylabel.cpp + kdocker.cpp + main.cpp + qtraylabel.cpp + trace.cpp + traylabelmgr.cpp + util.cpp + LINK + kdecore-shared kdeui-shared DCOP-shared + ${XMU_LIBRARIES} ${XPM_LIBRARIES} + DESTINATION + ${BIN_INSTALL_DIR} +) + diff --git a/src/customtraylabel.cpp b/src/customtraylabel.cpp index 684a098..757df2f 100644 --- a/src/customtraylabel.cpp +++ b/src/customtraylabel.cpp @@ -360,3 +360,5 @@ void CustomTrayLabel::dropEvent(QDropEvent *) "that is brought in front when you hover the item over the tray icon")); } + +#include "customtraylabel.moc" diff --git a/src/kdocker.cpp b/src/kdocker.cpp index fd6ce9b..ded1643 100644 --- a/src/kdocker.cpp +++ b/src/kdocker.cpp @@ -229,3 +229,5 @@ void KDocker::saveState(QSessionManager &sm) // sm.setRestartCommand(applicationFilePath()); } + +#include "kdocker.moc" diff --git a/src/qtraylabel.cpp b/src/qtraylabel.cpp index 34284bd..2c528c1 100644 --- a/src/qtraylabel.cpp +++ b/src/qtraylabel.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include @@ -809,3 +809,5 @@ bool QTrayLabel::restoreState(QSettings &settings) // End kicking butt + +#include "qtraylabel.moc" diff --git a/src/traylabelmgr.cpp b/src/traylabelmgr.cpp index 9bbf013..54a789e 100644 --- a/src/traylabelmgr.cpp +++ b/src/traylabelmgr.cpp @@ -35,7 +35,7 @@ #include "traylabelmgr.h" #include "util.h" -#include +#include #include #include @@ -523,3 +523,5 @@ bool TrayLabelMgr::x11EventFilter(XEvent *ev) return ret; } + +#include "traylabelmgr.moc" diff --git a/src/util.cpp b/src/util.cpp index 6ddf920..a8766b1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -23,7 +23,7 @@ #include "util.h" #include -#include +#include #include #include