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
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2010-01-09 12:49:54 +01:00
|
|
|
if "%2" == "" set TARGET=release
|
|
|
|
if "%2" == "release" set TARGET=release
|
|
|
|
if "%2" == "debug" set TARGET=debug
|
|
|
|
|
2009-07-14 17:47:38 +02:00
|
|
|
if "%1" == "cppcheck" goto cppcheck
|
|
|
|
if "%1" == "gui" goto gui
|
|
|
|
if "%1" == "tests" goto tests
|
2010-01-09 12:54:56 +01:00
|
|
|
if "%1" == "all" goto cppcheck
|
2009-07-14 17:47:38 +02:00
|
|
|
goto help
|
|
|
|
|
|
|
|
:cppcheck
|
2010-01-09 11:09:00 +01:00
|
|
|
cd cli
|
2010-01-09 12:49:54 +01:00
|
|
|
qmake -config %TARGET%
|
2010-01-09 11:26:34 +01:00
|
|
|
%MAKE%
|
2009-07-14 17:47:38 +02:00
|
|
|
cd ..
|
2010-01-09 12:54:56 +01:00
|
|
|
if "%1" == "all" goto gui
|
2009-07-14 17:47:38 +02:00
|
|
|
goto end
|
|
|
|
|
|
|
|
:gui
|
|
|
|
cd gui
|
2010-01-09 12:49:54 +01:00
|
|
|
qmake -config %TARGET%
|
2010-01-09 11:26:34 +01:00
|
|
|
%MAKE%
|
2009-07-14 17:47:38 +02:00
|
|
|
lrelease gui.pro
|
|
|
|
cd ..
|
|
|
|
goto end
|
|
|
|
|
|
|
|
:tests
|
|
|
|
cd test
|
2010-01-09 12:49:54 +01:00
|
|
|
qmake -config %TARGET%
|
2010-01-09 11:26:34 +01:00
|
|
|
%MAKE%
|
2009-07-14 17:47:38 +02:00
|
|
|
cd ..
|
|
|
|
goto end
|
|
|
|
|
|
|
|
:help
|
2010-01-09 12:46:43 +01:00
|
|
|
echo "Syntax: build <target> [debug|release]"
|
2010-01-09 12:54:56 +01:00
|
|
|
echo " where <target> is any of cppcheck/gui/tests/all"
|
2010-01-09 12:46:43 +01:00
|
|
|
echo " debug or release define used configuration"
|
2010-01-09 12:54:56 +01:00
|
|
|
echo " all- target builds both cppcheck and gui.
|
2009-07-14 17:47:38 +02:00
|
|
|
|
|
|
|
:end
|