Re: [CMake] Quoted String

2007-07-31 Thread Brandon Van Every
On 7/31/07, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi List,

 I want to add a definition to the compiler, so I do an ADD_DEFINITIONS().
 The defintion I want to add is a quoted string which should be parsed with 
 leading and ending .
 So I tried to escape it with \, but this doesn't also work.

 It should look like ADD_DEFINITIONS(-DPPATH=${path_to_somewhere}), and then 
 in the used c file the preprocessor will parse PPATH to /path_to_somewhere.
 But it currently pares it wihtout the quote sign. In the c file it will be 
 used as a char*, so the quotes are important.

 How can this be done?

It's a nightmare but it can be done.  Chicken does it.  You have to be
really really careful about all the different levels of escapes and
quotes.  Sometimes \ is all you need.  Sometimes \\\ is what you
need, because you need double \\ to survive CMake argument processing.
 It doesn't help that MACROs consume quotes when they shouldn't, as
per bug #5389.  The first thing you need to do is figure out the exact
point in your conversion(s) where you're losing the quotes.  \ does
work in SET assignments.

Chicken succeeds at this, so if you want to wade through the code to
figure out how to configure *.h files and so forth, it might be
helpful to you.
http://www.call-with-current-continuation.org

Cheers,
Brandon Van Every
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


RE: [CMake] Quoted String

2007-07-31 Thread Alexander.Camek
Hi Brandon, 

  Hi List,
 
  I want to add a definition to the compiler, so I do an 
 ADD_DEFINITIONS().
  The defintion I want to add is a quoted string which should 
 be parsed with leading and ending .
  So I tried to escape it with \, but this doesn't also work.
 
  It should look like 
 ADD_DEFINITIONS(-DPPATH=${path_to_somewhere}), and then in 
 the used c file the preprocessor will parse PPATH to 
 /path_to_somewhere.
  But it currently pares it wihtout the quote sign. In the c 
 file it will be used as a char*, so the quotes are important.
 
  How can this be done?
 
 It's a nightmare but it can be done.  Chicken does it.  You 
 have to be really really careful about all the different 
 levels of escapes and quotes.  Sometimes \ is all you need.  
 Sometimes \\\ is what you need, because you need double \\ 
 to survive CMake argument processing.
  It doesn't help that MACROs consume quotes when they 
 shouldn't, as per bug #5389.  The first thing you need to do 
 is figure out the exact point in your conversion(s) where 
 you're losing the quotes.  \ does work in SET assignments.

It seems that \\\ has fixed my problem.

Thanks for your help.

Greetings 

Alexander



Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake