From: Damjan Marion Date: Wed, 15 Feb 2023 21:10:05 +0000 (+0100) Subject: build: check for presence of python ply X-Git-Tag: v23.10-rc0~165 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F84%2F38284%2F3;p=vpp.git build: check for presence of python ply Type: improvement Change-Id: I4f190607bfce404fbe68ec968e6923509ea9519b Signed-off-by: Damjan Marion --- 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