Files
CMake/Tests/RunCMake/FindSWIG/components.cmake
Seth R Johnson e131d9f974 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.
2020-02-26 10:12:30 -05:00

10 lines
304 B
CMake

# 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()