Skip to content

Commit fa5c8fb

Browse files
committed
Added support to link cppcheck-core dynamically into GUI (use LINKCORE=yes when calling qmake)
1 parent 4c1abde commit fa5c8fb

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

‎gui/gui.pro‎

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ DEPENDPATH += . \
55
../lib
66
INCLUDEPATH += . \
77
../lib
8+
contains(LINKCORE, [yY][eE][sS]) {
9+
LIBS += -l../bin/cppcheck-core
10+
DEFINES += CPPCHECKLIB_IMPORT
11+
}
812
LIBS += -L../externals
913

1014
DESTDIR = .
@@ -15,11 +19,19 @@ UI_DIR = temp
1519

1620
win32 {
1721
CONFIG += windows
18-
DESTDIR = ../Build/gui
19-
RCC_DIR = ../BuildTmp/gui
20-
MOC_DIR = ../BuildTmp/gui
21-
OBJECTS_DIR = ../BuildTmp/gui
22-
UI_DIR = ../BuildTmp/gui
22+
contains(LINKCORE, [yY][eE][sS]) {
23+
DESTDIR = ../bin
24+
RCC_DIR = temp/generated
25+
MOC_DIR = temp/generated
26+
OBJECTS_DIR = temp/generated
27+
UI_DIR = temp/generated
28+
} else {
29+
DESTDIR = ../Build/gui
30+
RCC_DIR = ../BuildTmp/gui
31+
MOC_DIR = ../BuildTmp/gui
32+
OBJECTS_DIR = ../BuildTmp/gui
33+
UI_DIR = ../BuildTmp/gui
34+
}
2335
}
2436

2537
RESOURCES = gui.qrc
@@ -49,8 +61,11 @@ TRANSLATIONS = cppcheck_de.ts \
4961
# Windows-specific options
5062
CONFIG += embed_manifest_exe
5163

52-
BASEPATH = ../lib/
53-
include($$PWD/../lib/lib.pri)
64+
contains(LINKCORE, [yY][eE][sS]) {
65+
} else {
66+
BASEPATH = ../lib/
67+
include($$PWD/../lib/lib.pri)
68+
}
5469

5570
HEADERS += aboutdialog.h \
5671
application.h \

0 commit comments

Comments
 (0)