Skip to content

Commit

Permalink
Merge branch 'master' into percustompypinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Oct 30, 2023
2 parents 417997c + 246ae16 commit dff3deb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright: (C) 2022 Fondazione Istituto Italiano di Tecnologia
# Copyright: (C) Fondazione Istituto Italiano di Tecnologia
# Authors: Silvio Traversaro
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT

cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.8...3.16)

project(icub-models
VERSION 2.3.0)
Expand Down
9 changes: 7 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ if(ICUB_MODELS_USES_PYTHON)
if(ICUB_MODELS_DETECT_ACTIVE_PYTHON_SITEPACKAGES)
set(ICUB_MODELS_PYTHON_INSTALL_DIR ${Python3_SITELIB})
else()
execute_process(COMMAND ${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix=''))"
OUTPUT_VARIABLE _PYTHON_INSTDIR)
if(Python3_VERSION VERSION_GREATER_EQUAL 3.12)
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import os;import sysconfig;relative_site_packages = sysconfig.get_path('purelib').replace(sysconfig.get_path('data'), '').lstrip(os.path.sep);print(relative_site_packages)"
OUTPUT_VARIABLE _PYTHON_INSTDIR)
else()
execute_process(COMMAND ${Python3_EXECUTABLE} -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1,0,prefix=''))"
OUTPUT_VARIABLE _PYTHON_INSTDIR)
endif()
string(STRIP ${_PYTHON_INSTDIR} _PYTHON_INSTDIR_CLEAN)
set(ICUB_MODELS_PYTHON_INSTALL_DIR ${_PYTHON_INSTDIR_CLEAN})
endif()
Expand Down

0 comments on commit dff3deb

Please sign in to comment.