# Link interface library Iconv:Iconv not found

**URL:** <https://discourse.cmake.org/t/link-interface-library-iconv-iconv-not-found/13430>\
**Category:** Code\
**Created:** [January 19, 2025, 11:31am UTC](https://discourse.cmake.org/t/link-interface-library-iconv-iconv-not-found/13430 "2025-01-19T11:31:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![perdrix](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@perdrix](https://discourse.cmake.org/u/perdrix)\
**Post date:** [January 19, 2025, 11:31am UTC](https://discourse.cmake.org/t/link-interface-library-iconv-iconv-not-found/13430/1 "2025-01-19T11:31:07Z")

</div>

I’m trying to build my project on macOS. I’m installing pre-reqs using vcpkg.

I’m getting this error:

```auto
1> [CMake] CMake Error at out/build/vcpkg_installed/arm64-osx/share/exiv2/exiv2Export.cmake:60 (set_target_properties):
1> [CMake] The link interface of target "Exiv2::exiv2lib" contains:
1> [CMake] 
1> [CMake] Iconv::Iconv
1> [CMake] 
1> [CMake] but the target was not found.

```

This rather puzzles me as I thought that iconv was shipped with macOS?

What do I need to do to fix this. I don’t use either macports or brew.

I’m using Cmake 3.31.4.

---

<div class="post-metadata">

**Author:** ![perdrix](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@perdrix](https://discourse.cmake.org/u/perdrix)\
**Post date:** [January 20, 2025, 4:44am UTC](https://discourse.cmake.org/t/link-interface-library-iconv-iconv-not-found/13430/2 "2025-01-20T04:44:34Z")

</div>

It appears that all I needed was:

```auto
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
find_package(Iconv REQUIRED)
endif()

```

---

<div class="post-metadata">

**Author:** ![retif](https://discourse.cmake.org/user_avatar/discourse.cmake.org/retif/32/1776_2.png) [@retif](https://discourse.cmake.org/u/retif)\
**Post date:** [January 20, 2025, 8:01am UTC](https://discourse.cmake.org/t/link-interface-library-iconv-iconv-not-found/13430/3 "2025-01-20T08:01:36Z")

</div>

Or the original maintainer (_or vcpkg port author_) should have added [find\_dependency()](https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html) to that library’s CMake config. That would be a preferred way, but unfortunately it is rather common that they don’t bother/care/aware.
