and wow, the patch I just sent is broken because cmXCodeObject-&gt;Print() has sideffects! :(<div><br></div><div>Will send a patch that fixes -&gt;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">&lt;<a href="mailto:phb@spotify.com">phb@spotify.com</a>&gt;</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 &#39;copy to cmake build dir&#39; phase. Even after the mailinglist discussion I&#39;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 &quot;Copy Files&quot; 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&#39;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">&lt;<a href="mailto:phb@spotify.com" target="_blank">phb@spotify.com</a>&gt;</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">&lt;<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>&gt;</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>&gt;<br>
&gt; BTW, it might make more sense to move this to the cmake-developers mailing list.<br>
&gt;<br>
</div>I&#39;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>
&gt; On 1/18/2011 2:40 PM, Brad King wrote:<br>
&gt;&gt; On 1/18/2011 2:12 PM, Nick Kledzik wrote:<br>
&gt;&gt;&gt; When I use cmake to create a Makefile, the resulting main executable<br>
&gt;&gt;&gt; is placed in the build directory tree next to the Makefile.<br>
&gt;&gt;<br>
&gt;&gt; This is where CMake puts files in single-configuration generators.<br>
&gt;&gt;<br>
&gt;&gt;&gt; When I use cmake to create a xcode project, the resulting main<br>
&gt;&gt;&gt; executable is placed  in a subdirectory named Debug of the build<br>
&gt;&gt;&gt; directory tree.<br>
&gt;&gt;<br>
&gt;&gt; This is where CMake puts files in multi-configuration generators.<br>
&gt;&gt;<br>
&gt;&gt; Both of the above are expected default behaviors.  Both can be<br>
&gt;&gt; changed by CMake properties like RUNTIME_OUTPUT_DIRECTORY and<br>
&gt;&gt; its per-configuration equivalent.  All CMake generators must<br>
&gt;&gt; honor these.<br>
&gt;&gt;<br>
&gt;&gt;&gt; None of these locations are the &quot;native&quot; location<br>
&gt;&gt;&gt; where Xcode would put a build result.<br>
&gt;&gt;<br>
&gt;&gt; Xcode has settings like CONFIGURATION_BUILD_DIR to control<br>
&gt;&gt; where the build outputs go.  This already works.  Is there<br>
&gt;&gt; some reason your changes cannot use these?<br>
&gt;&gt;<br>
&gt;&gt; My understanding is that the main problem with the current generator<br>
&gt;&gt; is all the extra build phases and OTHER_LDFLAGS stuff used to deal<br>
&gt;&gt; with link line ordering and static libraries.  This is what Bill<br>
&gt;&gt; summarized:<br>
&gt;&gt;<br>
&gt;&gt; On 1/13/2011 3:41 PM, Bill Hoffman wrote:<br>
&gt;&gt;&gt; - have a static library show up more than once on a link line<br>
&gt;&gt;&gt; - be able to specify the order of static libraries on the link line<br>
&gt;&gt;&gt; - be able to relink and executable when a static library that it<br>
&gt;&gt; depends on is rebuilt.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m more interested in a solution to implementation issues like these<br>
&gt;&gt; than in interface details like where output files go.<br>
&gt;&gt;<br>
&gt;&gt; -Brad<br>
&gt;&gt;<br>
&gt; So, for Xcode and VS IDE, CMake will place things in directories like Debug, Release.<br>
&gt;<br>
&gt; For example, you should get something like this:<br>
&gt;<br>
&gt; ${RUNTIME_OUTPUT_DIRECTORY}/Debug/myexe<br>
&gt;<br>
&gt; Xcode does support building multiple configurations like Debug, Release, etc.  Where is the &quot;native&quot; 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 &quot;native&quot; location to the standard location the cmake expects.  There is little overhead for this.<br>





<br>
I&#39;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 &quot;cmake&quot;, 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 &quot;make Experimental&quot;.  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>