Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cmake error: Invalid escape sequence \U

Tags:

path

cmake

While running my OpenCL code in VC++ 10 by using CMake I am getting the following error:

CMake Error at CMakeLists.txt:6 (set): Syntax error in cmake code at
C:/Users/Shreedhar/Desktop/testCL/CMakeLists.txt:6

when parsing string
C:\Users\Shreedhar\Desktop\test_CL\CMakeLists
Invalid escape sequence \U
like image 470
shunya Avatar asked Dec 06 '12 05:12

shunya


2 Answers

Use forward slashes / in your paths

C:/Users/Shreedhar/Desktop/test_CL/CMakeLists
like image 192
Simon Avatar answered Oct 13 '22 09:10

Simon


If you are reading user input like environment variables then you'll need to do this by character replacement feature of string method.

string(REPLACE "\\" "/" outputVar ${_inputVar})
like image 17
Baris Demiray Avatar answered Oct 13 '22 09:10

Baris Demiray