Thanks JB for all your info. I soon as I have some free time I will try it :)<br><br><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 9:36 PM, Jean Baptiste Arnaud <span dir="ltr">&lt;<a href="mailto:jbaptiste.arnaud@gmail.com">jbaptiste.arnaud@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div style="word-wrap:break-word"><div>Cmake is really simple but you need to generate  from a specific configuration that shouldnt get information about compilation from the system but from a toolchain :</div>
<div><div><br></div><div>You have choice change the File generated :  by removing the line include(CMakeDetermineSystem) &quot;it is baaaaad&quot;</div><div>or change the printHeader method to take care about the cross compilation in CMakeGenerator, (maybe Igor have already fix this)</div>
<div><br></div><div>CMakeGenerator&gt;&gt;#printHeader</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>self puts: &#39;# This is automatically generated file using &#39;, self configurationName, &#39; on &#39;,</div>
<div><span style="white-space:pre-wrap">                </span>Date current asString, &#39; &#39; , Time current asString;</div><div><span style="white-space:pre-wrap">                </span>puts: &#39;cmake_minimum_required(VERSION 2.6.2)&#39;.</div>
<div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">        </span>self config requiresDetermineSystem ifTrue: [</div><div><span style="white-space:pre-wrap">                </span>self<span style="white-space:pre-wrap">        </span>puts: &#39;include(CMakeDetermineSystem)&#39;.</div>
<div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">        </span>]</div></div><div><br></div><div>and add in CPlatformConfig</div><div><br></div><div>A method :</div><div>CPlatformConfig&gt;&gt;#requiresDetermineSystem</div>
<div><span style="white-space:pre-wrap">        </span>^true</div><div><br></div><div>Create a WindowConfiguration as you wish and create a method </div><div><br></div><div>MyWindowConfiguration&gt;&gt;#requiresDetermineSystem</div>
<div><span style="white-space:pre-wrap">        </span>^false</div><div><span style="font-family:sans-serif;font-size:13px;line-height:19px"><div><br></div></span></div><div>OK here your source and CMake infrastructure is correct.</div>
<div>You need a cross compiler i use the mingw32</div><div>So you need to create your MyToolchain.cmake, just copy past the following code (change the compiler if needed).</div><div><br></div><div><div>&quot;</div><div>SET(CMAKE_SYSTEM_NAME Windows)</div>
<div>SET(CMAKE_C_COMPILER i386-mingw32-gcc)</div><div>SET(CMAKE_CXX_COMPILER i386-mingw32-g++)</div><div>SET(CMAKE_RC_COMPILER i386-mingw32-windres)</div><div><br></div><div># It should be everything in VM platform if it is not the case uncomment all this line.</div>
<div>#SET(CMAKE_FIND_ROOT_PATH where you install mingw32)</div><div>#SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)</div><div>#SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)</div><div>#SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)</div>
</div><div>&quot;</div><div><br></div><div>A generate your source and do : </div><div>cmake -DMAKE_TOOLCHAIN_FILE=MyToolchain.cmake</div><div>and make</div><div>that should work :</div><div><br></div><div>Possible error : </div>
<div>CMAKE_RC_COMPILER maybe not automatically call, if that happen check the #extraVMSettings: in your configuration and change the</div><div>[...]</div><div><div><span style="white-space:pre-wrap">        </span>maker cmd: &#39;add_custom_command&#39; params: &#39;OUTPUT &#39;, res ,</div>
<div><span style="white-space:pre-wrap">        </span>&#39;</div><div><span style="white-space:pre-wrap">                </span>COMMAND <span style="white-space:pre-wrap">        </span>windres --include-dir ${targetPlatform}/misc -D_WIN32 -i ${buildDir}/Cog.rc -o &#39;, res , &#39;</div>
<div><span style="white-space:pre-wrap">                </span>COMMENT &quot;Generating resource file...&quot;</div><div><span style="white-space:pre-wrap">        </span>&#39;.</div></div><div>[...]</div><div>Should be change in :</div><div>
<div>[...]<span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>maker cmd: &#39;add_custom_command&#39; params: &#39;OUTPUT &#39;, res ,</div><div><span style="white-space:pre-wrap">        </span>&#39;</div>
<div><span style="white-space:pre-wrap">                </span>COMMAND <span style="white-space:pre-wrap">        </span><b>i386-mingw32-windres</b> --include-dir ${targetPlatform}/misc -D_WIN32 -i ${buildDir}/Cog.rc -o &#39;, res , &#39;</div>
<div><span style="white-space:pre-wrap">                </span>COMMENT &quot;Generating resource file...&quot;</div><div><span style="white-space:pre-wrap">        </span>&#39;.</div></div><div>[...]</div><div><br></div><div>PS: i have a old version on my repository (JBARepo) under the CMakerVMMaker, but it is completely deprecated  CMakeVMMaker-jb.121.</div>
<div>PPS : I wish update this code but never spend the time</div><div>PPPS: I am available on skype if you want to discuss that.</div><div><br></div><div><div><br></div><div><br><div><div>On Dec 12, 2011, at 4:42 PM, Igor Stasenko wrote:</div>
<br><blockquote type="cite"><div><br>On 12 December 2011 16:33, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com" target="_blank">marianopeck@gmail.com</a>&gt; wrote:<br><blockquote type="cite"><br></blockquote>
<blockquote type="cite">Hi JB. Could you please tell me how should I run cmake to build for windows? Is there a specific generator?  because if I run:<br></blockquote><blockquote type="cite"><br></blockquote>since you cross-compiling under unix, you use unix makefiles, which is default.<br>
but to generate windows executable, you need different settings in cmake config.<br>like different compilation target (win32 executable, not ELF) etc.<br><br>JB could tell you more :)<br><br><blockquote type="cite">cmake --help<br>
</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">at the end the only generators I see are:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Generators<br></blockquote>
<blockquote type="cite"><br></blockquote><blockquote type="cite">The following generators are available on this platform:<br></blockquote><blockquote type="cite">  Unix Makefiles              = Generates standard UNIX makefiles.<br>
</blockquote><blockquote type="cite">  Xcode                       = Generate XCode project files.<br></blockquote><blockquote type="cite">  CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.<br></blockquote>
<blockquote type="cite">  Eclipse CDT4 - Unix Makefiles<br></blockquote><blockquote type="cite">                              = Generates Eclipse CDT 4.0 project files.<br></blockquote><blockquote type="cite">  KDevelop3                   = Generates KDevelop 3 project files.<br>
</blockquote><blockquote type="cite">  KDevelop3 - Unix Makefiles  = Generates KDevelop 3 project files.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">
<br></blockquote><blockquote type="cite">Thanks!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Thu, Jul 7, 2011 at 7:07 PM, Jean Baptiste Arnaud &lt;<a href="mailto:jbaptiste.arnaud@gmail.com" target="_blank">jbaptiste.arnaud@gmail.com</a>&gt; wrote:<br>
</blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Since the last Igor ( thank ) update it &#39;s possible to cross compile windows VM(last version) from MacOs and Unix.<br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Using Mingw and cmake.<br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Now, i do for Cog, and for ARM9 processor.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
My process imply to fix some window file cause some include are wrong, then it the cross compiler don&#39;t find some include beginning by Uppercase(cause the file isn&#39;t beginning by uppercase).<br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite">In /Platform/win32/vm/sqWin32Intel.c<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
#include &lt;float.h&gt; instead  #include &lt;Float.h&gt;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">in /Platform/win32/plugin/SocketPlugin/sqWin32NewNet.c<br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">#include &lt;ws2tcpip.h&gt; instead #include &lt;Ws2tcpip.h&gt;<br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Regard<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Jean Baptiste Arnaud<br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><a href="mailto:jbaptiste.arnaud@gmail.com" target="_blank">jbaptiste.arnaud@gmail.com</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">
--<br></blockquote><blockquote type="cite">Mariano<br></blockquote><blockquote type="cite"><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br></blockquote><blockquote type="cite">
<br></blockquote><blockquote type="cite"><br></blockquote><br><br><br>-- <br>Best regards,<br>Igor Stasenko.<br></div></blockquote></div><br><div>
<div style="word-wrap:break-word"><div>Regard</div><div>Jean Baptiste Arnaud</div><div><a href="mailto:jbaptiste.arnaud@gmail.com" target="_blank">jbaptiste.arnaud@gmail.com</a></div><div><br></div></div><br><br>
</div>
<br></div></div></div><br></blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>