diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/buildtools/FindSWIG.cmake | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | cmake/modules/buildtools/FindSWIG.cmake | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/modules/buildtools/FindSWIG.cmake b/cmake/modules/buildtools/FindSWIG.cmake new file mode 100644 index 0000000..fba544b --- /dev/null +++ b/cmake/modules/buildtools/FindSWIG.cmake @@ -0,0 +1,29 @@ +#.rst: +# FindSWIG +# -------- +# Finds the SWIG executable +# +# This will define the following variables:: +# +# SWIG_FOUND - system has SWIG +# SWIG_EXECUTABLE - the SWIG executable + +find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig + PATH_SUFFIXES swig) +if(SWIG_EXECUTABLE) + execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib + OUTPUT_VARIABLE SWIG_DIR + ERROR_VARIABLE SWIG_swiglib_error + RESULT_VARIABLE SWIG_swiglib_result) + execute_process(COMMAND ${SWIG_EXECUTABLE} -version + OUTPUT_VARIABLE SWIG_version_output + ERROR_VARIABLE SWIG_version_output + RESULT_VARIABLE SWIG_version_result) + string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1" + SWIG_VERSION "${SWIG_version_output}") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SWIG + REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR + VERSION_VAR SWIG_VERSION) |