CMake: Normalize installation path on Windows to avoid mixing slashes and backslashes - #9187
Merged
Conversation
Member
Author
|
@joa-quim Could you please check if it works for you on Windows locally? |
Member
|
Hmm, I don't see what I can test locally. I don't use those recipes to build GMT. I have a ConfigUser.cmake to set all that I need. |
Member
Author
|
This PR adds the following lines to |
Member
|
Rebuilt and installed locally and no issues. |
Esteban82
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, we had issues building GMT on Windows with errors like:
The real cause is that Windows uses backslashes (
D:\a\gmt\gmt) while CI (and CMake) uses slashes.PR #9097 fixed the issue by applying a workaround to convert backslashes to slashes. It works for CI, but users who build GMT locally (via WSL or similar) may still have the same issue.
This PR fixes the root issue by normalizing paths on Windows using CMake's
TO_CMAKE_PATHdirective (xref: https://cmake.org/cmake/help/latest/command/file.html#to-cmake-path). With the fix, the CI workflows can be simplified.Helped with Claude Opus 5.