[Development] Getting build flags for platforms without pkg-config

Aleix Pol aleixpol at kde.org
Mon Oct 30 13:22:00 CET 2017


On Mon, Oct 30, 2017 at 9:00 AM, Jeandet Alexis
<alexis.jeandet at member.fsf.org> wrote:
> Le dimanche 29 octobre 2017 à 15:57 -0700, Thiago Macieira a écrit :
>> On domingo, 29 de outubro de 2017 14:57:44 PDT Jeandet Alexis wrote:
>> > Hello,
>> >
>> > Previously I asked about getting some defines from pkg-config, I
>> > pushed
>> > some code on gerrit to fix that.
>> >
>> > Now I would like to care about platforms where we don't use pkg-
>> > config,
>> > at first I thought that we could get compile flags from qmake but
>> > it
>> > seems that no.
>>
>> You can get them from either qmake or cmake. The flags are saved
>> there.
>>
>> You should also reconsider and install pkg-config on those platforms.
>>
>> > Did I miss something?
>> > Would there be a way to get compile flags for a build system like
>> > meson?
>>
>> Either write a .pro file that prints or saves the flags, or read the
>> $$[QT_INSTALL_ARCHDATA]/mkspecs/modules/qt_lib_*.pri files.
>>
>> Reading the files directly is officially looking into private API and
>> we cannot
>> promise you that it will continue working. But I don't see how to do
>> it
>> officially with qmake either.
> I was affraid I would get this answer. How do you solve this issue with
> QBS? Does qmake generate files for QBS on each Qt version or do you
> hardcode stuff in QBS?
> This leads me to the conclusion that a kind of qt-pkg-config tool would
> be nice. Or just expending qmake to provide this infromations.
>>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

You should also be able to use cmake with --find-package. This is what
it looks like on my system:

$ cmake --find-package -DNAME=Qt5Core -DCOMPILER_ID=GNU -DLANGUAGE=CXX
-DMODE=LINK
-Wl,-rpath,/home/apol/devel/kde5/lib
/home/apol/devel/kde5/lib/libQt5Core.so.5.10.0
$ cmake --find-package -DNAME=Qt5Core -DCOMPILER_ID=GNU -DLANGUAGE=CXX
-DMODE=COMPILE
-I/home/apol/devel/kde5/include/
-I/home/apol/devel/kde5/include/QtCore
-I/home/apol/devel/kde5/lib64//mkspecs/linux-g++

Aleix



More information about the Development mailing list