Find_Library_Ex for msvc

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Thu Sep 27 14:38:24 CEST 2007


Alexander Neundorf schrieb:
> On Sunday 23 September 2007 07:55, Christian Ehrlicher wrote:
>> Hi,
>>
>> msvc needs to distinguish between debug and release libs to avoid
>> crashes (it use a different runtime and therefore some symbols/functions
>> are incompatible).
>> To respect this behaviour, we currently need to add a whole bunch of
>> cmake lines to every FindFoo.cmake. For an example see FindBlitz.cmake
>>
>> To simplify this, I wrote a new macro FIND_LIBRARY_EX() which allows a
>> new keyword 'WIN32_DEBUG_POSTFIX' (similar to cmake's DEBUG_POSTFIX).
>> Due to cmake script limitations it needs to be the second and third
>> argument:
>>
>> FIND_LIBRARY_EX(BLITZ_LIBRARIES
>>    WIN32_DEBUG_POSTFIX d
>>    qimageblitz
>>    PATHS
>>    $ENV{QIMAGEBLITZDIR}/lib
>>    ${KDE4_LIB_DIR}
>>    ${LIB_INSTALL_DIR}
>> )
>>
>> -> on win32, qimageblitz (release lib) and qimageblitzd (debug lib) is
>> searched and added to BLITZ_LIBRARIES
>> -> it does not change anything on non-win32 platforms
>>
>> I would like to check in this change tomorrow. Later I want to change
>> all kde libraries to have a debug postfix on win32 and use this macro
>> for those libs too.
>>
>> Any objections?
> 
> 
> Can we come up with a better name than just appending "_EX" ?
> Maybe FIND_LIBRARY_WITH_DEBUG() ?
> 
I'm not good in finding usefull names for such macros - I'm fine with
every name as long as I know what the macro does :)

Christian


More information about the Kde-buildsystem mailing list