summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Schueller <schueller@phimeca.com>2021-08-05 15:27:00 +0200
committerVadim Zeitlin <vz-swig@zeitlins.org>2021-10-03 16:32:11 +0200
commit42ed181e0816e32e0145bc02bdd4cc0141519de3 (patch)
treebb89829f4455a681079a07be546b2ea6b2d5dd6d
parent892db20d1244f2514c4c5deb25078e0b3da9942a (diff)
downloadswig-42ed181e0816e32e0145bc02bdd4cc0141519de3.tar.gz
[CMake] Add option to enable pcre
Closes #2031, #2065.
-rw-r--r--CHANGES.current3
-rw-r--r--CMakeLists.txt6
-rw-r--r--Doc/Manual/Windows.html3
3 files changed, 8 insertions, 4 deletions
diff --git a/CHANGES.current b/CHANGES.current
index a118132f8..3492e6df6 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -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.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0b6743471..8a195de54 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()
diff --git a/Doc/Manual/Windows.html b/Doc/Manual/Windows.html
index 9365070e9..eae9ffb84 100644
--- a/Doc/Manual/Windows.html
+++ b/Doc/Manual/Windows.html
@@ -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