diff options
| author | manuel <manuel@mausz.at> | 2017-06-04 16:57:49 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2017-06-04 16:57:49 +0200 |
| commit | f44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (patch) | |
| tree | d8de60fc7e17edeb6f0921726c038ee54b281445 /cmake/modules/FindSWIG.cmake | |
| parent | ae08c8b7221bc965ac40d70e53fc8fcddb050c46 (diff) | |
| download | kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.gz kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.tar.bz2 kodi-pvr-build-f44ecaa4f27e7538ddcad66d40e543bffa2d2d86.zip | |
sync with upstream
Diffstat (limited to 'cmake/modules/FindSWIG.cmake')
| -rw-r--r-- | cmake/modules/FindSWIG.cmake | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/modules/FindSWIG.cmake b/cmake/modules/FindSWIG.cmake new file mode 100644 index 0000000..523b49b --- /dev/null +++ b/cmake/modules/FindSWIG.cmake | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindSWIG | ||
| 3 | # -------- | ||
| 4 | # Finds the SWIG executable | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # SWIG_FOUND - system has SWIG | ||
| 9 | # SWIG_EXECUTABLE - the SWIG executable | ||
| 10 | |||
| 11 | find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig | ||
| 12 | PATH_SUFFIXES swig) | ||
| 13 | if(SWIG_EXECUTABLE) | ||
| 14 | execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib | ||
| 15 | OUTPUT_VARIABLE SWIG_DIR | ||
| 16 | ERROR_VARIABLE SWIG_swiglib_error | ||
| 17 | RESULT_VARIABLE SWIG_swiglib_result) | ||
| 18 | execute_process(COMMAND ${SWIG_EXECUTABLE} -version | ||
| 19 | OUTPUT_VARIABLE SWIG_version_output | ||
| 20 | ERROR_VARIABLE SWIG_version_output | ||
| 21 | RESULT_VARIABLE SWIG_version_result) | ||
| 22 | string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1" | ||
| 23 | SWIG_VERSION "${SWIG_version_output}") | ||
| 24 | endif() | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | find_package_handle_standard_args(SWIG | ||
| 28 | REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR | ||
| 29 | VERSION_VAR SWIG_VERSION) | ||
