diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py index 4340eab0941..1a3c1581e39 100755 --- a/util/cmake/run_pro2cmake.py +++ b/util/cmake/run_pro2cmake.py @@ -34,11 +34,27 @@ import sys script_path = os.path.dirname(os.path.abspath(__file__)) base_path = os.path.dirname(script_path) -pro2cmake = script_path + '/pro2cmake.py' +pro2cmake = os.path.join(script_path, 'pro2cmake.py') if len(sys.argv) > 1: base_path = os.path.abspath(sys.argv[1]) -for filename in glob.iglob(base_path + '/**/*.pro', recursive=True): - print('Converting:', filename) - subprocess.run([pro2cmake, filename]) +failed_files = [] + +pro_file_count = 0 +for filename in glob.iglob(os.path.join(base_path, '**/*.pro'), + recursive=True): + pro_file_count += 1 + print('{} ({}): Converting: {} ...' + .format(pro_file_count, len(failed_files), filename)) + result = subprocess.run([pro2cmake, os.path.basename(filename)], + cwd=os.path.dirname(filename)) + if result.returncode != 0: + failed_files.append(filename) + +if failed_files: + print('The following files were not successfully ' + 'converted ({} of {}):'.format(len(failed_files), pro_file_count)) + for f in failed_files: + print(' "{}"'.format(f)) +