[Cmake] How to remove a #define?

Brad King brad . king at kitware . com
Tue, 23 Sep 2003 16:50:41 -0400 (EDT)


On Tue, 23 Sep 2003, Mathews, Rob wrote:

> And of course it fails as soon as you use a real-world example. For
> example,
>
> ADD_DEFINITIONS(-DUNICODE -D_UNICODE -DWIN32 -Di386 -D_WIN32_WINNT=0x501 )
> ADD_DEFINITIONS("-UUNICODE")
> ADD_EXECUTABLE(test_cmake  test.cpp)
>
> Gives you an interesting error at compile time when the _WIN32_WINNT
> macro is expanded and is considered to include "-UUNICODE" as part of
> its value.

Not surprising.  You may want to try a different approach altogether.  We
recommend not using ADD_DEFINITIONS at all and instead using configured
header files.  See this message:

http://www . cmake . org/pipermail/cmake/2003-September/004286 . html

-Brad