开发者

How to add a framework to CMake

开发者 https://www.devze.com 2023-01-01 05:20 出处:网络
I have written a small helloworld program that needs the Cocoa framework. I\'d like to know how to add开发者_开发问答 a framework in CMake. All the information I have found is out-of-date. I have CMak

I have written a small helloworld program that needs the Cocoa framework. I'd like to know how to add开发者_开发问答 a framework in CMake. All the information I have found is out-of-date. I have CMake 2.8.1 on Snow Leopard.


Can you just use find_library like this: find_library(COCOA_LIBRARY Cocoa)?

Then use ${COCOA_LIBRARY} in your target_link_libraries. Possibly setting the CMAKE_FIND_FRAMEWORK variable to ONLY.

Also, refer to this article: How to use existing OSX frameworks.


another solution: https://stackoverflow.com/a/18330634/2482283

target_link_libraries(program "-framework Cocoa")
0

精彩评论

暂无评论...
验证码 换一张
取 消