summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/FindSWIG/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/FindSWIG/version-exact.cmake17
-rw-r--r--Tests/RunCMake/FindSWIG/version.cmake6
3 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake b/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake
index 6becc3c..2bdf913 100644
--- a/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake
@@ -2,4 +2,6 @@ include(RunCMake)
run_cmake(components)
run_cmake(missing-components)
+run_cmake(version)
+run_cmake(version-exact)
run_cmake(version-range)
diff --git a/Tests/RunCMake/FindSWIG/version-exact.cmake b/Tests/RunCMake/FindSWIG/version-exact.cmake
new file mode 100644
index 0000000..ec3651f
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/version-exact.cmake
@@ -0,0 +1,17 @@
+cmake_minimum_required (VERSION 3.18...3.19)
+
+find_package (SWIG)
+if (NOT SWIG_FOUND)
+ message (FATAL_ERROR "Failed to find SWIG")
+endif()
+
+# clean-up SWIG variables
+unset (SWIG_EXECUTABLE CACHE)
+unset (SWIG_DIR CACHE)
+
+set (version ${SWIG_VERSION})
+
+find_package (SWIG ${SWIG_VERSION} EXACT)
+if (NOT SWIG_FOUND)
+ message (FATAL_ERROR "Failed to find SWIG with version ${version} EXACT")
+endif()
diff --git a/Tests/RunCMake/FindSWIG/version.cmake b/Tests/RunCMake/FindSWIG/version.cmake
new file mode 100644
index 0000000..a4f1c39
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/version.cmake
@@ -0,0 +1,6 @@
+cmake_minimum_required (VERSION 3.18...3.19)
+
+find_package (SWIG 1.0)
+if (NOT SWIG_FOUND)
+ message (FATAL_ERROR "Failed to find SWIG with version 1.0")
+endif()