[CMake] SET_TARGET_PROPERTIES DEFINE_SYMBOL

David Cole david.cole at kitware.com
Tue Oct 4 10:05:52 EDT 2005


Use "hello.c" instead of "hello" in the call to SET_TARGET_PROPERTIES...

:-)


Patrick Brannan wrote:

> 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
>
>------------------------------------------------------------------------
>
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
>  
>



More information about the CMake mailing list