From 6104643db05607898f660bcbf84cebad440deef5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Feb 2019 15:26:31 +0100 Subject: [PATCH] CMake: pro2cmake.py: Remove leading ./ in paths Remove leading './' from paths before writing them into CMakeLists.txt. Change-Id: I5680a3470cf491a8805b559197f94f8e6a6ce9b7 Reviewed-by: Albert Astals Cid Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 891e42003a..5e93a21a02 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -86,7 +86,7 @@ def map_to_file(f: str, top_dir: str, current_dir: str, if f.startswith('$$QT_SOURCE_TREE'): return "${PROJECT_SOURCE_DIR}/" + f[17:] if f.startswith("./"): - return os.path.join(current_dir, f) + return os.path.join(current_dir, f) if current_dir != '.' else f[2:] if want_absolute_path and not os.path.isabs(f): return os.path.join(current_dir, f) return f @@ -98,6 +98,8 @@ def map_source_to_cmake(source: str, base_dir: str, return '' if source.startswith('$$PWD/'): return source[6:] + if source.startswith('./'): + return source[2:] if source == '.': return "${CMAKE_CURRENT_SOURCE_DIR}" if source.startswith('$$QT_SOURCE_TREE/'):