Skip to content

Instantly share code, notes, and snippets.

@metacollin
Created March 31, 2017 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metacollin/d1d95f49a052286666bd34fbb395f384 to your computer and use it in GitHub Desktop.
Save metacollin/d1d95f49a052286666bd34fbb395f384 to your computer and use it in GitHub Desktop.
diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt
index 20769c6a4..d81418deb 100644
--- a/pcbnew/CMakeLists.txt
+++ b/pcbnew/CMakeLists.txt
@@ -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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment