Warning, /office/calligra/cmake/modules/FindIconv.cmake is written in an unsupported language. File is not indexed.
0001 # - Try to find Iconv 0002 # Once done this will define 0003 # 0004 # ICONV_FOUND - system has Iconv 0005 # ICONV_INCLUDE_DIR - the Iconv include directory 0006 # ICONV_LIBRARIES - Link these to use Iconv 0007 # ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const 0008 # 0009 include(CheckCXXSourceCompiles) 0010 0011 if (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 0012 # Already in cache, be silent 0013 set(ICONV_FIND_QUIETLY TRUE) 0014 endif () 0015 0016 find_path(ICONV_INCLUDE_DIR iconv.h) 0017 0018 find_library(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c) 0019 0020 if(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) 0021 set(ICONV_FOUND TRUE) 0022 endif() 0023 0024 set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) 0025 set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) 0026 if(ICONV_FOUND) 0027 check_cxx_source_compiles(" 0028 #include <iconv.h> 0029 int main(){ 0030 iconv_t conv = 0; 0031 const char* in = 0; 0032 size_t ilen = 0; 0033 char* out = 0; 0034 size_t olen = 0; 0035 iconv(conv, &in, &ilen, &out, &olen); 0036 return 0; 0037 } 0038 " ICONV_SECOND_ARGUMENT_IS_CONST ) 0039 endif() 0040 set(CMAKE_REQUIRED_INCLUDES) 0041 set(CMAKE_REQUIRED_LIBRARIES) 0042 0043 if(ICONV_FOUND) 0044 if(NOT ICONV_FIND_QUIETLY) 0045 message(STATUS "Found Iconv: ${ICONV_LIBRARIES}") 0046 endif() 0047 else() 0048 if(Iconv_FIND_REQUIRED) 0049 message(FATAL_ERROR "Could not find Iconv") 0050 endif() 0051 endif() 0052 0053 mark_as_advanced( 0054 ICONV_INCLUDE_DIR 0055 ICONV_LIBRARIES 0056 ICONV_SECOND_ARGUMENT_IS_CONST 0057 )