]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Make documentation generating MSYS/MSYS2-compatible
authorРуслан Ижбулатов <lrn1986@gmail.com>
Thu, 6 Mar 2014 23:17:13 +0000 (23:17 +0000)
committerRalf Habacker <ralf.habacker@freenet.de>
Thu, 20 Mar 2014 09:57:31 +0000 (10:57 +0100)
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 <ralf.habacker@freenet.de>
cmake/doc/CMakeLists.txt

index 7fdfc2196f1771a90186209fe2f29beec787aeab..807af60c54b8caada262928657cd505b4e1eaef5 100644 (file)
@@ -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}