Issue
I am trying build Apache log4cxx 0.13.0 for mingw in windows platform
- I builder and installed apr and apr-util using MSYS2
- I downloaded log4cxx source from apache href="https://www.apache.org/dyn/closer.cgi/logging/log4cxx/0.13.0/apache-log4cxx-0.13.0.zip" rel="nofollow noreferrer">repository
but when configuring with CMake it shows this error:
CMake Error at src/cmake/FindAPR.cmake:17 (message):
apr-1-config --includedir failed with result %1 is not a valid Win32
application
Call Stack (most recent call first):
src/cmake/FindAPR.cmake:35 (_apr_invoke)
CMakeLists.txt:44 (find_package)
Solution
apu-1-config
of the apr-util package is actually a *nix shell script.
CMake is trying to run apu-1-config
directly but of course Windows has no clue how to execute it.
The solution is execute sh.exe
with apu-1-config
(and its arguments) as argument(s).
The following patch fixes this issue for me:
patch -ulbf src/cmake/FindAPR.cmake << EOF
@@ -10,3 +10,3 @@
execute_process(
- COMMAND \${APR_CONFIG_EXECUTABLE} \${ARGN}
+ COMMAND sh \${APR_CONFIG_EXECUTABLE} \${ARGN}
OUTPUT_VARIABLE _apr_output
EOF
patch -ulbf src/cmake/FindAPR-Util.cmake << EOF
@@ -11,3 +11,3 @@
execute_process(
- COMMAND \${APR_UTIL_CONFIG_EXECUTABLE} \${ARGN}
+ COMMAND sh \${APR_UTIL_CONFIG_EXECUTABLE} \${ARGN}
OUTPUT_VARIABLE _apr_output
EOF
I have updated my winlibs build script (which is mostly MSYS2 shell commands) so it now builds the most recent Apache Log4cxx 0.13.0. Besides this issue I had to add a few more workarounds though...
Answered By - Brecht Sanders Answer Checked By - Senaida (WPSolving Volunteer)