# Copying dependency to build engine *before* build

Hi, I realize this question is perhaps retarded and shows a severe lack of understanding of building an app for SailfishOS, but bear with me.

I'm succesfully able to build and run the C++ tutorial app: https://sailfishos.org/wiki/Tutorial_-_Combining_C%2B%2B_with_QML

Now I want to work on my first own app but I depend on a library that's somewhat complex and doesn't come with its own .profile: https://gitlab.com/embeddable-common-lisp/ecl/

When editing the .pro file I'm able to have the build engine find the needed ecl/ecl.h by including INCLUDEPATH += «include-directory», however I'm having a hell of a time getting build engine to find the ECL library which is on my local system in «lib-directory» (I've added LIBS += -lecl -L«lib-drectory» to the .pro file). I understand the build is done in a VM where the ECL library is not available, but I do not understand why it does find the include file.

I've read some posts: https://together.jolla.com/question/10713/create-the-example-of-including-your-own-library-and-standard-qt-module-in-a-harbour-compatible-way/ and https://together.jolla.com/question/151895/how-to-build-opencv-libraries-for-sfos/ but they're too complicated for me. I'm not able at the moment to put my focus in "doing the right thing" and just want the build engine to find that library (with the assumption that I am able to cross-compile it for the right architecture locally).

Then once I've got my stuff working and I'm satisfied I'll shift my focus and time to doing things correctly (like making a .pro file for the library for example).

edit retag close delete

TEMPLATE=subdirs?

app.depends = lib or similar

( 2019-01-10 13:20:29 +0200 )edit

GREAT that you start developing native apps!

( 2019-01-10 21:04:34 +0200 )edit

Sort by » oldest newest most voted

The build engine uses the shared folders mechanism to access files on host filesystem. For prototyping and similar purposes, any file from the host filesystem can be referred to at build time, under the constraint that

1. the file is located under the shared source folder, and
2. relative file path is used

The shared source folder defaults to user home directory and can be changed in Qt Creator > Tools > Options > Sailfish OS > Build Engine > Alt source folder.

INCLUDEPATH += ../../foo/include
LIBS += -L../../foo/lib -lfoo

more

Thanks, I found the magic incantation I needed! Somehow ../../«dir» did not work but ../TARGET/«dir» did.