| 1 |
From cb9aabf68d00c0113817c711ccbdca2b3b5fb97e Mon Sep 17 00:00:00 2001 |
| 2 |
From: "A. Maitland Bottoms" <[email protected]> |
| 3 |
Date: Fri, 26 Apr 2024 17:22:28 -0400 |
| 4 |
Subject: [PATCH 1/2] update python |
| 5 |
Forwarded: not-needed |
| 6 |
|
| 7 |
Do a local Python install as part of the build, then let CMake |
| 8 |
handle the install step. Allows package tools to work. |
| 9 |
--- |
| 10 |
bindings/python/CMakeLists.txt | 10 +++++++++- |
| 11 |
1 file changed, 9 insertions(+), 1 deletion(-) |
| 12 |
|
| 13 |
--- a/bindings/python/CMakeLists.txt |
| 14 |
+++ b/bindings/python/CMakeLists.txt |
| 15 |
@@ -205,9 +205,17 @@ |
| 16 |
add_custom_target(${PROJECT_NAME}py ALL DEPENDS _${PROJECT_NAME} WORKING_DIRECTORY |
| 17 |
${CMAKE_BINARY_DIR} COMMAND ${PYTHON_EXECUTABLE_LIB_VERSION} ${SETUP_PY} build) |
| 18 |
|
| 19 |
+add_custom_target(${PROJECT_NAME}py_staged ALL DEPENDS ${PROJECT_NAME}py WORKING_DIRECTORY |
| 20 |
+ ${CMAKE_BINARY_DIR} COMMAND ${PYTHON_EXECUTABLE_LIB_VERSION} ${SETUP_PY} install |
| 21 |
+ --record=${CMAKE_BINARY_DIR}/install_manifest_py.txt |
| 22 |
+ --root=${PROJECT_NAME}py_staged --prefix=${CMAKE_INSTALL_PREFIX}) |
| 23 |
+ |
| 24 |
+install(DIRECTORY ${CMAKE_BINARY_DIR}/${PROJECT_NAME}py_staged${CMAKE_INSTALL_PREFIX} |
| 25 |
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/..) |
| 26 |
+ |
| 27 |
if(NOT SKIP_INSTALL_ALL) |
| 28 |
install(CODE "execute_process(WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
| 29 |
COMMAND ${PYTHON_EXECUTABLE_LIB_VERSION} ${SETUP_PY} install |
| 30 |
--record=${CMAKE_BINARY_DIR}/install_manifest_py.txt |
| 31 |
- --root=\$ENV{DESTDIR}/ --prefix=${CMAKE_INSTALL_PREFIX})") |
| 32 |
+ --root=${PROJECT_NAME}pystaged/$ENV{DESTDIR} --prefix=${CMAKE_INSTALL_PREFIX})") |
| 33 |
endif() |