X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=python%2FCMakeLists.txt;h=fdba559ba6531f889784c05009a67204ec21d16b;hp=93410544fac2a45eec51cb8dd344708b3bbdfe67;hb=95d606d80a612a49a25342e2bea0672789d21c80;hpb=d0c1196190ba2adce20129ae263ceedc029603d6 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 ()