and wow, the patch I just sent is broken because cmXCodeObject->Print() has sideffects! :(<div><br></div><div>Will send a patch that fixes ->Print() when I have some extra time.</div><div><br>/Johan</div><div><br><div class="gmail_quote">
On Mon, Mar 7, 2011 at 1:33 PM, Johan Björk <span dir="ltr"><<a href="mailto:phb@spotify.com">phb@spotify.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Nick,<div><br></div><div>We are using a modification on your patch internally.</div><div>Few things</div><div>1) It breaks projects that have resources. Fix is to attach the Executable to only the 'copy to cmake build dir' phase. Even after the mailinglist discussion I'm unsure of the need for this?</div>

<div>XCode basically claims it is a recursive dependency as the executable file is added as a depenency on the "Copy Files" phase.</div><div><br></div><div>2) POST_BUILD targets stopped working. Re-added the code that uses those (Before the copy-files target, maybe it should be after? I Really don't understand the copy to cmake build dir phase.</div>

<div><br></div><div>Attached the original Patch from Nick modified to work with lastest git master + two fixes mentioned above.</div><div><br></div><font color="#888888"><div>/Johan</div></font><div><div></div><div class="h5">
<div><br></div><div><br><div class="gmail_quote">On Sun, Feb 20, 2011 at 2:43 PM, Johan Björk <span dir="ltr"><<a href="mailto:phb@spotify.com" target="_blank">phb@spotify.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nick,<div><br></div><div>Any updates on this patch?</div><div><br></div><div>Cheers</div><div>/Johan</div><div><br>



<br><div class="gmail_quote"><div><div></div><div>On Thu, Jan 20, 2011 at 2:08 AM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div><div>><br>
> BTW, it might make more sense to move this to the cmake-developers mailing list.<br>
><br>
</div>I've transfered this thread to the developer list.  See below for continuation..<br>
<div><div></div><div><br>
<br>
On Jan 18, 2011, at 12:42 PM, Bill Hoffman wrote:<br>
<br>
> On 1/18/2011 2:40 PM, Brad King wrote:<br>
>> On 1/18/2011 2:12 PM, Nick Kledzik wrote:<br>
>>> When I use cmake to create a Makefile, the resulting main executable<br>
>>> is placed in the build directory tree next to the Makefile.<br>
>><br>
>> This is where CMake puts files in single-configuration generators.<br>
>><br>
>>> When I use cmake to create a xcode project, the resulting main<br>
>>> executable is placed  in a subdirectory named Debug of the build<br>
>>> directory tree.<br>
>><br>
>> This is where CMake puts files in multi-configuration generators.<br>
>><br>
>> Both of the above are expected default behaviors.  Both can be<br>
>> changed by CMake properties like RUNTIME_OUTPUT_DIRECTORY and<br>
>> its per-configuration equivalent.  All CMake generators must<br>
>> honor these.<br>
>><br>
>>> None of these locations are the "native" location<br>
>>> where Xcode would put a build result.<br>
>><br>
>> Xcode has settings like CONFIGURATION_BUILD_DIR to control<br>
>> where the build outputs go.  This already works.  Is there<br>
>> some reason your changes cannot use these?<br>
>><br>
>> My understanding is that the main problem with the current generator<br>
>> is all the extra build phases and OTHER_LDFLAGS stuff used to deal<br>
>> with link line ordering and static libraries.  This is what Bill<br>
>> summarized:<br>
>><br>
>> On 1/13/2011 3:41 PM, Bill Hoffman wrote:<br>
>>> - have a static library show up more than once on a link line<br>
>>> - be able to specify the order of static libraries on the link line<br>
>>> - be able to relink and executable when a static library that it<br>
>> depends on is rebuilt.<br>
>><br>
>> I'm more interested in a solution to implementation issues like these<br>
>> than in interface details like where output files go.<br>
>><br>
>> -Brad<br>
>><br>
> So, for Xcode and VS IDE, CMake will place things in directories like Debug, Release.<br>
><br>
> For example, you should get something like this:<br>
><br>
> ${RUNTIME_OUTPUT_DIRECTORY}/Debug/myexe<br>
><br>
> Xcode does support building multiple configurations like Debug, Release, etc.  Where is the "native" location for those files?<br>
</div></div>As I said, it is per-user xcode settings.  You cannot infer the location from source tree cmake has access to.<br>
<br>
At build time, the location is known within xcode.  So, I added a copy-file phase to have xocde copy the resulting binary from the "native" location to the standard location the cmake expects.  There is little overhead for this.<br>





<br>
I've now have a patch which:<br>
1) preserves link order<br>
2) builds libraries into the xcode native location<br>
4) removes pre and post shell script phases previously used to fix dependency problems<br>
3) xcode projects now have proper dependencies<br>
<br>
WIth this cmake patch, I can build CMake.xcodeproject, open it in xcode, build-all, set the current target to be "cmake", make a source change, hit build, and have xcode just compile that one file, re-archive the library, then re-link cmake tool.  I also debugged all this in Xcode by setting arguments for the cmake tool and hitting the build-and-debug within xcode!<br>





<br>
Attached is the patch from cmake-2.8.3 sources:<br>
<br><br>
<br></div></div><div>
This cmake also creates an xcode project that builds LLVM.  It is still not quite optimal because there are a bunch of cases where custom rules cause a custom make file to be generated which is executed from within xcode via a shell script phase.  Xcode does not now which files the script might modify, so xcode has to be conservative and re-check all timestamps.  There are ways to add custom scripts with specified input and output files in xcode.  I may get to fixing that someday...<br>





<br>
<br>
How does one run the test suite?  I saw the instructions about building cmake for make, then executing "make Experimental".  I did that and all 184 or 184 tests passed.  But it looks like this is running the cmake generated makefiles - not cmake generated xcode projects.<br>





<br></div>
-Nick<div><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>_______________________________________________<br>
cmake-developers mailing list<br>
<a href="mailto:cmake-developers@cmake.org" target="_blank">cmake-developers@cmake.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers</a><br>
<br></div></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><font color="#333333">Johan Björk<br>Team Lead, Development Tools<br>Spotify<br>
<br>This e-mail (including any attachments) may contain information that is<br>confidential and/or privileged. It is intended only for the recipient(s).<br>If you have reason to believe that you are not the intended recipient of<br>
this e-mail, please contact the sender immediately and delete the e-mail<br>from your computer.</font></span><br>
</div>