FindIconv.cmake 562 B

123456789101112131415
  1. # TODO(dundargoc): FindIconv is shipped by default on cmake version 3.11+. This
  2. # file can be removed once we decide to upgrade minimum cmake version.
  3. find_path2(ICONV_INCLUDE_DIR NAMES iconv.h)
  4. find_library2(ICONV_LIBRARY NAMES iconv libiconv)
  5. find_package_handle_standard_args(Iconv DEFAULT_MSG
  6. ICONV_INCLUDE_DIR)
  7. mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARY)
  8. add_library(iconv INTERFACE)
  9. target_include_directories(iconv SYSTEM BEFORE INTERFACE ${ICONV_INCLUDE_DIR})
  10. if(ICONV_LIBRARY)
  11. target_link_libraries(iconv INTERFACE ${ICONV_LIBRARY})
  12. endif()