summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-05 03:50:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-05 03:50:29 +0000
commit5cf5e6b8214ace7beb2836bce2f2b3e3324222ca (patch)
tree379e5636d96beeaa73a73fd1824b6ba2975d088e
parentb739bb3004a7aa23de0f9f5360011e81cd2f7b54 (diff)
downloadgtk-qt-engine-5cf5e6b8214ace7beb2836bce2f2b3e3324222ca.tar.gz
gtk-qt-engine-5cf5e6b8214ace7beb2836bce2f2b3e3324222ca.zip
Migrate gtk-qt-trinity to new CMake system (mostly)
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gtk-qt-engine@1230450 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--CMakeLists.txt77
-rw-r--r--ConfigureChecks.cmake3
-rw-r--r--kcm_gtk/CMakeLists.txt48
-rw-r--r--po/CMakeLists.txt49
-rw-r--r--po/bg/bg.po (renamed from po/bg.po)0
-rw-r--r--po/de/de.po (renamed from po/de.po)0
-rw-r--r--po/es/es.po (renamed from po/es.po)0
-rw-r--r--po/fr/fr.po (renamed from po/fr.po)0
-rw-r--r--po/it/it.po (renamed from po/it.po)0
-rw-r--r--po/nn/nn.po (renamed from po/nn.po)0
-rwxr-xr-xpo/ru/ru.po (renamed from po/ru.po)0
-rw-r--r--po/sv/sv.po (renamed from po/sv.po)0
-rw-r--r--po/tr/tr.po (renamed from po/tr.po)0
-rw-r--r--src/CMakeLists.txt4
14 files changed, 87 insertions, 94 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 55d50a8..4d7b8ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,21 +1,56 @@
-PROJECT (gtk-qt-engine)
-INCLUDE (UsePkgConfig)
+cmake_minimum_required( VERSION 2.8 )
+
+
+##### general package setup #####################
+
+project( gtk-qt-engine )
+
+set( PACKAGE gtk-qt-engine )
+set( VERSION "3.5.13" )
+
+
+##### include essential cmake modules ###########
+
+include( FindPkgConfig )
+include( CheckIncludeFile )
+include( CheckCSourceRuns )
+include( CheckCXXSourceCompiles )
+include( CheckLibraryExists )
+include( CheckFunctionExists )
+include( CheckStructHasMember )
+
+##### include our cmake modules #################
+
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+include( TDEMacros )
+
+
+##### setup install paths #######################
-# Find KDE
-FIND_PACKAGE(KDE3 REQUIRED)
+include( TDESetupPaths )
+tde_setup_paths( )
-# Find Qt
-FIND_PACKAGE(Qt3)
-MESSAGE(STATUS "Found Qt library: ${QT_QT_LIBRARY}")
+##### set PKG_CONFIG_PATH #######################
-IF(QT_FOUND)
-ELSE(QT_FOUND)
- MESSAGE(STATUS_ERROR "Qt3 package not found--assuming TQt4")
- SET(QT_INCLUDE_DIR "/usr/include/qt4")
-ENDIF(QT_FOUND)
+set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}:${LIB_INSTALL_DIR}/pkgconfig" )
-SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt")
-SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc")
+
+##### 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 "-Wl,--no-undefined" )
+set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
+
+INCLUDE (UsePkgConfig)
# Find GTK
PKGCONFIG(gtk+-2.0 GTK_INCLUDE_DIR GTK_LIB_DIR GTK_LINK_FLAGS GTK_CFLAGS)
@@ -78,21 +113,15 @@ EXEC_PROGRAM(
SET(INSTALL_PATH_GTK_THEMES "${GTK_PREFIX}/share/themes" CACHE PATH "The directory in which to install the theme data (eg. /usr/share/themes)")
MESSAGE(STATUS "Installing the GTK theme engine data to: ${INSTALL_PATH_GTK_THEMES}")
-SET(INSTALL_PATH_KCONTROL_MODULES "${KDE3_LIB_DIR}" CACHE PATH "The directory in which to install KControl plugins (eg. /usr/lib)")
+SET(INSTALL_PATH_KCONTROL_MODULES "${TDE_LIB_DIR}" CACHE PATH "The directory in which to install KControl plugins (eg. /usr/lib)")
MESSAGE(STATUS "Installing the KControl plugins to: ${INSTALL_PATH_KCONTROL_MODULES}")
MESSAGE(STATUS "Installing everything else to: ${CMAKE_INSTALL_PREFIX}")
# Setup definitions and directories to be used in all subdirectories
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${KDE3_DEFINITIONS} ${BONOBO_DEFINITIONS})
-LINK_DIRECTORIES(${KDE3_LIB_DIR} ${GTK_LIB_DIR} ${BONOBO_LIB_DIR})
-INCLUDE_DIRECTORIES(${KDE3_INCLUDE_DIRS} ${GTK_INCLUDE_DIR} ${BONOBO_INCLUDE_DIR})
-
-SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt")
-SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc")
-
-# Setup CXX flags
-SET(CMAKE_CXX_FLAGS "-I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT")
+ADD_DEFINITIONS(${QT_DEFINITIONS} ${TDE_DEFINITIONS} ${BONOBO_DEFINITIONS})
+LINK_DIRECTORIES(${TDE_LIB_DIR} ${GTK_LIB_DIR} ${BONOBO_LIB_DIR} ${TQT_LIBRARY_DIRS})
+INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIR} ${BONOBO_INCLUDE_DIR} ${TDE_INCLUDE_DIR} ${TQT_INCLUDE_DIRS})
# Subdirectories
ADD_SUBDIRECTORY(src)
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..3bc08a7
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,3 @@
+# required stuff
+find_package( TQt )
+find_package( TDE )
diff --git a/kcm_gtk/CMakeLists.txt b/kcm_gtk/CMakeLists.txt
index d5537c5..9133b39 100644
--- a/kcm_gtk/CMakeLists.txt
+++ b/kcm_gtk/CMakeLists.txt
@@ -1,27 +1,27 @@
-INCLUDE(KDE3Macros)
-INCLUDE(GtkQt)
-
-# Sources
-SET(kcm_kcmgtk_SOURCES
- kcmgtk.cpp)
-
-KDE3_AUTOMOC(${kcm_kcmgtk_SOURCES})
-
-# UI files
-SET(kcm_kcmgtk_UI
- kcmgtkwidget.ui
- mozillaprofile.ui
- emacsdetails.ui
- searchpaths.ui)
-
-KDE3_ADD_UI_FILES(kcm_kcmgtk_SOURCES ${kcm_kcmgtk_UI})
-
-GTKQT_KDE3_ADD_KPART(kcm_kcmgtk "${INSTALL_PATH_KCONTROL_MODULES}/kde3" ${kcm_kcmgtk_SOURCES})
-
-INSTALL(
- TARGETS kcm_kcmgtk
- DESTINATION ${INSTALL_PATH_KCONTROL_MODULES}/kde3
-)
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+include( TDEMacros )
+
+ include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+ )
+
+ link_directories(
+ ${TQT_LIBRARY_DIRS}
+ )
+
+ tde_add_kpart( kcm_kcmgtk AUTOMOC
+ SOURCES kcmgtk.cpp
+ kcmgtkwidget.ui
+ mozillaprofile.ui
+ emacsdetails.ui
+ searchpaths.ui
+ LINK ${TQT_LIBRARIES} -lkdecore -lkdeui
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+ )
INSTALL(
FILES kcmgtk.desktop
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index c5fef00..9d1908d 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -1,45 +1,6 @@
-# .po to .gmo stuff
-FILE(GLOB _pofiles *.po)
+file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po )
-FOREACH(_file ${_pofiles})
- GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
- SET(_out "${_file_we}.gmo")
- SET(_in "${_file_we}.po")
-
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_out}
- COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in}
- DEPENDS ${_in}
- )
-
- INSTALL(
- FILES ${_out}
- DESTINATION share/locale/${_file_we}/LC_MESSAGES/
- RENAME gtkqtengine.mo
- )
-
- SET(_outputs ${_outputs} ${_out})
-ENDFOREACH(_file)
-
-ADD_CUSTOM_TARGET(
- pofiles ALL
- DEPENDS ${_outputs}
-)
-
-
-# Stuff to generate the .pot
-FILE(GLOB POT_UIFILES ../kcm_gtk/*.ui)
-SET(POT_SOURCES ../kcm_gtk/kcmgtk.cpp)
-SET(POT_OUTPUT gtkqtengine.pot)
-
-ADD_CUSTOM_COMMAND(
- OUTPUT _${POT_OUTPUT}
- COMMAND ${EXTRACTRC_PATH} ${POT_UIFILES} > rc.cpp
- COMMAND ${XGETTEXT_PATH} --foreign-user -C -ci18n -ki18n -ktr2i18n -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -x "${KDE3_INCLUDE_DIR}/kde.pot" -o ${POT_OUTPUT} rc.cpp ${POT_SOURCES}
- COMMAND rm rc.cpp
-)
-
-ADD_CUSTOM_TARGET(
- extract_messages
- DEPENDS _${POT_OUTPUT}
-)
+foreach( _po ${po_files} )
+ get_filename_component( _lang ${_po} PATH )
+ tde_create_translation( FILES ${_po} LANG ${_lang} )
+endforeach( )
diff --git a/po/bg.po b/po/bg/bg.po
index 2bbbdcf..2bbbdcf 100644
--- a/po/bg.po
+++ b/po/bg/bg.po
diff --git a/po/de.po b/po/de/de.po
index d0e81b6..d0e81b6 100644
--- a/po/de.po
+++ b/po/de/de.po
diff --git a/po/es.po b/po/es/es.po
index c812c34..c812c34 100644
--- a/po/es.po
+++ b/po/es/es.po
diff --git a/po/fr.po b/po/fr/fr.po
index c223a6d..c223a6d 100644
--- a/po/fr.po
+++ b/po/fr/fr.po
diff --git a/po/it.po b/po/it/it.po
index 14c3f81..14c3f81 100644
--- a/po/it.po
+++ b/po/it/it.po
diff --git a/po/nn.po b/po/nn/nn.po
index c6a72ac..c6a72ac 100644
--- a/po/nn.po
+++ b/po/nn/nn.po
diff --git a/po/ru.po b/po/ru/ru.po
index 12bfced..12bfced 100755
--- a/po/ru.po
+++ b/po/ru/ru.po
diff --git a/po/sv.po b/po/sv/sv.po
index fe943be..fe943be 100644
--- a/po/sv.po
+++ b/po/sv/sv.po
diff --git a/po/tr.po b/po/tr/tr.po
index ebef097..ebef097 100644
--- a/po/tr.po
+++ b/po/tr/tr.po
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0ca785e..32bb6cf 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -11,7 +11,7 @@ ADD_LIBRARY(qtengine SHARED ${GTK-QT-SOURCES})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GTK_CFLAGS} ${BONOBO_CFLAGS}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GTK_CFLAGS} ${BONOBO_CFLAGS}")
-TARGET_LINK_LIBRARIES(qtengine ${GTK_LINK_FLAGS} ${QT_LIBRARIES} ${BONOBO_LINK_FLAGS})
+TARGET_LINK_LIBRARIES(qtengine ${GTK_LINK_FLAGS} ${BONOBO_LINK_FLAGS} ${TQT_LIBRARIES} -lX11)
INSTALL(
TARGETS qtengine
@@ -25,4 +25,4 @@ INSTALL(
INSTALL(
FILES gtkrc
DESTINATION "${INSTALL_PATH_GTK_THEMES}/Qt/gtk-2.0"
-) \ No newline at end of file
+)