pcbnew: Fix cmake to work with no wxPython on macOS

This commit is contained in:
Ian McInerney 2019-12-22 02:04:15 +00:00
parent 1d050e9b9d
commit bf5dba847c
1 changed files with 11 additions and 2 deletions

View File

@ -744,7 +744,7 @@ if( KICAD_SCRIPTING )
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.py
COMMENT "Copying pcbnew.py into ${PYTHON_DEST}"
)
add_dependencies( ScriptingPcbnewPyCopy ScriptingWxpythonCopy )
add_dependencies( ScriptingPcbnewPyCopy ScriptingPythonDirectoryCreation )
endif()
# python plugins
@ -791,7 +791,7 @@ if( KICAD_SCRIPTING_MODULES )
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.so
COMMENT "Copying _pcbnew.so into ${PYTHON_DEST}"
)
add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingWxpythonCopy )
add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingPythonDirectoryCreation )
set( PYMOD_EXT "so" )
else() # only linux remains among supported platforms
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.kiface DESTINATION ${PYTHON_DEST} COMPONENT binary RENAME "_pcbnew.so" )
@ -826,6 +826,14 @@ endif()
if( APPLE )
if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
# If we don't have wxPython, then we must create the site-packages directory
add_custom_target( ScriptingPythonDirectoryCreation ALL
COMMAND ${CMAKE_COMMAND} -E make_directory "${PYTHON_DEST}"
COMMENT "Creating Python library directory ${PYTHON_DEST}"
)
endif()
if( KICAD_SCRIPTING_WXPYTHON )
# find wx-X.Y-osx_cocoa path below PYTHON_SITE_PACKAGE_PATH
file( GLOB WXPYTHON_DIR RELATIVE ${PYTHON_SITE_PACKAGE_PATH} ${PYTHON_SITE_PACKAGE_PATH}/wx-?.?-osx_cocoa )
if( NOT WXPYTHON_DIR )
@ -837,5 +845,6 @@ if( APPLE )
COMMAND ${CMAKE_COMMAND} -E copy "${PYTHON_SITE_PACKAGE_PATH}/wxversion.py" "${PYTHON_DEST}"
COMMENT "Copying wxPython into ${PYTHON_DEST}"
)
add_dependencies( ScriptingWxpythonCopy ScriptingPythonDirectoryCreation )
endif()
endif()