Check for wxPython.h when wxPython scripting is enabled.

Fixes lp:1785663

https://bugs.launchpad.net/kicad/+bug/1785663
This commit is contained in:
Wayne Stambaugh 2018-10-20 09:21:12 -04:00 committed by Maciej Suminski
parent de971df4c6
commit 9519de8ab2
1 changed files with 21 additions and 0 deletions

View File

@ -822,6 +822,9 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message( STATUS "wxWidgets_TOOLKIT_FOUND=${wxWidgets_TOOLKIT_FOUND}" )
message( STATUS "WXPYTHON_TOOLKIT_FOUND=${WXPYTHON_TOOLKIT_FOUND}" )
# Check if wxWidgets toolkits match, it is a Linux-only issue
if( UNIX AND NOT APPLE AND NOT wxWidgets_TOOLKIT_FOUND STREQUAL WXPYTHON_TOOLKIT_FOUND )
message( FATAL_ERROR "\nwxWidgets and wxPython use different toolkits "
@ -830,6 +833,24 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
"${wxWidgets_TOOLKIT_FOUND} or add '-DKICAD_SCRIPTING_WXPYTHON=OFF' to cmake "
"parameters to disable wxPython support." )
endif()
message( STATUS "wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}" )
# wxPython appears to be installed and valid so make sure the headers are available.
foreach( path ${wxWidgets_INCLUDE_DIRS} )
message( STATUS "Searching for wx/wxPython/wxPython.h in ${path}" )
find_path( wxPYTHON_INCLUDE_DIRS wx/wxPython/wxPython.h
PATHS "${path}" )
if( wxPYTHON_INCLUDE_DIRS )
break()
endif()
endforeach()
if( NOT wxPYTHON_INCLUDE_DIRS )
message( FATAL_ERROR "Cannot find wxPython.h." )
endif()
endif()
#message( STATUS "PYTHON_INCLUDE_DIRS:${PYTHON_INCLUDE_DIRS}" )