I have something such as this in my cmake:
set(MyLib_SRC $ENV{MyLib_DIR}/MyLib.cpp)
add_library(MyLibrary STATIC ${MyLib_SRC})
but when I ran the cmake, I am getting this error:
CMake Warning (dev) at CMakeLists.txt:97 (add_library):
Syntax error in cmake code when parsing string
D:NewDevelopmentLib/myLib.cpp
Invalid escape sequence N
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.
I read this OS answer cmake parse error :Invalid escape sequence o but How can I chang the macro (which macro!) to a function?
The value of env variable is
MyLib_DIR=D:NewDevelopmentLib
See Question&Answers more detail:os