The easiest is to do like we did in jevoisbase. See the CMakeLists.txt file in jevoisbase. You basically need to:
- get a list of all the source files from your thord-party package that you need to compile
- add them to your project's target using the target_sources() cmake command.
- add any needed include path using the include_directories() command.
- that's it, the files will get compiled and linked into your module, both for host and platform.
For example, for the zbar library (barcode and qrcode deconding), we did:
########################################################################################################################
# ZZBar barcode / QR-code source files:
include_directories(Contrib/ZBar/include Contrib/ZBar/zbar)
set(ZBS "${JVB}/Contrib/ZBar/zbar")
target_sources(jevoisbase PRIVATE ${ZBS}/processor.c ${ZBS}/scanner.c ${ZBS}/symbol.c ${ZBS}/img_scanner.c
${ZBS}/qrcode/rs.c ${ZBS}/qrcode/isaac.c ${ZBS}/qrcode/util.c ${ZBS}/qrcode/qrdectxt.c ${ZBS}/qrcode/bch15_5.c
${ZBS}/qrcode/binarize.c ${ZBS}/qrcode/qrdec.c ${ZBS}/config.c ${ZBS}/error.c ${ZBS}/processor/posix.c
${ZBS}/processor/lock.c ${ZBS}/processor/null.c ${ZBS}/convert.c ${ZBS}/decoder/i25.c ${ZBS}/decoder/qr_finder.c
${ZBS}/decoder/code128.c ${ZBS}/decoder/codabar.c ${ZBS}/decoder/code39.c ${ZBS}/decoder/databar.c
${ZBS}/decoder/ean.c ${ZBS}/decoder/code93.c ${ZBS}/image.c ${ZBS}/refcnt.c ${ZBS}/decoder.c)