Skip to content

Commit

Permalink
Remove old python cmake code
Browse files Browse the repository at this point in the history
Also don't need to install python3-distutils anymore.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters committed Apr 18, 2024
1 parent 577db0b commit aed0488
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ libeigen3-dev
libgz-cmake4-dev
libgz-utils3-dev
libpython3-dev
python3-distutils
python3-pybind11
python3-pytest
ruby-dev
Expand Down
15 changes: 3 additions & 12 deletions src/python_pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
endif()

if(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION)
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c "if True:
from distutils import sysconfig as sc
print(sc.get_python_lib(plat_specific=True))"
OUTPUT_VARIABLE Python3_SITEARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
# Get install variable from Python3 module
# Python3_SITEARCH is available from 3.12 on, workaround if needed:
find_package(Python3 COMPONENTS Interpreter)
endif()
# Get install variable from Python3 module
# Python3_SITEARCH is available from 3.12 on, workaround if needed:
find_package(Python3 COMPONENTS Interpreter)

if(USE_DIST_PACKAGES_FOR_PYTHON)
string(REPLACE "site-packages" "dist-packages" GZ_PYTHON_INSTALL_PATH ${Python3_SITEARCH})
Expand Down

0 comments on commit aed0488

Please sign in to comment.