[cmake-developers] Setting includes, defines and other usage requirements with one command
Stephen Kelly
steveire at gmail.com
Mon Feb 11 13:21:38 EST 2013
Matthew Woehlke wrote:
> I've been reading about this feature for a while, and one thing that has
> been in the back of my mind is, how will code generation tools (Qt MOC
> comes to mind) that depend on being able to get the list of include
> directories to pass to a non-compiler executable work when all this
> stuff starts converging?
Hi Matthew,
That is an issue I raised before here about a join-genex:
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/5835/focus=5841
https://gitorious.org/~steveire/cmake/steveires-
cmake/commit/449fe543680eed9f82042ef475c240cba9590a55
So, it's something for the future.
The CMAKE_AUTOMOC feature already evaluates the generator expressions from
the targets.
>
> At some point, I think it is going to need to be possible to pass
> include directives from a target to a custom command (which generates
> source files used /by the same target/), ideally with the ability to
> specify how to pass each include directive (e.g. '<dir>', '-I <dir>',
> '--include=<dir>', etc.).
>
> Is this going to be possible with the new system? (Maybe the custom
> command can be given an "argument" that is a generator expression that
> will expand to the appropriate arguments?)
>
> Also, what is going to happen to projects using qt4_wrap_cpp (which
> doesn't know about targets) that start using the new stuff?
The macros read the INCLUDE_DIRECTORIES directory property, not the target
properties. So, to keep using the macros, keep using the
include_directories() command and don't put generator expressions in it
until you migrate to CMAKE_AUTOMOC, or until the join-genex exists and the
macro is ported to use it (I don't know if that macro will be ported to use
it).
Thanks,
Steve.
More information about the cmake-developers
mailing list