stephen-webb commented on a change in pull request #23:
URL: https://github.com/apache/logging-log4cxx/pull/23#discussion_r419184713
##########
File path: src/cmake/FindAPR-Util.cmake
##########
@@ -34,7 +34,14 @@ find_program(APR_UTIL_CONFIG_EXECUTABLE
mark_as_advanced(APR_UTIL_CONFIG_EXECUTABLE)
if(EXISTS ${APR_UTIL_CONFIG_EXECUTABLE})
_apu_invoke(APR_UTIL_INCLUDE_DIR --includedir)
- _apu_invoke(APR_UTIL_LIBRARIES --link-ld)
+ if (APU_STATIC OR NOT BUILD_SHARED_LIBS)
+ _apr_invoke(_apr_util_link_args --link-ld)
+ string(REGEX MATCH "-L([^ ]*)" _apr_util_L_flag ${_apr_util_link_args})
Review comment:
The path provided by apu-1-config is needed so cmake "find_library"
function can locate libaprutil-1.a on Linux systems which support multiple
binary interfaces and put archives in a sub-directory of /lib and /usr/lib
(e.g. arm-linux-gnueabihf). The captured path is provided as a hint to
find_library. CMake can also be told in which sub-directory to look in by
setting CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.
If the captured path is empty, no hint will be provided to find_library. If
cmake does not find the library, the "find_package_handle_standard_args"
function will report that error.
The regex does not try to match "-L foo/bar" as that is not the form
produced by apu-1-config.
I will change the regex to "-L[^ ]+" to improve clarity. The perl '\s'
escape sequence is not recognised by cmake.
----------------------------------------------------------------
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]