CMake Warning (dev) at CMakeLists.txt:5 (set): Syntax error in cmake code at E:/PycharmProjects/mend/tensorrtx/yolov5/CMakeLists.txt:5 when parsing string E:\itOpencv\opencv\build Invalid escape sequence \i Policy CMP0010 is not set: Bad variable reference syntax is an error. Run "cmake --help-policy CMP0010" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at CMakeLists.txt:10 (set): Syntax error in cmake code at
时间: 2024-03-11 14:46:25 浏览: 268
这个警告信息表明,在 CMakeLists.txt 文件的第 5 行和第 10 行出现了语法错误。具体地说,第 5 行中的字符串 "E:\itOpencv\opencv\build" 中的反斜杠 "\" 被视为无效的转义序列,需要进行修复。在 CMake 中,反斜杠是用来进行路径分隔符转义的,因此您可以将路径中的反斜杠改为正斜杠 "/",或者将每个反斜杠都加倍,即将 "\" 改为 "\\"。另外,警告信息中提到了 CMP0010 策略,您可以通过在 CMakeLists.txt 文件中添加 `cmake_policy(SET CMP0010 NEW)` 来设置该策略并消除警告。
相关问题
CMake Error at CMakeLists.txt:125: Parse error. Expected "(", got unquoted argument with text "catkin_DIR=/path/to/catkinConfig.cmake/directory".
I apologize for the confusion. The error you encountered is due to incorrect syntax in the CMakeLists.txt file. To resolve this issue, you need to update the CMakeLists.txt file with the correct syntax for setting the "catkin_DIR" variable.
Here's the correct syntax for setting the "catkin_DIR" variable in the CMakeLists.txt file:
```cmake
set(catkin_DIR "/path/to/catkinConfig.cmake/directory")
```
Replace "/path/to/catkinConfig.cmake/directory" with the actual path to the directory containing "catkinConfig.cmake".
Make sure to place this line of code before the line where the error is occurring (at line 125 in your case). After making this change, try building your project again.
阅读全文