summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindSWIG/components.cmake
diff options
context:
space:
mode:
authorSeth R Johnson <johnsonsr@ornl.gov>2020-02-21 03:05:55 (GMT)
committerSeth R Johnson <johnsonsr@ornl.gov>2020-02-26 15:12:30 (GMT)
commite131d9f974fd51d0cecb8f3e23d72f2aa8f12ec8 (patch)
tree8a390f2bd7f55f54284d1718abed14a69d1b4e71 /Tests/RunCMake/FindSWIG/components.cmake
parent25ca8e5ce5019c0fb8648f7408b864add6b19d83 (diff)
downloadCMake-e131d9f974fd51d0cecb8f3e23d72f2aa8f12ec8.zip
CMake-e131d9f974fd51d0cecb8f3e23d72f2aa8f12ec8.tar.gz
CMake-e131d9f974fd51d0cecb8f3e23d72f2aa8f12ec8.tar.bz2
FindSWIG: Add COMPONENTS support for SWIG target languages
Newer versions of SWIG drop support for some target languages, and some forks of SWIG (such as for Fortran and MATLAB) aren't supported by the mainline version of SWIG. Swig versions as old as 1.3.6 (circa 2001) and possibly older use the same format for listing available wrappers "%-15s - Generate %s wrappers", so component detection should be quite reliable.
Diffstat (limited to 'Tests/RunCMake/FindSWIG/components.cmake')
-rw-r--r--Tests/RunCMake/FindSWIG/components.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindSWIG/components.cmake b/Tests/RunCMake/FindSWIG/components.cmake
new file mode 100644
index 0000000..b79a81e
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/components.cmake
@@ -0,0 +1,9 @@
+# Note that 'perl' will not be found because it is not lowercase.
+find_package(SWIG REQUIRED
+ COMPONENTS java
+ OPTIONAL_COMPONENTS python PERL)
+
+message(STATUS "SWIG_VERSION='${SWIG_VERSION}'")
+foreach(_lang java python PERL)
+ message(STATUS "SWIG_${_lang}_FOUND=${SWIG_${_lang}_FOUND}")
+endforeach()