Re: String manipulation in Build Rule output files field
Re: String manipulation in Build Rule output files field
- Subject: Re: String manipulation in Build Rule output files field
- From: BJ Homer <email@hidden>
- Date: Sun, 21 Feb 2010 09:17:28 -0700
On Sun, Feb 21, 2010 at 5:49 AM, Andreas Grosam
<email@hidden> wrote:
Just an idea:
#!/usr/bin/bash
MY_INPUT_FILE_DIR=$(dirname ${INPUT_FILE_PATH})
ragel -o "${DERIVED_FILES_DIR}/${MY_INPUT_FILE_DIR}/${INPUT_FILE_BASE}.cpp" "${INPUT_FILE_PATH}"
This should place the product of html/parser.rl into folder ${DERIVED_FILES_DIR}/html
And the product of xml/parser.rl into folder ${DERIVED_FILES_DIR}/xml accordingly.
I haven't tried this, especially if Xcode will find the products - that is the .cpp files - and using them correctly in its build rule. If not, it may call your custom build rule every time, even when they are already generated. Of course, you need to setup your project such that gcc is able to find the generated sources as well.
Yes, the actual generation of the .cpp files works fine; there are a number of ways around that issue including the one you suggested. The problem is that you also have to tell Xcode what the output files are from that script, and in that area, I don't have access to MY_INPUT_FILE_DIR nor $(dirname *). So it will generate the cpp files, but then Xcode won't know to compile them because it doesn't know about them.
-BJ
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden