summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-03-13 15:36:26 -0400
committerTom Rondeau <trondeau@vt.edu>2013-03-13 15:36:26 -0400
commitf2e1c50081e66b7962c707de90378ac9209070bc (patch)
tree2f18af4cbfeba7e1bde9198f987f58817f0e816b
parent890f2882d2210b1d4e64f0bbffc42ccc716cfd97 (diff)
log: replacing log4cxx with log4cpp.
-rw-r--r--docs/doxygen/other/extra_pages.dox2
-rw-r--r--docs/doxygen/other/logger.dox22
-rw-r--r--gnuradio-core/src/lib/CMakeLists.txt6
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block.cc4
-rw-r--r--gnuradio-core/src/lib/runtime/gr_logger.h28
-rw-r--r--gnuradio-core/src/lib/runtime/gr_logger.i8
-rw-r--r--gnuradio-core/src/lib/swig/CMakeLists.txt6
-rw-r--r--gnuradio-core/src/tests/CMakeLists.txt4
-rw-r--r--gr-atsc/src/lib/CMakeLists.txt6
-rw-r--r--gr-audio/lib/CMakeLists.txt6
-rw-r--r--gr-blocks/tests/CMakeLists.txt4
-rw-r--r--gr-comedi/src/CMakeLists.txt6
-rw-r--r--gr-digital/lib/CMakeLists.txt6
-rw-r--r--gr-fcd/lib/CMakeLists.txt6
-rw-r--r--gr-filter/lib/CMakeLists.txt4
-rw-r--r--gr-howto-write-a-block/CMakeLists.txt4
-rw-r--r--gr-howto-write-a-block/cmake/Modules/FindLog4cpp.cmake58
-rw-r--r--gr-howto-write-a-block/cmake/Modules/GrMiscUtils.cmake32
-rw-r--r--gr-howto-write-a-block/lib/CMakeLists.txt2
-rw-r--r--gr-noaa/lib/CMakeLists.txt6
-rw-r--r--gr-pager/lib/CMakeLists.txt6
-rw-r--r--gr-qtgui/lib/CMakeLists.txt6
-rw-r--r--gr-shd/lib/CMakeLists.txt6
-rw-r--r--gr-trellis/src/lib/CMakeLists.txt6
-rw-r--r--gr-uhd/lib/CMakeLists.txt6
-rw-r--r--gr-video-sdl/src/CMakeLists.txt4
-rw-r--r--gr-vocoder/lib/CMakeLists.txt6
-rw-r--r--gr-wavelet/lib/CMakeLists.txt6
28 files changed, 163 insertions, 103 deletions
diff --git a/docs/doxygen/other/extra_pages.dox b/docs/doxygen/other/extra_pages.dox
index 44cdf9d483..94c741864d 100644
--- a/docs/doxygen/other/extra_pages.dox
+++ b/docs/doxygen/other/extra_pages.dox
@@ -80,7 +80,7 @@ audio-osx and audio-windows to be either satisfied or built.
\li comedilib (>= 0.8) http://www.comedi.org/
\subsection dep_gr_log gr-log: Logging Tools (Optional)
-\li log4cxx (>= 0.10.0) http://logging.apache.org/log4cxx
+\li log4cpp (>= 1.0) http://log4cpp.sourceforge.net/
\section build_gr_cmake Building GNU Radio
diff --git a/docs/doxygen/other/logger.dox b/docs/doxygen/other/logger.dox
index f98a64657b..e0f8ac4965 100644
--- a/docs/doxygen/other/logger.dox
+++ b/docs/doxygen/other/logger.dox
@@ -4,20 +4,23 @@
GNU Radio has a logging interface to enable various levels of logging
information to be printed to the console or a file. The logger derives
-from log4cxx (http://logging.apache.org/log4cxx) which is readily
+from log4cpp (http://log4cpp.sourceforge.net/) which is readily
available in most Linux distributions. This is an optional dependency
and GNU Radio will work without it.
When configuring GNU Radio, the -DENABLE_GR_LOG=On|Off option to cmake
will allow the user to toggle use of the logger on and off. The logger
-defaults to "on" and will use log4cxx if it is available. If log4cxx
+defaults to "on" and will use log4cpp if it is available. If log4cpp
is not found, the default logging will output to standard output or
standard error, depending on the level of the log message.
Logging is useful for blocks to print out certain amounts of data at
different levels. These levels are:
- TRACE < DEBUG < INFO < WARN < ERROR < FATAL
+<pre>
+ DEBUG < INFO < WARN < TRACE < ERROR < ALERT < CRIT < FATAL <EMERG
+</pre>
+
The order here determines the level of output. These levels are
hierarchical in that specifying any level also includes any level
@@ -123,7 +126,7 @@ simple examples of using them:
If the logger is not enabled, then these macros become nops and do
nothing (and d_logger and d_debug_logger are NULL pointers). If
-logging is enabled but the log4cxx library is not found, then TRACE,
+logging is enabled but the log4cpp library is not found, then TRACE,
DEBUG, and INFO levels go to stdout and the rest to stderr.
@@ -133,11 +136,10 @@ If not using the simplified settings discussed above, where we can
direct the logger messages to either a file or one of the standard
outputs, we must use a more complicated configuration file. We do this
by specifying the "log_config" option in the [LOG] section. The
-log4cxx documentation (found through
-http://logging.apache.org/log4cxx/) will provide more information on
-how configuration works and looks. Mostly, a default configuration
-script provided with GNU Radio can be used. After installation, the
-default configuration script is located at:
+log4cpp documentation will provide more information on how
+configuration works and looks. Mostly, a default configuration script
+provided with GNU Radio can be used. After installation, the default
+configuration script is located at:
<pre>
$prefix/etc/gnuradio/gr_log_default.xml
@@ -196,7 +198,7 @@ except we would use "gr_log_debug." in the GR_LOG_GETLOGGER call):
\endcode
This creates a pointer called LOG (which is instantiated as a
-log4cxx:LoggerPtr in the macro) that we can now use locally as the
+log4cpp:LoggerPtr in the macro) that we can now use locally as the
input to our logging macros like 'GR_LOG_TRACE(LOG, "message")'.
*/
diff --git a/gnuradio-core/src/lib/CMakeLists.txt b/gnuradio-core/src/lib/CMakeLists.txt
index 5b39cbc036..b69b858ad0 100644
--- a/gnuradio-core/src/lib/CMakeLists.txt
+++ b/gnuradio-core/src/lib/CMakeLists.txt
@@ -76,12 +76,12 @@ link_directories(${LOG4CPP_LIBRARY_DIRS})
# Setup library
########################################################################
-# Only use if log4cxx is installed
+# Only use if log4cpp is installed
# Define ENABLE_GR_LOG so .h and .cc files can turn actual
# logging and insert dummy functions.
-#if(LOG4CXX_FOUND)
+#if(LOG4CPP_FOUND)
# add_definitions(-DENABLE_GR_LOG)
-#endif(LOG4CXX_FOUND)
+#endif(LOG4CPP_FOUND)
message("******************************************")
message("LOG4CPP LIBRARIES are ${LOG4CPP_LIBRARIES}")
message("******************************************")
diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc
index a5029d13cc..4950e8666c 100644
--- a/gnuradio-core/src/lib/runtime/gr_block.cc
+++ b/gnuradio-core/src/lib/runtime/gr_block.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2009,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2009,2010,2013 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -91,7 +91,7 @@ gr_block::gr_block (const std::string &name,
}
}
d_debug_logger = DLOG;
-#endif /* HAVE_LOG4CXX */
+#endif /* HAVE_LOG4CPP */
#else /* ENABLE_GR_LOG */
d_logger = NULL;
d_debug_logger = NULL;
diff --git a/gnuradio-core/src/lib/runtime/gr_logger.h b/gnuradio-core/src/lib/runtime/gr_logger.h
index d28907d045..2aadc3c936 100644
--- a/gnuradio-core/src/lib/runtime/gr_logger.h
+++ b/gnuradio-core/src/lib/runtime/gr_logger.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2012 Free Software Foundation, Inc.
+ * Copyright 2012-2013 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -23,7 +23,7 @@
/*******************************************************************************
* Author: Mark Plett
* Description:
-* The gr_logger module wraps the log4cxx library for logging in gnuradio
+* The gr_logger module wraps the log4cpp library for logging in gnuradio
*******************************************************************************/
#ifndef INCLUDED_GR_LOGGER_H
@@ -32,7 +32,7 @@
/*!
* \file gr_logger.h
* \ingroup logging
-* \brief GNURADIO logging wrapper for log4cxx library (C++ port of log4j)
+* \brief GNURADIO logging wrapper for log4cpp library (C++ port of log4j)
*
*/
@@ -101,7 +101,7 @@ typedef std::string gr_logger_ptr;
#define GR_LOG_ASSERT(logger, cond, msg) std::cerr<<"ERROR:"<<msg<<std::endl; assert(cond)
#else /* HAVE_LOG4CPP */
-// Second configuration...logging to log4cxx
+// Second configuration...logging to log4cpp
#include <log4cpp/Category.hh>
#include <log4cpp/PropertyConfigurator.hh>
@@ -114,7 +114,7 @@ typedef std::string gr_logger_ptr;
* \brief GR_LOG macros
* \ingroup logging
*
- * These macros wrap the standard LOG4CXX_LEVEL macros. The availablie macros
+ * These macros wrap the standard LOG4CPP_LEVEL macros. The availablie macros
* are:
* GR_LOG_DEBUG
* GR_LOG_INFO
@@ -362,7 +362,7 @@ GR_CORE_API void logger_get_level(gr_logger_ptr logger, std::string &level);
/*!
* \brief Get the logger's output level.
*
- * Gets the level of the logger. This returns the actual Log4cxx::Level
+ * Gets the level of the logger. This returns the actual Log4cpp::Level
* data type, which can be:
*
* \li log4cpp::Priority::NOTSET
@@ -465,10 +465,10 @@ class gr_logger
/*! \brief inline function, wrapper for EMERG message */
void emerg(std::string name,std::string msg){GR_EMERG(name,msg);};
- /*! \brief inline function, wrapper for LOG4CXX_ASSERT for conditional ERROR message */
+ /*! \brief inline function, wrapper for LOG4CPP_ASSERT for conditional ERROR message */
void errorIF(std::string name,bool cond,std::string msg){GR_ERRORIF(name,cond,msg);};
- /*! \brief inline function, wrapper for LOG4CXX_ASSERT for conditional ERROR message */
+ /*! \brief inline function, wrapper for LOG4CPP_ASSERT for conditional ERROR message */
void gr_assert(std::string name,bool cond,std::string msg){GR_ASSERT(name,cond,msg);};
// Wrappers for Logger Pointer referenced functions
@@ -478,19 +478,19 @@ class gr_logger
/*! \brief inline function, wrapper to get the logger level */
void get_log_level(gr_logger_ptr logger,std::string &level){GR_LOG_GET_LEVEL(logger,level);}
- /*! \brief inline function, wrapper for LOG4CXX_DEBUG for DEBUG message */
+ /*! \brief inline function, wrapper for LOG4CPP_DEBUG for DEBUG message */
void log_debug(gr_logger_ptr logger,std::string msg){GR_LOG_DEBUG(logger,msg);};
- /*! \brief inline function, wrapper for LOG4CXX_INFO for INFO message */
+ /*! \brief inline function, wrapper for LOG4CPP_INFO for INFO message */
void log_info(gr_logger_ptr logger,std::string msg){GR_LOG_INFO(logger,msg);};
/*! \brief inline function, wrapper for NOTICE message */
void log_notice(gr_logger_ptr logger,std::string msg){GR_LOG_NOTICE(logger,msg);};
- /*! \brief inline function, wrapper for LOG4CXX_WARN for WARN message */
+ /*! \brief inline function, wrapper for LOG4CPP_WARN for WARN message */
void log_warn(gr_logger_ptr logger,std::string msg){GR_LOG_WARN(logger,msg);};
- /*! \brief inline function, wrapper for LOG4CXX_ERROR for ERROR message */
+ /*! \brief inline function, wrapper for LOG4CPP_ERROR for ERROR message */
void log_error(gr_logger_ptr logger,std::string msg){GR_LOG_ERROR(logger,msg);};
/*! \brief inline function, wrapper for NOTICE message */
@@ -505,10 +505,10 @@ class gr_logger
/*! \brief inline function, wrapper for EMERG message */
void log_emerg(gr_logger_ptr logger,std::string msg){GR_LOG_EMERG(logger,msg);};
- /*! \brief inline function, wrapper for LOG4CXX_ASSERT for conditional ERROR message */
+ /*! \brief inline function, wrapper for LOG4CPP_ASSERT for conditional ERROR message */
void log_errorIF(gr_logger_ptr logger,bool cond,std::string msg){GR_LOG_ERRORIF(logger,cond,msg);};
- /*! \brief inline function, wrapper for LOG4CXX_ASSERT for conditional ERROR message */
+ /*! \brief inline function, wrapper for LOG4CPP_ASSERT for conditional ERROR message */
void log_assert(gr_logger_ptr logger,bool cond,std::string msg){GR_LOG_ASSERT(logger,cond,msg);};
};
diff --git a/gnuradio-core/src/lib/runtime/gr_logger.i b/gnuradio-core/src/lib/runtime/gr_logger.i
index e0fe120205..70e50e02b3 100644
--- a/gnuradio-core/src/lib/runtime/gr_logger.i
+++ b/gnuradio-core/src/lib/runtime/gr_logger.i
@@ -23,7 +23,7 @@
* Copyright 2011 Johns Hopkins University Applied Physics Lab
* Author: Mark Plett
* Description:
-* SWIG interface generator file for gr_logger module. gr_logger wraps log4cxx logging
+* SWIG interface generator file for gr_logger module. gr_logger wraps log4cpp logging
* for gnuradio.
*******************************************************************************/
@@ -48,14 +48,14 @@
#include <log4cpp/Category.hh>
%}
-namespace log4cxx{
+namespace log4cpp{
class LoggerPtr {
public:
~LoggerPtr();
};
};
void logger_load_config(const std::string &config_filename);
-void logger_set_level(log4cxx::LoggerPtr logger, const std::string &level);
+void logger_set_level(log4cpp::LoggerPtr logger, const std::string &level);
%rename(log) gr_logger;
@@ -105,5 +105,5 @@ public:
};
-#endif /* HAVE_LOG4CXX */
+#endif /* HAVE_LOG4CPP */
#endif /* ENABLE_GR_LOG */
diff --git a/gnuradio-core/src/lib/swig/CMakeLists.txt b/gnuradio-core/src/lib/swig/CMakeLists.txt
index de42cf2a49..2c89494e78 100644
--- a/gnuradio-core/src/lib/swig/CMakeLists.txt
+++ b/gnuradio-core/src/lib/swig/CMakeLists.txt
@@ -25,15 +25,15 @@ set(GR_SWIG_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}
${GNURADIO_CORE_SWIG_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
- ${LOG4CXX_INCLUDE_DIRS}
+ ${LOG4CPP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
set(GR_SWIG_LIBRARIES
gnuradio-core
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
-# Only use if log4cxx is installed
+# Only use if log4cpp is installed
# Define ENABLE_GR_LOG for the .i file to ignore it.
if(ENABLE_GR_LOG)
SET(GR_SWIG_FLAGS "-DENABLE_GR_LOG")
diff --git a/gnuradio-core/src/tests/CMakeLists.txt b/gnuradio-core/src/tests/CMakeLists.txt
index f09c0bbe8f..2340f123e1 100644
--- a/gnuradio-core/src/tests/CMakeLists.txt
+++ b/gnuradio-core/src/tests/CMakeLists.txt
@@ -36,8 +36,8 @@ link_directories(
${CPPUNIT_LIBRARY_DIRS}
)
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Build benchmarks and non-registered tests
diff --git a/gr-atsc/src/lib/CMakeLists.txt b/gr-atsc/src/lib/CMakeLists.txt
index 43e372b34a..86c0be4430 100644
--- a/gr-atsc/src/lib/CMakeLists.txt
+++ b/gr-atsc/src/lib/CMakeLists.txt
@@ -30,8 +30,8 @@ include_directories(
link_directories(${Boost_LIBRARY_DIRS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Generate viterbi mux source
@@ -115,7 +115,7 @@ ENDIF(MSVC)
list(APPEND atsc_libs
gnuradio-core
${Boost_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-atsc SHARED ${gr_atsc_sources})
diff --git a/gr-audio/lib/CMakeLists.txt b/gr-audio/lib/CMakeLists.txt
index b68e1fea4b..c9e2806ebd 100644
--- a/gr-audio/lib/CMakeLists.txt
+++ b/gr-audio/lib/CMakeLists.txt
@@ -30,10 +30,10 @@ include_directories(
link_directories(${Boost_LIBRARY_DIRS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
-list(APPEND gr_audio_libs gnuradio-core ${Boost_LIBRARIES} ${LOG4CXX_LIBRARIES})
+list(APPEND gr_audio_libs gnuradio-core ${Boost_LIBRARIES} ${LOG4CPP_LIBRARIES})
list(APPEND gr_audio_sources gr_audio_registry.cc)
list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/gr-audio.conf)
diff --git a/gr-blocks/tests/CMakeLists.txt b/gr-blocks/tests/CMakeLists.txt
index 8f7ba2f64f..6a4f9d4c54 100644
--- a/gr-blocks/tests/CMakeLists.txt
+++ b/gr-blocks/tests/CMakeLists.txt
@@ -37,8 +37,8 @@ link_directories(
${CPPUNIT_LIBRARY_DIRS}
)
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Build benchmarks and non-registered tests
diff --git a/gr-comedi/src/CMakeLists.txt b/gr-comedi/src/CMakeLists.txt
index 116f561394..0dc0960016 100644
--- a/gr-comedi/src/CMakeLists.txt
+++ b/gr-comedi/src/CMakeLists.txt
@@ -33,8 +33,8 @@ link_directories(
${COMEDI_LIBRARY_DIRS}
)
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Setup library
@@ -49,7 +49,7 @@ list(APPEND comedi_libs
gnuradio-core
${Boost_LIBRARIES}
${COMEDI_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-comedi SHARED ${gr_comedi_sources})
diff --git a/gr-digital/lib/CMakeLists.txt b/gr-digital/lib/CMakeLists.txt
index c7f73f8505..bc0e925dea 100644
--- a/gr-digital/lib/CMakeLists.txt
+++ b/gr-digital/lib/CMakeLists.txt
@@ -26,12 +26,12 @@ include_directories(
${GR_ANALOG_INCLUDE_DIRS}
${GNURADIO_CORE_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
- ${LOG4CXX_INCLUDE_DIRS}
+ ${LOG4CPP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
link_directories(${Boost_LIBRARY_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# generate helper scripts to expand templated files
@@ -159,7 +159,7 @@ ENDIF(MSVC)
list(APPEND digital_libs
gnuradio-core
${Boost_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-digital SHARED ${gr_digital_sources})
diff --git a/gr-fcd/lib/CMakeLists.txt b/gr-fcd/lib/CMakeLists.txt
index 709b69cfdd..8e4afafdb1 100644
--- a/gr-fcd/lib/CMakeLists.txt
+++ b/gr-fcd/lib/CMakeLists.txt
@@ -36,8 +36,8 @@ include_directories(
link_directories(${Boost_LIBRARY_DIRS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Setup library
@@ -82,7 +82,7 @@ add_library(gnuradio-fcd SHARED ${gr_fcd_sources})
if (LINUX)
list(APPEND fcd_libs rt)
endif()
-target_link_libraries(gnuradio-fcd ${fcd_libs} ${LOG4CXX_LIBRARIES})
+target_link_libraries(gnuradio-fcd ${fcd_libs} ${LOG4CPP_LIBRARIES})
GR_LIBRARY_FOO(gnuradio-fcd RUNTIME_COMPONENT "fcd_runtime" DEVEL_COMPONENT "fcd_devel")
diff --git a/gr-filter/lib/CMakeLists.txt b/gr-filter/lib/CMakeLists.txt
index a89bb52dd6..f9937fa18d 100644
--- a/gr-filter/lib/CMakeLists.txt
+++ b/gr-filter/lib/CMakeLists.txt
@@ -97,13 +97,13 @@ include_directories(
${GNURADIO_CORE_INCLUDE_DIRS}
${VOLK_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
- ${LOG4CXX_INCLUDE_DIRS}
+ ${LOG4CPP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
link_directories(
${Boost_LIBRARY_DIRS}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
########################################################################
diff --git a/gr-howto-write-a-block/CMakeLists.txt b/gr-howto-write-a-block/CMakeLists.txt
index d5d04e24d0..1a9f403dd2 100644
--- a/gr-howto-write-a-block/CMakeLists.txt
+++ b/gr-howto-write-a-block/CMakeLists.txt
@@ -105,14 +105,14 @@ include_directories(
${CMAKE_SOURCE_DIR}/include
${GNURADIO_CORE_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
- ${LOG4CXX_INCLUDE_DIRS}
+ ${LOG4CPP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
link_directories(
${GNURADIO_CORE_LIBRARY_DIRS}
${GRUEL_LIBRARY_DIRS}
- ${LOG4CXX_LIBRARY_DIRS}
+ ${LOG4CPP_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
)
diff --git a/gr-howto-write-a-block/cmake/Modules/FindLog4cpp.cmake b/gr-howto-write-a-block/cmake/Modules/FindLog4cpp.cmake
new file mode 100644
index 0000000000..0b7208630f
--- /dev/null
+++ b/gr-howto-write-a-block/cmake/Modules/FindLog4cpp.cmake
@@ -0,0 +1,58 @@
+# - Find Log4cpp
+# Find the native LOG4CPP includes and library
+#
+# LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc.
+# LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP.
+# LOG4CPP_FOUND - True if LOG4CPP found.
+
+
+if (LOG4CPP_INCLUDE_DIR)
+ # Already in cache, be silent
+ set(LOG4CPP_FIND_QUIETLY TRUE)
+endif ()
+
+find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh
+ /opt/local/include
+ /usr/local/include
+ /usr/include
+)
+
+set(LOG4CPP_NAMES log4cpp)
+find_library(LOG4CPP_LIBRARY
+ NAMES ${LOG4CPP_NAMES}
+ PATHS /usr/lib /usr/local/lib /opt/local/lib
+)
+
+message("#####################")
+message("LOG INCLEUDE :${LOG4CPP_INCLUDE_DIR}")
+message("LOG LIBRARY :${LOG4CPP_LIBRARY}")
+
+
+message("#####################")
+
+if (LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY)
+ set(LOG4CPP_FOUND TRUE)
+ set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} )
+else ()
+ set(LOG4CPP_FOUND FALSE)
+ set(LOG4CPP_LIBRARIES )
+endif ()
+
+if (LOG4CPP_FOUND)
+ if (NOT LOG4CPP_FIND_QUIETLY)
+ message(STATUS "Found LOG4CPP: ${LOG4CPP_LIBRARIES}")
+ endif ()
+else ()
+ if (LOG4CPP_FIND_REQUIRED)
+ message(STATUS "Looked for LOG4CPP libraries named ${LOG4CPPS_NAMES}.")
+ message(FATAL_ERROR "Could NOT find LOG4CPP library")
+ endif ()
+endif ()
+
+message("internal libs: ${LOG4CPP_LIBRARIES}")
+
+mark_as_advanced(
+ LOG4CPP_LIBRARY
+ LOG4CPP_LIBRARIES
+ LOG4CPP_INCLUDE_DIR
+ )
diff --git a/gr-howto-write-a-block/cmake/Modules/GrMiscUtils.cmake b/gr-howto-write-a-block/cmake/Modules/GrMiscUtils.cmake
index 685ac3c879..876e71687f 100644
--- a/gr-howto-write-a-block/cmake/Modules/GrMiscUtils.cmake
+++ b/gr-howto-write-a-block/cmake/Modules/GrMiscUtils.cmake
@@ -219,35 +219,35 @@ endfunction(GR_GEN_TARGET_DEPS)
# Can manually set with -DENABLE_GR_LOG=0|1
########################################################################
function(GR_LOGGING)
- find_package(Log4cxx)
+ find_package(Log4cpp)
OPTION(ENABLE_GR_LOG "Use gr_logger" ON)
if(ENABLE_GR_LOG)
# If gr_logger is enabled, make it usable
add_definitions( -DENABLE_GR_LOG )
- # also test LOG4CXX; if we have it, use this version of the logger
+ # also test LOG4CPP; if we have it, use this version of the logger
# otherwise, default to the stdout/stderr model.
- if(LOG4CXX_FOUND)
- SET(HAVE_LOG4CXX True)
- add_definitions( -DHAVE_LOG4CXX )
- else(LOG4CXX_FOUND)
- SET(HAVE_LOG4CXX False)
- SET(LOG4CXX_INCLUDE_DIRS "")
- SET(LOG4CXX_LIBRARY_DIRS "")
- SET(LOG4CXX_LIBRARIES "")
- endif(LOG4CXX_FOUND)
+ if(LOG4CPP_FOUND)
+ SET(HAVE_LOG4CPP True)
+ add_definitions( -DHAVE_LOG4CPP )
+ else(LOG4CPP_FOUND)
+ SET(HAVE_LOG4CPP False)
+ SET(LOG4CPP_INCLUDE_DIRS "")
+ SET(LOG4CPP_LIBRARY_DIRS "")
+ SET(LOG4CPP_LIBRARIES "")
+ endif(LOG4CPP_FOUND)
SET(ENABLE_GR_LOG ${ENABLE_GR_LOG} CACHE INTERNAL "" FORCE)
else(ENABLE_GR_LOG)
- SET(HAVE_LOG4CXX False)
- SET(LOG4CXX_INCLUDE_DIRS)
- SET(LOG4CXX_LIBRARY_DIRS)
- SET(LOG4CXX_LIBRARIES)
+ SET(HAVE_LOG4CPP False)
+ SET(LOG4CPP_INCLUDE_DIRS)
+ SET(LOG4CPP_LIBRARY_DIRS)
+ SET(LOG4CPP_LIBRARIES)
endif(ENABLE_GR_LOG)
message(STATUS "ENABLE_GR_LOG set to ${ENABLE_GR_LOG}.")
- message(STATUS "HAVE_LOG4CXX set to ${HAVE_LOG4CXX}.")
+ message(STATUS "HAVE_LOG4CPP set to ${HAVE_LOG4CPP}.")
endfunction(GR_LOGGING)
diff --git a/gr-howto-write-a-block/lib/CMakeLists.txt b/gr-howto-write-a-block/lib/CMakeLists.txt
index a55bb1fa4a..dee02f08c7 100644
--- a/gr-howto-write-a-block/lib/CMakeLists.txt
+++ b/gr-howto-write-a-block/lib/CMakeLists.txt
@@ -27,7 +27,7 @@ target_link_libraries(gnuradio-howto
${Boost_LIBRARIES}
${GRUEL_LIBRARIES}
${GNURADIO_CORE_LIBRARIES}
- ${LOG4CXX_LIBRARIES})
+ ${LOG4CPP_LIBRARIES})
set_target_properties(gnuradio-howto PROPERTIES DEFINE_SYMBOL "gnuradio_howto_EXPORTS")
########################################################################
diff --git a/gr-noaa/lib/CMakeLists.txt b/gr-noaa/lib/CMakeLists.txt
index bded04b779..4830fe4f95 100644
--- a/gr-noaa/lib/CMakeLists.txt
+++ b/gr-noaa/lib/CMakeLists.txt
@@ -29,8 +29,8 @@ include_directories(
link_directories(${Boost_LIBRARY_DIRS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Setup library
@@ -58,7 +58,7 @@ endif(MSVC)
list(APPEND noaa_libs
gnuradio-core
${Boost_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-noaa SHARED ${gr_noaa_sources})
diff --git a/gr-pager/lib/CMakeLists.txt b/gr-pager/lib/CMakeLists.txt
index 711712375e..68c60ed16d 100644
--- a/gr-pager/lib/CMakeLists.txt
+++ b/gr-pager/lib/CMakeLists.txt
@@ -29,8 +29,8 @@ include_directories(
link_directories(${Boost_LIBRARY_DIRS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Setup library
@@ -63,7 +63,7 @@ endif(MSVC)
list(APPEND pager_libs
gnuradio-core
${Boost_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-pager SHARED ${gr_pager_sources})
diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt
index 2203bf409b..955db49e72 100644
--- a/gr-qtgui/lib/CMakeLists.txt
+++ b/gr-qtgui/lib/CMakeLists.txt
@@ -81,14 +81,14 @@ include_directories(
${GRUEL_INCLUDE_DIRS}
${QWT_INCLUDE_DIRS}
${QT_INCLUDE_DIRS}
- ${LOG4CXX_INCLUDE_DIRS}
+ ${LOG4CPP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
)
link_directories(
${QWT_LIBRARY_DIRS}
- ${LOG4CXX_LIBRARY_DIRS}
+ ${LOG4CPP_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
)
@@ -102,7 +102,7 @@ list(APPEND qtgui_libs
${QWT_LIBRARIES}
${QT_LIBRARIES}
${PYTHON_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_definitions(-DQWT_DLL) #setup QWT library linkage
diff --git a/gr-shd/lib/CMakeLists.txt b/gr-shd/lib/CMakeLists.txt
index 9f00c33488..bb98d8ce8b 100644
--- a/gr-shd/lib/CMakeLists.txt
+++ b/gr-shd/lib/CMakeLists.txt
@@ -31,8 +31,8 @@ include_directories(
link_directories(${SHD_LIBRARY_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Setup library
@@ -60,7 +60,7 @@ list(APPEND shd_libs
gnuradio-core
${Boost_LIBRARIES}
${SHD_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-shd SHARED ${gr_shd_sources})
diff --git a/gr-trellis/src/lib/CMakeLists.txt b/gr-trellis/src/lib/CMakeLists.txt
index 26ff108c8a..074a9741ed 100644
--- a/gr-trellis/src/lib/CMakeLists.txt
+++ b/gr-trellis/src/lib/CMakeLists.txt
@@ -32,8 +32,8 @@ include_directories(
link_directories(${Boost_LIBRARY_DIRS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# generate the python helper script which calls into the build utils
@@ -167,7 +167,7 @@ endif(MSVC)
list(APPEND trellis_libs
gnuradio-core
${Boost_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-trellis SHARED ${gr_trellis_sources})
diff --git a/gr-uhd/lib/CMakeLists.txt b/gr-uhd/lib/CMakeLists.txt
index f23885aca5..15ba1e7f1c 100644
--- a/gr-uhd/lib/CMakeLists.txt
+++ b/gr-uhd/lib/CMakeLists.txt
@@ -34,8 +34,8 @@ link_directories(
${Boost_LIBRARY_DIRS}
)
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Setup library
@@ -64,7 +64,7 @@ list(APPEND uhd_libs
gnuradio-core
${Boost_LIBRARIES}
${UHD_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-uhd SHARED ${gr_uhd_sources})
diff --git a/gr-video-sdl/src/CMakeLists.txt b/gr-video-sdl/src/CMakeLists.txt
index 1e37505acc..8053182239 100644
--- a/gr-video-sdl/src/CMakeLists.txt
+++ b/gr-video-sdl/src/CMakeLists.txt
@@ -25,7 +25,7 @@ include_directories(
${GNURADIO_CORE_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
- ${LOG4CXX_INCLUDE_DIRS}
+ ${LOG4CPP_INCLUDE_DIRS}
${SDL_INCLUDE_DIR}
)
@@ -57,7 +57,7 @@ list(APPEND video_sdl_libs
gnuradio-core
${Boost_LIBRARIES}
${SDL_LIBRARY}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-video-sdl SHARED ${gr_video_sdl_sources})
diff --git a/gr-vocoder/lib/CMakeLists.txt b/gr-vocoder/lib/CMakeLists.txt
index 930ec96eca..e00fd09b8b 100644
--- a/gr-vocoder/lib/CMakeLists.txt
+++ b/gr-vocoder/lib/CMakeLists.txt
@@ -29,8 +29,8 @@ include_directories(
link_directories(${Boost_LIBRARY_DIRS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Setup library
@@ -78,7 +78,7 @@ GR_INCLUDE_SUBDIRECTORY(gsm)
list(APPEND vocoder_libs
gnuradio-core
${Boost_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-vocoder SHARED ${gr_vocoder_sources})
diff --git a/gr-wavelet/lib/CMakeLists.txt b/gr-wavelet/lib/CMakeLists.txt
index 66c31d7f6b..2b5ce093d4 100644
--- a/gr-wavelet/lib/CMakeLists.txt
+++ b/gr-wavelet/lib/CMakeLists.txt
@@ -35,8 +35,8 @@ link_directories(${Boost_LIBRARY_DIRS})
link_directories(${GSL_LIBRARY_DIRS})
add_definitions(${GSL_DEFINITIONS})
-include_directories(${LOG4CXX_INCLUDE_DIRS})
-link_directories(${LOG4CXX_LIBRARY_DIRS})
+include_directories(${LOG4CPP_INCLUDE_DIRS})
+link_directories(${LOG4CPP_LIBRARY_DIRS})
########################################################################
# Setup library
@@ -66,7 +66,7 @@ list(APPEND wavelet_libs
${Boost_LIBRARIES}
${WAVELET_LIBRARIES}
${GSL_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
+ ${LOG4CPP_LIBRARIES}
)
add_library(gnuradio-wavelet SHARED ${gr_wavelet_sources})