1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
From: Sebastian Spaeth <Sebastian@SSpaeth.de>
Date: Thu, 27 Oct 2022 10:31:12 +0200
Subject: [PATCH] Use python version as specified by PYVER
To build for all python versions we use the python version as requested by
pybuild.
---
CMakeLists.txt | 2 +-
src/python/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f080b4b..260711f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,7 +78,7 @@ if (WITH_PYTHON)
find_package(SWIG 4.0)
# Use Python3_ROOT_DIR to help find python3, if the correct location is not
# being found by default.
- find_package(Python3 COMPONENTS Interpreter Development)
+ find_package(Python3 ${PYVER} COMPONENTS Interpreter Development)
endif()
if (MSVC)
diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index ced0832..ab94096 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -16,6 +16,6 @@ set_property(TEST pywraps2_test PROPERTY ENVIRONMENT
"PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}/python")
# Install the wrapper.
-install(TARGETS _pywraps2 DESTINATION ${Python3_SITELIB})
+install(TARGETS _pywraps2 DESTINATION "lib/python${PYVER}/dist-packages")
install(FILES "${PROJECT_BINARY_DIR}/python/pywraps2.py"
DESTINATION ${Python3_SITELIB})
|