FindIconv.cmake 557 B

123456789101112131415161718192021
  1. find_path(ICONV_INCLUDE_DIR NAMES iconv.h)
  2. find_library(ICONV_LIBRARY NAMES iconv)
  3. if (ICONV_LIBRARY)
  4. set(ICONV_SYMBOL_FOUND "${ICONV_LIBRARY}")
  5. else()
  6. check_function_exists(iconv_open ICONV_SYMBOL_FOUND)
  7. endif()
  8. include(FindPackageHandleStandardArgs)
  9. find_package_handle_standard_args(Iconv DEFAULT_MESSAGE ICONV_INCLUDE_DIR ICONV_SYMBOL_FOUND)
  10. if(ICONV_LIBRARY)
  11. set(ICONV_LIBRARIES "${ICONV_LIBRARY}")
  12. else()
  13. set(ICONV_LIBRARIES)
  14. endif()
  15. set(ICONV_INCLUDE_DIRS "${ICONV_INCLUDE_DIR}")
  16. mark_as_advanced(ICONV_LIBRARY ICONV_INCLUDE_DIR)