Skip to content

Commit

Permalink
Fix CMake build in Windows for CMAKE_MODULE_PATH force to use "/"
Browse files Browse the repository at this point in the history
Signed-off-by: loonghao <[email protected]>
  • Loading branch information
loonghao committed Oct 19, 2023
1 parent ab317e6 commit 22aad9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rezplugins/shell/_utils/powershell_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ def shebang(self):

def setenv(self, key, value):
value = self.escape_string(value, is_path=self._is_pathed_key(key))
if platform_.name == "windows" and key == "CMAKE_MODULE_PATH":
# Fix CMake build in Windows for `CMAKE_MODULE_PATH` force to use "/"
value = value.replace("\\", "/")
self._addline('Set-Item -Path "Env:{0}" -Value "{1}"'.format(key, value))

def prependenv(self, key, value):
Expand Down
3 changes: 3 additions & 0 deletions src/rezplugins/shell/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ def shebang(self):

def setenv(self, key, value):
value = self.escape_string(value, is_path=self._is_pathed_key(key))
if key == "CMAKE_MODULE_PATH":
# Fix CMake build in Windows for `CMAKE_MODULE_PATH` force to use "/"
value = value.replace("\\", "/")
self._addline('set %s=%s' % (key, value))

def unsetenv(self, key):
Expand Down

0 comments on commit 22aad9b

Please sign in to comment.