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.
You can simply use find_library as follows: find_library(COCOA_LIBRARY Cocoa) ?
find_library
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 .
${COCOA_LIBRARY}
target_link_libraries
CMAKE_FIND_FRAMEWORK
ONLY
Also refer to this article: How to use existing OSX platforms .
another solution: fooobar.com/questions/1159728 / ...
target_link_libraries(program "-framework Cocoa")