Qtcreator 4.4.1 on osx

#1

hi.

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:

    Properties{
        condition: of.platform === "osx"
        cpp.minimumOsxVersion: "10.9"
    }

additionally i needed to add a qbs profile setting in the Kit i am using:
qbs.architecture:"x86_64"
(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
...
HOST_OS=Darwin
Done!
linking $(PRODUCT_NAME)
generating dSYM for qtcreatortest

this produces 2 defunct applications:
$(PRODUCT_NAME).app
qtcreatortest_debug.app

the output-folder looks like this:

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

what’s wrong here?
io

#2

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

'Security',
'LDAP',
#3

are you using 0.9.8 or from github?

#4

that is with the version on github

#5

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

#6

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)
#7

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

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

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

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

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

    Probe{
        id: targetDebug
        property string name: "test"
        ...
    }

something wrong with that probe?

#8

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

instead of: project.path
using: project.sourceDirectory

works

#9

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:

    Probe{
        id: targetDebug
        property string name: appname+"_debug"
        ...
    }

that solves the undefined PRODUCT_NAME problem.

builds now without that extra environment variable in the Kit.
:slight_smile:

#10

seems qbs.architecture is usually managed via a qbs profile:
http://doc.qt.io/qbs/qbs-module.html

also see this stackoverflow:

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

#11

i collected the changes in this branch:

commit details:
https://github.com/i-n-g-o/openFrameworks/commit/6006bc7be42092919cd69c5db7e23f565da0b3ca

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

#12

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.