From e1be85a5522466ecbdd594d9e5e3cd3014b0089f Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Wed, 9 Jan 2013 19:22:40 +0100 Subject: [PATCH] Match compiler: Be more user friendly on how to invoke it --- tools/matchcompiler.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/matchcompiler.py b/tools/matchcompiler.py index bf6a620fc..5a3b31dbd 100755 --- a/tools/matchcompiler.py +++ b/tools/matchcompiler.py @@ -1,6 +1,7 @@ #!/usr/bin/python import os +import sys import re import glob @@ -485,6 +486,11 @@ class MatchCompiler: # Main program build_dir = 'build' +# Check if we are invoked from the right place +if not os.path.exists('lib') and not os.path.exists('samples'): + print('Please invoke from the top level cppcheck source dir. Example: tools/matchcompiler.py') + sys.exit(-1) + # Create build directory if needed if not os.path.exists(build_dir): os.makedirs(build_dir)