From: xantares Date: Mon, 23 Sep 2013 07:48:49 +0000 (+0200) Subject: Workaround for cmake bug #0013449 X-Git-Tag: v1.1rc1~7 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=95d606d80a612a49a25342e2bea0672789d21c80 Workaround for cmake bug #0013449 --- diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 9341054..fdba559 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -2,7 +2,16 @@ option ( PYTHON_BINDINGS "Build python bindings via swig" ON ) option ( LINK_PYTHON_LIBRARY "Link against python libraries" ON ) if ( PYTHON_BINDINGS ) - find_package ( SWIG ) + # workaround for cmake bug #0013449 + if ( NOT DEFINED CMAKE_FIND_ROOT_PATH ) + find_package ( SWIG ) + else () + find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig ) + if ( SWIG_EXECUTABLE ) + set ( SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake ) + set ( SWIG_FOUND TRUE ) + endif () + endif () find_package ( PythonLibs ) find_package ( PythonInterp ) endif ()