conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/1/head
gregory guy 5 years ago
parent d58173e773
commit 55ebab38f1
No known key found for this signature in database
GPG Key ID: 6EFE0EF249A874C0

@ -0,0 +1,80 @@
############################################
# #
# Improvements and feedbacks are welcome #
# #
# This file is released under GPL >= 3 #
# #
############################################
cmake_minimum_required( VERSION 2.8 )
#### general package setup
project( kima )
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} )
option( WITH_NVCONTROL "Build with NVidia control support" ${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 )
tde_conditional_add_subdirectory( BUILD_DOC doc )
tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
##### write configure files
configure_file( config.h.cmake config.h @ONLY )

@ -0,0 +1,45 @@
###########################################
# #
# 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 NVidia support
if( WITH_NVCONTROL )
set( NVCONTROL_FOUND false)
find_path( NVCONTROL_INCLUDE_DIR NAMES "NVCtrlLib.h" PATH_SUFFIXES "NVCtrl" )
find_library( NVCONTROL_LIBRARIES NAMES XNVCtrl )
if( NVCONTROL_LIBRARIES AND NVCONTROL_INCLUDE_DIR )
set( NVCONTROL_FOUND true)
endif( NVCONTROL_LIBRARIES AND NVCONTROL_INCLUDE_DIR )
if( NVCONTROL_FOUND )
set( HAVE_NVCONTROL 1 )
else()
tde_message_fatal( "NVidia support has been requested but <NVCtrlLib.h> or libXNVCtrl were not found on your system" )
endif( NVCONTROL_FOUND )
endif( WITH_NVCONTROL )

@ -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 you have <NVCtrlLib.h> header */
#cmakedefine HAVE_NVCONTROL @HAVE_NVCONTROL@

@ -0,0 +1 @@
tde_auto_add_subdirectories( )

@ -0,0 +1,2 @@
tde_create_handbook( DESTINATION ${PROJECT_NAME} )

@ -0,0 +1,5 @@
file( GLOB _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po )
if( _srcs )
tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} )
endif( )

@ -0,0 +1,42 @@
add_subdirectory( cpufreqd )
add_subdirectory( sources )
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}/src/sources
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### libkima (kpart)
tde_add_kpart( libkima AUTOMOC
SOURCES
prefs.ui
kima.cpp
flowlayout.cpp
sourcelistitem.cpp
LINK
cpufreqd-static
sources-static
tdeui-shared
DESTINATION ${PLUGIN_INSTALL_DIR}
)
##### other data
install(
FILES ${PROJECT_NAME}.desktop
DESTINATION ${DATA_INSTALL_DIR}/kicker/applets
)

@ -0,0 +1,23 @@
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_LIB_DIR}
)
##### cpufreqd (static)
tde_add_library( cpufreqd STATIC_PIC AUTOMOC
SOURCES
cpufreqd.cpp
cpufreqdconnection.cpp
cpufreqdprofile.cpp
)

@ -154,3 +154,4 @@ void CPUFreqd::setMode(uint32_t mode) {
m_conn.write(CMD_SET_MODE, mode);
m_conn.close();
}
#include "cpufreqd.moc"

@ -345,3 +345,4 @@ TQLayoutItem* FlowLayout::takeAt(int index) {
return item;
}
#endif // USE_QT4
#include "flowlayout.moc"

@ -73,7 +73,7 @@
//#include "kdebug.h"
extern "C" {
KPanelApplet* init( TQWidget* inParent, const TQString& inConfigFile) {
KDE_EXPORT KPanelApplet* init( TQWidget* inParent, const TQString& inConfigFile) {
TDEGlobal::locale()->insertCatalogue("kima");
return new Kima(inConfigFile, KPanelApplet::Normal,
//KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences,
@ -430,3 +430,4 @@ void Kima::maybeTip(const TQPoint& inPos){
text.append("</table>");
tip(rect(), text);
}
#include "kima.moc"

@ -1,71 +0,0 @@
#include <kdialog.h>
#include <tdelocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './prefs.ui'
**
** Created: Thu Jun 21 19:16:50 2007
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.7 edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "prefs.h"
#include <tqvariant.h>
#include <tqsplitter.h>
#include <tqheader.h>
#include <tdelistview.h>
#include <tqwidgetstack.h>
#include <tqlayout.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>
/*
* Constructs a Prefs as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
Prefs::Prefs( TQWidget* parent, const char* name, WFlags fl )
: TQWidget( parent, name, fl )
{
if ( !name )
setName( "Prefs" );
PrefsLayout = new TQVBoxLayout( this, 0, 6, "PrefsLayout");
splitter3 = new TQSplitter( this, "splitter3" );
splitter3->setOrientation( TQSplitter::Horizontal );
sourceListView = new TDEListView( splitter3, "sourceListView" );
sourceListView->addColumn( tr2i18n( "Source" ) );
sourceListView->header()->setClickEnabled( FALSE, sourceListView->header()->count() - 1 );
sourceListView->header()->setResizeEnabled( FALSE, sourceListView->header()->count() - 1 );
sourceListView->setResizeMode( TDEListView::AllColumns );
widgetStack = new TQWidgetStack( splitter3, "widgetStack" );
WStackPage = new TQWidget( widgetStack, "WStackPage" );
widgetStack->addWidget( WStackPage, 0 );
PrefsLayout->addWidget( splitter3 );
languageChange();
resize( TQSize(340, 73).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
}
/*
* Destroys the object and frees any allocated resources
*/
Prefs::~Prefs()
{
// no need to delete child widgets, TQt does it all for us
}
/*
* Sets the strings of the subwidgets using the current
* language.
*/
void Prefs::languageChange()
{
setCaption( tr2i18n( "Preferences" ) );
sourceListView->header()->setLabel( 0, tr2i18n( "Source" ) );
}
#include "prefs.moc"

@ -95,3 +95,4 @@ void SourceListItem::stateChange(bool inOn){
TQCheckListItem::stateChange(inOn);
setEnabled(inOn);
}
#include "sourcelistitem.moc"

@ -0,0 +1,46 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${NVCONTROL_INCLUDE_DIR}
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### sources (static)
tde_add_library( sources STATIC_PIC AUTOMOC
SOURCES
labelsourcePrefs.ui
sourceprefs.ui
acpithermalsrc.cpp
batterysrc.cpp
cpuinfofreqsrc.cpp
hddtempsrc.cpp
hwmonfansrc.cpp
hwmonthermalsrc.cpp
i8ksrc.cpp
ibmacpifansrc.cpp
ibmacpithermalsrc.cpp
ibmhdaps.cpp
ibookg4thermalsrc.cpp
labelsource.cpp
nvidiathermalsrc.cpp
omnibookthermalsrc.cpp
source.cpp
sysfreqsrc.cpp
threadedtrigger.cpp
triggeredsource.cpp
updateevent.cpp
uptimesrc.cpp
LINK
tdecore-shared
${NVCONTROL_LIBRARIES}
)

@ -62,4 +62,4 @@ TQString ACPIThermalSrc::fetchValue() {
}
return s;
}
#include "acpithermalsrc.moc"

@ -70,3 +70,4 @@ TQString BatterySrc::fetchValue() {
}
return s;
}
#include "batterysrc.moc"

@ -55,3 +55,4 @@ TQString CpuinfoFreqSrc::fetchValue(){
}
return s;
}
#include "cpuinfofreqsrc.moc"

@ -97,4 +97,4 @@ TQString HDDTempSrc::fetchValue(){
}
return s;
}
#include "hddtempsrc.moc"

@ -88,4 +88,4 @@ TQString HwMonFanSrc::fetchValue(){
}
return s;
}
#include "hwmonfansrc.moc"

@ -91,4 +91,4 @@ TQString HwMonThermalSrc::fetchValue(){
}
return s;
}
#include "hwmonthermalsrc.moc"

@ -108,4 +108,4 @@ TQString I8kSrc::index2Name(unsigned int inIndex){
return "unknown" + TQString().setNum(inIndex);
}
}
#include "i8ksrc.moc"

@ -54,4 +54,4 @@ TQString IBMACPIFanSrc::fetchValue(){
}
return s;
}
#include "ibmacpifansrc.moc"

@ -84,3 +84,4 @@ TQString IBMACPIThermalSrc::index2Name(unsigned int inIndex){
return "ibmacpi" + TQString().setNum(inIndex);
}
}
#include "ibmacpithermalsrc.moc"

@ -61,3 +61,4 @@ TQString IBMHDAPSSrc::fetchValue(){
}
return s;
}
#include "ibmhdaps.moc"

@ -60,4 +60,4 @@ TQString IbookG4ThermalSrc::fetchValue(){
}
return s;
}
#include "ibookg4thermalsrc.moc"

@ -131,3 +131,4 @@ void LabelSource::realizeWidget(){
mLabel->setTextFormat(TQt::PlainText);
connect(this, TQT_SIGNAL(valueUpdated(const TQString&)), this, TQT_SLOT(updateLabel(const TQString&)));
}
#include "labelsource.moc"

@ -1,110 +0,0 @@
#include <kdialog.h>
#include <tdelocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './labelsourcePrefs.ui'
**
** Created: Thu Jun 21 19:16:51 2007
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.7 edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "labelsourcePrefs.h"
#include <tqvariant.h>
#include <tqpushbutton.h>
#include <tqframe.h>
#include <tqlabel.h>
#include <kcolorbutton.h>
#include <tdefontrequester.h>
#include <tqcombobox.h>
#include <tqlayout.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>
/*
* Constructs a LabelSourcePrefs as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
LabelSourcePrefs::LabelSourcePrefs( TQWidget* parent, const char* name, WFlags fl )
: TQWidget( parent, name, fl )
{
if ( !name )
setName( "LabelSourcePrefs" );
LabelSourcePrefsLayout = new TQVBoxLayout( this, 0, 6, "LabelSourcePrefsLayout");
defaultSourcePrefsFrame = new TQFrame( this, "defaultSourcePrefsFrame" );
defaultSourcePrefsFrame->setFrameShape( TQFrame::NoFrame );
defaultSourcePrefsFrame->setFrameShadow( TQFrame::Plain );
defaultSourcePrefsFrameLayout = new TQVBoxLayout( defaultSourcePrefsFrame, 0, 6, "defaultSourcePrefsFrameLayout");
taskbartitleLabel = new TQLabel( defaultSourcePrefsFrame, "taskbartitleLabel" );
TQFont taskbartitleLabel_font( taskbartitleLabel->font() );
taskbartitleLabel_font.setBold( TRUE );
taskbartitleLabel->setFont( taskbartitleLabel_font );
defaultSourcePrefsFrameLayout->addWidget( taskbartitleLabel );
layout13 = new TQHBoxLayout( 0, 0, 6, "layout13");
colorLabel = new TQLabel( defaultSourcePrefsFrame, "colorLabel" );
layout13->addWidget( colorLabel );
colorButton = new KColorButton( defaultSourcePrefsFrame, "colorButton" );
layout13->addWidget( colorButton );
spacer1 = new TQSpacerItem( 350, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
layout13->addItem( spacer1 );
defaultSourcePrefsFrameLayout->addLayout( layout13 );
layout17 = new TQHBoxLayout( 0, 0, 6, "layout17");
fontLabel = new TQLabel( defaultSourcePrefsFrame, "fontLabel" );
layout17->addWidget( fontLabel );
fontRequester = new TDEFontRequester( defaultSourcePrefsFrame, "fontRequester" );
layout17->addWidget( fontRequester );
defaultSourcePrefsFrameLayout->addLayout( layout17 );
layout18 = new TQHBoxLayout( 0, 0, 6, "layout18");
alignmentLabel = new TQLabel( defaultSourcePrefsFrame, "alignmentLabel" );
layout18->addWidget( alignmentLabel );
alignmentComboBox = new TQComboBox( FALSE, defaultSourcePrefsFrame, "alignmentComboBox" );
layout18->addWidget( alignmentComboBox );
spacer2 = new TQSpacerItem( 350, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
layout18->addItem( spacer2 );
defaultSourcePrefsFrameLayout->addLayout( layout18 );
LabelSourcePrefsLayout->addWidget( defaultSourcePrefsFrame );
languageChange();
resize( TQSize(299, 135).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
}
/*
* Destroys the object and frees any allocated resources
*/
LabelSourcePrefs::~LabelSourcePrefs()
{
// no need to delete child widgets, TQt does it all for us
}
/*
* Sets the strings of the subwidgets using the current
* language.
*/
void LabelSourcePrefs::languageChange()
{
setCaption( tr2i18n( "LabelSourcePrefs" ) );
taskbartitleLabel->setText( tr2i18n( "<br>\n"
"Taskbar visual settings" ) );
colorLabel->setText( tr2i18n( "Foreground color:" ) );
colorButton->setText( TQString() );
fontLabel->setText( tr2i18n( "Font:" ) );
alignmentLabel->setText( tr2i18n( "Alignment:" ) );
alignmentComboBox->clear();
alignmentComboBox->insertItem( tr2i18n( "Left" ) );
alignmentComboBox->insertItem( tr2i18n( "Center" ) );
alignmentComboBox->insertItem( tr2i18n( "Right" ) );
}
#include "labelsourcePrefs.moc"

@ -172,4 +172,4 @@ TQString NVidiaThermalSrc::fetchValue(){
return mValue;
#endif
}
#include "nvidiathermalsrc.moc"

@ -55,4 +55,4 @@ TQString OmnibookThermalSrc::fetchValue(){
}
return s;
}
#include "omnibookthermalsrc.moc"

@ -220,3 +220,4 @@ int Source::celsiusToFahrenheit(int inCelsius) const{
void Source::realizeWidget(){
mIsMetric = TDEGlobal::locale()->measureSystem() == TDELocale::Metric;
}
#include "source.moc"

@ -1,88 +0,0 @@
#include <kdialog.h>
#include <tdelocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './sourceprefs.ui'
**
** Created: Thu Jun 21 19:16:51 2007
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.7 edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "sourceprefs.h"
#include <tqvariant.h>
#include <tqpushbutton.h>
#include <tqlabel.h>
#include <tqlineedit.h>
#include <tqcheckbox.h>
#include <tqlayout.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>
/*
* Constructs a SourcePrefs as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*/
SourcePrefs::SourcePrefs( TQWidget* parent, const char* name, WFlags fl )
: TQWidget( parent, name, fl )
{
if ( !name )
setName( "SourcePrefs" );
SourcePrefsLayout = new TQVBoxLayout( this, 0, 6, "SourcePrefsLayout");
descriptionLabel = new TQLabel( this, "descriptionLabel" );
SourcePrefsLayout->addWidget( descriptionLabel );
hBoxLayout = new TQHBoxLayout( 0, 0, 6, "hBoxLayout");
nameLabel = new TQLabel( this, "nameLabel" );
hBoxLayout->addWidget( nameLabel );
nameLineEdit = new TQLineEdit( this, "nameLineEdit" );
hBoxLayout->addWidget( nameLineEdit );
spacer8 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
hBoxLayout->addItem( spacer8 );
SourcePrefsLayout->addLayout( hBoxLayout );
taskbarCheckBox = new TQCheckBox( this, "taskbarCheckBox" );
SourcePrefsLayout->addWidget( taskbarCheckBox );
hBoxLayout2 = new TQHBoxLayout( 0, 0, 6, "hBoxLayout2");
spacer8_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
hBoxLayout2->addItem( spacer8_2 );
nameCheckBox = new TQCheckBox( this, "nameCheckBox" );
hBoxLayout2->addWidget( nameCheckBox );
SourcePrefsLayout->addLayout( hBoxLayout2 );
tooltipCheckBox = new TQCheckBox( this, "tooltipCheckBox" );
SourcePrefsLayout->addWidget( tooltipCheckBox );
languageChange();
resize( TQSize(203, 127).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );
}
/*
* Destroys the object and frees any allocated resources
*/
SourcePrefs::~SourcePrefs()
{
// no need to delete child widgets, TQt does it all for us
}
/*
* Sets the strings of the subwidgets using the current
* language.
*/
void SourcePrefs::languageChange()
{
setCaption( tr2i18n( "SourcePrefs" ) );
descriptionLabel->setText( tr2i18n( "description" ) );
nameLabel->setText( tr2i18n( "Name:" ) );
taskbarCheckBox->setText( tr2i18n( "Show this source in Taskbar" ) );
nameCheckBox->setText( tr2i18n( "Show name in Taskbar" ) );
tooltipCheckBox->setText( tr2i18n( "Show this source in ToolTip" ) );
}
#include "sourceprefs.moc"

@ -63,4 +63,4 @@ TQString SysFreqSrc::fetchValue(){
}
return s;
}
#include "sysfreqsrc.moc"

@ -65,3 +65,4 @@ void ThreadedTrigger::run(){
// 2. mWaitMutex is locked when we enter the loop
mWaitMutex.unlock(); // unlock it again
}
#include "threadedtrigger.moc"

@ -46,3 +46,4 @@ void TriggeredSource::customEvent(TQCustomEvent* event){
TQString TriggeredSource::getValue() const{
return mValue;
}
#include "triggeredsource.moc"

@ -68,3 +68,4 @@ void UptimeSrc::realizeWidget() {
mTimeFormatLong = i18n("%1d %2:%3");
mTimeFormatShort = i18n("%1:%2");
}
#include "uptimesrc.moc"

Loading…
Cancel
Save