Skip to content

Commit

Permalink
build also without logging in icecc
Browse files Browse the repository at this point in the history
Look for the newly introduced logging.h header in icecc, and enable the
logging bits only when it is present.

This makes sure icemon can be built with icecc 1.0.x.
  • Loading branch information
pinotree committed Feb 22, 2014
1 parent 20ab8ff commit b88ab05
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -6,6 +6,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/mod

include(GNUInstallDirs)
include(KDE4Macros-Icecream)
include(CheckIncludeFileCXX)

# version info
set(ICEMON_VERSION_MAJOR "2")
Expand Down Expand Up @@ -43,6 +44,8 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR} # config-icemon.h
)

check_include_file_cxx(icecc/logging.h ICECC_HAVE_LOGGING_H)

set(
INSTALL_TARGETS_DEFAULT_ARGS
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
1 change: 1 addition & 0 deletions config-icemon.h.cmake
@@ -1,2 +1,3 @@
#define ICEMON_VERSION_STRING "@ICEMON_VERSION_STRING@"
#cmakedefine ICECC_HAVE_LOGGING_H 1

6 changes: 6 additions & 0 deletions src/icecreammonitor.cc
Expand Up @@ -26,8 +26,12 @@
#include "hostinfo.h"
#include "statusview.h"

#include <config-icemon.h>

#include <icecc/comm.h>
#ifdef ICECC_HAVE_LOGGING_H
#include <icecc/logging.h>
#endif

#include <qdebug.h>

Expand Down Expand Up @@ -359,6 +363,7 @@ void IcecreamMonitor::setSchedulerState( bool online )

void IcecreamMonitor::setupDebug()
{
#ifdef ICECC_HAVE_LOGGING_H
char *env = getenv("ICECC_DEBUG");
int debug_level = Error;

Expand All @@ -379,6 +384,7 @@ void IcecreamMonitor::setupDebug()
}

setup_debug(debug_level, logfile, "ICEMON");
#endif
}

#include "icecreammonitor.moc"

0 comments on commit b88ab05

Please sign in to comment.