[CMake] A iconv check cmake file
Hendrik Sattler
post at hendrik-sattler.de
Sat Oct 20 02:28:34 EDT 2007
Am Freitag 19 Oktober 2007 schrieb eddy xu:
> I have not found one module to find iconv library in cmake, so I wrote one,
> here is the code:
>
> # Find iconv library
> #
> # Author: Eddy Xu <eddyxu at gmail.com>
> #
> # Released under BSD license
> #
> # ICONV_INCLUDE_DIRS - where to find iconv.h, etc
> # ICONV_LIBRARIES - Lists of libraries when using iconv
> # ICONV_FOUND - True if iconv found
>
>
> # Look for the header file
> FIND_PATH( ICONV_INCLUDE_DIR NAMES iconv.h )
> MARK_AS_ADVANCED( ICONV_INCLUDE_DIR )
>
> # Look for the library
> FIND_LIBRARY( ICONV_LIBRARY NAMES iconv )
> MARK_AS_ADVANCED( ICONV_LIBRARY )
This is not sufficient. Iconv may also be used with GNU libc and then doesn't
need an additional library. Thus, you have to test for a symbol.
HS
More information about the CMake
mailing list