How to add a framework to CMake

I wrote a small helloworld program that needs Cocoa infrastructure. I would like to know how to add a framework to CMake. All the information I found is out of date. I have CMake 2.8.1 on Snow Leopard.

+9
frameworks cmake macos
source share
2 answers

You can simply use find_library as follows: find_library(COCOA_LIBRARY Cocoa) ?

Then use ${COCOA_LIBRARY} in your target_link_libraries . Perhaps the CMAKE_FIND_FRAMEWORK variable CMAKE_FIND_FRAMEWORK set to CMAKE_FIND_FRAMEWORK ONLY .

Also refer to this article: How to use existing OSX platforms .

+22
source share

another solution: fooobar.com/questions/1159728 / ...

 target_link_libraries(program "-framework Cocoa") 
0
source share

All Articles