From 95d606d80a612a49a25342e2bea0672789d21c80 Mon Sep 17 00:00:00 2001 From: xantares Date: Mon, 23 Sep 2013 09:48:49 +0200 Subject: [PATCH] Workaround for cmake bug #0013449 --- python/CMakeLists.txt | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) 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 () -- 1.7.1