mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
cmake: add custom error messsage about Python 3
This should be helpful as developers need to migrate to Python 3.
This commit is contained in:
parent
c77816aef2
commit
75c8fb12e4
@ -267,7 +267,13 @@ endif()
|
|||||||
# If using catkin, Python 2 is found since it points
|
# If using catkin, Python 2 is found since it points
|
||||||
# to the Python libs installed with the ROS distro
|
# to the Python libs installed with the ROS distro
|
||||||
if (NOT CATKIN_DEVEL_PREFIX)
|
if (NOT CATKIN_DEVEL_PREFIX)
|
||||||
find_package(PythonInterp 3 REQUIRED)
|
find_package(PythonInterp 3)
|
||||||
|
# We have a custom error message to tell users how to install python3.
|
||||||
|
if (NOT PYTHONINTERP_FOUND)
|
||||||
|
message(FATAL_ERROR "Python 3 not found. Please install Python 3:\n"
|
||||||
|
" Ubuntu: sudo apt install python3 python3-devel python3-pip\n"
|
||||||
|
" macOS: brew install python")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(PythonInterp REQUIRED)
|
find_package(PythonInterp REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user