Swig CMake: find the whole SWIG package, not just the executable
The package includes other variables that are important for SWIG to work.
It prevented using SWIG on Fedora 29.
@@ -36,12 +36,7 @@ function(qi_swig_wrap_python module_name interface_file)
# we search for the SWIG_EXECUTABLE by yourself, because FindSWIG call find_file
# but when we are cross-compiling and we want to use swig from the system
# then CMAKE_FIND_ROOT_PATH prevent find_file from working.
- find_program(SWIG_EXECUTABLE swig)
- if(NOT SWIG_EXECUTABLE)
- qi_error("Could not find swig executable in PATH, please install it")
- return()
- endif()
-
+ find_package(SWIG REQUIRED)
include("UseSWIG")
set_source_files_properties(${interface_file} PROPERTIES CPLUSPLUS ON)
