summaryrefslogtreecommitdiffstats
path: root/util/cmake
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-02-07 15:26:31 +0100
committerTobias Hunger <tobias.hunger@qt.io>2019-02-11 09:36:00 +0000
commit6104643db05607898f660bcbf84cebad440deef5 (patch)
treee2d930a9677e34918bda590cb3e00b982944490b /util/cmake
parent64e3c8bb190b95ab4da581dc5667864d8f4a176c (diff)
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 <albert.astals.cid@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'util/cmake')
-rwxr-xr-xutil/cmake/pro2cmake.py4
1 files changed, 3 insertions, 1 deletions
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/'):