[Interest] Xcode Script not working with Qt5

Sensei senseiwa at gmail.com
Tue Jan 15 13:34:11 CET 2013


Dear all,

I am moving to Qt 5, developing on my Mac with Xcode.

My script creates a project, creates a plain old Makefile, and compiles 
MOCs and UIs, creating a library that I link. At least it did with Qt 4.8!

<rant>
The /real problem/ is that Qt 5 still has no real integration with 
Xcode. Yes, I know there are 3rd party tools, and yes I know about the 
Creator, and yes, there is a mkspec (useless with Xcode: it recreates 
the project!). Those are not "integration". Having a good VisualStudio 
plugin and no Xcode one, makes the Mac a second rate platform to develop 
in. That's a shame!
</rant>

I'd *really* like to see Xcode and Qt integrated.


Well, that said, my script does not "see" forms in the Makefile. So, 
here's my script (with old 4.8 commented out):


PATH=$PATH:/Applications/Development/qt/5.0.0/clang_64/bin
QTDIR=/Applications/Development/qt
QMAKESPEC=/Applications/Development/qt/5.0.0/clang_64/mkspecs/macx-llvm
#QTDIR=/Applications/Development/qt
#QTBIN=$QTDIR/Desktop/Qt/4.8.1/gcc/bin
#QMAKE=$QTBIN/qmake
TempName="$PROJECT_NAME.Qt"
TempDirectory="$OBJROOT/$TempName"
#
cd "$OBJROOT"
mkdir -p "$TempName"
cd "$TempName"
#echo mkdir -p $TempName
#cd $TempDirectory
#
echo Generating qmake project...
qmake -project "$SOURCE_ROOT/$PROJECT_NAME"
#
echo Generating qmake makefile...
qmake -makefile
#
echo Generating MOC files...
make mocables
#
echo Compiling UI files...
make compiler_uic_make_all
#
echo Compiling...
make compiler_rcc_make_all
for i in *.cpp; do
    Target=`echo $i | sed s/cpp/o/`
    make $Target
done
#
echo Creating library...
Object=""
for i in *.o; do
    Object="$Object $i"
done
ar rcs lib$TempName.a $Object
exit 0


And as you can see from the output, MOC files are created and compiled.


Generating qmake project...
Generating qmake makefile...
Generating MOC files...
/Applications/Development/qt/5.0.0/clang_64/bin/moc -DQT_NO_DEBUG 
-DQT_GUI_LIB -DQT_CORE_LIB 
-I/Applications/Development/qt/5.0.0/clang_64/mkspecs/macx-clang -I. -I. 
-I../../../../../TeXon 
-I/Applications/Development/qt/5.0.0/clang_64/include 
-I/Applications/Development/qt/5.0.0/clang_64/include/QtGui 
-I/Applications/Development/qt/5.0.0/clang_64/lib/QtGui.framework/Versions/5/Headers 
-I/Applications/Development/qt/5.0.0/clang_64/include/QtCore 
-I/Applications/Development/qt/5.0.0/clang_64/lib/QtCore.framework/Versions/5/Headers 
-I. -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers 
-I/System/Library/Frameworks/AGL.framework/Headers -D__APPLE__ 
-D__GNUC__=4 ../../../../../TeXon/txAboutDialog.h -o moc_txAboutDialog.cpp
[...]
Compiling UI files...
make: *** No rule to make target `compiler_uic_make_all'.  Stop.
Compiling...
/Applications/Development/qt/5.0.0/clang_64/bin/rcc -name texon 
../../../../../TeXon/texon.qrc -o qrc_texon.cpp
clang++ -c -pipe -mmacosx-version-min=10.6 -O2 -Wall -W -fPIE 
-DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB 
-I/Applications/Development/qt/5.0.0/clang_64/mkspecs/macx-clang -I. -I. 
-I../../../../../TeXon 
-I/Applications/Development/qt/5.0.0/clang_64/include 
-I/Applications/Development/qt/5.0.0/clang_64/include/QtGui 
-I/Applications/Development/qt/5.0.0/clang_64/lib/QtGui.framework/Versions/5/Headers 
-I/Applications/Development/qt/5.0.0/clang_64/include/QtCore 
-I/Applications/Development/qt/5.0.0/clang_64/lib/QtCore.framework/Versions/5/Headers 
-I. -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers 
-I/System/Library/Frameworks/AGL.framework/Headers -o 
moc_txAboutDialog.o moc_txAboutDialog.cpp
[...]
clang++ -c -pipe -mmacosx-version-min=10.6 -O2 -Wall -W -fPIE 
-DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB 
-I/Applications/Development/qt/5.0.0/clang_64/mkspecs/macx-clang -I. -I. 
-I../../../../../TeXon 
-I/Applications/Development/qt/5.0.0/clang_64/include 
-I/Applications/Development/qt/5.0.0/clang_64/include/QtGui 
-I/Applications/Development/qt/5.0.0/clang_64/lib/QtGui.framework/Versions/5/Headers 
-I/Applications/Development/qt/5.0.0/clang_64/include/QtCore 
-I/Applications/Development/qt/5.0.0/clang_64/lib/QtCore.framework/Versions/5/Headers 
-I. -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers 
-I/System/Library/Frameworks/AGL.framework/Headers -o qrc_texon.o 
qrc_texon.cpp
Creating library...



Since I use forms with generated ui_FILENAME files, I have a compilation 
error: clang doesn't find a previously generated file.

Now, digging in the .pro, I see that my forms are there:



FORMS += /Users/sensei/Documents/Projects/texon/TeXon/TeXon/about.ui \
          /Users/sensei/Documents/Projects/texon/TeXon/TeXon/newProject.ui



But as the compiler said, I find no ui_* in the directory where they 
should be. I see MOCs, their respective objects, I see QRC and the 
object, but no UIs.

As I read the Makefile I see no mention of UIs, while resources, mocs, 
and sources are there.


Any hint?










More information about the Interest mailing list