CMake: run_pro2cmake.py: Add statistics
Change-Id: I78e65970694d0c37c4b3c3ba6e6a83155579ea0f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
eb832cb00a
commit
04d6981702
@ -34,11 +34,27 @@ import sys
|
|||||||
|
|
||||||
script_path = os.path.dirname(os.path.abspath(__file__))
|
script_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
base_path = os.path.dirname(script_path)
|
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:
|
if len(sys.argv) > 1:
|
||||||
base_path = os.path.abspath(sys.argv[1])
|
base_path = os.path.abspath(sys.argv[1])
|
||||||
|
|
||||||
for filename in glob.iglob(base_path + '/**/*.pro', recursive=True):
|
failed_files = []
|
||||||
print('Converting:', filename)
|
|
||||||
subprocess.run([pro2cmake, filename])
|
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))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user