Skip to content

Commit

Permalink
Merge pull request #16 from rm5248/rm-cmake-fixes
Browse files Browse the repository at this point in the history
Add a small configuration output to help the user see how log4cxx is configured. Document how to disable tests.
  • Loading branch information
ams-tschoening committed Feb 13, 2020
2 parents 8880c68 + 8eca44f commit 6105320
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
41 changes: 41 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,44 @@ install(EXPORT log4cxxTargets
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}")
2 changes: 2 additions & 0 deletions src/site/apt/building/cmake.apt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ $ sudo make install
| -DLOG4CXX_UNICHAR=yes | Enable UniChar API methods, choice of yes, no (default). |
*------------------------+---------------------------------------------------------------------------------------------+
| -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
Expand Down

0 comments on commit 6105320

Please sign in to comment.