summaryrefslogtreecommitdiffstats
path: root/tdecore
diff options
context:
space:
mode:
authorFrançois Andriot <francois.andriot@free.fr>2014-10-07 01:00:47 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-10-07 01:34:09 +0200
commit84e3f9e06ba1b6a050e838ca55970f018e81b749 (patch)
treec0b5c29503c24bba5339eab5191a692ddbb674dc /tdecore
parente255a8ca6387cc1f100beffe39f889328e8f2a41 (diff)
downloadtdelibs-84e3f9e06ba1b6a050e838ca55970f018e81b749.tar.gz
tdelibs-84e3f9e06ba1b6a050e838ca55970f018e81b749.zip
Allow conditional build of tdehwlib
Diffstat (limited to 'tdecore')
-rw-r--r--tdecore/CMakeLists.txt13
-rw-r--r--tdecore/kdemacros.h.cmake1
-rw-r--r--tdecore/kinstance.cpp14
-rw-r--r--tdecore/kinstance.h12
-rw-r--r--tdecore/tdeglobal.cpp4
5 files changed, 37 insertions, 7 deletions
diff --git a/tdecore/CMakeLists.txt b/tdecore/CMakeLists.txt
index 508ca855b..85f5c99df 100644
--- a/tdecore/CMakeLists.txt
+++ b/tdecore/CMakeLists.txt
@@ -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}
)
diff --git a/tdecore/kdemacros.h.cmake b/tdecore/kdemacros.h.cmake
index 766ca622a..083cc8c8d 100644
--- a/tdecore/kdemacros.h.cmake
+++ b/tdecore/kdemacros.h.cmake
@@ -21,6 +21,7 @@
#define _KDE_MACROS_H_
/* Set by configure */
+#cmakedefine __TDE_HAVE_TDEHWLIB 1
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
/**
diff --git a/tdecore/kinstance.cpp b/tdecore/kinstance.cpp
index 6760c95a0..cbdf86783 100644
--- a/tdecore/kinstance.cpp
+++ b/tdecore/kinstance.cpp
@@ -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
{
diff --git a/tdecore/kinstance.h b/tdecore/kinstance.h
index be60c943c..e0fdf73de 100644
--- a/tdecore/kinstance.h
+++ b/tdecore/kinstance.h
@@ -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;
diff --git a/tdecore/tdeglobal.cpp b/tdecore/tdeglobal.cpp
index f8639d526..8ef5f59db 100644
--- a/tdecore/tdeglobal.cpp
+++ b/tdecore/tdeglobal.cpp
@@ -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()
{