Find the Simplified Wrapper and Interface Generator (SWIG) executable.
This module finds an installed SWIG and determines its version. If a COMPONENTS or OPTIONAL_COMPONENTS argument is given to find_package, it will also determine supported target languages. The module sents the following variables:
Any COMPONENTS given to find_package should be the names of supported target languages as provided to the LANGUAGE argument of swig_add_library, such as python or perl5. Language names must be lowercase.
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.
Example usage requiring SWIG 4.0 or higher and Python language support, with optional Fortran support:
find_package(SWIG 4.0 COMPONENTS python OPTIONAL_COMPONENTS fortran)
if(SWIG_FOUND)
message("SWIG found: ${SWIG_EXECUTABLE}")
if(NOT SWIG_fortran_FOUND)
message(WARNING "SWIG Fortran bindings cannot be generated")
endif()
endif()