cppcheck/build-pcre.txt

69 lines
1.8 KiB
Plaintext
Raw Normal View History

2015-11-01 10:29:44 +01:00
PCRE is a library that is used by the optional "rules" feature for the command
line version of cppcheck. It is 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
2015-11-01 10:29:44 +01:00
to enable rules support. You can disable rules support (removing the PCRE
2013-08-31 16:12:48 +02:00
dependency) by passing HAVE_RULES=no to qmake.
- If you are on Windows, but have PCRE available, you can enable rules support
2013-08-31 16:12:48 +02:00
by passing HAVE_RULES=yes to qmake.
2013-08-31 16:12:48 +02:00
- 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
2010-12-12 11:56:22 +01:00
2015-11-01 10:29:44 +01:00
Build instructions
------------------
2010-12-12 11:56:22 +01:00
Windows
2015-11-01 10:29:44 +01:00
-------
2010-12-12 11:56:22 +01:00
Visual Studio
2013-08-31 16:12:48 +02:00
To build PCRE, download the source code from www.pcre.org and
2015-11-01 10:29:44 +01:00
CMake (https://cmake.org/download/). We assume you use Visual Studio 2015 -
otherwise adapt the commands for your version.
2010-12-12 11:56:22 +01:00
2013-08-31 16:12:48 +02:00
VS Solution file
2015-11-01 10:29:44 +01:00
cmake . -G "Visual Studio 14 2015"
2013-08-31 16:12:48 +02:00
Open PCRE.sln with VS IDE or via cmd:
2015-11-01 10:29:44 +01:00
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
2013-08-31 16:12:48 +02:00
MSBuild PCRE.sln /target:Build /property:Configuration="Release"
2010-12-12 11:56:22 +01:00
2015-11-01 10:29:44 +01:00
For 64-bit target: cmake . -G "Visual Studio 14 2015 Win64"
2010-12-12 11:56:22 +01:00
2013-08-31 16:12:48 +02:00
or using NMake
2015-11-01 10:29:44 +01:00
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
2013-08-31 16:12:48 +02:00
cmake . -G "NMake Makefiles"
nmake
2010-12-12 11:56:22 +01:00
2013-08-31 16:12:48 +02:00
or using MSYS
cmake . -G "MSYS Makefiles"
make
2010-12-12 11:56:22 +01:00
Linux
2015-11-01 10:29:44 +01:00
-----
2010-12-12 11:56:22 +01:00
2015-11-01 10:29:44 +01:00
The normal Makefile should work.
2010-12-12 11:56:22 +01:00
2013-08-31 16:12:48 +02:00
Install PCRE on Ubuntu might be needed:
sudo apt-get install libpcre3 libpcre3-dev
Mac OSX
2015-11-01 10:29:44 +01:00
-------
2013-08-31 16:12:48 +02:00
Install PCRE:
2013-08-31 16:12:48 +02:00
sudo port install pcre
Ensure /path/to/pcre.h is in CXXFLAGS, e.g:
2013-08-31 16:12:48 +02:00
export CXXFLAGS=${CXXFLAGS}:/opt/local/include
Or for MSVC copy pcre.lib and pcre.h in /externals directory.