From: Руслан Ижбулатов Date: Thu, 6 Mar 2014 23:17:13 +0000 (+0000) Subject: Make documentation generating MSYS/MSYS2-compatible X-Git-Tag: dbus-1.9.0~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d274bd42fe69272f55fabad5bc3da13d879a8d8d;p=thirdparty%2Fdbus.git Make documentation generating MSYS/MSYS2-compatible xmlto is a shell script, it needs to be fed MSYSsy filenames. This patch adds a cygpath invocation for filename conversion (autotools do that automatically, for CMake you have to spell it out). Cygwpath is available in MSYS2 (and Cygwin, obviously). When cygpath is not available, use MSYS-specific pwd extension to get W32 path. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75860 Reviewed-by: Ralf Habacker --- diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt index 7fdfc2196..807af60c5 100644 --- a/cmake/doc/CMakeLists.txt +++ b/cmake/doc/CMakeLists.txt @@ -20,6 +20,8 @@ find_program(MEINPROC4_EXECUTABLE meinproc4) find_program(XMLTO_EXECUTABLE xmlto) +find_program(CYGPATH_EXECUTABLE cygpath) + if (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE) OPTION(DBUS_ENABLE_XML_DOCS "build XML documentation (requires xmlto or meinproc4)" ON) ADD_CUSTOM_TARGET(xmldoc ALL) @@ -71,6 +73,19 @@ macro (DOCBOOK _sources _format) ) endif () if (XMLTO_EXECUTABLE) + if (MSYS) + if (CYGPATH_EXECUTABLE) + execute_process( + COMMAND cygpath ${_infile} + OUTPUT_VARIABLE _infile) + else () + execute_process(COMMAND dirname ${_infile} OUTPUT_VARIABLE _path) + string(STRIP ${_path} _path) + execute_process(COMMAND sh -c "cd ${_path}; pwd -W" OUTPUT_VARIABLE _path) + string(STRIP ${_path} _path) + set(_infile "${_path}/${_name}") + endif(CYGPATH_EXECUTABLE) + endif (MSYS) ADD_CUSTOM_COMMAND( OUTPUT ${_outfile} COMMAND ${XMLTO_EXECUTABLE} -vv ${_format} ${_infile}