[cmake-developers] Patch for FindBZip2.cmake BZIP2_NEED_PREFIX issue with cross compiled mingw32 applications

Brad King brad.king at kitware.com
Tue Jul 21 09:46:55 EDT 2015


On 07/19/2015 03:07 PM, Ralf Habacker wrote:
> The check is performed with CheckFunctionExists.c, which converts the
> function name into a prototype of the form 'char BZ2_bzCompressInit()',
> while in real it is
> 
> int BZ2_bzCompressInit ( bz_stream *strm, 
>                          int blockSize100k, 
>                          int verbosity,
>                          int workFactor );

Rather than (or in addition to) changing to _BZ2_decompress, please look
at changing the check to use CheckSymbolExists.  It allows the actual
header to be included so we can test using the library the way the
project will.  That is likely more robust.  Note that you may need
to set CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_LIBRARIES to make
sure the check is run with the desired bzip2 library.

Thanks,
-Brad



More information about the cmake-developers mailing list