From 9e75cd50a2a752929ac2ba704d7eb2d36c3836ac Mon Sep 17 00:00:00 2001 From: gregory guy Date: Sun, 5 Jul 2020 15:38:22 +0200 Subject: [PATCH] Conversion to the cmake building system. Signed-off-by: gregory guy --- CMakeLists.txt | 77 +++++++++++++++++++++++++++++++++++++++++++ ConfigureChecks.cmake | 34 +++++++++++++++++++ config.h.cmake | 8 +++++ lib/CMakeLists.txt | 34 +++++++++++++++++++ lib/tdeqt4converter.h | 2 +- 5 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt create mode 100644 ConfigureChecks.cmake create mode 100644 config.h.cmake create mode 100644 lib/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..be75614 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,77 @@ +############################################ +# # +# Improvements and feedbacks are welcome # +# # +# This file is released under GPL >= 3 # +# # +############################################ + + +cmake_minimum_required( VERSION 2.8 ) + + +#### general package setup + +project( qt4-tqt-theme-engine ) +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_EXAMPLES "Build examples" ${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( lib ) +#add_subdirectory( plugin ) +#tde_conditional_add_subdirectory( BUILD_EXAMPLES examples ) + + +##### 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..6fada61 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,34 @@ +########################################### +# # +# 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 ) + + +##### look for Qt4 + +find_package( Qt4 REQUIRED QtCore QtGui ) + +if( (NOT QT_QTCORE_FOUND) AND (NOT QT_QTGUI_FOUND) ) + tde_message_fatal( "Qt4 is required but was not found on your system" ) +endif() 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/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 0000000..69cdb11 --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,34 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} + ${QT_INCLUDE_DIR} + +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIBRARY_DIRS} + ${QT_LIBRARY_DIR} +) + +add_definitions( -DTQT_NO_COMPAT_NAMES ) + +##### tdeqt4interface (SHARED) + +tde_add_library( tdeqt4interface SHARED AUTOMOC + + SOURCES + tdeqt4painter.cpp + tdeqt4converter.cpp + LINK + tdecore-shared + tdeui-shared + tdeio-shared + ${QT_QTCORE_LIBRARY} + ${QT_QTGUI_LIBRARY} + + VERSION 1.0.0 +) diff --git a/lib/tdeqt4converter.h b/lib/tdeqt4converter.h index 6d94c9b..8851c06 100644 --- a/lib/tdeqt4converter.h +++ b/lib/tdeqt4converter.h @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #undef Qt