Important: Please read the Qt Code of Conduct -

qmake: subdirs with different configs

  • Hi, I'm using Qt4.8.7 on Windows 10. I have two qmake project files, and, each located in each own directory (project1 and project2). Both projects can take various custom optional CONFIG arguments, say arg1, arg2 and arg3.

    I'd now like to create a master project file which can pass different CONFIG arguments to each project. I've tried this:

    SUBDIRS = project1 project2
    project1.CONFIG += arg2
    project2.CONFIG += arg1 arg3

    but unfortunately the CONFIG arguments are completely ignored in the resulting Makefiles for the two individual projects. Is there a way to achieve what I'm looking for?

  • Lifetime Qt Champion


    I am not aware of a direct way for that.

    One thing you could do is use a .qmake.conf file with a custom variable for each of your project and then in the project .pro file you'll parse the corresponding variable and append the content to the original one.

Log in to reply