From 3031fcead54a66aa68b0653e35ef59fbae9e442f Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 18 Oct 2023 13:32:54 +0900 Subject: [PATCH] Add cmake building files Signed-off-by: Michele Calgaro --- CMakeL10n.txt | 19 +++++++++ CMakeLists.txt | 80 +++++++++++++++++++++++++++++++++++++ ConfigureChecks.cmake | 25 ++++++++++++ INSTALL | 81 ++++++++------------------------------ README | 18 --------- client/CMakeL10n.txt | 12 ++++++ client/CMakeLists.txt | 41 +++++++++++++++++++ client/fahrenheit.desktop | 3 +- client/fahrenheitclient.cc | 15 ++++--- client/fahrenheitclient.h | 6 +-- client/pics/CMakeLists.txt | 4 ++ config.h.cmake | 8 ++++ debian/changelog | 2 +- 13 files changed, 219 insertions(+), 95 deletions(-) create mode 100644 CMakeL10n.txt create mode 100644 CMakeLists.txt create mode 100644 ConfigureChecks.cmake create mode 100644 client/CMakeL10n.txt create mode 100644 client/CMakeLists.txt create mode 100644 client/pics/CMakeLists.txt create mode 100644 config.h.cmake diff --git a/CMakeL10n.txt b/CMakeL10n.txt new file mode 100644 index 0000000..8c4c584 --- /dev/null +++ b/CMakeL10n.txt @@ -0,0 +1,19 @@ +######################################### +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >=2 # +# # +######################################### + +cmake_minimum_required( VERSION 3.1 ) + + +##### include our cmake modules ######### + +include( TDEL10n ) + + +##### create translation templates ###### + +tde_l10n_auto_add_subdirectories( ) diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..df8dffa --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,80 @@ +############################################ +# # +# Improvements and feedbacks are welcome # +# # +# This file is released under GPL >= 3 # +# # +############################################ + + +cmake_minimum_required( VERSION 3.1 ) + + +#### general package setup + +project( twin-style-fahrenheit ) + + +#### include essential cmake modules + +include( FindPkgConfig ) +include( CheckFunctionExists ) +include( CheckSymbolExists ) +include( CheckIncludeFile ) +include( CheckLibraryExists ) +include( CheckCSourceCompiles ) +include( CheckCXXSourceCompiles ) + + +#### include our cmake modules + +include( TDEMacros ) + + +##### set version number ######################## + +tde_set_project_version( ) + + +##### setup install paths + +include( TDESetupPaths ) +tde_setup_paths( ) + + +##### user-requested modules + +option( BUILD_ALL "Build all" ON ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) + + +##### optional stuff + +option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) +option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) + + +##### 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( client ) +tde_conditional_add_project_translations( BUILD_TRANSLATIONS ) + + +##### 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..d1e3778 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,25 @@ +########################################### +# # +# 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 ) diff --git a/INSTALL b/INSTALL index ef18572..4e6dcda 100644 --- a/INSTALL +++ b/INSTALL @@ -1,65 +1,16 @@ -Example Installation in a Nutshell: -==================================== - -1) Type 'make -f Makefile.cvs' - -2) Type './configure' - -3) Type 'make' - -4) Type (as root) 'make install' - -Example Installation in More Detail: -===================================== - -0) Make sure that the prerequisite KDE 3.2 development libraries and -headers are installed first. These can be found at -. - -1) Unzip and untar the package into its own directory. Change into -this directory, and read the README file. (I'm assuming that -you've read this, the INSTALL file :-)) - -2) Type './configure --help", and peruse the configure options -available. It may be necessary to use one or more of these options -on your system. - -3) Type './configure' to configure the software for your system. If -you're using `csh' on an old version of System V, you might need -to type sh ./configure' instead. - -4) Type 'make' to compile the package. - -5) If you are not logged in as root, type 'su' and enter the root -password to switch over to the root account. This is not necessary -if you configured the software to install to your home directory/ - -6) Type 'make install' to install the software. - -7) Activate the styles, decorations and color schemes through the -KDE Control Center or the Preferences menu. - -8) You can uninstall the software by typing 'make uninstall'. - -A Note on the KDE Library -======================== - -If you are having problems configuring the software, first make sure -that the required KDE 3.2 or greater libraries are installed. Several -systems have broken this into several packages. You will need both -the runtime and the development packages. - -If you still have problems, set the TDEDIR environment variable and -the --prefix configure option to the location where you installed -KDE. Also make sure that you are using GNU make and not the standard -make everyone else uses. - -Rebuilding the Configuration -============================ - -If you ever need to rebuild the configuration files, type the -following in thebase directory of the distribution: - make -f Makefile.cvs - -You will need the current automake/autoconf set of programs. - +Basic Installation +================== + +twin-style-fahrenheit relies on cmake to build. + +Here are suggested default options: + + -DCMAKE_INSTALL_PREFIX="/opt/trinity" \ + -DCONFIG_INSTALL_DIR="/etc/trinity" \ + -DSYSCONF_INSTALL_DIR="/etc/trinity" \ + -DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_VERBOSE_MAKEFILE="ON" \ + -DCMAKE_SKIP_RPATH="OFF" \ + -DBUILD_ALL="ON" \ + -DWITH_ALL_OPTIONS="ON" diff --git a/README b/README index c2d93cc..cdf40ac 100644 --- a/README +++ b/README @@ -27,24 +27,6 @@ and don't find it a problem in the least. I find it usable; therefore, it is usable for me. It wastes space with all the funky curves and bars. Well, my monitor is 1400x1050, so I've got space to waste. -COMPILING -========= -A straight-forward affair; read the INSTALL file for more details, but -the following ought to be enough: -1) make -f Makefile.cvs -2) ./configure - (Depending on your system, you may need to add '--prefix=/usr' -and if it can't find the location of the Qt libs and includes, those as -well. './configure --help' will tell you what you need to know.) -3) make -4) (as root) make install - -If you have problems compiling, make sure that you have the necessary -KDE development files installed. And before complaining that you can't -compile, read through the discussions for other KDE 3.2 borders. There -is a 99.9% chance that your problem already has a long and glorious -precedent set by others. - COLORS ====== There are six color settings that you will want to play with diff --git a/client/CMakeL10n.txt b/client/CMakeL10n.txt new file mode 100644 index 0000000..b4a5b2e --- /dev/null +++ b/client/CMakeL10n.txt @@ -0,0 +1,12 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "messages/twin-style-fahrenheit" + SOURCES . + X-POT ${CMAKE_SOURCE_DIR}/../../../core/tde-i18n/template/messages/tdebase/twin_clients.pot +) + +tde_l10n_create_template( + CATALOG "desktop_files/twin-style-fahrenheit-desktops" + SOURCES *.desktop +) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt new file mode 100644 index 0000000..e7755f4 --- /dev/null +++ b/client/CMakeLists.txt @@ -0,0 +1,41 @@ +tde_import( twin ) + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIBRARY_DIRS} +) + + +add_subdirectory( pics ) + + +##### twin_fahrenheit (kpart) + +tde_add_kpart( twin_fahrenheit AUTOMOC + + SOURCES + fahrenheitclient.cc + fahrenheitclient.h + LINK + tdecore-shared + tdeui-shared + tdecorations-shared + + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### other data + +tde_create_translated_desktop( + SOURCE fahrenheit.desktop + DESTINATION ${DATA_INSTALL_DIR}/twin +) diff --git a/client/fahrenheit.desktop b/client/fahrenheit.desktop index 6ffe692..32a887b 100644 --- a/client/fahrenheit.desktop +++ b/client/fahrenheit.desktop @@ -1,5 +1,4 @@ -# KDE Desktop Entry [Desktop Entry] Encoding=UTF-8 Name=Fahrenheit -X-TDE-Library=twin3_fahrenheit +X-TDE-Library=twin_fahrenheit diff --git a/client/fahrenheitclient.cc b/client/fahrenheitclient.cc index 3269266..6bd67b2 100644 --- a/client/fahrenheitclient.cc +++ b/client/fahrenheitclient.cc @@ -13,11 +13,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "fahrenheitclient.h" @@ -132,7 +132,10 @@ FahrenheitButton::FahrenheitButton(FahrenheitClient *parent, const char *name, setBackgroundMode(NoBackground); setFixedWidth(16); setCursor(arrowCursor); - if (pixmap) setPixmap(pixmap); + if (!pixmap.isEmpty()) + { + setPixmap(pixmap); + } TQToolTip::add(this, tip); } diff --git a/client/fahrenheitclient.h b/client/fahrenheitclient.h index ab52d0b..36b7953 100644 --- a/client/fahrenheitclient.h +++ b/client/fahrenheitclient.h @@ -1,7 +1,7 @@ ////////////////////////////////////////////////////////////////////////////// // fahrenheitclient.h // ------------------- -// Fahrenheit window decoration for KDE +// Fahrenheit window decoration for TDE // ------------------- // Copyright (c) 2003, 2004 David Johnson // @@ -27,7 +27,7 @@ #ifndef FAHRENHEITCLIENT_H #define FAHRENHEITCLIENT_H -#include +#include #include #include @@ -115,7 +115,7 @@ inline void FahrenheitButton::reset() class FahrenheitClient : public KDecoration { - Q_OBJECT + TQ_OBJECT public: FahrenheitClient(KDecorationBridge *b, KDecorationFactory *f); virtual ~FahrenheitClient(); diff --git a/client/pics/CMakeLists.txt b/client/pics/CMakeLists.txt new file mode 100644 index 0000000..3af694e --- /dev/null +++ b/client/pics/CMakeLists.txt @@ -0,0 +1,4 @@ +install( + FILES close.png help.png maximize.png minimize.png minmax.png sticky.png unsticky.png + DESTINATION ${DATA_INSTALL_DIR}/twin/fahrenheit +) 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/debian/changelog b/debian/changelog index 38e77b9..7b0f842 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,4 +2,4 @@ twin-style-fahrenheit-trinity (0.1-0) unstable; urgency=low * Initial release for TDE - -- Michele Calgaro Tue, 17 Oct 2023 20:48:00 +0900 + -- Michele Calgaro Tue, 17 Oct 2023 20:48:00 +0900