Important: Please read the Qt Code of Conduct -

[SOLVED] qmake make and install target

  • hi,

    I am trying to add the make install make target to my project. I added all my configfiles, external librarys, etc as target to the INSTALLS variable. This works nice.

    My problem now is:
    How do I add the compilation output to INSTALLS?

    I tried doing this:

    target.files += $$OUT_PWD/$(DESTDIR)/$(TARGET)
    target.path += /somewhere/to/install
    INSTALLS += target

    using this from the commandline works for dynamic-library projects. But if I try to open the .pro with QtCreator, QtCreator it will crash.

    Also the documentation says: Note that qmake will skip files that are executable. If you need to install executable files, you can unset the files' executable flags.

    How does this make sens? how is somebody supposed to create an install target if it is not possible to add the compilation executable to the installation.

  • ok found the solution:

    in my .pro i hat a typo:

    target.files = config.conf ....    // wrong

    this needs to be:

    target.files += config.conf  // right

    also I hade multiple installation-targets and did not add target to installs in every build configuration.

    so for those who run in the same problem:

    1. be sure you add target to INSTALLS, target.files is already filled with your compilation output.
    2. use += not = to add other files