Added top-level 'check' target.

Also refactored all. pro files by the way. :)
This commit is contained in:
Aleksey Palazhchenko 2009-09-04 22:59:25 +04:00
parent e48664a3c9
commit d9d2f53df6
7 changed files with 107 additions and 187 deletions

1
.gitignore vendored
View File

@ -26,7 +26,6 @@ gui/gui.vcproj
gui/gui
gui/qrc_gui.cpp
gui/*.qm
gui/ui_*.h
# Doxygen output folder
doxyoutput/
# qmake generated

8
cppcheck.pro Normal file
View File

@ -0,0 +1,8 @@
TEMPLATE = subdirs
SUBDIRS = src test gui
CONFIG += ordered
# check target - build and run tests
check.depends = sub-test
check.commands = $$PWD/test/test
QMAKE_EXTRA_TARGETS += check

View File

@ -1,7 +1,3 @@
######################################################################
# Automatically generated by qmake (2.01a) Sun Feb 22 10:14:18 2009
######################################################################
TEMPLATE = app
TARGET =
QT += xml
@ -10,6 +6,7 @@ INCLUDEPATH += .
RCC_DIR = temp
MOC_DIR = temp
OBJECTS_DIR = temp
UI_DIR = temp
CONFIG += warn_on
RESOURCES = gui.qrc
FORMS = main.ui \
@ -29,89 +26,51 @@ TRANSLATIONS = cppcheck_fi.ts \
# Windows-specific options
CONFIG += embed_manifest_exe
# Input
HEADERS += mainwindow.h \
checkthread.h \
resultsview.h \
resultstree.h \
settingsdialog.h \
threadresult.h \
threadhandler.h \
applicationlist.h \
applicationdialog.h \
aboutdialog.h \
common.h \
fileviewdialog.h \
projectfile.h \
report.h \
txtreport.h \
xmlreport.h \
translationhandler.h \
csvreport.h \
../src/checkautovariables.h \
../src/checkdangerousfunctions.h \
../src/checkheaders.h \
../src/cppcheck.h \
../src/mathlib.h \
../src/settings.h \
../src/tokenize.h \
../src/checkbufferoverrun.h \
../src/checkmemoryleak.h \
../src/checkstl.h \
../src/checkunusedfunctions.h \
../src/errorlogger.h \
../src/preprocessor.h \
../src/threadexecutor.h \
../src/checkclass.h \
../src/check.h \
../src/checkother.h \
../src/cppcheckexecutor.h \
../src/filelister.h \
../src/token.h \
../src/classinfo.h \
SOURCES += main.cpp \
mainwindow.cpp\
checkthread.cpp \
resultsview.cpp \
resultstree.cpp \
threadresult.cpp \
threadhandler.cpp \
settingsdialog.cpp \
applicationlist.cpp \
applicationdialog.cpp \
aboutdialog.cpp \
fileviewdialog.cpp \
projectfile.cpp \
report.cpp \
txtreport.cpp \
xmlreport.cpp \
translationhandler.cpp \
csvreport.cpp \
../src/checkautovariables.cpp \
../src/checkdangerousfunctions.cpp \
../src/checkmemoryleak.cpp \
../src/checkstl.cpp \
../src/errorlogger.cpp \
../src/mathlib.cpp \
../src/threadexecutor.cpp \
../src/checkbufferoverrun.cpp \
../src/checkother.cpp \
../src/cppcheck.cpp \
../src/filelister.cpp \
../src/preprocessor.cpp \
../src/token.cpp \
../src/checkclass.cpp \
../src/checkheaders.cpp \
../src/cppcheckexecutor.cpp \
../src/checkunusedfunctions.cpp \
../src/settings.cpp \
../src/tokenize.cpp
include($$PWD/../src/src.pri)
HEADERS += mainwindow.h \
checkthread.h \
resultsview.h \
resultstree.h \
settingsdialog.h \
threadresult.h \
threadhandler.h \
applicationlist.h \
applicationdialog.h \
aboutdialog.h \
common.h \
fileviewdialog.h \
projectfile.h \
report.h \
txtreport.h \
xmlreport.h \
translationhandler.h \
csvreport.h
SOURCES += main.cpp \
mainwindow.cpp\
checkthread.cpp \
resultsview.cpp \
resultstree.cpp \
threadresult.cpp \
threadhandler.cpp \
settingsdialog.cpp \
applicationlist.cpp \
applicationdialog.cpp \
aboutdialog.cpp \
fileviewdialog.cpp \
projectfile.cpp \
report.cpp \
txtreport.cpp \
xmlreport.cpp \
translationhandler.cpp \
csvreport.cpp
win32 {
RC_FILE = cppcheck-gui.rc
HEADERS += ../src/resource.h
LIBS += -lshlwapi
}
# run lrelease before build
lrelease.commands = lrelease gui.pro
QMAKE_EXTRA_TARGETS += lrelease
PRE_TARGETDEPS += lrelease

View File

@ -1,5 +1,3 @@
=========
Cppcheck
=========
@ -17,17 +15,13 @@ Compiling
The Makefile works under Linux.
To make it work under Windows with DJGPP, change "g++" to "gxx".
To build cppcheck with qmake, run the commands:
cd src
qmake -config release (or '-config debug' if doing developer build)
make
To compile the GUI one needs Qt development libraries and issue the following commands:
cd gui
qmake -config release (or '-config debug' if doing developer build)
lrelease gui.pro
make
To build cppcheck with qmake, run this commands:
qmake -config release this will generate Makefile (use 'debug' instead of 'release' if doing developer build)
make this will build command-line tool, GUI and autotests
make sub-src this will build command-line tool only
make check this one will build and run autotests
Usage
@ -43,4 +37,3 @@ Webpage
http://www.sf.net/projects/cppcheck

45
src/src.pri Normal file
View File

@ -0,0 +1,45 @@
# Common project include with headers and sources
HEADERS += $$PWD/check.h \
$$PWD/checkautovariables.h \
$$PWD/checkbufferoverrun.h \
$$PWD/checkclass.h \
$$PWD/checkdangerousfunctions.h \
$$PWD/checkheaders.h \
$$PWD/checkmemoryleak.h \
$$PWD/checkother.h \
$$PWD/checkstl.h \
$$PWD/checkunusedfunctions.h \
$$PWD/classinfo.h \
$$PWD/cppcheck.h \
$$PWD/cppcheckexecutor.h \
$$PWD/errorlogger.h \
$$PWD/filelister.h \
$$PWD/mathlib.h \
$$PWD/preprocessor.h \
$$PWD/resource.h \
$$PWD/settings.h \
$$PWD/threadexecutor.h \
$$PWD/token.h \
$$PWD/tokenize.h
# no main.cpp here
SOURCES += $$PWD/checkautovariables.cpp \
$$PWD/checkbufferoverrun.cpp \
$$PWD/checkclass.cpp \
$$PWD/checkdangerousfunctions.cpp \
$$PWD/checkheaders.cpp \
$$PWD/checkmemoryleak.cpp \
$$PWD/checkother.cpp \
$$PWD/checkstl.cpp \
$$PWD/checkunusedfunctions.cpp \
$$PWD/cppcheck.cpp \
$$PWD/cppcheckexecutor.cpp \
$$PWD/errorlogger.cpp \
$$PWD/filelister.cpp \
$$PWD/mathlib.cpp \
$$PWD/preprocessor.cpp \
$$PWD/settings.cpp \
$$PWD/threadexecutor.cpp \
$$PWD/token.cpp \
$$PWD/tokenize.cpp

View File

@ -1,7 +1,3 @@
######################################################################
# Automatically generated by qmake (2.01a) Mon Jul 13 10:40:01 2009
######################################################################
TEMPLATE = app
TARGET = cppcheck
DEPENDPATH += .
@ -10,49 +6,8 @@ OBJECTS_DIR = temp
CONFIG += warn_on
CONFIG -= qt app_bundle
# Input
HEADERS += check.h \
checkautovariables.h \
checkbufferoverrun.h \
checkclass.h \
checkdangerousfunctions.h \
checkheaders.h \
checkmemoryleak.h \
checkother.h \
checkstl.h \
checkunusedfunctions.h \
classinfo.h \
cppcheck.h \
cppcheckexecutor.h \
errorlogger.h \
filelister.h \
mathlib.h \
preprocessor.h \
resource.h \
settings.h \
threadexecutor.h \
token.h \
tokenize.h
SOURCES += checkautovariables.cpp \
checkbufferoverrun.cpp \
checkclass.cpp \
checkdangerousfunctions.cpp \
checkheaders.cpp \
checkmemoryleak.cpp \
checkother.cpp \
checkstl.cpp \
checkunusedfunctions.cpp \
cppcheck.cpp \
cppcheckexecutor.cpp \
errorlogger.cpp \
filelister.cpp \
main.cpp \
mathlib.cpp \
preprocessor.cpp \
settings.cpp \
threadexecutor.cpp \
token.cpp \
tokenize.cpp
include($$PWD/src.pri)
SOURCES += main.cpp
win32 {
CONFIG += embed_manifest_exe console

View File

@ -1,7 +1,3 @@
######################################################################
# Automatically generated by qmake (2.01a) Mon Jul 13 17:37:53 2009
######################################################################
TEMPLATE = app
TARGET = test
DEPENDPATH += .
@ -11,26 +7,8 @@ CONFIG += warn_on debug
CONFIG -= qt app_bundle
DEFINES += UNIT_TESTING
# Input
HEADERS += testsuite.h \
../src/tokenize.h \
../src/settings.h \
../src/errorlogger.h \
../src/token.h \
../src/checkautovariables.h \
../src/check.h \
../src/checkbufferoverrun.h \
../src/checkother.h \
../src/checkclass.h \
../src/cppcheck.h \
../src/checkunusedfunctions.h \
../src/checkdangerousfunctions.h \
../src/filelister.h \
../src/mathlib.h \
../src/checkmemoryleak.h \
../src/preprocessor.h \
../src/checkstl.h \
../src/checkheaders.h
include($$PWD/../src/src.pri)
HEADERS += testsuite.h
SOURCES += testautovariables.cpp \
testbufferoverrun.cpp \
testcharvar.cpp \
@ -54,24 +32,7 @@ SOURCES += testautovariables.cpp \
testtokenize.cpp \
testunusedfunctions.cpp \
testunusedprivfunc.cpp \
testunusedvar.cpp \
../src/tokenize.cpp \
../src/settings.cpp \
../src/errorlogger.cpp \
../src/token.cpp \
../src/checkautovariables.cpp \
../src/checkbufferoverrun.cpp \
../src/checkother.cpp \
../src/checkclass.cpp \
../src/cppcheck.cpp \
../src/checkunusedfunctions.cpp \
../src/checkdangerousfunctions.cpp \
../src/filelister.cpp \
../src/mathlib.cpp \
../src/checkmemoryleak.cpp \
../src/preprocessor.cpp \
../src/checkstl.cpp \
../src/CheckHeaders.cpp
testunusedvar.cpp
win32 {
CONFIG += console