diff --git a/CMakeLists.txt b/CMakeLists.txt index ce0da6bc8..1f397c5fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ include(CTest) # Allow option based library naming. # This is the default name. -set(LOG4CXX_LIB_NAME log4cxx) +set(LOG4CXX_LIB_NAME "log4cxx${LOG4CXX_LIBRARY_SUFFIX}") # If you are including log4cxx from a higher-level CMake file(perhaps as a submodule?) # CMAKE_SOURCE_DIR will refer to the first CMakeLists.txt. Since we need some files @@ -74,7 +74,6 @@ endif() option(LOG4CXX_QT_SUPPORT "Qt support/integration" OFF) if(LOG4CXX_QT_SUPPORT) find_package(Qt5 COMPONENTS Core REQUIRED) - set(LOG4CXX_LIB_NAME log4cxx-qt) endif(LOG4CXX_QT_SUPPORT) option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) @@ -136,12 +135,12 @@ if(WIN32) endif() include(GNUInstallDirs) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src/main/include/log4cxx - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LOG4CXX_LIBRARY_SUFFIX}" FILES_MATCHING PATTERN "*.h" PATTERN "Private" EXCLUDE ) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/main/include/log4cxx - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LOG4CXX_LIBRARY_SUFFIX}" FILES_MATCHING PATTERN "*.h" PATTERN "Private" EXCLUDE ) @@ -150,7 +149,6 @@ install(TARGETS ${LOG4CXX_LIB_NAME} EXPORT log4cxxTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) IF(WIN32 AND BUILD_SHARED_LIBS AND LOG4CXX_INSTALL_PDB) @@ -164,14 +162,15 @@ if(UNIX) # Support for pkg-config in consuming projects set(prefix "${CMAKE_INSTALL_PREFIX}") set(exec_prefix "${CMAKE_INSTALL_PREFIX}") + set(libsuffix "${LOG4CXX_LIBRARY_SUFFIX}") set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") - set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}/${LOG4CXX_LIBRARY_SUFFIX}") set(VERSION "${log4cxx_VERSION_MAJOR}.${log4cxx_VERSION_MINOR}.${log4cxx_VERSION_PATCH}") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/liblog4cxx.pc.in" - "${CMAKE_CURRENT_BINARY_DIR}/liblog4cxx.pc" + "${CMAKE_CURRENT_BINARY_DIR}/lib${LOG4CXX_LIB_NAME}.pc" ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblog4cxx.pc" + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${LOG4CXX_LIB_NAME}.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif(UNIX) @@ -180,7 +179,7 @@ endif(UNIX) # target_link_libraries( myApplication PRIVATE log4cxx) install(EXPORT log4cxxTargets FILE log4cxxConfig.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/log4cxx + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LOG4CXX_LIB_NAME} ) # Support for find_package(log4cxx 0.11) in consuming CMake projects include(CMakePackageConfigHelpers) @@ -189,7 +188,7 @@ write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/log4cxxConfigVersi COMPATIBILITY SameMinorVersion ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/log4cxxConfigVersion.cmake" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/log4cxx + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LOG4CXX_LIB_NAME} ) # diff --git a/liblog4cxx.pc.in b/liblog4cxx.pc.in index e29239ed2..e282af83c 100644 --- a/liblog4cxx.pc.in +++ b/liblog4cxx.pc.in @@ -17,10 +17,10 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: log4cxx +Name: log4cxx@libsuffix@ Description: log4cxx C++ logging framework Version: @VERSION@ -Libs: -L${libdir} -llog4cxx +Libs: -L${libdir} -llog4cxx@libsuffix@ Cflags: -I${includedir} Requires.private: apr-1 apr-util-1 diff --git a/src/site/doxy/Doxyfile.in b/src/site/doxy/Doxyfile.in index 41f1ec1d1..291acb43a 100644 --- a/src/site/doxy/Doxyfile.in +++ b/src/site/doxy/Doxyfile.in @@ -2347,6 +2347,7 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = LOG4CXX_WCHAR_T_API \ LOG4CXX_UNICHAR_API \ + LOG4CXX_CFSTRING_API \ LOG4CXX_QSTRING_API # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this diff --git a/src/site/markdown/development/build-cmake.md b/src/site/markdown/development/build-cmake.md index dcad02cce..857a3f0e0 100644 --- a/src/site/markdown/development/build-cmake.md +++ b/src/site/markdown/development/build-cmake.md @@ -72,6 +72,7 @@ $ cmake --build buildtrees/Log4cxx --target install --config Release | -DAPR_STATIC=yes | Link to the APR static library. By default, the Log4cxx shared library is linked to the APR shared library. If BUILD_SHARED_LIBS=off, the static APR library is always used. | |-DLOG4CXX_TEST_PROGRAM_PATH=path| An extra path to prepend to the PATH for test programs. Log4cxx requires zip, sed, and grep on the PATH in order for the tests to work properly. | | -DPREFER_BOOST=on | Prefer the Boost version of dependent libraries over standard library | +|-DLOG4CXX_LIBRARY_SUFFIX=qt| Change the Log4cxx library name. Allows side by side installation when using non-standard options (a different ABI). | ## A note on C++ version and Boost