summaryrefslogtreecommitdiff
path: root/gr-howto-write-a-block
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-03-13 18:02:42 -0400
committerTom Rondeau <trondeau@vt.edu>2013-03-13 18:02:42 -0400
commit1c9d67fc220737873728310bd679d9e9cfab470a (patch)
tree5fbf8c157da3e938d9b90ebe720f3efbcef39215 /gr-howto-write-a-block
parent1d8d1f111c41862d877686a89344a4a74f146cee (diff)
parent1bacc04f7a8f2f9c868a9934624683c7cefb2300 (diff)
Merge branch 'master' into next
Conflicts: gr-audio/lib/CMakeLists.txt gr-blocks/include/blocks/CMakeLists.txt gr-blocks/include/blocks/socket_pdu.h gr-blocks/lib/CMakeLists.txt gr-blocks/swig/blocks_swig.i gr-comedi/src/CMakeLists.txt gr-howto-write-a-block/lib/CMakeLists.txt gr-noaa/lib/CMakeLists.txt gr-qtgui/lib/CMakeLists.txt gr-uhd/lib/CMakeLists.txt gr-vocoder/lib/CMakeLists.txt gr-wavelet/lib/CMakeLists.txt
Diffstat (limited to 'gr-howto-write-a-block')
-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/FindLog4cxx.cmake28
-rw-r--r--gr-howto-write-a-block/cmake/Modules/GrMiscUtils.cmake32
-rw-r--r--gr-howto-write-a-block/lib/CMakeLists.txt13
5 files changed, 82 insertions, 53 deletions
diff --git a/gr-howto-write-a-block/CMakeLists.txt b/gr-howto-write-a-block/CMakeLists.txt
index cd7e447f6f..760a7b62ea 100644
--- a/gr-howto-write-a-block/CMakeLists.txt
+++ b/gr-howto-write-a-block/CMakeLists.txt
@@ -110,7 +110,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/include
${GNURADIO_CORE_INCLUDE_DIRS}
${GRUEL_INCLUDE_DIRS}
- ${LOG4CXX_INCLUDE_DIRS}
+ ${LOG4CPP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${CPPUNIT_INCLUDE_DIRS}
)
@@ -118,7 +118,7 @@ include_directories(
link_directories(
${GNURADIO_CORE_LIBRARY_DIRS}
${GRUEL_LIBRARY_DIRS}
- ${LOG4CXX_LIBRARY_DIRS}
+ ${LOG4CPP_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
${CPPUNIT_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/FindLog4cxx.cmake b/gr-howto-write-a-block/cmake/Modules/FindLog4cxx.cmake
deleted file mode 100644
index b1e4f6f1f7..0000000000
--- a/gr-howto-write-a-block/cmake/Modules/FindLog4cxx.cmake
+++ /dev/null
@@ -1,28 +0,0 @@
-# CMake module to find LOG4CXX library
-
-INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(PC_LOG4CXX liblog4cxx)
-
-FIND_PATH(
- LOG4CXX_INCLUDE_DIRS
- NAMES log4cxx/log4cxx.h
- HINTS $ENV{LOG4CXX_DIR}/include
- ${PC_LOG4CXX_INCLUDE_DIRS}
- PATHS /usr/local/include
- /usr/include
-)
-
-FIND_LIBRARY(
- LOG4CXX_LIBRARIES
- NAMES log4cxx
- HINTS $ENV{LOG4CXX_DIR}/lib
- ${PC_LOG4CXX_LIBRARIES}
- PATHS /usr/local/lib
- /usr/local/lib64
- /usr/lib
- /usr/lib64
-)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LOG4CXX DEFAULT_MSG LOG4CXX_LIBRARIES LOG4CXX_INCLUDE_DIRS)
-MARK_AS_ADVANCED(LOG4CXX_LIBRARIES LOG4CXX_INCLUDE_DIRS)
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 2c995b868b..826138bf91 100644
--- a/gr-howto-write-a-block/lib/CMakeLists.txt
+++ b/gr-howto-write-a-block/lib/CMakeLists.txt
@@ -25,13 +25,12 @@ include(GrPlatform) #define LIB_SUFFIX
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})
-add_library(gnuradio-howto SHARED square_ff_impl.cc square2_ff_impl.cc)
-target_link_libraries(gnuradio-howto
- ${Boost_LIBRARIES}
- ${GRUEL_LIBRARIES}
- ${GNURADIO_CORE_LIBRARIES}
- ${LOG4CXX_LIBRARIES}
-)
+add_library(gnuradio-howto SHARED howto_square_ff.cc howto_square2_ff.cc)
+target_link_libraries(gnuradio-howto
+ ${Boost_LIBRARIES}
+ ${GRUEL_LIBRARIES}
+ ${GNURADIO_CORE_LIBRARIES}
+ ${LOG4CPP_LIBRARIES})
set_target_properties(gnuradio-howto PROPERTIES DEFINE_SYMBOL "gnuradio_howto_EXPORTS")