# CMake not finding Accelerate framework

**URL:** <https://discourse.cmake.org/t/cmake-not-finding-accelerate-framework/8468>\
**Category:** Code\
**Tags:** os:macos\
**Created:** [July 6, 2023, 5:36am UTC](https://discourse.cmake.org/t/cmake-not-finding-accelerate-framework/8468 "2023-07-06T05:36:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuelpmish](https://discourse.cmake.org/user_avatar/discourse.cmake.org/samuelpmish/32/3308_2.png) [@samuelpmish](https://discourse.cmake.org/u/samuelpmish)\
**Post date:** [July 6, 2023, 5:36am UTC](https://discourse.cmake.org/t/cmake-not-finding-accelerate-framework/8468/1 "2023-07-06T05:36:22Z")

</div>

Hi,

In a project of mine, some of my dependencies apparently use the Accelerate framework. When linking against them, I get link lines that look like (I’m not sure why the `-framework Accelerate` is duplicated, but deduplicating it manually didn’t seem to make a difference):

```auto
/Users/sam/code/project/dep/install/bin/clang++ -g -arch arm64 -isysroot 
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -Wl,-search_paths_first 
-Wl,-headerpad_max_install_names -Wl,-no_compact_unwind 
tests/CMakeFiles/my_test.dir/my_test.cpp.o -o tests/my_test 
-l/Users/sam/code/project/dep/install/lib/libstrumpack.a  
-Xlinker -framework -Xlinker Accelerate -lm -ldl  
-Xlinker -framework -Xlinker Accelerate -lm -ldl

```

which ends up failing with

```auto
ld: framework not found Accelerate

```

The accelerate framework is in the standard place:  
`/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/`  
and if I manually point the compiler at that directory with

```auto
target_link_options(mylib PUBLIC 
"-Wl,-F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/")

```

then things work correct correctly.

* * *

I’m trying to find out why this isn’t being done automatically, or how to work around it without hardcoding a machine-specific path in my CMakeLists.txt.

I see that there is a variable named `CMAKE_SYSTEM_FRAMEWORK_PATH`, and it has  
the value of:

```auto
message(${CMAKE_SYSTEM_FRAMEWORK_PATH}) 

#output (verbatim)
~/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Network/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Library/Developer/CommandLineTools/Library/Frameworks/Library/Developer/CommandLineTools/Library/Frameworks/Library/Frameworks/Network/Library/Frameworks/System/Library/Frameworks

```

Is this the expected output, with no whitespace or semicolon separators? If so, how can I extract the relevant framework directory from this variable?

Thank you

---

<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:** [July 7, 2023, 4:30am UTC](https://discourse.cmake.org/t/cmake-not-finding-accelerate-framework/8468/2 "2023-07-07T04:30:51Z")

</div>

> [@samuelpmish](#):
>
> I see that there is a variable named `CMAKE_SYSTEM_FRAMEWORK_PATH`, and it has  
> the value of:
> 
> ```auto
> message(${CMAKE_SYSTEM_FRAMEWORK_PATH}) 
> 
> #output (verbatim)
> ~/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Network/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Library/Developer/CommandLineTools/Library/Frameworks/Library/Developer/CommandLineTools/Library/Frameworks/Library/Frameworks/Network/Library/Frameworks/System/Library/Frameworks
> 
> ```

That output seems to indicate your `CMAKE_SYSTEM_FRAMEWORK_PATH` is not pointing at the standard system location, but rather your personal area under your home directory. That may be the source of your problem. I suggest tracking down what is setting `CMAKE_SYSTEM_FRAMEWORK_PATH` and if it is not coming from CMake itself, try to prevent that from happening.

---

<div class="post-metadata">

**Author:** ![samuelpmish](https://discourse.cmake.org/user_avatar/discourse.cmake.org/samuelpmish/32/3308_2.png) [@samuelpmish](https://discourse.cmake.org/u/samuelpmish)\
**Post date:** [July 7, 2023, 2:53pm UTC](https://discourse.cmake.org/t/cmake-not-finding-accelerate-framework/8468/3 "2023-07-07T14:53:01Z")

</div>

If I just have a trivial CMake project I still get this incredibly long framework path:

```auto
% cat CMakeLists.txt 
cmake_minimum_required(VERSION 3.16)
project(simple LANGUAGES CXX)

message(${CMAKE_SYSTEM_FRAMEWORK_PATH})

% cmake . -Bbuild
~/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/Network/Library/Frameworks/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/Library/Developer/CommandLineTools/Library/Frameworks/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Library/Frameworks/Network/Library/Frameworks/System/Library/Frameworks

```

Is this normal? This path doesn’t exist (or is this supposed to be multiple paths and the separators between list entries aren’t showing?), I would have expected something like a single entry of  
`/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/`

I don’t know how to find out where this value comes from or how to fix it. The relevant documentation doesn’t offer any guidance:  
[https://cmake.org/cmake/help/latest/variable/CMAKE\_SYSTEM\_FRAMEWORK\_PATH.html](https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.html)

---

<div class="post-metadata">

**Author:** ![samuelpmish](https://discourse.cmake.org/user_avatar/discourse.cmake.org/samuelpmish/32/3308_2.png) [@samuelpmish](https://discourse.cmake.org/u/samuelpmish)\
**Post date:** [July 7, 2023, 3:00pm UTC](https://discourse.cmake.org/t/cmake-not-finding-accelerate-framework/8468/4 "2023-07-07T15:00:08Z")

</div>

update:

- cleanly reinstalling CMake from `brew` to 3.26.4 doesn’t change anything
- binaries downloaded from [cmake.org](http://cmake.org) give the same output

---

<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 12, 2023, 8:35pm UTC](https://discourse.cmake.org/t/cmake-not-finding-accelerate-framework/8468/5 "2023-12-12T20:35:06Z")

</div>

Sorry it took me so long to get back to this. The problem isn’t with `CMAKE_SYSTEM_FRAMEWORK_PATH`, it is with how you’re calling `message()`. When you pass a list to the `message()` command, it concatenates the list items without inserting any `;` or other character between list items. If you quote the whole `${CMAKE_SYSTEM_FRAMEWORK_PATH}` value, you’ll see the semicolon separators.

```cmake
cmake_minimum_required(VERSION 3.16)
project(simple LANGUAGES CXX)

# Make sure the following is quoted
message("${CMAKE_SYSTEM_FRAMEWORK_PATH}")

```
