[CMake] SET_TARGET_PROPERTIES DEFINE_SYMBOL

Patrick Brannan brannanster at gmail.com
Mon Oct 3 21:19:24 EDT 2005


I'm new to CMake and have run into an issue: DEFINE_SYMBOL doesn't seem to
work when applied to target properties. I tried this exammple on NMake
Makefiles for the free VC tools:

===========hello.c==================
#include <stdio.h>
int main(void)
{
#ifdef _WORLD_
printf("Hello World!\n");
#else
printf("Hello You!\n");
#endif
exit(0);
}
==================================

==========CMakeLists.txt============
PROJECT(Hello)
ADD_EXECUTABLE(hello hello.c)
# ADD_DEFINITIONS(-D_WORLD_) # This works if uncommented
SET_TARGET_PROPERTIES(hello PROPERTIES DEFINE_SYMBOL _WORLD_)
=================================

The ADD_DEFINITIONS command works as expected. SET_TARGET_PROPERTIES does
not. I'm sure I'm doing something dumb, but I can't seem to figure it out. I
read an earlier post about the same topic, but none of the issues seem to
apply in this case.

I am worrying about this because I am trying to build a an application with
both static and dynamic bindings. And we need to apply different definitions
to the same sources to get both to build.

Any help would be appreciated.

Thanks,

Pat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20051003/8d05c850/attachment.html


More information about the CMake mailing list