how to use a custom sqlite build in Xcode with Cocoapods

126 views
Skip to first unread message

Robert Welz

unread,
Apr 6, 2018, 1:02:28 PM4/6/18
to FMDB
Hello all.

I have a rather big Xcode project (2 targets plus cocoapods targets). I use FMDB 2.6.2 as cocoapod target.

As far as I understand, FMDB uses the sqlite libraries which are installed on the system. But the requirements (by my boss) are that I have to use a specific version which I include in the installer of my application.

I am building a unix binary (no application bundle) to use as Launch Agent/Daemon run as root and my installer will first install the sqlite libs to /usr/local/lib/libsqlite3.8.8.3.dylib

But where do I configure FMDB to use that version? Is FMDB.xconfig the right place for this?

And what do I have to configure? My FMDB.xconfig looks like:

CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FMDB
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FMDB" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/GZIP" "${PODS_ROOT}/Headers/Public/RegExCategories"
OTHER_LDFLAGS = -l"sqlite3"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/FMDB
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES

Thank you for your valuable help,

kind regards,

Robert

Gus Mueller

unread,
Apr 6, 2018, 1:12:04 PM4/6/18
to fm...@googlegroups.com
Instead of using a dylib, why not make a static version of it and include that in your app? Or maybe use the amalgamation version of the source?

Failing that, I think you just need to make sure that Xcode searches in /usr/local/lib/ first for the dylib. Maybe drag and drop it into your Xcode project in the Libraries folder?

-gus
> --
> You received this message because you are subscribed to the Google Groups "FMDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fmdb+uns...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Robert Welz

unread,
May 4, 2018, 8:51:33 AM5/4/18
to FMDB
Dear Gus, 
thank you very much. I did it the way you described (dropping the .a file onto the cocoa pod subproject) and everything works fine now.

kind regards,

Robert
Reply all
Reply to author
Forward
0 new messages