Conversion of uVision project to csolution issue

Exporting project works fine, and opening in VSCode works fine...

Attempting to build project...

-- stdout output is:
-- Configuring incomplete, errors occurred!

-- stderr output is:
CMake Error at groups.cmake:18 (add_library):
  Syntax error in cmake code at

    C:/Data/project_name_stuff/groups.cmake:18

  when parsing string

    Group_mark\cmsis_core\m-profile

  Invalid character escape '\c'.

Meaning that characters that work fine in uVision group names can cause issues after conversion to csolution...

Why does the conversion not fail in this case when there are characters in the group names that are not supported afterwards?
Or automatically convert such characters to something supported?

In this case the groupname in uVision is mark\cmsis_core\m-profile and the \ is causing issues.

The project has hundreds of groupnames that include backslashes in the names...

Parents
  • When exported to CMake-based csolution projects, these group names (as strings) are used directly, but since \ is treated as an escape character in CMake, it causes a syntax error.

    For a quick fix, after export, open the cproject.yml file and simply use Ctrl + F → Replace All to replace the backslashes (i.e., change \ to _ or /). That should allow the CMake configuration to complete successfully.

    I’ve already reported this internally so that the uv2csolution tool can handle such characters automatically in the future.

Reply
  • When exported to CMake-based csolution projects, these group names (as strings) are used directly, but since \ is treated as an escape character in CMake, it causes a syntax error.

    For a quick fix, after export, open the cproject.yml file and simply use Ctrl + F → Replace All to replace the backslashes (i.e., change \ to _ or /). That should allow the CMake configuration to complete successfully.

    I’ve already reported this internally so that the uv2csolution tool can handle such characters automatically in the future.

Children
No data