We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

Defining qml directory location

asked 2014-01-24 15:02:45 +0200

juke gravatar image

I'm trying to build multiple apps from same source and resources, but I can't find out where the resource file's location is defined.

My projects' directory structure is following

App/
    src/
        main.c
        ...
    qml/
        main.qml
        ...
    Project1/
        project1.pro
        project1.desktop
        project1.png
    Project2/
        project2.pro
        project2.desktop
        project2.png

In .pro files I have under

OTHER_FILES = ../qml/main.qml

but those files are not copied to the build box and building fails to that.

I also tried symlinking qml to ../qml which will put only the symlink inside the rpm, so that's not a fix either.

Can the qml dir's location be redefined somewhere or do I need to do something else to achieve having multiple projects using the same resources? Perhaps adding a build step where the resources are copied would work?

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
1

answered 2014-01-24 18:04:06 +0200

juke gravatar image

This can be done using qmake install set which is accessed using the INSTALLS variable in .pro file.

myQmlFiles.path = /usr/share/${TARGET}/qml
myQmlFiles.files = ../qml/*

INSTALLS += myQmlFiles

where .path defines where .files will be copied in the rpm build root. This can also be used for bundling any other files with your app.

Documentation for INSTALLS can be viewed here

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2014-01-24 15:02:45 +0200

Seen: 678 times

Last updated: Jan 24 '14