Qtcreator 4.4.1 on osx


i have some problems getting oF playing nicely with qtcreator 4.4.1 on osx.

before a newly created project (using qt-creator) got parsed correctly 2 files needed some changes.
cpp.minimumOsxVersion in files openFrameworks.qbs and ofApp.qbs needs to be strings in order for qbs to parse the files properly.
i also aligned the minimumOsxVersion number in the files, it looks like this now in both files:

        condition: of.platform === "osx"
        cpp.minimumOsxVersion: "10.9"

additionally i needed to add a qbs profile setting in the Kit i am using:
(shouldn’t this be rather derived automatically from the kit?)

then all the files show up in qtcreator…
when building the project the compile output looks like this:

compiling main.cpp
compiling ofApp.cpp
generating Info.plist for qtcreatortest
generating PkgInfo for qtcreatortest
/usr/bin/make -j4 Debug
linking $(PRODUCT_NAME)
generating dSYM for qtcreatortest

this produces 2 defunct applications:

the output-folder looks like this:

but running make manually in the project-folder does produce a working application bundle:

what’s wrong here?

forgot to mention:
also i needed to add these to of.qbs, where osx Properties are defined (coreFrameworks:…)


are you using 0.9.8 or from github?

that is with the version on github

ok, i haven’t tested qtcreator on master osx for a while, will take a look when i have a moment

i investigated a bit more:
the environment variable “PRODUCT_NAME” simply is not set when building with qbs.

which is weird. when running qbs shell in the project folder, i see the variable set up correctly

anyway, setting that variable in the Kit i’m using solves this problem.
PRODUCT_NAME=test creates an app-bundle with the name “test”…

i figured libfmodex.dylib does not get copied over to the bundle.
putting that in place manually makes it a functional app :slight_smile:

now, i’m new to qbs:

  • how to set that environment variable?
  • can i log something somehow? (e.g. in the Rule exportdylib)

hm. setting the env-var only works if i hardcode the targetName in ofApp.qbs:

        condition: qbs.buildVariant.contains("debug")
        targetName: "test"//targetDebug.name

it does not work if i hardcode it in the Probes:

        id: targetDebug
        property string name
        configure: {
            name = "test"
            found = true;

if setting the name in the Probe like this it would work again:

        id: targetDebug
        property string name: "test"

something wrong with that probe?

found the problem with library-copy:
in file ofApp.qbs, line 92:

instead of: project.path
using: project.sourceDirectory


also in the toplevel qbs file we need to use
sourceDirectory instead of path where the project.name gets resolved. it should look like this:

ofApp {
    name: { return FileInfo.baseName(sourceDirectory) }

in ofApp.qbs the taget-probes need to initialize the name property:

        id: targetDebug
        property string name: appname+"_debug"

that solves the undefined PRODUCT_NAME problem.

builds now without that extra environment variable in the Kit.

seems qbs.architecture is usually managed via a qbs profile:

also see this stackoverflow:

so, setting qbs.architecture in the kit seems to be the way to go…

i collected the changes in this branch:

commit details:

could somebody give it a try on a different platform?
(qtcreate 4.4.1)

about updating addons:
tick the option “Force probes” in the build setting
(unfold the Build steps and find the option there)

when this option is checked, changes in the of.addons list (see your main qbs file) are taken into account…

thanks @arturo for telling me.