summaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen/CMakeLists.txt
diff options
context:
space:
mode:
authorDamjan Marion <dmarion@me.com>2023-02-15 22:10:05 +0100
committerDave Wallace <dwallacelf@gmail.com>2023-03-07 02:29:56 +0000
commit16cc15b23227c4ec866405b1bf205faf3d0f4a56 (patch)
tree18060d5ffa607f4a6718351a3dcdc103598cbb4c /src/tools/vppapigen/CMakeLists.txt
parent1cada9ad78fa8d1b6e6d812e0e407cde7f05d262 (diff)
build: check for presence of python ply
Type: improvement Change-Id: I4f190607bfce404fbe68ec968e6923509ea9519b Signed-off-by: Damjan Marion <dmarion@me.com>
Diffstat (limited to 'src/tools/vppapigen/CMakeLists.txt')
-rw-r--r--src/tools/vppapigen/CMakeLists.txt16
1 files changed, 16 insertions, 0 deletions
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