Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
772 views
in Technique[技术] by (71.8m points)

macos - CMake: Copy Frameworks into App Bundle

In my project directory I have some 3rd party frameworks, namely SFML, that I need to copy into the app bundle when I build my app. Any clean way to do that (maybe like the Copy Files Build Phase in Xcode)?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should check out CMake's BundleUtilities module.

There's a wiki entry complete with a functioning sample app here:

https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/BundleUtilities

The documentation for the BundleUtilities module is here:

http://www.cmake.org/cmake/help/v2.8.8/cmake.html#module:BundleUtilities

I recommend configuring a CMake -P script that calls fixup_bundle appropriately and then using a CMake "install(SCRIPT ...)" command to call that script at install time. Ask more specific questions later if you run into any problems with this approach, or if there's something unclear about the example or documentation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...