Skip to content

Commit

Permalink
Revert "Migrate away from PythonInterp CMake module (ros#1195)"
Browse files Browse the repository at this point in the history
This reverts commit 5a4540c.
pybind/pybind11#5472
  • Loading branch information
rhaschke committed Dec 19, 2024
1 parent 0b3805c commit c03717c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12.0)
cmake_minimum_required(VERSION 3.0.2)

set(catkin_EXTRAS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

Expand Down
8 changes: 1 addition & 7 deletions cmake/python.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# the CMake variable PYTHON_INSTALL_DIR has the same value as the Python function catkin.builder.get_python_install_dir()

set(PYTHON_VERSION "$ENV{ROS_PYTHON_VERSION}" CACHE STRING "Specify specific Python version to use ('major.minor' or 'major')")
find_package(Python ${PYTHON_VERSION} REQUIRED)

# Set these legacy variables for compatibility with what PythonInterp used to do
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
set(PYTHON_VERSION_MAJOR ${Python_VERSION_MAJOR})
set(PYTHON_VERSION_MINOR ${Python_VERSION_MINOR})
set(PYTHON_VERSION_PATCH ${Python_VERSION_PATCH})
find_package(PythonInterp ${PYTHON_VERSION} REQUIRED)

message(STATUS "Using PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")

Expand Down

0 comments on commit c03717c

Please sign in to comment.