summaryrefslogtreecommitdiff
path: root/Modules/FindSWIG.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindSWIG.cmake')
-rw-r--r--Modules/FindSWIG.cmake51
1 files changed, 26 insertions, 25 deletions
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 92c032f6a..ae6ae56f7 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -1,31 +1,32 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSWIG
-# --------
-#
-# Find SWIG
-#
-# This module finds an installed SWIG. It sets the following variables:
-#
-# ::
-#
-# SWIG_FOUND - set to true if SWIG is found
-# SWIG_DIR - the directory where swig is installed
-# SWIG_EXECUTABLE - the path to the swig executable
-# SWIG_VERSION - the version number of the swig executable
-#
-#
-#
-# The minimum required version of SWIG can be specified using the
-# standard syntax, e.g. find_package(SWIG 1.1)
-#
-# All information is collected from the SWIG_EXECUTABLE so the version
-# to be found can be changed from the command line by means of setting
-# SWIG_EXECUTABLE
+#[=======================================================================[.rst:
+FindSWIG
+--------
-find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig)
+Find Simplified Wrapper and Interface Generator (SWIG)
+
+This module finds an installed SWIG. It sets the following variables:
+
+::
+
+ SWIG_FOUND - set to "True" if SWIG is found
+ SWIG_DIR - the directory where swig is installed
+ SWIG_EXECUTABLE - the path to the swig executable
+ SWIG_VERSION - the version number of the swig executable
+
+
+
+The minimum required version of SWIG can be specified using the
+standard syntax, e.g. :command:`find_package(SWIG 1.1)`
+
+All information is collected from the ``SWIG_EXECUTABLE``, so the version
+to be found can be changed from the command line by means of setting
+``SWIG_EXECUTABLE``
+#]=======================================================================]
+
+find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
if(SWIG_EXECUTABLE)
execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
@@ -63,4 +64,4 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
VERSION_VAR SWIG_VERSION )
-mark_as_advanced(SWIG_DIR SWIG_VERSION)
+mark_as_advanced(SWIG_DIR SWIG_VERSION SWIG_EXECUTABLE)