Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Finding configure options for a Qt kit?



  • I'm trying to figure out what options were used to configure when building the kits that come with Qt Creator by default. Is there such a way to figure this out?

    Let me explain a little about what I'm trying to achieve as well as that might help answer the question a different way. What I want to do is rebuild Qt for Windows ensuring that everything is built as it would be with the supplied binaries, but with a patch I want applied. When I first compiled for example, I had no OpenSSL support and so had to figure out what to set there. And now I'm concerned by all the options like -qt-pcre etc and I want to make sure that I'm building it with the same settings as the default kits that are supplied by Qt.


  • Moderators

    @mattjgalloway said in Finding configure options for a Qt kit?:

    I'm trying to figure out what options were used to configure.... Is there such a way to figure this out?

    All the configure options for all the platforms are published here: https://code.qt.io/cgit/qtsdk/qtsdk.git/tree/packaging-tools/bld_config

    when building the kits that come with Qt Creator by default

    Technically, it's the other way round. No kits come with Qt Creator; instead, Qt Creator comes with Qt!



  • All the configure options for all the platforms are published here: https://code.qt.io/cgit/qtsdk/qtsdk.git/tree/packaging-tools/bld_config

    Perfect! Yes that's precisely what I was looking for thankyou!

    Technically, it's the other way round. No kits come with Qt Creator; instead, Qt Creator comes with Qt!

    Hehe yes - excuse my terminology!



  • @JKSH said in Finding configure options for a Qt kit?:

    All the configure options for all the platforms are published here: https://code.qt.io/cgit/qtsdk/qtsdk.git/tree/packaging-tools/bld_config

    Great to know that. However, that applies to binaries supplied by Qt company.

    But what if I build some Qt release with my own set of configuration switches, and pass that Qt release to you. Is there a way to know the build configuration from the binaries themselves?


  • Moderators

    @Pablo-J-Rogina said in Finding configure options for a Qt kit?:

    But what if I build some Qt release with my own set of configuration switches, and pass that Qt release to you. Is there a way to know the build configuration from the binaries themselves?

    Ah, good question. I'm not aware of a way to query the configuration flags from the binaries themselves.



  • Hi, I brought up almost the same topic in the Qt Creator mailing list in May https://lists.qt-project.org/pipermail/qt-creator/2020-May/008540.html
    where I surmised that introducing a new type of file, a .kit file (that would contain all build configuration/settings) could be something you could click on that automagically could add that build to Qt Creator. Would be handy when adding your own custom builds to Qt Creator :-)

    Been lazy Haven't had the time to create an bug report/suggestion to introduce .kit files but I think it's a good idea. Also I got stuck trying to analyze the infrastructure already in place in the MaintenanceTool, I'm thinking of the commands it issues during installation to the sdktool.exe program, this is an example when installing 5.15.0 MinGW 32-bit (copied from Qt's installation log):

    C:\Qt\Tools\QtCreator\bin\sdktool.exe, addKit, --id, qt.qt5.5150.win32_mingw81_kit, --name, Desktop Qt %{Qt:Version} MinGW 32-bit, --Ctoolchain, ProjectExplorer.ToolChain.Mingw:qt.tools.win32_mingw810.gcc, --Cxxtoolchain, ProjectExplorer.ToolChain.Mingw:qt.tools.win32_mingw810.g++, --qt, qt.qt5.5150.win32_mingw81, --debuggerid, Debugger.qt.tools.win32_mingw810, --devicetype, Desktop, UNDOEXECUTE, C:\Qt\/Tools/QtCreator\bin\sdktool.exe, rmKit, --id, qt.qt5.5150.win32_mingw81_kit
    [305768] C:\\Qt\\/Tools/QtCreator\\bin\\sdktool.exe" started, arguments: "addKit --id qt.qt5.5150.win32_mingw81_kit --name Desktop Qt %{Qt:Version} MinGW 32-bit --Ctoolchain ProjectExplorer.ToolChain.Mingw:qt.tools.win32_mingw810.gcc --Cxxtoolchain ProjectExplorer.ToolChain.Mingw:qt.tools.win32_mingw810.g++ --qt qt.qt5.5150.win32_mingw81 --debuggerid Debugger.qt.tools.win32_mingw810 --devicetype Desktop
    

    what I mean is, it seems that the sdktool.exe is quite capable of adding also your own homegrown builds, but you have to figure out all those switches :-(

    So I'm thinking if the configure program could somehow save all the settings you specify into a .kit file which you then could invoke sdktool.exe with, and voila, a new kit could appear out of thin air inside Qt Creator :-)


  • Lifetime Qt Champion

    @hskoglund IIRC it's currently called config.options in the build folder.


  • Moderators

    @SGaist config.opt 😉

    you can also check your actual command inside the config.log it's the first line there



  • config.options
    actual command inside the config.log it's the first line there

    All those things are gone when you distribute the Qt binaries (executable and shared libraries)

    One option could be to embed such information (i.e. the command line) inside Qt5Core.so/.dll (the bare minimum file required if your write a Qt app). I was also thinking of embedding that information in qmake but given Qt 6.x will move into CMake that option won't be applicable soon.


Log in to reply