diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-02-26 13:53:04 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-02-28 08:07:07 +0000 |
commit | 04d69817027c37440a85b0f0ec8b9b0e8c037b56 (patch) | |
tree | 6d8710a9876adbc7a74f43546624f893704dc1ab | |
parent | eb832cb00ae231d31052e885d4482e34aeb2640d (diff) |
CMake: run_pro2cmake.py: Add statistics
Change-Id: I78e65970694d0c37c4b3c3ba6e6a83155579ea0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rwxr-xr-x | util/cmake/run_pro2cmake.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py index 4340eab094..1a3c1581e3 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)) + |