[CMake] problem with ADD_DEFINITION
Nuno Lopes
nunoplopes at sapo.pt
Sun Sep 3 07:28:27 EDT 2006
Hello,
Thank you both for your answers and sorry for my late response (I was on
vacations).
> Hello!
>
>>> 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?
>>
>> Full-fledged integration of CMake and pkgconfig has not been
>> implemented. The PKGCONFIG macro was a user contribution to make
>> running pkgconfig easier. You still have to parse the resulting options
>> using the STRING command and construct the proper inputs to
>> ADD_DEFINITIONS, INCLUDE_DIRECTORIES, and LINK_LIBRARIES.
>>
>> I suggest trying to get things working by manually specifying the
>> locations in your CMake code. Once you understand what the commands
>> need as input you can move on to extracting this information from
>> PKGCONFIG.
I'm a new to cmake. In one of my projects we decided to use cmake instead of
autotools, because of their high learning curve.
I'll try to follow your suggestion, by studing the STRING command.
> I recently submitted a better (but incompatible) version of a PKGCONFIG
> macro, which already fills the relevant variables and thus is far
> simpler to use. I did not get any response or the requested discussion
> :-/ Seeing you still proposing the old macro makes things even more sad
> :-/
>
> Btw., after working even more with cmake I see even improvement for my
> version of the macro. Instead of passing all variables to the macro you
> just pass a name prefix and make the macro define the variables
> following the naming schema of similar macros itself - similar to the
> way the equivalent autoconf macro works.
Personally I also think that the PKGCONFIG macro should be made easier. When
I was using it for the first time I though it would add the cflags
automatically to the build, for example. But this discussion doesn't belong
to me, as I'm a new comer here.
Best Regards,
Nuno Lopes
More information about the CMake
mailing list