Building MacOSX Frameworks with CMake -
i trying build os x library using cmake. libary includes amount of resource files (.pdfs used icon images). in initial attempts, have been building library , resource files separately libgeneric.a , generic-resources.bundle - with, bundle hosting relevant images libgeneric.a uses.
set (src srcfile1.m srcfile2.m) set (headers srcfile1.h srcfile2.h) set (icons icon1.pdf icon2.pdf) set (source_file_properties ${icons} properties macosx_package_location "resources") add_library(generic ${src} ${headers}) add_library(generic-resources module ${icons}) set_target_properties(generic-resources properties linker_language c) # suppress cmake error of not able determine linker language libary set_target_properties(generic-resources properties bundle true)
this worked fine, except, not able figure out how directly include .bundle in build process of applications using libgeneric.a. way cmake load bundle add source file in target application. but, since, bundle had not yet been compiled while running cmake, complain source file did not exist. workaround, resorted manually adding .bundle xcode after cmake generated app.xcodeproj file (and compiled bundle). getting cumbersome, figured i'd try build mac os x framework instead (to house both library , code)
set (src srcfile1.m srcfile2.m) set (headers srcfile1.h srcfile2.h) set (icons icon1.pdf icon2.pdf) set (source_file_properties ${icons} properties macosx_package_location "resources") add_library(generic shared ${src} ${headers} ${icons}) set_target_properties(generic properties framework true) set_target_properties(generic properties macosx_rpath true) #to suppress cmake warnings on rpath
however, creating framework icons inside resources directory. code library missing. appreciate assistance in getting framework build correctly. how,
- get cmake build library indicated source file , place inside framework
- get cmake copy headers appropriately in framework.
i setting rpath true now, haven't figured out it. set to? objective build private framework, bundle automatically application.
alternatively, there easy way cmake build bundle file created in earlier process, , load built file applications build process.
Comments
Post a Comment