Fix build of Python plugin for macOS

This commit is contained in:
Collin Anderson 2017-03-31 08:49:48 -04:00 committed by Chris Pavlina
parent 8cd1df0524
commit 9b876d9d98
1 changed files with 15 additions and 1 deletions

View File

@ -765,7 +765,7 @@ if( KICAD_SCRIPTING_MODULES )
# put everything into bundle at build time, it is relocated at install
add_custom_target( ScriptingModulesPcbnewSoCopy ALL
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.so" "${PYTHON_DEST}/"
DEPENDS _pcbnew
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.so
COMMENT "Copying _pcbnew.so into ${PYTHON_DEST}"
)
add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingWxpythonCopy )
@ -776,6 +776,19 @@ if( KICAD_SCRIPTING_MODULES )
set( PYMOD_EXT "so" )
endif()
if( APPLE )
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
DEPENDS pcbnew_kiface
COMMAND ${CMAKE_COMMAND} -E copy ${OSX_BUNDLE_BUILD_KIFACE_DIR}/_pcbnew.kiface _pcbnew.${PYMOD_EXT}
COMMENT "Creating python's pcbnew native module _pcbnew.${PYMOD_EXT} for command line use."
)
add_custom_target(
pcbnew_python_module ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
)
else()
# For phase 1, copy _pcbnew.kiface to the python module.
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
DEPENDS pcbnew_kiface
@ -786,6 +799,7 @@ if( KICAD_SCRIPTING_MODULES )
pcbnew_python_module ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
)
endif()
endif()