Fixup python module install

INSTALL(FILE) does not handle setting linux-specific attributes in the
same way that INSTALL(TARGET) does.  This patch is suggested by
StefanBruens

Fixes https://gitlab.com/kicad/code/kicad/issues/9974
This commit is contained in:
Seth Hillbrand 2022-06-22 13:26:43 -07:00
parent 3942e31f21
commit 6fd60c5561
2 changed files with 8 additions and 2 deletions

View File

@ -21,7 +21,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
cmake_minimum_required( VERSION 3.12 FATAL_ERROR )
cmake_minimum_required( VERSION 3.16 FATAL_ERROR )
# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html

View File

@ -829,7 +829,13 @@ 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" )
install( TARGETS pcbnew_kiface DESTINATION ${PYTHON_DEST} COMPONENT binary )
cmake_policy(SET CMP0087 NEW)
install( CODE
"file( RENAME
\$ENV{DESTDIR}${PYTHON_DEST}/\$<TARGET_FILE_NAME:pcbnew_kiface>
\$ENV{DESTDIR}${PYTHON_DEST}/_pcbnew.so
)" )
set( PYMOD_EXT "so" )
endif()