Find_Library_Ex for msvc

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Sun Sep 23 13:55:42 CEST 2007


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?
Christian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FindLibraryEx.diff
Url: http://mail.kde.org/pipermail/kde-buildsystem/attachments/20070923/596422bb/attachment.ksh 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20070923/596422bb/attachment.pgp 


More information about the Kde-buildsystem mailing list