[CMake] problem with ADD_DEFINITION

Nuno Lopes nunoplopes at sapo.pt
Fri Aug 11 11:24:33 EDT 2006


Hi,

Thanks for your help. But in theory the cflags can include anything they 
like, (e.g. "-DHAVE_XPTO -I/tmp/xpto -Wl,-O"), so probably 
INCLUDE_DIRECTORIES isn't the right one to choose, am I right?

Thanks,
Nuno


----- Original Message ----- 
> Hi Nuno,
>
> You should use INCLUDE_DIRECTORIES for the includes, ADD_DEFINITIONS is
> meant for "real" definitions, e.g. -DWINDOWS .
>
> Cheers,
> Laurentiu
> -- 
>
> Laurentiu Nicolae
> Senior Software Engineer
> Quintiq
>
> Tel: +31 (0)73 691 07 39
> Fax: +31 (0)73 691 07 54
> www.quintiq.com
>
>>>> On 10-Aug-06 at 9:27 PM, "Nuno Lopes" <nunoplopes at sapo.pt> wrote:
>> Hello,
>>
>> I'm new to cmake and I'm trying to port one of my projects to cmake,
> but I'm
>> having some difficulties with this:
>>
>> # libxml2
>> PKGCONFIG( libxml-2.0 XML_INCLUDE_DIR XML_LIBRARY_DIR XML_LINK_FLAGS
>> XML_CFLAGS)
>> IF( NOT XML_INCLUDE_DIR )
>>     MESSAGE("WARNING: libxml2 is not installed.")
>> ELSE( NOT XML_INCLUDE_DIR )
>>     # Add libXML2 stuff
>>     LINK_LIBRARIES(${XML_LINK_FLAGS})
>>     ADD_DEFINITIONS(${XML_CFLAGS})
>> ENDIF( NOT XML_INCLUDE_DIR )
>>
>>
>> XML_CFLAGS is set to: -I/usr/include/libxml2 



More information about the CMake mailing list