# find\_library misses a framework

**URL:** https://discourse.cmake.org/t/find-library-misses-a-framework/9736
**Category:** Usage
**Tags:** os:ios
**Created:** [December 29, 2023, 6:38pm UTC](https://discourse.cmake.org/t/find-library-misses-a-framework/9736 "2023-12-29T18:38:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kentzo](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kentzo/32/4122_2.png) [@Kentzo](https://discourse.cmake.org/u/Kentzo)
#### Post date: [December 29, 2023, 6:38pm UTC](https://discourse.cmake.org/t/find-library-misses-a-framework/9736/1 "2023-12-29T18:38:20Z")

</div>

I don’t quite understand why `find_library` fails locate a framework when cross-compiling for tvOS:

```auto
CMake Debug Log at qtmultimedia/cmake/FindFFmpeg.cmake:128 (find_library):
  find_library called with the following settings:

    VAR: AVDEVICE_LIBRARY
    NAMES: "avdevice"
    Documentation: Path to a library.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 1
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 1
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 0
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
    CMAKE_FIND_USE_INSTALL_PREFIX: 1

  find_library considered the following locations:

    /Users/developer/Documents/Qt-build/install/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Users/developer/Documents/Qt-build/install/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Users/developer/Documents/Qt-build/install/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Users/developer/Documents/Qt-build/install/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Users/developer/Documents/Qt-build/install/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator17.2.sdk/usr/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator17.2.sdk/usr/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator17.2.sdk/usr/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator17.2.sdk/usr/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator17.2.sdk/usr/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator17.2.sdk/usr/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator17.2.sdk/System/Library/Frameworks/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator17.2.sdk/System/Library/Frameworks/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/cmake/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)
    /usr/local/(lib)avdevice(\.tbd|\.dylib|\.so|\.a)

  The item was not found.

```

The library is bundled in a framework and available at `/Users/developer/Documents/Qt-build/install/lib/libavdevice.framework/libavdevice`. But this path was not even considered, as you can see from the output above.

At the same time `find_path` has no problem with it:

```auto
CMake Debug Log at qtmultimedia/cmake/FindFFmpeg.cmake:117 (find_path):
  find_path called with the following settings:

    VAR: AVDEVICE_INCLUDE_DIRS
    NAMES: "libavdevice/avdevice.h"
    Documentation: Path to a file.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 1
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 1
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 0
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
    CMAKE_FIND_USE_INSTALL_PREFIX: 1

  find_path considered the following locations:

    /Users/developer/Documents/Qt-build/install/Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/cmake/include/ffmpeg/libavdevice.framework/Headers/avdevice.h
    /Users/developer/Documents/Qt-build/install/Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/cmake/include/include/libavdevice.framework/Headers/avdevice.h
    /Users/developer/Documents/Qt-build/install/Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/cmake/include/libavdevice.framework/Headers/avdevice.h
    /Users/developer/Documents/Qt-build/install/Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/cmake/ffmpeg/libavdevice.framework/Headers/avdevice.h
    /Users/developer/Documents/Qt-build/install/Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/cmake/include/libavdevice.framework/Headers/avdevice.h
    /Users/developer/Documents/Qt-build/install/Users/developer/Documents/Qt-build/Qt-appletvsimulator/src/Qt-build/qtbase/lib/cmake/libavdevice.framework/Headers/avdevice.h
    /Users/developer/Documents/Qt-build/install/lib/ffmpeg/libavdevice.framework/Headers/avdevice.h
    /Users/developer/Documents/Qt-build/install/lib/include/libavdevice.framework/Headers/avdevice.h

  The item was found at

    /Users/developer/Documents/Qt-build/install/lib/libavdevice.framework/Headers/avdevice.h

```

Is there a configuration variable or `find_library` setting that may prevent it from looking for frameworks?

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [December 30, 2023, 1:36am UTC](https://discourse.cmake.org/t/find-library-misses-a-framework/9736/2 "2023-12-30T01:36:56Z")

</div>

`CMAKE_FIND_FRAMEWORK` is probably what you’re looking for. It’s not all that common to see anything set that though.

---

<div class="post-metadata">

### Author: ![Kentzo](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kentzo/32/4122_2.png) [@Kentzo](https://discourse.cmake.org/u/Kentzo)
#### Post date: [December 30, 2023, 4:05am UTC](https://discourse.cmake.org/t/find-library-misses-a-framework/9736/3 "2023-12-30T04:05:51Z")

</div>

`find_library` can properly locate frameworks. It’s just output of --debug-find fails to mention framework locations. See [https://gitlab.kitware.com/cmake/cmake/-/issues/25547](https://gitlab.kitware.com/cmake/cmake/-/issues/25547)
