From a2483d48f36938436500f1721340aa0162ecf723 Mon Sep 17 00:00:00 2001 From: Marco Serantoni Date: Sat, 8 Feb 2014 00:40:11 +0100 Subject: [PATCH] [MacOSX] Fixing qa, thanks Miguel Angel for the feedback --- CMakeLists.txt | 13 ++++++++++--- qa/CMakeLists.txt | 6 +++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8a47a5b13..25e58e036a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,8 +383,6 @@ if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC ) endif() message(STATUS "SWIG_EXECUTABLE: ${SWIG_EXECUTABLE}") - set( PYTHON_EXECUTABLE /usr/bin/python2.6 ) - set( PYTHON_DEST ${LIBWXPYTHON_ROOT}/wxPython/lib/python2.6/site-packages ) set(wxWidgets_BIN_DIR ${LIBWXPYTHON_ROOT}/bin/wxrc ) @@ -504,7 +502,16 @@ set( INC_AFTER # Find Python and other scripting resources if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES ) - set( PythonInterp_FIND_VERSION ) + + if( NOT APPLE ) + set( PythonInterp_FIND_VERSION ) + else() + set( PYTHON_LIBRARY /System/Library/Frameworks/Python.framework/Versions/2.6/Python ) + set( PYTHON_INCLUDE_DIR /System/Library/Frameworks/Python.framework/Versions//2.6/include/python2.6 ) + set( PythonInterp_FIND_VERSION 2.6 ) + set( PythonLibs_FIND_VERSION 2.6 ) + endif() + find_package( PythonInterp ) check_find_package_result( PYTHONINTERP_FOUND "Python Interpreter" ) diff --git a/qa/CMakeLists.txt b/qa/CMakeLists.txt index 783987f585..796575d288 100644 --- a/qa/CMakeLists.txt +++ b/qa/CMakeLists.txt @@ -1,8 +1,12 @@ if( KICAD_SCRIPTING_MODULES ) + if( APPLE AND ( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC ) ) + set( PYTHON_QA_PATH :${LIBWXPYTHON_ROOT}/wxPython/lib/python2.6/site-packages ) + endif() + # build target that runs the QA tests through scripting add_custom_target( qa - COMMAND PYTHONPATH=${CMAKE_BINARY_DIR}/pcbnew ${PYTHON_EXECUTABLE} test.py + COMMAND PYTHONPATH=${CMAKE_BINARY_DIR}/pcbnew${PYTHON_QA_PATH} ${PYTHON_EXECUTABLE} test.py COMMENT "running qa" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}