From b72adf8a911f4281c7c56b359f9ae1a35f766fcf Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Wed, 18 Sep 2019 15:04:44 +0200 Subject: [PATCH] Add option to generate pro2cmake on failed ones The option --only-missing was added to check only the cases where there is a pro file and not a CMakeLists.txt Change-Id: Ifc6233552757e0afe8e7242a79f958e8bc77f823 Reviewed-by: Alexandru Croitor --- util/cmake/run_pro2cmake.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py index 5d5f50cc2a8..16ad0534cd2 100755 --- a/util/cmake/run_pro2cmake.py +++ b/util/cmake/run_pro2cmake.py @@ -47,6 +47,12 @@ def parse_command_line(): action="store_true", help="Run pro2cmake only on .pro files that already have a CMakeLists.txt.", ) + parser.add_argument( + "--only-missing", + dest="only_missing", + action="store_true", + help="Run pro2cmake only on .pro files that do not have a CMakeLists.txt.", + ) parser.add_argument( "--only-qtbase-main-modules", dest="only_qtbase_main_modules", @@ -87,6 +93,9 @@ def find_all_pro_files(base_path: str, args: argparse.Namespace): return True return False + def cmake_lists_missing_filter(path): + return not cmake_lists_exists_filter(path) + def qtbase_main_modules_filter(path): main_modules = [ "corelib", @@ -112,6 +121,8 @@ def find_all_pro_files(base_path: str, args: argparse.Namespace): filter_func = None if args.only_existing: filter_func = cmake_lists_exists_filter + elif args.only_missing: + filter_func = cmake_lists_missing_filter elif args.only_qtbase_main_modules: filter_func = qtbase_main_modules_filter