2023-01-10 10:49:57 -07:00
|
|
|
# TODO(dundargoc): FindIconv is shipped by default on cmake version 3.11+. This
|
|
|
|
# file can be removed once we decide to upgrade minimum cmake version.
|
|
|
|
|
2014-11-08 14:18:04 -07:00
|
|
|
find_path(ICONV_INCLUDE_DIR NAMES iconv.h)
|
2018-06-06 18:39:17 -07:00
|
|
|
find_library(ICONV_LIBRARY NAMES iconv libiconv)
|
2023-03-02 02:22:41 -07:00
|
|
|
find_package_handle_standard_args(Iconv DEFAULT_MSG
|
|
|
|
ICONV_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARY)
|
2023-03-02 14:50:43 -07:00
|
|
|
|
|
|
|
add_library(iconv INTERFACE)
|
|
|
|
target_include_directories(iconv SYSTEM BEFORE INTERFACE ${ICONV_INCLUDE_DIR})
|
|
|
|
if(ICONV_LIBRARY)
|
|
|
|
target_link_libraries(iconv INTERFACE ${ICONV_LIBRARY})
|
|
|
|
endif()
|