You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rm...@apache.org on 2021/04/18 16:18:04 UTC
[logging-log4cxx] branch master updated: Use new LOG4CXX_SOURCE_DIR
in the event that this is not the top-level cmake file (#63)
This is an automated email from the ASF dual-hosted git repository.
rmiddleton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
The following commit(s) were added to refs/heads/master by this push:
new b91748b Use new LOG4CXX_SOURCE_DIR in the event that this is not the top-level cmake file (#63)
b91748b is described below
commit b91748b6d7e841b6942bc15de7c09c411d77d206
Author: Robert Middleton <rm...@users.noreply.github.com>
AuthorDate: Sun Apr 18 12:16:31 2021 -0400
Use new LOG4CXX_SOURCE_DIR in the event that this is not the top-level cmake file (#63)
---
CMakeLists.txt | 5 +++++
src/main/cpp/CMakeLists.txt | 2 +-
src/main/include/CMakeLists.txt | 4 ++--
src/site/doxy/Doxyfile.in | 14 +++++++-------
4 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6663db5..ed6d702 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,11 @@ include(src/cmake/projectVersionDetails.cmake)
project(log4cxx VERSION ${log4cxx_VER} LANGUAGES CXX)
include(CTest)
+# 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
+# in relation to the log4cxx source root, set a variable that contains the log4cxx root.
+set(LOG4CXX_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+
# define the SO Version of the library. Version of the log4cxx project is subtly different than the version of the library
# (at least in the past it was project vesion: 0.a.b.c and the library so vesion a.b.c.0
set(LIBLOG4CXX_LIB_VERSION ${log4cxx_VERSION_MINOR}.${log4cxx_VERSION_PATCH}.${log4cxx_VERSION_TWEAK})
diff --git a/src/main/cpp/CMakeLists.txt b/src/main/cpp/CMakeLists.txt
index c54a71b..ff5375d 100644
--- a/src/main/cpp/CMakeLists.txt
+++ b/src/main/cpp/CMakeLists.txt
@@ -197,7 +197,7 @@ if(LOG4CXX_ABI_CHECK)
COMMENT "Dumping ABI symbols")
add_custom_target(compare-abi ALL
- COMMAND perl ${abi-compliance-script} -l log4cxx -old ${CMAKE_SOURCE_DIR}/src/main/abi-symbols/abi.dump -new new-abi.dump
+ COMMAND perl ${abi-compliance-script} -l log4cxx -old ${LOG4CXX_SOURCE_DIR}/src/main/abi-symbols/abi.dump -new new-abi.dump
DEPENDS dump-abi
COMMENT "Comparing ABI symbols")
endif(LOG4CXX_ABI_CHECK)
diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt
index a596d4b..8183660 100644
--- a/src/main/include/CMakeLists.txt
+++ b/src/main/include/CMakeLists.txt
@@ -101,7 +101,7 @@ foreach(varName HAS_STD_LOCALE HAS_ODBC HAS_MBSRTOWCS HAS_WCSTOMBS HAS_FWIDE
endforeach()
# Check for standard headers that we need, fall back to boost if they're not found
-include(${CMAKE_SOURCE_DIR}/src/cmake/boost-fallback/boost-fallback.cmake)
+include(${LOG4CXX_SOURCE_DIR}/src/cmake/boost-fallback/boost-fallback.cmake)
set(NAMESPACE_ALIAS log4cxx)
if( ${STD_THREAD_FOUND} )
@@ -153,7 +153,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/log4cxx.h.in
${CMAKE_CURRENT_BINARY_DIR}/log4cxx/log4cxx.h
@ONLY
)
-configure_file(${CMAKE_SOURCE_DIR}/src/cmake/boost-fallback/boost-std-configuration.h.cmake
+configure_file(${LOG4CXX_SOURCE_DIR}/src/cmake/boost-fallback/boost-std-configuration.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/log4cxx/boost-std-configuration.h
)
diff --git a/src/site/doxy/Doxyfile.in b/src/site/doxy/Doxyfile.in
index 989a935..fa53335 100644
--- a/src/site/doxy/Doxyfile.in
+++ b/src/site/doxy/Doxyfile.in
@@ -718,7 +718,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
-LAYOUT_FILE = ${CMAKE_SOURCE_DIR}/src/site/doxy/DoxygenLayout.xml
+LAYOUT_FILE = ${LOG4CXX_SOURCE_DIR}/src/site/doxy/DoxygenLayout.xml
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
@@ -805,8 +805,8 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = ${CMAKE_SOURCE_DIR}/src/main/include \
- ${CMAKE_SOURCE_DIR}/src/site/markdown \
+INPUT = ${LOG4CXX_SOURCE_DIR}/src/main/include \
+ ${LOG4CXX_SOURCE_DIR}/src/site/markdown \
${CMAKE_BINARY_DIR}/src/site/markdown
# This tag can be used to specify the character encoding of the source files
@@ -943,7 +943,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH = ${CMAKE_SOURCE_DIR}/src/site/images
+IMAGE_PATH = ${LOG4CXX_SOURCE_DIR}/src/site/images
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -999,7 +999,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
-USE_MDFILE_AS_MAINPAGE = ${CMAKE_SOURCE_DIR}/src/site/markdown/index.md
+USE_MDFILE_AS_MAINPAGE = ${LOG4CXX_SOURCE_DIR}/src/site/markdown/index.md
#---------------------------------------------------------------------------
# Configuration options related to source browsing
@@ -1184,7 +1184,7 @@ HTML_HEADER =
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_FOOTER = ${CMAKE_SOURCE_DIR}/src/site/doxy/footer.html
+HTML_FOOTER = ${LOG4CXX_SOURCE_DIR}/src/site/doxy/footer.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
@@ -1209,7 +1209,7 @@ HTML_STYLESHEET =
# list). For an example see the documentation.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_EXTRA_STYLESHEET = ${CMAKE_SOURCE_DIR}/src/site/doxy/customdoxygen.css
+HTML_EXTRA_STYLESHEET = ${LOG4CXX_SOURCE_DIR}/src/site/doxy/customdoxygen.css
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note