William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 1 | From d4ddfc7a350011b7944ed8d6bca80f164dfd1387 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 2 | From: Romain Naour <romain.naour@smile.fr> |
| 3 | Date: Fri, 10 Jul 2020 17:08:34 +0200 |
| 4 | Subject: [PATCH] pyiec61850: don't break CMAKE_INSTALL_PATH by trying to find |
| 5 | python modules install path (site-packages) |
| 6 | |
| 7 | https://stackoverflow.com/questions/1242904/finding-python-site-packages-directory-with-cmake |
| 8 | |
| 9 | Signed-off-by: Romain Naour <romain.naour@smile.fr> |
| 10 | --- |
| 11 | pyiec61850/CMakeLists.txt | 11 ++--------- |
| 12 | 1 file changed, 2 insertions(+), 9 deletions(-) |
| 13 | |
| 14 | diff --git a/pyiec61850/CMakeLists.txt b/pyiec61850/CMakeLists.txt |
| 15 | index 159ef4b..d1732a1 100644 |
| 16 | --- a/pyiec61850/CMakeLists.txt |
| 17 | +++ b/pyiec61850/CMakeLists.txt |
| 18 | @@ -31,14 +31,7 @@ endif() |
| 19 | |
| 20 | swig_link_libraries(iec61850 ${PYTHON_LIBRARIES} ${LIBS}) |
| 21 | |
| 22 | -# Finding python modules install path |
| 23 | -execute_process( |
| 24 | - COMMAND ${PYTHON_EXECUTABLE} -c |
| 25 | - "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())" |
| 26 | - OUTPUT_VARIABLE PYTHON_SITE_DIR |
| 27 | -) |
| 28 | - |
| 29 | -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iec61850.py DESTINATION ${PYTHON_SITE_DIR}) |
| 30 | -install(TARGETS _iec61850 LIBRARY DESTINATION ${PYTHON_SITE_DIR}) |
| 31 | +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iec61850.py DESTINATION /usr/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) |
| 32 | +install(TARGETS _iec61850 LIBRARY DESTINATION /usr/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages) |
| 33 | |
| 34 | add_test(test_pyiec61850 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/test_pyiec61850.py) |
| 35 | -- |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 36 | 2.31.1 |
Andrew Geissler | a2681d9 | 2020-10-16 10:17:07 -0500 | [diff] [blame] | 37 | |