# Accidental escape sequence included install directory on Windows platforms

**URL:** https://discourse.cmake.org/t/accidental-escape-sequence-included-install-directory-on-windows-platforms/14331
**Category:** Usage
**Tags:** os:windows
**Created:** [July 8, 2025, 3:46pm UTC](https://discourse.cmake.org/t/accidental-escape-sequence-included-install-directory-on-windows-platforms/14331 "2025-07-08T15:46:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![adembudak](https://discourse.cmake.org/user_avatar/discourse.cmake.org/adembudak/32/5657_2.png) [@adembudak](https://discourse.cmake.org/u/adembudak)
#### Post date: [July 8, 2025, 3:46pm UTC](https://discourse.cmake.org/t/accidental-escape-sequence-included-install-directory-on-windows-platforms/14331/1 "2025-07-08T15:46:35Z")

</div>

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:

```auto
 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](https://stackoverflow.com/questions/28070810/cmake-generate-error-on-windows-as-it-uses-as-escape-seq) seem to solves it. I worked it out by changing this:

```cmake
install(DIRECTORY ${_imgui_dir}/docs DESTINATION ${CMAKE_INSTALL_DATADIR}/Dear\ ImGui)

```

to this:

```cmake
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?
