MantisBT - CMake
View Issue Details
0014885CMakeCMakepublic2014-04-18 02:432016-06-10 14:31
Aggelos Kolaitis 
Kitware Robot 
highmajoralways
closedmoved 
AppleMac OS X10.9
CMake 2.8.12.2 
 
0014885: Linking to frameworks in Xcode generator is buggy
When using the Xcode generator, even though CMake can properly find all frameworks, the building process will fail with 'framework not found' errors. In a discussion in the CMake mailing list, someone suggested that this happens because Apple no longer looks in /Library/Frameworks and ~/Library/Frameworks by default.
Unzip the attached archive, you will see the following tree:

cmake_bug/
| CMakeLists.txt
| dummy.c
| FindSDL2.cmake

Download http://libsdl.org/release/SDL2-2.0.3.dmg [^] and install SDL2.framework in
/Library/Frameworks or ~/Library/Frameworks.

Run CMake and choose the Xcode generator. You should see this in the cache:

> SDL2_LIBRARY /Library/Frameworks/SDL2.framework

Hit generate and open the Xcode project. Building will fail with 'SDL2: framework not found'.

I can provide more information if needed.

* A quick workaround is to link directly to the actual SDL2 dylib, but this is not a fix.

> SDL2_LIBRARY /Library/Frameworks/SDL2.framework/SDL2

* I haven't tested other frameworks other than SDL2 because I don't own a Mac, this has been reported by my users, but I was able to reproduce it in my friend's Macbook.

* This does not happen if I choose the makefile generator.
No tags attached.
zip cmake_bug.zip (3,496) 2014-04-18 02:43
https://public.kitware.com/Bug/file/5129/cmake_bug.zip
Issue History
2014-04-18 02:43Aggelos KolaitisNew Issue
2014-04-18 02:43Aggelos KolaitisFile Added: cmake_bug.zip
2014-04-18 09:16Brad KingNote Added: 0035741
2014-04-22 16:05Aggelos KolaitisNote Added: 0035760
2014-04-22 16:12Brad KingNote Added: 0035761
2014-04-23 13:12Aggelos KolaitisNote Added: 0035765
2016-06-10 14:29Kitware RobotNote Added: 0042537
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035741)
Brad King   
2014-04-18 09:16   
The example works for me with CMake 3.0.0-rc3. Please test it:

 http://www.cmake.org/files/v3.0/?C=M;O=D [^]
(0035760)
Aggelos Kolaitis   
2014-04-22 16:05   
You mean that you don't get any errors when building the project?

Unfortunately, I can't test it right now because I won't have access to a Mac for the next few days.

Would it be rude to ask you to test again with CMake 2.8.12.2? Because the issue is probably solved with CMake 3 if I understood correctly your comment.
(0035761)
Brad King   
2014-04-22 16:12   
Re 0014885:0035760: Actually it works for me with 2.8.12.2 also.

The link line contains "-F/Users/<username>/Library/Frameworks", the location of the SDL2 framework.

I'm using Xcode 5.0.2 on OS X 10.9.
(0035765)
Aggelos Kolaitis   
2014-04-23 13:12   
Well, I had SDL2.framework in /Library/Frameworks and not in ~/Library/Frameworks.
I don't think that's the problem though.

I will try once again when I the chance and get back with the results.

btw, I've also got Xcode 5.0.2 on 10.9
(0042537)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.