Allow conditional build of tdehwlib

pull/16/head
François Andriot 10 years ago committed by Slávek Banko
parent e255a8ca63
commit 84e3f9e06b

@ -85,7 +85,8 @@ OPTION( WITH_PCRE "Enable pcre regex support for kjs" ON )
OPTION( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
OPTION( WITH_INOTIFY "Enable inotify support for tdeio" ON )
OPTION( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} )
option( WITH_TDEHWLIB_DAEMONS "Enable daemons for TDE hwlib" ${WITH_ALL_OPTIONS} )
option( WITH_TDEHWLIB "Enable TDE hwlib globally" ON )
option( WITH_TDEHWLIB_DAEMONS "Enable daemons for TDE hwlib" ${WITH_TDEHWLIB} )
option( WITH_HAL "Enable HAL support" OFF )
option( WITH_DEVKITPOWER "Enable DeviceKit Power support" OFF )
option( WITH_LOGINDPOWER "Enable Logind/Systemd Power support" OFF )
@ -506,6 +507,10 @@ set( LTDL_OBJDIR \".\" )
set( KDELIBSUFF "${LIB_SUFFIX}" )
set( kde_socklen_t socklen_t )
if( WITH_TDEHWLIB )
set( __TDE_HAVE_TDEHWLIB 1 )
endif( WITH_TDEHWLIB )
##### check for libdl ###########################

@ -12,7 +12,12 @@
add_subdirectory( malloc )
add_subdirectory( network )
add_subdirectory( tdeconfig_compiler )
add_subdirectory( tdehw )
if( WITH_TDEHWLIB )
add_subdirectory( tdehw )
set( TDEHW_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tdehw )
set( TDEHW_LIB tdehw-static )
endif( WITH_TDEHWLIB )
if( WITH_LIBART )
add_subdirectory( svgicons )
@ -25,7 +30,7 @@ include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/network
${CMAKE_CURRENT_SOURCE_DIR}/tdehw
${TDEHW_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/dcop
${CMAKE_SOURCE_DIR}/libltdl
${CMAKE_SOURCE_DIR}/tdefx
@ -128,10 +133,10 @@ set( ${target}_SRCS
tde_add_library( ${target} SHARED AUTOMOC
SOURCES ${${target}_SRCS}
VERSION 14.0.0
EMBED tdecorenetwork-static tdehw-static
EMBED tdecorenetwork-static ${TDEHW_LIB}
LINK ltdlc-static ${KDESVGICONS} DCOP-shared tdefx-shared ${ZLIB_LIBRARIES}
${LIBIDN_LIBRARIES} ${XCOMPOSITE_LIBRARIES} ICE SM ${GAMIN_LIBRARIES}
${LIBBFD_LIBRARIES} util
${LIBBFD_LIBRARIES} ${LIB_UTIL}
DEPENDENCIES dcopidl dcopidl2cpp
DESTINATION ${LIB_INSTALL_DIR}
)

@ -21,6 +21,7 @@
#define _KDE_MACROS_H_
/* Set by configure */
#cmakedefine __TDE_HAVE_TDEHWLIB 1
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
/**

@ -24,8 +24,10 @@
#include "tdelocale.h"
#include "kcharsets.h"
#include "kiconloader.h"
#ifdef __TDE_HAVE_TDEHWLIB
#include "tdehardwaredevices.h"
#include "tdenetworkconnections.h"
#endif
#include "tdeaboutdata.h"
#include "kstandarddirs.h"
#include "kdebug.h"
@ -72,8 +74,10 @@ TDEInstance::TDEInstance( const TQCString& name)
: _dirs (0L),
_config (0L),
_iconLoader (0L),
#ifdef __TDE_HAVE_TDEHWLIB
_hardwaredevices (0L),
_networkmanager (0L),
#endif
_name( name ), _aboutData( new TDEAboutData( name, "", 0 ) ), m_configReadOnly(false)
{
DEBUG_ADD
@ -92,8 +96,10 @@ TDEInstance::TDEInstance( const TDEAboutData * aboutData )
: _dirs (0L),
_config (0L),
_iconLoader (0L),
#ifdef __TDE_HAVE_TDEHWLIB
_hardwaredevices (0L),
_networkmanager (0L),
#endif
_name( aboutData->appName() ), _aboutData( aboutData ), m_configReadOnly(false)
{
DEBUG_ADD
@ -113,8 +119,10 @@ TDEInstance::TDEInstance( TDEInstance* src )
: _dirs ( src->_dirs ),
_config ( src->_config ),
_iconLoader ( src->_iconLoader ),
#ifdef __TDE_HAVE_TDEHWLIB
_hardwaredevices ( src->_hardwaredevices ),
_networkmanager ( src->_networkmanager ),
#endif
_name( src->_name ), _aboutData( src->_aboutData ), m_configReadOnly(false)
{
DEBUG_ADD
@ -133,8 +141,10 @@ TDEInstance::TDEInstance( TDEInstance* src )
src->_dirs = 0L;
src->_config = 0L;
src->_iconLoader = 0L;
#ifdef __TDE_HAVE_TDEHWLIB
src->_hardwaredevices = 0L;
src->_networkmanager = 0L;
#endif
src->_aboutData = 0L;
delete src;
}
@ -153,11 +163,13 @@ TDEInstance::~TDEInstance()
delete _iconLoader;
_iconLoader = 0;
#ifdef __TDE_HAVE_TDEHWLIB
delete _hardwaredevices;
_hardwaredevices = 0;
delete _networkmanager;
_networkmanager = 0;
#endif
// delete _config; // Do not delete, stored in d->sharedConfig
_config = 0;
@ -270,6 +282,7 @@ TDEIconLoader *TDEInstance::iconLoader() const
return _iconLoader;
}
#ifdef __TDE_HAVE_TDEHWLIB
TDEHardwareDevices *TDEInstance::hardwareDevices() const
{
DEBUG_CHECK_ALIVE
@ -289,6 +302,7 @@ TDEGlobalNetworkManager *TDEInstance::networkManager() const
return _networkmanager;
}
#endif
void TDEInstance::newIconLoader() const
{

@ -18,6 +18,9 @@
#ifndef _KINSTANCE_H
#define _KINSTANCE_H
#include <tqstring.h>
#include "tdelibs_export.h"
class TDEStandardDirs;
class TDEAboutData;
class TDEConfig;
@ -27,11 +30,10 @@ class TQFont;
class TDEInstancePrivate;
class KMimeSourceFactory;
class TDESharedConfig;
#ifdef __TDE_HAVE_TDEHWLIB
class TDEHardwareDevices;
class TDEGlobalNetworkManager;
#include <tqstring.h>
#include "tdelibs_export.h"
#endif
/**
@ -110,6 +112,7 @@ class TDECORE_EXPORT TDEInstance
*/
TDEIconLoader *iconLoader() const;
#ifdef __TDE_HAVE_TDEHWLIB
/**
* Returns a TDEHardwareDevices object.
* @return the hardwaredevices object.
@ -121,6 +124,7 @@ class TDECORE_EXPORT TDEInstance
* @return the networkmanager object.
*/
TDEGlobalNetworkManager *networkManager() const;
#endif
/**
* Re-allocate the global iconloader.
@ -168,8 +172,10 @@ private:
mutable TDEConfig *_config;
mutable TDEIconLoader *_iconLoader;
#ifdef __TDE_HAVE_TDEHWLIB
mutable TDEHardwareDevices *_hardwaredevices;
mutable TDEGlobalNetworkManager *_networkmanager;
#endif
mutable void *_placeholder;
TQCString _name;

@ -34,8 +34,10 @@
#include <tdelocale.h>
#include <kcharsets.h>
#include <kiconloader.h>
#ifdef __TDE_HAVE_TDEHWLIB
#include <tdehardwaredevices.h>
#include <tdenetworkconnections.h>
#endif
#include <kstandarddirs.h>
#include <kinstance.h>
#include "kstaticdeleter.h"
@ -81,6 +83,7 @@ TDEIconLoader *TDEGlobal::iconLoader()
return _instance->iconLoader();
}
#ifdef __TDE_HAVE_TDEHWLIB
TDEHardwareDevices *TDEGlobal::hardwareDevices()
{
MYASSERT(_instance);
@ -94,6 +97,7 @@ TDEGlobalNetworkManager *TDEGlobal::networkManager()
return _instance->networkManager();
}
#endif
TDEInstance *TDEGlobal::instance()
{

Loading…
Cancel
Save