c++ - Add raw string macro using target_compile_definitions -
i want add cmakelists.txt
raw string macro equivalent of:
#if defined(q_os_win) #define commport_name r"(\\.\com1)" #elif defined(q_os_unix) #define commport_name "/dev/ttys0" #else #error "platform not supported" #endif
i tried following:
if(win32) target_compile_definitions(${project_name} private -dcommport_name="r"(\\.\com1)"") elseif(unix) target_compile_definitions(${project_name} private -dcommport_name="/dev/ttys0") else() message(fatal_error "platform not supported") endif()
but error:
cmake warning (dev) @ path/to/project/cmakelists.txt:68: syntax warning in cmake code @ column 85
argument not separated preceding token whitespace. warning project developers. use -wno-dev suppress it.
is possible use kind of quotes, '' in bash prevent occurrence of above error?
Comments
Post a Comment