[Cmake] SET_TARGET_PROPERTIES + DEFINE_SYMBOL

ibiris at genius.org.br ibiris at genius.org.br
Fri Jul 23 15:31:57 EDT 2004





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 :-)

----
Ilias Biris, Ph.D.
ASR, Senior Researcher
Genius Instituto de Tecnologia
TEL: +55 (0)92 6146503
FAX: +55 (0)92 6133144
http://www.genius.org.br/

"I could have made money this way, and perhaps amused myself writing code.
But I knew that at the end of my career, I would look back on years of
building walls to divide people, and feel I had spent my life making the
world a worse place."
                                                   Richard Stallman
**************************************************************************************************

O conteúdo desse e-mail ou de seus anexos são confidenciais e restritos ao 
destinatário da mensagem.
Se você recebeu esse e-mail por engano, por favor notifique o remetente 
imediatamente e não faça cópias ou distribua seu conteúdo para ninguém.

**************************************************************************************************

The contents of this email and any attachments are confidential.
They are intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or  the 
sender immediately and do not disclose the contents to anyone or make copies.

**************************************************************************************************


More information about the Cmake mailing list