Carl Yuheng Ren
Carl Yuheng Ren

Reputation: 1011

CMake broken after update to Xcode 7.0

I use QtCreator and CMake for c++ development on a Mac, after updating to Xcode 7.0, CMake seems broken, after running CMake I got this warning:

CMake Warning at /usr/local/Cellar/cmake/HEAD/share/cmake/Modules/Platform/Darwin-Initialize.cmake:128 (message): Ignoring CMAKE_OSX_SYSROOT value:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk

because the directory does not exist. Call Stack (most recent call first): /usr/local/Cellar/cmake/HEAD/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake:18 (include) CMakeLists.txt:3 (project)

and build, I got this error:

*** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Accelerate.framework'

I know that Xcode 7.0 has removed MacOSX10.10.sdk and added MacOSX10.11.sdk, so I thought it might be my cmake is too old, I updated my cmake to 3.3.2 with homebrew but still doesn't work, does anyone know how to fix this? Thanks!

Upvotes: 26

Views: 11643

Answers (3)

Rishabh Deep Singh
Rishabh Deep Singh

Reputation: 914

If someone is using Clion you can try

Tools > CMake > Reset cache and reload project

Upvotes: 21

qris
qris

Reputation: 8162

The default value for CMAKE_OSX_SYSROOT appears to be baked into the cmake executable, and automatically added to newly-created CMakeCache.txt cache files.

So I needed to both upgrade cmake and then delete all my CMakeCache.txt files to get CMake working again.

Upvotes: 6

Carl Yuheng Ren
Carl Yuheng Ren

Reputation: 1011

delete any old CMakeCache.txt in current project and dependencies and rebuild solves the problem.

Upvotes: 73

Related Questions