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 <alexandru.croitor@qt.io>
This commit is contained in:
Cristian Maureira-Fredes 2019-09-18 15:04:44 +02:00 committed by Alexandru Croitor
parent 255a6d91db
commit b72adf8a91

View File

@ -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