[CMake] INSTALL(CODE ...)

Brandon J. Van Every bvanevery at gmail.com
Mon Aug 14 12:08:55 EDT 2006


William A. Hoffman wrote:
> At 10:41 AM 8/14/2006, Christian Lang wrote:
>   
>> Hello,
>>
>> I tried it, but it did not work either ...
>>
>>     
>>> Try putting the ${DATE} inside the quotes...
>>>
>>> Christian Lang wrote:
>>>
>>>       
>>>> Hello,
>>>>
>>>> I want to add some custom install code via INSTALL(CODE <code>). How can I set variables inside such a INSTALL(CODE ...) statement? I tried something like
>>>>
>>>> INSTALL(CODE "
>>>> SET(DATE \"today\")
>>>> MESSAGE(\"Date = \" ${DATE})
>>>> ")
>>>>         
>
> Each line of CODE is being treated as a completely separate script.
> You may have to use the INSTALL(SCRIPT instead to get this working.
>
>   

$ symbols need to be escaped, like \$.  That is the error.

INSTALL(CODE ...) is flexible, but it is also cryptic.  It is often a 
source of actions that would be better as first-class INSTALL commands.


Cheers,
Brandon Van Every



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060814/845ab307/attachment.html


More information about the CMake mailing list