If VERSION is a preprocessor definition, you can use the <a href="http://cmake.org/cmake/help/cmake2.6docs.html#command:set_property">set_property</a> command. For example, if you want VERSION to be defined only in your main.cc source, do<br>
<br><pre>set_property(SOURCE main.cc PROPERTY COMPILE_DEFINITIONS VERSION=1.0)</pre>or<br><pre>set_source_files_properties(main.cc PROPERTY COMPILE_DEFINITIONS VERSION=1.0)</pre>you can also set properties on a per-target or per-directory basis.<br>
<br>HTH<br><br>- <br><br><div class="gmail_quote">On Fri, Apr 10, 2009 at 4:42 PM, John Dey <span dir="ltr"><<a href="mailto:jsdey@optonline.net">jsdey@optonline.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I have converted a program from using make to cmake. I needed to make a change to the main.cc program to get it to work. I am going back to see if I can get it to work without making the change. main.cc has a statement something to the effect of "fprintf(stdin, "%s\n", VERSION);" and the Makefile contains the statement "VERSION = 0.8.2". How can I set the variable VERSION in CMakeLists.txt? Any direction on setting the variable would be appreciated. Thanks.<br>
<br>
John<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Adolfo Rodríguez Tsouroukdissian<br><br>Robotics engineer<br>PAL ROBOTICS S.L<br><a href="http://www.pal-robotics.com">http://www.pal-robotics.com</a><br>Tel. +34.93.414.53.47<br>
Fax.+34.93.209.11.09<br>