1 2 3 4
libiconv provides CMake targets: find_package(Iconv REQUIRED) target_link_libraries(main PRIVATE Iconv::Iconv)