Important: Please read the Qt Code of Conduct -

QMake .pro file : include other makefile

  • Hi,

    Currently we have several non-qt projects with some common makefiles. Right now I created an Qt project and now I want to include the common makefile to support some targets used by all projects.

    Is there some way to tell qmake to include other makefiles in the makefile generated by qmake? I have searched the web but couldn't find the solution..

  • Maybe a subdirs project can do the trick:

    TEMPLATE = subdirs
    SUBDIRS = commonlib speciallib
    commonlib.makefile = /path/to/commonlib/makefile
    speciallib.makefile = /path/to/speciallib/makefile

    (Brain to terminal, not tested; see the "SUBDIRS": reference doc for further details).

    You will have to add the resulting libs etc. to your actual project then.

  • I get errors that it cannot find the .pro file..

    TEMPLATE = subdirs
    SUBDIRS = common_unittest
    common_unittest.makefile = ../../Makefile.common_unittest

    cd common_unittest/ && /home/dm051/sotasm3/qt/build/bin/qmake /home/dm051/sotasm3/AdvancedMmi/unittest_src/common_unittest/ CONFIG+=debug_and_release -o ../../Makefile.common_unittest
    Cannot find file: /home/dm051/sotasm3/AdvancedMmi/unittest_src/common_unittest/
    make: *** [common_unittest/../../Makefile.common_unittest] Error 2

Log in to reply