[CMake] Macro with strings: nmake/Visual

Peter Kümmel syntheticpp at gmx.net
Tue Jun 13 08:33:50 EDT 2006


Brad King wrote:
> Peter Kümmel wrote:
>> When I use add_definitions I must
>> pass for nmake and the IDE different
>> string macro definitions:
>>
>>
>> 1. source code: #define BOOST_USER_CONFIG=<config.h>
>>
>> if(MSVC_IDE)
>>     add_definitions(-DBOOST_USER_CONFIG=&lt\;config.h&gt\;)
>> else(MSVC_IDE)
>>     add_definitions(-DBOOST_USER_CONFIG="<config.h>")
>> endif(MSVC_IDE)
>>
>> 2.  source code: #define DLOCALEDIR="."
>>
>> if(MSVC_IDE)
>>     add_definitions(-DLOCALEDIR=".")
>> else(MSVC_IDE)
>>     add_definitions(-DLOCALEDIR=\\".\\" )
>> endif(MSVC_IDE)
>>
>> Is there a simpler solution or is it a bug?
> 
> Passing angle brackets and quotes in definitions through the command
> line has never really been done with CMake before.  I'd say this is a
> bug, but I'm not sure how to fix it without breaking someone's project
> who already did your work-around.  Please report it to the bug tracker
> so at least it won't be lost.
> 
> -Brad
> 
> 

Bug is already in the tracker:
http://www.cmake.org/Bug/bug.php?op=show&bugid=3362&pos=0

And the 'mortal question' is:
Should we break work-arounds by fixing bugs? :)

Peter




More information about the CMake mailing list