rm5248 commented on a change in pull request #63:
URL: https://github.com/apache/logging-log4cxx/pull/63#discussion_r615247114
##########
File path: 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}")
Review comment:
My understanding from Steven's email was that if you have a situation
like the following:
```
/MyProject
/MyProject/CMakeLists.txt
/MyProject/log4cxx
/MyProject/log4cxx/CMakeLists.txt
```
where log4cxx is some kind of submodule to MyProject that you add with some
CMake directive such as `add_directory`, then CMAKE_SOURCE_DIR will be set to
/MyProject, which is an issue for how log4cxx finds certain files. For
example, the ABI dump file(relative to the log4cxx root) is
src/main/abi-symbols/abi.dump. In this case, I think it would try to look in
MyProject/src/main/abi-symbols/abi.dump, instead of the intended location of
MyProject/log4cxx/src/main/abi-symbols/abi.dump.
Because of that, I don't believe that it needs to be configurable. In the
normal case of building log4cxx by itself, CMAKE_SOURCE_DIR will equal
CMAKE_CURRENT_SOURCE_DIR at the top-level CMakeLists file.
I'm not positive about that though, so Steven's insight would be useful.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]