<p>Try prefixing definitions with -D</p>
<p>On Mar 28, 2011 10:26 PM, "David Doria" <<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>> wrote:<br type="attribution">> I have setup a list of definitions:<br>> <br>> SET(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} UNIX;")<br>
> SET(MAIN_BUILD_DEFINITIONS "${MAIN_BUILD_DEFINITIONS} PIXEL_DIMENSION=3;")<br>> <br>> I display them and apply them to my executable as follows:<br>> <br>> add_executable(ImageCompleter ${MainSources})<br>
> message("Main build definitions: " ${MAIN_BUILD_DEFINITIONS})<br>> set_target_properties(ImageCompleter PROPERTIES COMPILE_DEFINITIONS<br>> "${MAIN_BUILD_DEFINITIONS}")<br>> <br>> The output is:<br>
> Main build definitions: UNIX PIXEL_DIMENSION=3<br>> <br>> which looks correct (i.e. UNIX was defined)<br>> <br>> However, in my code there is:<br>> <br>> #if defined(UNIX)<br>>         ... some code...<br>
> #else<br>> #error "Not implemented for this platform!"<br>> #endif<br>> <br>> When I build, the error is produced, indicating that UNIX was not defined.<br>> <br>> I created a small standalone example and it worked as expected... any<br>
> suggestions of what else to check?<br>> <br>> Thanks,<br>> <br>> David<br>> _______________________________________________<br>> Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>> <br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">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">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">http://www.cmake.org/mailman/listinfo/cmake</a><br></p>