2009-07-14 17:47:38 +02:00
|
|
|
@echo off
|
|
|
|
REM A simple script to build different cppcheck targets from project root
|
2010-01-09 12:54:56 +01:00
|
|
|
REM folder. This script can be run from VS prompt or Qt prompt.
|
2009-07-14 17:47:38 +02:00
|
|
|
REM
|
2010-01-09 12:46:43 +01:00
|
|
|
REM Usage: build <target> [release|debug]
|
2010-01-09 12:54:56 +01:00
|
|
|
REM where <target> is any of cppcheck/gui/tests/all
|
2010-01-09 12:46:43 +01:00
|
|
|
REM release or debug is the configuration
|
2010-01-09 12:54:56 +01:00
|
|
|
REM all-target builds both cppcheck and gui.
|
2009-07-14 17:47:38 +02:00
|
|
|
REM
|
2011-08-18 23:01:39 +02:00
|
|
|
REM Run the command before build.bat to enable rules using pcre:
|
|
|
|
REM set HAVE_RULES=yes
|
|
|
|
REM
|
2009-07-14 17:47:38 +02:00
|
|
|
REM TODO:
|
|
|
|
REM - run tests too
|
|
|
|
|
2010-01-09 12:46:43 +01:00
|
|
|
if "%1" == "" goto help
|
|
|
|
|
2010-01-09 11:26:34 +01:00
|
|
|
REM QT prompt sets QMAKESPEC
|
2011-08-18 23:07:48 +02:00
|
|
|
if "%QMAKESPEC%" == "" (
|
|
|
|
REM parse qmakespec to see if it's some msvc
|
|
|
|
if "%QMAKESPEC:~6,4%" == "msvc" (
|
|
|
|
set MAKE=nmake
|
|
|
|
) else (
|
|
|
|
set MAKE=mingw32-make
|
|
|
|
)
|
2010-01-09 11:26:34 +01:00
|
|
|
) else (
|
|
|
|
set MAKE=nmake
|
|
|
|
)
|
|
|
|
|
2012-09-06 10:57:07 +02:00
|
|
|
if "%2" == "" set TARGET=release
|
|
|
|
if "%2" == "debug" set TARGET=debug
|
2010-01-09 12:49:54 +01:00
|
|
|
if "%2" == "release" set TARGET=release
|
|
|
|
|
2012-09-06 10:57:07 +02:00
|
|
|
if "%1" == "all" goto cppcheck
|
2009-07-14 17:47:38 +02:00
|
|
|
if "%1" == "cppcheck" goto cppcheck
|
2012-09-06 10:57:07 +02:00
|
|
|
if "%1" == "gui" goto gui
|
|
|
|
if "%1" == "tests" goto tests
|
2009-07-14 17:47:38 +02:00
|
|
|
goto help
|
|
|
|
|
|
|
|
:cppcheck
|
2012-09-05 15:07:35 +02:00
|
|
|
pushd cli
|
2011-08-18 23:01:39 +02:00
|
|
|
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
2010-01-09 11:26:34 +01:00
|
|
|
%MAKE%
|
2012-09-05 15:07:35 +02:00
|
|
|
popd
|
2010-01-09 12:54:56 +01:00
|
|
|
if "%1" == "all" goto gui
|
2009-07-14 17:47:38 +02:00
|
|
|
goto end
|
|
|
|
|
|
|
|
:gui
|
2012-09-05 15:07:35 +02:00
|
|
|
pushd gui
|
2011-08-18 23:01:39 +02:00
|
|
|
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
2010-01-09 11:26:34 +01:00
|
|
|
%MAKE%
|
2009-07-14 17:47:38 +02:00
|
|
|
lrelease gui.pro
|
2012-09-05 15:07:35 +02:00
|
|
|
popd
|
2009-07-14 17:47:38 +02:00
|
|
|
goto end
|
|
|
|
|
|
|
|
:tests
|
2012-09-05 15:07:35 +02:00
|
|
|
pushd test
|
2011-08-18 23:01:39 +02:00
|
|
|
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
2010-01-09 11:26:34 +01:00
|
|
|
%MAKE%
|
2012-09-05 15:07:35 +02:00
|
|
|
popd
|
2009-07-14 17:47:38 +02:00
|
|
|
goto end
|
|
|
|
|
|
|
|
:help
|
2012-09-06 10:57:07 +02:00
|
|
|
echo Syntax: build ^<target^> [debug^|release]
|
|
|
|
echo where ^<target^> is any of cppcheck/gui/tests/all
|
|
|
|
echo debug or release define used configuration
|
|
|
|
echo all- target builds both cppcheck and gui.
|
2009-07-14 17:47:38 +02:00
|
|
|
|
|
|
|
:end
|