[Cmake] SET_TARGET_PROPERTIES + DEFINE_SYMBOL
Brad King
brad.king at kitware.com
Fri Jul 23 16:16:00 EDT 2004
ibiris at genius.org.br wrote:
>
>
>
> Greetings,
>
> I noticed that when I am trying to use SET_TARGET_PROPERTIES to set the
> property DEFINE_SYMBOL on a target that is a library (added with
> ADD_LIBRARY), the appropriate precompiler definition (-DXXX) does not
> appear in the generated Makefile for the library.
>
> Separately from the CMakeLists.txt for my library I also have a
> CMakeLists.txt for an executable being built linking against the compiled
> library. Though the SET_TARGET_PROPERTIES was not added for this executable
> target the symbols passed through the DEFINE_SYMBOL properties used on the
> library target appear in the Makefiles for the executable.
>
> So what is happening is roughly the following
>
> ---
> ... in CMakeLists.txt for xlib ...
>
> ADD_LIBRARY(xlib SHARED f1.c f2.c)
> SET_TARGET_PROPERTIES( xlib DEFINE_SYMBOL __FOO__
> DEFINE_SYMBOL __BAR__)
>
>
> ... in CMakeLists.txt for aexec ...
> ADD_EXECUTABLE( aexec a.c b.c)
> TARGET_LINK_LIBRARIES(aexec xlib)
> ---
>
> the symbols __FOO__ and __BAR__ appear in the Makefile for aexec instead of
> the Makefile for xlib ...
>
> Ideas? I am a bit stuck (and yes I have checked that the correct target
> names are passed to SET_TARGET_PROPERTIES) ...
>
> Thanks in advance for your kind help :-)
I cannot duplicate this problem from your example for CMake 2.0.2. I
get a Makefile for xlib that has the symbols defined when building the
.o files, and a Makefile for aexec that has no mention of the symbols.
What version of CMake are you using? Please post a complete minimal
example that duplicates the problem.
Thanks,
-Brad
More information about the Cmake
mailing list