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

Basic Qt Creator Qmake Config



  • Hi,

    I have a basic project Qt project that I am working with. This is my first time using Qt Creator. I am trying to build for both Mac and Windows, and would like the setup to be as simple as possible (i.e. open the project, select a kit, hit build and then deploy). I am trying to use .pro project files with qmake to achieve this.

    In my project file, I specify a couple of options, for example:

    QT += core gui
    

    And:

    settings.files = $$PWD/settings.txt
    settings.path = $$OUT_PWD
    INSTALLS +=  settings
    

    I would think this results in two things:

    1. The Qt Core and GUI DLLs are copied to the build directory.
    2. The file settings.txt is copied to the build directory.

    But what actually happens:

    1. No DLLs are copied and running the .exe results in an error stating Qt5Core.dll was not found.
    2. No settings.txt file in the build folder.

    All of this is playing around with the analogclock example.

    Am I doing something wrong? Do these options not do what I think they do? Do I need to configure something in Qt Creator?

    Thanks!


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The INSTALL variable is used for the "make install" command not on build.

    If you want to deploy your application on Windows then you should use windeployqt.



  • I tried windeployqt. It will copy the DLLs. But I also already knew which ones I needed, so the auto-detection part is not very helpful. It also does not copy my settings file. Can this not be done/configured via the Qt Creator deploy process? Thanks!


  • Lifetime Qt Champion

    Add a custom build step to call make install.


  • Lifetime Qt Champion

    This post is deleted!


  • Thank you for your help @SGaist .

    I ended up settling for this method. It's more complicated than using the INSTALL variable but does not require adding an extra build step (which I feel would be more error-prone).


Log in to reply