Re: [cmake-developers] Recommended way to get the definitions for a target ?

2012-09-07 Thread Brad King
On 09/06/2012 03:28 PM, Alexander Neundorf wrote:
> is there a recommended way to collect the preprocessor definitions for a 
> target 
> ?
> From looking around it seems I have to manually collect COMPILE_DEFINITIONS 
> from the makefile, the target and the source file, and then again for each of 
> those additionally the per-configuration settings.

That is the only way now AFAIK.  You can survey how each generator
does it to be sure.  Note that they do not actually need to collect
everything in one place because the target-wide definitions and the
per-source definitions go in different places in the generated build
systems.

> Is this how it should be done, or is there a centralized function somewhere, 
> and if not, where should it be ?

Your description includes collecting them from a source file too.
This looks like you want the definitions for a cmSourceFile, not for
just a cmTarget.  A new internal API to collect the definitions would
need the cmTarget, cmSourceFile, and configuration name at least.  It
would probably go on cmGeneratorTarget if it is meant for use by the
generators.

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] Recommended way to get the definitions for a target ?

2012-09-06 Thread Alexander Neundorf
Hi,

is there a recommended way to collect the preprocessor definitions for a target 
?
>From looking around it seems I have to manually collect COMPILE_DEFINITIONS 
from the makefile, the target and the source file, and then again for each of 
those additionally the per-configuration settings.
Is this how it should be done, or is there a centralized function somewhere, 
and if not, where should it be ?

Alex
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers