summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-09-09 14:29:12 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-09-09 19:20:57 +0000
commitb0dbfc3094b9c3950643fc5acf7020e33825dd3e (patch)
tree6e6dc25d58d1b5882c69becc2a92266609314671 /util
parente87677ad4f2dec8c6e5991de1180016ddc937342 (diff)
Skip converting certain projects when they are passed to pro2cmake
Specifically skip cmake tests projects (because they are only needed when Qt is built with qmake). Also skip test qmake projects in qmake's test suite. We might find more tests to skip in the future. Change-Id: I4c3a42db669b31e81fd06206652371b6a70fd8ce Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 91e7f5f5f4..e2ac9ef4b0 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -2485,6 +2485,23 @@ def copy_generated_file_to_final_location(scope: Scope, keep_temporary_files=Fal
os.remove(scope.generated_cmake_lists_path)
+def should_convert_project(project_file_path: str = '') -> bool:
+ qmake_conf_path = find_qmake_conf(project_file_path)
+ qmake_conf_dir_path = os.path.dirname(qmake_conf_path)
+
+ project_relative_path = os.path.relpath(project_file_path, qmake_conf_dir_path)
+
+ # Skip cmake auto tests, they should not be converted.
+ if project_relative_path.startswith('tests/auto/cmake'):
+ return False
+
+ # Skip qmake testdata projects.
+ if project_relative_path.startswith('tests/auto/tools/qmake/testdata'):
+ return False
+
+ return True
+
+
def main() -> None:
args = _parse_commandline()
@@ -2498,6 +2515,11 @@ def main() -> None:
if new_current_dir:
os.chdir(new_current_dir)
+ project_file_absolute_path = os.path.abspath(file)
+ if not should_convert_project(project_file_absolute_path):
+ print('Skipping conversion of project: "{}"'.format(project_file_absolute_path))
+ continue
+
parseresult = parseProFile(file_relative_path, debug=debug_parsing)
if args.debug_parse_result or args.debug: