aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/common.py
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-11-10 09:32:45 +0100
committerEike Ziller <eike.ziller@qt.io>2020-11-10 09:50:23 +0000
commit88498101a0e32ea89654c27ee5a1822606351d83 (patch)
treeefadb305f7d30a32083b5417efc34e210ed33cf6 /scripts/common.py
parentad48f2639c80ece9b8a271a8809d44561177995a (diff)
Build scripts: Fix path format for cmake calls
Make sure to pass posix style paths to CMAKE_PREFIX_PATH, CMAKE_MODULE_PATH and CMAKE_INSTALL_PREFIX. Otherwise this can lead to funny "Unknown control sequence \U" kind of errors. Follow-up of fceaff1a6fba4a99d07a45ec07142898d7a0fca3 Change-Id: I1c8445f9c298a17115bca6b42f099a99e33d6de2 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'scripts/common.py')
-rw-r--r--scripts/common.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/common.py b/scripts/common.py
index a828faca2de..df025cf839e 100644
--- a/scripts/common.py
+++ b/scripts/common.py
@@ -40,6 +40,12 @@ def is_linux_platform():
def is_mac_platform():
return sys.platform.startswith('darwin')
+def to_posix_path(path):
+ if is_windows_platform():
+ # should switch to pathlib from python3
+ return path.replace('\\', '/')
+ return path
+
def check_print_call(command, workdir, env=None):
print('------------------------------------------')
print('COMMAND:')