[Insight-developers] ITKModular: macro trouble

Brad King brad.king at kitware.com
Thu Mar 17 17:26:35 EDT 2011


On 03/17/2011 05:20 PM, Bill Hoffman wrote:
> On 3/17/2011 4:39 PM, Bill Lorensen wrote:
>> For the project ITK-Common, the following directive fails:
>> #ifdef ITK-Common_EXPORTS
>>
>> because, I believe, a "-" cannot exist in a #ifdef
>
> In mine it defines this:
> ITK_Common_EXPORTS

Correct.  The library name gets translated to a C identifier:

  http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:DEFINE_SYMBOL
  "...set to target_EXPORTS by default (with some substitutions if the
   target is not a valid C identifier)..."

One can see it in the implementation too:

  http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmTarget.cxx;hb=v2.8.4#l3793
  http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/kwsys/SystemTools.cxx;hb=v2.8.4#l3897

-Brad


More information about the Insight-developers mailing list