qmake issues on win32

Lubomir I. Ivanov neolit123 at gmail.com
Thu Oct 10 06:26:12 UTC 2013


On 10 October 2013 00:37, Thiago Macieira <thiago at macieira.org> wrote:
> On quarta-feira, 9 de outubro de 2013 23:16:01, Lubomir I. Ivanov wrote:
>> but it still persists even if the qmake / make pairs are used from the
>> same shell type of shell.
>>
>> same for cmd.exe / msys-sh:
>> qt-ui/../dive.h:22:25: error: libxml/tree.h: No such file or directory
>> qt-ui/../dive.h:23:31: error: libxslt/transform.h: No such file or directory
>>
>> no longer finds the includes for libxml/libxslt.
>> so perhaps we should disable "silent" or work around it somehow?
>
> Looks like the cause of both problems is the same. Your output contains:
>
> DEBUG 1: Project Parser: c:\dev\subsurface\subsurface-configure.pri:78
> :XML2_CFLAGS: :=: (-I/dev/linux_lib/libxml/include
> )
>
> That extra newline before closing the parenthesis is quite telling. On Linux
> I'm getting:
>
> DEBUG 1: Project Parser: /home/thiago/src/subsurface/subsurface-
> configure.pri:70 :XML2_CFLAGS: :=: (-I/usr/include/libxml2)
>
> [Yours is from pkg-config and mine is from xml2-config, but the same thing
> appears for pkg-config runs]
>
> The most likely scenario is that it's the CRLF line ending. If the CR doesn't
> get stripped, qmake will notice that the variable has a weird inside, so it
> needs to add quotes around the argument when writing the Makefile.
>
> That would explain both the quotes and the excess newline in your Makefile.\
>
> Let me investigate a little to see what I can do.
>

and it's an excess CRLF indeed, but that's not a special case but
rather the standard output of pkg-config that comes with msys (0.25).
so whoever wrote the windows port decided to add an extra CRLF...

here is my lazy solution with a .cmd wrapper and it only works for
single line output.

------------------------------
:: pkg-config.cmd
@echo off
:: store last line with output into a varible
for /f "tokens=*" %%a in ('_pkg-config %*') do (
set out=%%a
)
:: truncate extra CRLF from line
if "%out%" NEQ "" (
   echo %out% | tr '\r\n' ' '
)
set out=
------------------------------

following your comments, i don't think there is an easy way to solve
the "CONFIG += silent" / CreateProcess situation unless we disable it
when the current OS is win32.
so "V = 1" is required and that's fine for me for the moment...
qmake "PKGCONFIG += libmarble libiconv libusb-1.0" "V = 1"

on the topic of sh.exe availability in PATH, i think we can safely
assume that user will have msys(-git) packages installed and most
likely sh.exe.
this is a dependency because our script are made for bash/sh.

lubomir
--


More information about the subsurface mailing list