Use symlink to pcbnew kiface for python module on Linux
Instead of installing an identical shared library into the Python folder, just use a link to the existing library instead. Fixes https://gitlab.com/kicad/code/kicad/issues/9974
This commit is contained in:
parent
b51d8c9825
commit
9bb5beb264
|
@ -869,6 +869,16 @@ else()
|
|||
set( PYTHON_DEST "${PYTHON_SITE_PACKAGE_PATH}"
|
||||
CACHE PATH "Python module install path."
|
||||
)
|
||||
|
||||
if( IS_ABSOLUTE ${PYTHON_SITE_PACKAGE_PATH} )
|
||||
set( PYTHON_FULL_DEST "${PYTHON_SITE_PACKAGE_PATH}"
|
||||
CACHE PATH "Python module full install path."
|
||||
)
|
||||
else()
|
||||
set( PYTHON_FULL_DEST "${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE_PACKAGE_PATH}"
|
||||
CACHE PATH "Python module full install path."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
message( STATUS "Python module install path: ${PYTHON_DEST}" )
|
||||
|
||||
|
|
|
@ -828,9 +828,19 @@ elseif( APPLE )
|
|||
)
|
||||
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" )
|
||||
else()
|
||||
# Linux is the remaining platform, and we will create a symlink for the kiface from the python site-packages directory.
|
||||
set( PYMOD_EXT "so" )
|
||||
|
||||
if( IS_ABSOLUTE ${KICAD_KIFACE} )
|
||||
file( RELATIVE_PATH PCBNEW_PYTHON_SYMLINK ${PYTHON_FULL_DEST} ${KICAD_KIFACE}/_pcbnew${KIFACE_SUFFIX} )
|
||||
else()
|
||||
file( RELATIVE_PATH PCBNEW_PYTHON_SYMLINK ${PYTHON_FULL_DEST} ${CMAKE_INSTALL_PREFIX}/${KICAD_KIFACE}/_pcbnew${KIFACE_SUFFIX} )
|
||||
endif()
|
||||
|
||||
install( CODE "message( STATUS \"Symlinking ${PYTHON_FULL_DEST}/_pcbnew.${PYMOD_EXT} to _pcbnew${KIFACE_SUFFIX}\")
|
||||
execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink \"${PCBNEW_PYTHON_SYMLINK}\" \"${PYTHON_FULL_DEST}/_pcbnew.${PYMOD_EXT}\" )"
|
||||
)
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
|
@ -843,7 +853,7 @@ if( APPLE )
|
|||
pcbnew_python_module ALL
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
|
||||
)
|
||||
else()
|
||||
elseif( WIN32 )
|
||||
# For phase 1, copy _pcbnew.kiface to the python module.
|
||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT}
|
||||
DEPENDS pcbnew_kiface
|
||||
|
|
Loading…
Reference in New Issue