[CMake] INSTALL(CODE ...)

Christian Lang christian.lang at uni-bielefeld.de
Mon Aug 14 16:37:07 EDT 2006


Hello,
>  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

Thank you! I changed it and know it works.
Christian





More information about the CMake mailing list