[CMake] undef a symbol

David Cole david.cole at kitware.com
Tue Jun 12 18:55:49 EDT 2012


Please do not use anything except for -D args with add_definitions. Other
flags should be added to CMAKE_CXX_FLAGS or some other variable, and they
are compiler specific. I doubt that "/U" works uniformly across compilers
the same way -D does.

The remove_definitions command is the opposite of the add_definitions
command, but it still takes its arguments exactly as add_definitions does,
with "-D" prefixes.

  http://cmake.org/cmake/help/v2.8.8/cmake.html#command:remove_definitions


HTH,
David


On Tue, Jun 12, 2012 at 6:16 PM, Totte Karlsson <totte at dunescientific.com>wrote:

> Seem
> that add_definitions(/UTheSymbol) did the job!
>
> -totte
>
>
> On 6/12/2012 2:57 PM, Totte Karlsson wrote:
>
>> Hi,
>> I have a folder in which I build a library. For doing so I have a
>> add_definitions(-DMySymbol) line
>>
>> It seems that subfolders inherits this,which I don't want. How do I
>> "undef" the
>> MySymbol symbol in a subfolder CMakeList file?
>>
>> -totte
>>
>>  --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120612/2bda028d/attachment-0001.htm>


More information about the CMake mailing list