diff --git a/src/rezplugins/shell/cmd.py b/src/rezplugins/shell/cmd.py index a63f5cb60..d203e7ea6 100644 --- a/src/rezplugins/shell/cmd.py +++ b/src/rezplugins/shell/cmd.py @@ -280,7 +280,9 @@ def normalize_path(self, path): This isn't explicitely necessary on Windows since around Windows 7, CMD has supported mixed slashes as a path separator. However, - we can still call this method to normalize paths for consistency. + we can still call this method to normalize paths for consistency and + have better interoperability with some software such as cmake which + prefer forward slashes e.g. GH issue #1321. Args: path (str): Path to normalize. @@ -292,7 +294,8 @@ def normalize_path(self, path): if not config.enable_path_normalization: return path - normalized_path = path.replace("/", "\\") + path = os.path.normpath(path) + normalized_path = path.replace("\\", "/") if path != normalized_path: log("CMD normalize_path()")