QMake SUBDIRS project: how to call release-clear top-level Makefile?

I am using the Qt.pro file using the SUBDIRS pattern (basically following this answer ).

In addition, I am building my decision with qmake -recursive MyProject.proand nmake Release.

Now I want to provide a separate batch file for cleaning the output of the release and metafiles (but not debug, but).

The problem is that the top-level Makefileonly clean, and distcleanis generated qmake, whereas other directories there also release-cleanand debug-clean(also contain additional folders Makefile.Debug, and Makefile.Release).

What I want to do is call

nmake Makefile release-clean

from the script package. However, the top-level make file does not contain this configuration.

Now I could call an equal line for each subproject manually, but this is obviously my least favorable option.

Is there a way to get qmake to create a target release-cleanfor a top-level file, or is there another way to just clear the release files?

PS: I use nmake, so yes, I'm on Windows (XP) and using MSVC (2008)

+5
source share
1 answer

The following batch of script does the job:

REM set up environment
SET VISUALDIR=C:\PROGRA~1\MICROS~1.0
PUSHD %VISUALDIR%\VC
CALL vcvarsall.bat x86
POPD

REM clean solution
msbuild yoursolution.sln /p:Configuration=Release /t:clean

REM and you may want to add a build command :
msbuild yoursolution.sln /p:Configuration=Release
+2
source

All Articles