summaryrefslogtreecommitdiff
path: root/cmake
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 /cmake
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 'cmake')
-rw-r--r--cmake/Modules/FindLog4cpp.cmake53
-rw-r--r--cmake/Modules/FindLog4cxx.cmake28
-rw-r--r--cmake/Modules/GrMiscUtils.cmake33
3 files changed, 70 insertions, 44 deletions
diff --git a/cmake/Modules/FindLog4cpp.cmake b/cmake/Modules/FindLog4cpp.cmake
new file mode 100644
index 0000000000..fc314c61a5
--- /dev/null
+++ b/cmake/Modules/FindLog4cpp.cmake
@@ -0,0 +1,53 @@
+# - 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
+)
+
+
+if (LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY)
+ set(LOG4CPP_FOUND TRUE)
+ set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE)
+ set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE)
+else ()
+ set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE)
+ set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE)
+ set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE)
+ set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE)
+ set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
+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 ()
+
+mark_as_advanced(
+ LOG4CPP_LIBRARIES
+ LOG4CPP_INCLUDE_DIRS
+)
diff --git a/cmake/Modules/FindLog4cxx.cmake b/cmake/Modules/FindLog4cxx.cmake
deleted file mode 100644
index b1e4f6f1f7..0000000000
--- a/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/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake
index c7fe77bc88..69ff1f5ddc 100644
--- a/cmake/Modules/GrMiscUtils.cmake
+++ b/cmake/Modules/GrMiscUtils.cmake
@@ -218,36 +218,37 @@ 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 CACHE INTERNAL "" FORCE)
- add_definitions( -DHAVE_LOG4CXX )
- else(LOG4CXX_FOUND)
- SET(HAVE_LOG4CXX False CACHE INTERNAL "" FORCE)
- SET(LOG4CXX_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
- SET(LOG4CXX_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE)
- SET(LOG4CXX_LIBRARIES "" CACHE INTERNAL "" FORCE)
- endif(LOG4CXX_FOUND)
+ if(LOG4CPP_FOUND)
+ SET(HAVE_LOG4CPP True CACHE INTERNAL "" FORCE)
+ add_definitions( -DHAVE_LOG4CPP )
+ else(not LOG4CPP_FOUND)
+ SET(HAVE_LOG4CPP False CACHE INTERNAL "" FORCE)
+ SET(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
+ SET(LOG4CPP_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE)
+ SET(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE)
+ endif(LOG4CPP_FOUND)
SET(ENABLE_GR_LOG ${ENABLE_GR_LOG} CACHE INTERNAL "" FORCE)
else(ENABLE_GR_LOG)
- SET(HAVE_LOG4CXX False CACHE INTERNAL "" FORCE)
- SET(LOG4CXX_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
- SET(LOG4CXX_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE)
- SET(LOG4CXX_LIBRARIES "" CACHE INTERNAL "" FORCE)
+ SET(HAVE_LOG4CPP False CACHE INTERNAL "" FORCE)
+ SET(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
+ SET(LOG4CPP_LIBRARY_DIRS "" CACHE INTERNAL "" FORCE)
+ SET(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE)
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}.")
+ message(STATUS "LOG4CPP_LIBRARIES set to ${LOG4CPP_LIBRARIES}.")
endfunction(GR_LOGGING)