[CMake] Add option to enable pcre

Closes #2031, #2065.
This commit is contained in:
Julien Schueller 2021-08-05 15:27:00 +02:00 committed by Vadim Zeitlin
commit 42ed181e08
3 changed files with 8 additions and 4 deletions

View file

@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.1.0 (in progress)
===========================
2021-10-03: jschueller
[CMake] #2065: Add option to enable or disable PCRE support.
2021-09-16: ianlancetaylor
[Go] Improved _cgo_panic implementation.

View file

@ -73,9 +73,9 @@ if (MSVC)
set (CMAKE_CXX_FLAGS "/EHsc ${CMAKE_CXX_FLAGS}")
endif ()
set (PCRE_REQUIRED_ARG "REQUIRED" CACHE STRING "required arg")
find_package (PCRE ${PCRE_REQUIRED_ARG})
if (PCRE_FOUND)
option (WITH_PCRE "Enable pcre" ON)
if (WITH_PCRE)
find_package (PCRE REQUIRED)
set (HAVE_PCRE 1)
include_directories (${PCRE_INCLUDE_DIRS})
endif()

View file

@ -251,7 +251,8 @@ For fully working build steps always check the Continuous Integration setups cur
and save to a folder e.g. C:\Tools\Bison
</li>
<li>
Install PCRE using Nuget using the following command: <pre>C:\Tools\nuget install pcre -Version 8.33.0.1 -OutputDirectory C:\Tools\pcre</pre>
Install PCRE using Nuget using the following command: <pre>C:\Tools\nuget install pcre -Version 8.33.0.1 -OutputDirectory C:\Tools\pcre</pre>.
Alternatively, use <tt>WITH_PCRE</tt> option to disable PCRE support if you are sure not to need it.
</li>
<li>
We will also need the SWIG source code. Either download a zipped archive from GitHub, or if git is installed clone the latest codebase