Hi all,
I'm using NetBeans C++ to build a simple Qt application. Here is what I did:
- From 'File' I chose 'New project'
- In the 'New project' window I selected C/C++ category and C/C++ Qt application
- Then I clicked Next and on the second frame I renamed my project to 'Test'
- Clicked 'Finish' and the sample project was created successfully (is is also the only project open so it is treated as the main project).
- From 'Run' I chose 'Build Main Project' - the action was successful
Then I created an Ant script to build the same project from the console:
Linux projects build
<target name="My.Test"> <echo>Building my Test Linux project.</echo> <exec executable="make" failonerror="true" dir="Test"> <arg value="-f"/> <arg value="Makefile"/> <arg value="clobber"/> </exec> </target>
When I run this script I get a peculiar error:
Test.linux: [echo] Building my Test Linux project.
My.Test:
[echo] Building my Test Linux project.
[exec] for CONF in Debug Release ; \
[exec] do \
[exec] "make" -f nbproject/Makefile-${CONF}.mk QMAKE= SUBPROJECTS= .clean-conf; \
[exec] done
[exec] make[1]: Entering directory `/home/myusr/Development/Projects/Test'
[exec] VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
[exec] /bin/sh: -o: not found
The build fails. After looking at the make files I found the following lines in Makefile-Debug.mk:
# Link Libraries and Options
LDLIBSOPTIONS=
nbproject/qt-${CND_CONF}.mk: nbproject/qt-${CND_CONF}.pro FORCE
${QMAKE} VPATH=. -o qttmp-${CND_CONF}.mk nbproject/qt-${CND_CONF}.pro
mv -f qttmp-${CND_CONF}.mk nbproject/qt-${CND_CONF}.mk
I don't understand why '${QMAKE} VPATH=. -o qttmp-${CND_CONF}.mk nbproject/qt-${CND_CONF}.pro' is unacceptable and what is actually wrong.
After some pondering I noticed that NetBeans sets the value of ${QMAKE} to /usr/bin/qmake, but when I call the ant script it stays an empty string. So my question is rather how NetBeans knows where to find the qmake - is there a project setting or is it a setting of the IDE itself. Should I rely on the fact that the qmake path is always this '/usr/bin/qmake' and set ${QMAKE} variable in the ant script manually or is there another way to solve this?
10x in advance