Skip to content

Commit

Permalink
Add --break-system-packages if Unix and Python >= 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
sanguinariojoe committed Oct 10, 2023
1 parent f7411e7 commit b7b604d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion wrappers/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@ add_custom_target(python_wrapper ALL DEPENDS ${OUTPUT})
add_dependencies(python_wrapper moordyn)

# Prepare the installation if eventually required
set(PY_INSTALL_ARGS "")
if(${PYTHON_WRAPPER_USERINSTALL})
set(PY_INSTALL_ARGS "--user")
set(PY_INSTALL_ARGS "${PY_INSTALL_ARGS} --user")
endif()
if (UNIX)
if((${Python_VERSION_MAJOR} GREATER 3) OR ((${Python_VERSION_MAJOR} EQUAL 3) AND (${Python_VERSION_MINOR} GREATER 10)))
set(PY_INSTALL_ARGS "${PY_INSTALL_ARGS} --break-system-packages")
endif()
endif()
install(CODE "
execute_process(COMMAND ${Python_EXECUTABLE} -m pip install dist/moordyn-${MOORDYN_VERSION}.tar.gz ${PY_INSTALL_ARGS}
Expand Down

0 comments on commit b7b604d

Please sign in to comment.