Skip to content

FindSWIG: reduce calls to SWIG exe, and clean up variables

Seth R Johnson requested to merge sethrj/cmake:findswig-clean into master

If all SWIG cache variables (EXECUTABLE, DIR, VERSION) are set, there should be no need to invoke the SWIG exe on a reconfigure. This changeset reduces the number of calls to the SWIG executable, and additionally prevents temporary SWIG_xxx values from propagating outside the find_package call.

I also refactored the conditionals to be less nested (and thus more predictable), including changing the definition of SWIG_USE_FILE to reflect that it's if and only if SWIG_FOUND is trure.

Merge request reports