[Development] [Android] Use pkg-config to link with external libraries in qmake project
Denis Shienkov
denis.shienkov at gmail.com
Wed Dec 20 11:03:30 CET 2017
Next, I have modified the link_pkgconfig.prf to
add there a message output like:
...
INCLUDEPATH *= $$PKGCONFIG_INCLUDEPATH
DEFINES *= $$PKGCONFIG_DEFINES
message("blaaaaaaaaaaaaa $$INCLUDEPATH")
...
and I see required output:
Project MESSAGE: blaaaaaaaaaaaaa
c:/Android/gstreamer/armv7c:/Android/gstreamer/armv7/include/gstreamer-1.0
c:/Android/gstreamer/armv7c:/Android/gstreamer/armv7/include/glib-2.0
c:/Android/gstreamer/armv7c:/Android/gstreamer/armv7/lib/glib-2.0/include
all fine...
But, if I try to output message from my *.pro file:
message("blaaaaaaaaaaaaa $$INCLUDEPATH")
then I see an empty content of INCLUDEPATH...
What happens?
20.12.2017 12:55, Denis Shienkov пишет:
>
> I even have tried following from the Windows cmd durectly:
>
> set PATH=c:\pkgconfig\bin;%PATH%
> set PKG_CONFIG_LIBDIR=c:/Android/gstreamer/armv7/lib/pkgconfig
> set PKG_CONFIG_SYSROOT_DIR=c:/Android/gstreamer/armv7
>
> pkg-config.exe --cflags gstreamer-1.0
>
> Output is:
>
> -pthread
> -Ic:/Android/gstreamer/armv7c:/Android/gstreamer/armv7/include/gstreamer-1.0
> -Ic:/Android/gstreamer/armv7c:/Android/gstreamer/armv7/include/glib-2.0
> -Ic:/Android/gstreamer/armv7c:/Android/gstreamer/armv7/lib/glib-2.0/include
>
> So, all include dirs are found, but the qmake's link_pkgconfig.prf
> skiped this.. :(
>
>
> 20.12.2017 12:35, Denis Shienkov пишет:
>>
>> Hi Oswald,
>>
>> Hmm.. many thanks for your hint, I have modified the
>> pkg-conf env variables to:
>>
>> 1. PKG_CONFIG_LIBDIR = c:\Android\gstreamer\armv7\lib\pkgconfig
>> - a path to all *.pc files.
>>
>> 2. PKG_CONFIG_SYSROOT_DIR = c:\Android\gstreamer\armv7
>> - a path to a 'fake' sysroot, which contains an 'include',
>> 'lib', 'etc' and other directories.
>>
>> Now, the qmake eats it without warnings...
>> But, now, it does not detect the gst's include files,
>> like:
>>
>> #include <gst/gst.h>
>>
>> though they are present in:
>>
>> c:\Android\gstreamer\armv7\include\gstreamer-1.0\gst\
>>
>> :(
>>
>>
>> 20.12.2017 12:04, Oswald Buddenhagen пишет:
>>> On Wed, Dec 20, 2017 at 11:39:20AM +0300, Denis Shienkov wrote:
>>>> This says about the 'sysroot', but, I have no any sysroot for Android kit,
>>>>
>>> that's just implausible. you must have something that resembles a
>>> sysroot, even if it's not declared as such. if you don't find anything
>>> else, just use the directory that contains the lib and include
>>> directories.
>>>
>>> the code is in qt_functions.prf:pkgConfigExecutable(). here you see that
>>> you will need to set %PKG_CONFIG_LIBDIR% and %PKG_CONFIG_SYSROOT_DIR% if
>>> you qt build is not configured for pkg-config use to start with.
>>> _______________________________________________
>>> Development mailing list
>>> Development at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/development
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20171220/0db1b3c8/attachment.html>
More information about the Development
mailing list