Force QtCreator to run “qmake” when building

后端 未结 4 2131
猫巷女王i
猫巷女王i 2021-02-06 03:33

In some of my projects I use some pre-build step(s) configured in the .pro file. So qmake will execute this step whenever it is activated.

Now in QtCreator,

4条回答
  •  再見小時候
    2021-02-06 04:17

    What I've done is created a makefile that explicitly calls qmake. Of course, that means I have two makefiles, but in my project file, I have

    MAKEFILE = makefile_qt
    

    which means that the generated makefile will have that name.

    So, for the makefile I manually created, I have:

    default: 
        qmake;
        ${MAKE} -f makefile_qt;
    

    Then, from QtCreator, I just call the regular make, which will default to makefile. Or you can leave the Qt-generated makefile as is, and just call make -f makefile to call your manually created one. I forget which has precedence, makefile or Makefile, and I'm not sure if it is always the same.

提交回复
热议问题