Merge pull request #32 from rpavlik/qmake-configure-rules
Qmake configure rules
This commit is contained in:
commit
80ba3d6a92
|
@ -1,3 +1,21 @@
|
||||||
|
PCRE is a library that is used by the optional "rules" feature. (It adds
|
||||||
|
some additional features to the command line client.) It's readily available
|
||||||
|
on Linux and Mac OS X, but must be obtained separately for Windows.
|
||||||
|
|
||||||
|
If you're using qmake to generate makefiles, the following behavior applies:
|
||||||
|
|
||||||
|
- If you're not on Windows, it assumes by default that you have PCRE and want
|
||||||
|
to enable rules support.
|
||||||
|
|
||||||
|
- If you're not on Windows, you can disable rules support (removing the PCRE
|
||||||
|
dependency) by passing HAVE_RULES=no to qmake.
|
||||||
|
|
||||||
|
- If you are on Windows, but have PCRE available, you can enable rules support
|
||||||
|
by passing HAVE_RULES=yes to qmake.
|
||||||
|
|
||||||
|
- Note: This includes using build.bat since it calls qmake - to use PCRE and
|
||||||
|
build.bat, you need to run set HAVE_RULES=yes before each run of build.bat
|
||||||
|
|
||||||
|
|
||||||
Some temporary build instructions. This is work in progress.
|
Some temporary build instructions. This is work in progress.
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,9 @@ REM where <target> is any of cppcheck/gui/tests/all
|
||||||
REM release or debug is the configuration
|
REM release or debug is the configuration
|
||||||
REM all-target builds both cppcheck and gui.
|
REM all-target builds both cppcheck and gui.
|
||||||
REM
|
REM
|
||||||
|
REM Run the command before build.bat to enable rules using pcre:
|
||||||
|
REM set HAVE_RULES=yes
|
||||||
|
REM
|
||||||
REM TODO:
|
REM TODO:
|
||||||
REM - run tests too
|
REM - run tests too
|
||||||
|
|
||||||
|
@ -36,7 +39,7 @@ goto help
|
||||||
|
|
||||||
:cppcheck
|
:cppcheck
|
||||||
cd cli
|
cd cli
|
||||||
qmake -config %TARGET%
|
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
||||||
%MAKE%
|
%MAKE%
|
||||||
cd ..
|
cd ..
|
||||||
if "%1" == "all" goto gui
|
if "%1" == "all" goto gui
|
||||||
|
@ -44,7 +47,7 @@ goto end
|
||||||
|
|
||||||
:gui
|
:gui
|
||||||
cd gui
|
cd gui
|
||||||
qmake -config %TARGET%
|
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
||||||
%MAKE%
|
%MAKE%
|
||||||
lrelease gui.pro
|
lrelease gui.pro
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -52,7 +55,7 @@ goto end
|
||||||
|
|
||||||
:tests
|
:tests
|
||||||
cd test
|
cd test
|
||||||
qmake -config %TARGET%
|
qmake -config %TARGET% HAVE_RULES=%HAVE_RULES%
|
||||||
%MAKE%
|
%MAKE%
|
||||||
cd ..
|
cd ..
|
||||||
goto end
|
goto end
|
||||||
|
|
|
@ -5,7 +5,6 @@ INCLUDEPATH += . ../lib
|
||||||
OBJECTS_DIR = temp
|
OBJECTS_DIR = temp
|
||||||
CONFIG += warn_on
|
CONFIG += warn_on
|
||||||
CONFIG -= qt app_bundle
|
CONFIG -= qt app_bundle
|
||||||
DEFINES += HAVE_RULES
|
|
||||||
|
|
||||||
BASEPATH = ../externals/tinyxml/
|
BASEPATH = ../externals/tinyxml/
|
||||||
include($$PWD/../externals/tinyxml/tinyxml.pri)
|
include($$PWD/../externals/tinyxml/tinyxml.pri)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# no manual edits - this file is autogenerated by dmake
|
# no manual edits - this file is autogenerated by dmake
|
||||||
|
|
||||||
LIBS += -L../externals -lpcre
|
include($$PWD/pcrerules.pri)
|
||||||
INCLUDEPATH += ../externals ../externals/tinyxml
|
INCLUDEPATH += ../externals/tinyxml
|
||||||
HEADERS += $${BASEPATH}check.h \
|
HEADERS += $${BASEPATH}check.h \
|
||||||
$${BASEPATH}check64bit.h \
|
$${BASEPATH}check64bit.h \
|
||||||
$${BASEPATH}checkassignif.h \
|
$${BASEPATH}checkassignif.h \
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# On non-Windows, if the variable HAVE_RULES is empty, default to using PCRE and enabling rules
|
||||||
|
!win32:isEmpty(HAVE_RULES) {
|
||||||
|
CONFIG += use_pcre_rules
|
||||||
|
}
|
||||||
|
|
||||||
|
# If HAVE_RULES=yes is passed to qmake, use PCRE and enable rules
|
||||||
|
contains(HAVE_RULES, [yY][eE][sS]) {
|
||||||
|
CONFIG += use_pcre_rules
|
||||||
|
}
|
||||||
|
|
||||||
|
use_pcre_rules {
|
||||||
|
DEFINES += HAVE_RULES
|
||||||
|
LIBS += -L../externals -lpcre
|
||||||
|
INCLUDEPATH += ../externals
|
||||||
|
message("Rules enabled - to disable them and remove the dependency on PCRE, pass HAVE_RULES=no to qmake.")
|
||||||
|
} else {
|
||||||
|
message("Rules disabled - to enable them, make PCRE available and pass HAVE_RULES=yes to qmake.")
|
||||||
|
}
|
|
@ -182,8 +182,8 @@ int main(int argc, char **argv)
|
||||||
if (fout1.is_open())
|
if (fout1.is_open())
|
||||||
{
|
{
|
||||||
fout1 << "# no manual edits - this file is autogenerated by dmake\n\n";
|
fout1 << "# no manual edits - this file is autogenerated by dmake\n\n";
|
||||||
fout1 << "LIBS += -L../externals -lpcre\n";
|
fout1 << "include($$PWD/pcrerules.pri)\n";
|
||||||
fout1 << "INCLUDEPATH += ../externals ../externals/tinyxml\n";
|
fout1 << "INCLUDEPATH += ../externals/tinyxml\n";
|
||||||
fout1 << "HEADERS += $${BASEPATH}check.h \\\n";
|
fout1 << "HEADERS += $${BASEPATH}check.h \\\n";
|
||||||
for (unsigned int i = 0; i < libfiles.size(); ++i)
|
for (unsigned int i = 0; i < libfiles.size(); ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue