summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-03-13 15:35:51 -0400
committerTom Rondeau <trondeau@vt.edu>2013-03-13 15:35:51 -0400
commit890f2882d2210b1d4e64f0bbffc42ccc716cfd97 (patch)
tree3f85469b8ce65d0bc691e105257ccad32d603535 /cmake
parent4e81a23e6c950e38fe920fbea0dffe551ec35a2f (diff)
parentafae86a4354c2c82030def9c90b8fe74dcbf4f9d (diff)
Merge remote-tracking branch 'gr3.7_log4cpp'
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindLog4cpp.cmake58
-rw-r--r--cmake/Modules/FindLog4cxx.cmake28
-rw-r--r--cmake/Modules/GrMiscUtils.cmake35
3 files changed, 77 insertions, 44 deletions
diff --git a/cmake/Modules/FindLog4cpp.cmake b/cmake/Modules/FindLog4cpp.cmake
new file mode 100644
index 0000000000..0b7208630f
--- /dev/null
+++ b/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/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..65b0b5a8c8 100644
--- a/cmake/Modules/GrMiscUtils.cmake
+++ b/cmake/Modules/GrMiscUtils.cmake
@@ -218,36 +218,39 @@ endfunction(GR_GEN_TARGET_DEPS)
# Can manually set with -DENABLE_GR_LOG=0|1
########################################################################
function(GR_LOGGING)
- find_package(Log4cxx)
+ find_package(Log4cpp)
+
+ message(STATUS "LOG4CPP_LIBRARIES First set to ${LOG4CPP_LIBRARIES}.")
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)