[CMake] PKGCONFIG backward compatibility on CVS trunk.

Bill Hoffman bill.hoffman at kitware.com
Tue Dec 5 20:09:41 EST 2006


Alan W. Irwin wrote:
> On 2006-12-05 23:51+0100 Michel Hermier wrote:
>
>> Alan W. Irwin wrote:
>>> On 2006-12-05 22:31+0100 Michel Hermier wrote:
>>>
>>>>>>
>>>>> Do you have a case where something works in CMake-2.4.4, but does 
>>>>> not work in CVS CMake that uses UsePkgConfig.cmake?
>>>>> If so, we will fix it.  If this is new stuff, we can not change 
>>>>> UsePkgConfig.cmake because it will break old code.   There should
>>>>> be no change in this stuff from 2.4.4 and 2.4.5, so either should 
>>>>> work the same.  The new module is currently only in CVS.
>>>>>
>>>>> -Bill
>>>>>
>>>
>>>> I checked the generation of the qca.pc file and it was not updated 
>>>> for 2 month so it was definitely working before the update.
>>>
>>> Michel, could you clarify, please?  Are you comparing an old CVS 
>>> version
>>> with latest CVS or an _actual release_ (such as 2.4.5 which is 
>>> available for
>>> you to try) with latest CVS?
>> I reverted the UsePkgConfig.cmake, so that the old macro is defined, 
>> and it worked again, so the package that broke for me was really 
>> working with the old macro.
>> Here is attached the hack that works for me and is probably not valid 
>> since I don't check for empty values but I'm not sure.
>
> It appears the 2.4.5 version of UsePkgConfig.cmake is what you need. I
> therefore believe the current approach in cvs (although it works
> consistently for PLplot for 2.4.5 and cvs version) is attempting the
> impossible; emulate the old behaviour by using the modern macros with
> post-processing to attempt to make the result _exactly_ compatible.
>
> Therefore, I suggest the following improved proposal to take care of 
> these
> compatibility issues exactly.
>
> 1) Copy the 2.4.5 UsePkgConfig.cmake which defines the PKGCONFIG macro to
> CVS with the only change being to add a message that it is an obsolete
> macro.  Then you _know_ that if the user uses UsePkgConfig.cmake they 
> will
> automatically be compatible with what was done before.
>
> 2) Get rid of the emulated definition of the PKGCONFIG macro that is
> currently in FindPkgConfig.cmake.  In other words, FindPkgConfig.cmake is
> completely reserved for the new pkg-config stuff and does not try to 
> emulate
> the old PKGCONFIG macro.
>
> I attach a patch to current CVS that implements this proposal.  It works
> for PLplot.
>
> Michel, does this patch work for you?

There is one problem....   The old macro had a serious bug in that \n 
were often embeded into
the strings for library paths and caused bad makefiles to be generated.  
I guess we could revert
back to the old one, and add a fix for that.  

-Bill



More information about the CMake mailing list