blob: 523b49bd82d219e6e7fac427c3762af310d3913a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#.rst:
# FindSWIG
# --------
# Finds the SWIG executable
#
# This will will define the following variables::
#
# SWIG_FOUND - system has SWIG
# SWIG_EXECUTABLE - the SWIG executable
find_program(SWIG_EXECUTABLE NAMES 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)
|