Re: Custom Rules with xcode
Re: Custom Rules with xcode
- Subject: Re: Custom Rules with xcode
- From: Trenton Schulz <email@hidden>
- Date: Tue, 9 Dec 2003 14:48:33 +0100
On Dec 9, 2003, at 2:37 PM, Willard Myers wrote:
On Dec 9, 2003, at 08:11, Trenton Schulz wrote:
I've tried a similar thing with uic and Qt Designer ui files.
Source files with names matching: *.ui
using: Custom script:
/Users/twschulz/troll/qt/3.3/bin/uic $INPUT_FILE_PATH -o
${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h
/Users/twschulz/troll/qt/3.3/bin/uic -impl
${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h $INPUT_FILE_PATH -o
${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.cpp
with output files:
${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.h
${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.cpp
And the files are generated just fine. But then all it does is copy
the files. It would be great if Xcode would build them and link them
into the application, since they are C++ files. I can, of course, add
these files to the project myself, but then you have some sort of
chicken and egg problem. How can I tell Xcode what to do?
I tried exactly the same thing and got no further. For now, I've
fallen back to a (Python) script build phase that runs both uic and
moc on a wired list of .ui files, and moc on a wired list of .h files.
I add all the files in DERIVED_FILES_DIR to the project once; then I
only need to fixup my project when the lists in my script change.
Qt/Mac users need two things for the Xcode custom rule feature to help
us out (immensely):
(1) The target should depend on the generated (C++) files, so they get
appropriately generated *and* compiled and linked.
This would fix quite a few problems with Qt Designer files.
(2) The pattern matcher needs to look inside .h files to find those
containing the Q_OBJECT macro.
Not quite good enough (you could use the Q_OBJECT macro in a .cpp, for
example) Alternatively, the ability to add a "moc" build phase where
one could just drag files that need to be moc'ed into it, and Xcode
would notice the output and build and link in those to. That would
probably make it possible to just use Xcode from the start with Qt.
Still, I find it hard to believe that the build rules just copy files.
Unless Xcode does some magic for its *own* build rules (like GCC).
-- Trenton
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.