Saturday, February 19, 2011

Static Library in iOS (Xcode)

As you can read in the following blog entries
static libraries are the best way to reuse code between several iOS projects.
In the second tutorial (part1) they define the BUILT_PRODUCTS_DIR to have a shared build output locations. I prefere here a bit different settings:
  • /Users/Shared/${USER}/products (Place Build Products in)
  • /Users/Shared/${USER}/products/Temp (Place Intermediate Build Files in)
This separate the real products (as. e.g. a static library and its header files) and the all the other build results (e.g. object files).
Additional this setting you can simplify you search path for header files. The source tree setup of the tutorial is not required therefore.
You can set you "Header Search Path" to
  • ${BUILT_PRODUCTS_DIR}/usr/local/include
The advantage is this setup work even independent of the configuration and therefor it is sufficient to define it for "All Configurations" either for each target or even for the project.
Hope this helps a bit ..
Stephan

No comments: