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



_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to