An existing C++ multi project uses CMake 2.8 in QT so far. We want to continue maintaining it in Visual Studio 2010. I generated Visual Studio projects in CMake with option -G "Visual Studio 10"
but now I fail to compile them for the following reason:
In the project we use a well known macro which itself is discussed for example in this question.
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
The macro is defined in CMake in order to provide it to the compiler (cl.exe) as a preprocessor definition:
add_definitions(-DDISALLOW_COPY_AND_ASSIGN\(TypeName\)=\" TypeName(const TypeName&)\; void operator=(const TypeName&)\; \")
Visual Studio does not accept CMake's output and throws compilation errors wherever the macro is used in the code. What would be the proper syntax so that CMake can properly generate it for Visual Studio 2010?