Merge pull request #16 from rm5248/rm-cmake-fixes
Add a small configuration output to help the user see how log4cxx is configured. Document how to disable tests.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2809445..51a9c5a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,3 +61,44 @@
NAMESPACE log4cxx::
DESTINATION share/cmake/log4cxx
)
+
+#
+# Get the varaibles from the subdirectories
+#
+get_directory_property( HAS_LIBESMTP DIRECTORY src/main/include DEFINITION HAS_LIBESMTP )
+get_directory_property( HAS_ODBC DIRECTORY src/main/include DEFINITION HAS_ODBC )
+get_directory_property( HAS_SYSLOG DIRECTORY src/main/include DEFINITION HAS_SYSLOG )
+
+foreach(varName HAS_STD_LOCALE HAS_ODBC HAS_MBSRTOWCS HAS_WCSTOMBS HAS_FWIDE HAS_LIBESMTP HAS_SYSLOG)
+ if(${varName} EQUAL 0)
+ set(${varName} "OFF" )
+ elseif(${varName} EQUAL 1)
+ set(${varName} "ON" )
+ else()
+ set(${varName} "UNKNOWN" )
+ endif()
+endforeach()
+
+#
+# Output configuration information
+# Similar to APR CMake configuration
+#
+message(STATUS "")
+message(STATUS "")
+message(STATUS "log4cxx configuration summary:")
+message(STATUS "")
+
+message(STATUS " Build type ...................... : ${CMAKE_BUILD_TYPE}")
+message(STATUS " Build tests ..................... : ${BUILD_TESTING}")
+message(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
+message(STATUS " C++ compiler .................... : ${CMAKE_CXX_COMPILER}")
+message(STATUS " log4cxx char API ................ : ${LOG4CXX_CHAR}")
+message(STATUS " log4cxx wchar API ............... : ${LOG4CXX_WCHAR_T}")
+message(STATUS " log4cxx unichar API ............. : ${LOG4CXX_UNICHAR}")
+if(APPLE)
+message(STATUS " log4cxx cfstring API ............ : ${LOG4CXX_CFSTRING}")
+endif()
+message(STATUS " logchar type .................... : ${LOG4CXX_CHAR}")
+message(STATUS " Using libESMTP .................. : ${HAS_LIBESMTP}")
+message(STATUS " ODBC library .................... : ${HAS_ODBC}")
+message(STATUS " syslog .......................... : ${HAS_SYSLOG}")
diff --git a/src/site/apt/building/cmake.apt b/src/site/apt/building/cmake.apt
index 3585ea8..250324b 100644
--- a/src/site/apt/building/cmake.apt
+++ b/src/site/apt/building/cmake.apt
@@ -46,6 +46,8 @@
*------------------------+---------------------------------------------------------------------------------------------+
| -DLOG4CXX_CFSTRING=yes | Enable CFString API methods, requires Mac OS/X CoreFoundation, choice of yes, no (default). |
*------------------------+---------------------------------------------------------------------------------------------+
+| -DBUILD_TESTING=off | Disable tests. Tests are enabled by default |
+*------------------------+---------------------------------------------------------------------------------------------+
Building and testing log4cxx on a Microsoft Windows with APR, Expat and APR-Util built from source
extracted into apr-1.7.0, libexpat(from github) and apr-util-1.6.1 in %HOMEPATH%\Libraries.