# Trying to link with tiff

**URL:** https://discourse.cmake.org/t/trying-to-link-with-tiff/12961
**Category:** Code
**Created:** [November 13, 2024, 12:30pm UTC](https://discourse.cmake.org/t/trying-to-link-with-tiff/12961 "2024-11-13T12:30:22Z")
**Posts on this page:** 4
**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: [November 13, 2024, 12:30pm UTC](https://discourse.cmake.org/t/trying-to-link-with-tiff/12961/1 "2024-11-13T12:30:22Z")

</div>

I added:

```auto
find_package(Tiff 4.7 REQUIRED)

```

to my top level CMakeLists.txt to supply the link libraries for tiff. But for my pains I got:

```auto
1> [CMake] The link interface of target "TIFF::tiff" contains:
1> [CMake] 
1> [CMake] CMath::CMath
1> [CMake] 
1> [CMake] but the target was not found. Possible reasons include:

```

of course find\_package(CMath) finds nothing so what do I need to install to silence this complaint or what else to specify so it only sets things up to link with tiff.a

David

---

<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: [November 13, 2024, 12:33pm UTC](https://discourse.cmake.org/t/trying-to-link-with-tiff/12961/2 "2024-11-13T12:33:45Z")

</div>

When I stumbled upon this issue, I just [patched](https://github.com/retifrav/vcpkg-registry/blob/master/ports/tiff/dependencies-discovery-and-installation.patch#L10-L14) the original TIFF’s CMake project (_you might not need all of that patch, just the math-related bits_).  
Should’ve probably sent this to the TIFF maintainers too.

---

<div class="post-metadata">

### Author: ![ion.nistor](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ion.nistor/32/5958_2.png) [@ion.nistor](https://discourse.cmake.org/u/ion.nistor)
#### Post date: [December 19, 2025, 6:42am UTC](https://discourse.cmake.org/t/trying-to-link-with-tiff/12961/3 "2025-12-19T06:42:02Z")

</div>

This was addressed upstream in libtiff, a few days ago: [cmake: Replace CMath::CMath with direct link to avoid export (!764) · Merge requests · libtiff / libtiff · GitLab](https://gitlab.com/libtiff/libtiff/-/merge_requests/764)

No releases yet, 4.7.1 still has the problem.

---

<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: [December 19, 2025, 11:09am UTC](https://discourse.cmake.org/t/trying-to-link-with-tiff/12961/4 "2025-12-19T11:09:42Z")

</div>

> [@retif](#):
>
> I just [patched](https://github.com/retifrav/vcpkg-registry/blob/master/ports/tiff/dependencies-discovery-and-installation.patch#L10-L14) the original TIFF’s CMake project

That link has died (_I renamed the patch file afterwards_), and I can’t edit my old replies, so here’s an [updated link](https://github.com/retifrav/vcpkg-registry/blob/284541d4a911378983ccfcac0f70c4826cfc1a9b/ports/tiff/001-dependencies-discovery-and-installation.patch).
