Hello everyone, I’m trying to setup GitHub workflow for the project I worked on CMakeForImGui, which adds CMake support for ImGui… anyway. The workflow file configures, builds and installs on different platforms, but having a problem at install step on Windows. The install path includes a ‘\a’ sequence, and caused this error:
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
##[endgroup]
[1/1] build/cmake_install.cmake
CMake Error at build/cmake_install.cmake:36 (file):
Syntax error in cmake code at
D:/a/CMakeForImGui/CMakeForImGui/build/cmake_install.cmake:36
when parsing string
D:\a\CMakeForImGui\CMakeForImGui/imgui/docs
Invalid character escape '\a'.
There is this Stack Overflow question seem to solves it. I worked it out by changing this:
install(DIRECTORY ${_imgui_dir}/docs DESTINATION ${CMAKE_INSTALL_DATADIR}/Dear\ ImGui)
to this:
cmake_path(CONVERT ${_imgui_dir}/docs TO_CMAKE_PATH_LIST _imgui_docs_dir)
install(DIRECTORY ${_imgui_docs_dir} DESTINATION ${CMAKE_INSTALL_DATADIR}/Dear\ ImGui)
but now it fails on the other path
My question is, is this a known thing on Windows that needs to worked out by converting all the install paths with cmake_path()
command (or with $<PATH:CMAKE_PATH >
generator expression) or did i just hit an weird path appear on this runner machine?