diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-11-11 18:47:28 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-11-12 10:12:35 +0000 |
commit | 37ab7eae9de557ad58cf371a6ce049fdf7545e6e (patch) | |
tree | a5f5f9f3303689e8504a2ac8cd26ec45788b2fa3 /util/cmake/pro2cmake.py | |
parent | 2199a50a2a8dd7cd75cc6714c981452ffa5a3ed0 (diff) |
pro2cmake: Clean up debug messages
Don't needlessly show a bunch of special case debug messages
unless debugging is enabled.
There used to be a barrage of scary message when using
run_pro2cmake.
Change-Id: I49ab3522e11844a99653034b5f15a634a368d227
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-x | util/cmake/pro2cmake.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ea5f2b91e1..d8168aa489 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -3383,8 +3383,9 @@ def cmakeify_scope( cm_fh.write(buffer_value) -def generate_new_cmakelists(scope: Scope, *, is_example: bool = False) -> None: - print("Generating CMakeLists.gen.txt") +def generate_new_cmakelists(scope: Scope, *, is_example: bool = False, debug: bool = False) -> None: + if debug: + print("Generating CMakeLists.gen.txt") with open(scope.generated_cmake_lists_path, "w") as cm_fh: assert scope.file cm_fh.write(f"# Generated from {os.path.basename(scope.file)}.\n\n") @@ -3415,8 +3416,11 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: scope.merge(include_scope) -def copy_generated_file_to_final_location(scope: Scope, keep_temporary_files=False) -> None: - print(f"Copying {scope.generated_cmake_lists_path} to {scope.original_cmake_lists_path}") +def copy_generated_file_to_final_location( + scope: Scope, keep_temporary_files=False, debug: bool = False +) -> None: + if debug: + print(f"Copying {scope.generated_cmake_lists_path} to {scope.original_cmake_lists_path}") copyfile(scope.generated_cmake_lists_path, scope.original_cmake_lists_path) if not keep_temporary_files: os.remove(scope.generated_cmake_lists_path) @@ -3526,7 +3530,7 @@ def main() -> None: file_scope.dump() print("\n#### End of full .pro/.pri file structure.\n") - generate_new_cmakelists(file_scope, is_example=args.is_example) + generate_new_cmakelists(file_scope, is_example=args.is_example, debug=args.debug) copy_generated_file = True if not args.skip_special_case_preservation: |