Skip to content

Commit

Permalink
Added top-level 'check' target.
Browse files Browse the repository at this point in the history
Also refactored all. pro files by the way. :)
  • Loading branch information
AlekSi committed Sep 4, 2009
1 parent e48664a commit d9d2f53
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 188 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ gui/gui.vcproj
gui/gui
gui/qrc_gui.cpp
gui/*.qm
gui/ui_*.h
# Doxygen output folder
doxyoutput/
# qmake generated
Expand Down
8 changes: 8 additions & 0 deletions cppcheck.pro
Original file line number Diff line number Diff line change
@@ -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
127 changes: 43 additions & 84 deletions gui/gui.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
######################################################################
# Automatically generated by qmake (2.01a) Sun Feb 22 10:14:18 2009
######################################################################

TEMPLATE = app
TARGET =
QT += xml
Expand All @@ -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 \
Expand All @@ -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
21 changes: 7 additions & 14 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


=========
Cppcheck
=========
Expand All @@ -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

Expand All @@ -43,4 +37,3 @@ Webpage

http://www.sf.net/projects/cppcheck


45 changes: 45 additions & 0 deletions src/src.pri
Original file line number Diff line number Diff line change
@@ -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
49 changes: 2 additions & 47 deletions src/src.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
######################################################################
# Automatically generated by qmake (2.01a) Mon Jul 13 10:40:01 2009
######################################################################

TEMPLATE = app
TARGET = cppcheck
DEPENDPATH += .
Expand All @@ -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
Expand Down
45 changes: 3 additions & 42 deletions test/test.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
######################################################################
# Automatically generated by qmake (2.01a) Mon Jul 13 17:37:53 2009
######################################################################

TEMPLATE = app
TARGET = test
DEPENDPATH += .
Expand All @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit d9d2f53

Please sign in to comment.