From 16cc15b23227c4ec866405b1bf205faf3d0f4a56 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 15 Feb 2023 22:10:05 +0100 Subject: build: check for presence of python ply Type: improvement Change-Id: I4f190607bfce404fbe68ec968e6923509ea9519b Signed-off-by: Damjan Marion --- src/tools/vppapigen/CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/tools/vppapigen/CMakeLists.txt b/src/tools/vppapigen/CMakeLists.txt index bfabc3a670c..04ebed54862 100644 --- a/src/tools/vppapigen/CMakeLists.txt +++ b/src/tools/vppapigen/CMakeLists.txt @@ -11,6 +11,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +find_package( + Python3 + REQUIRED + COMPONENTS Interpreter +) + +execute_process( + COMMAND ${Python3_EXECUTABLE} -c "import ply" + RESULT_VARIABLE _rv + OUTPUT_QUIET +) + +if (NOT ${_rv} EQUAL 0) + message( FATAL_ERROR "The \"ply\" Python3 package is not installed.") +endif() + install( FILES vppapigen.py RENAME vppapigen -- cgit 1.2.3-korg