<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Cmake is really simple but you need to generate &nbsp;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 : &nbsp;by removing the line&nbsp;include(CMakeDetermineSystem) "it is baaaaad"</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 class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self puts: '# This is automatically generated file using ', self configurationName, ' on ',</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>Date current asString, ' ' , Time current asString;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>puts: 'cmake_minimum_required(VERSION 2.6.2)'.</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self config requiresDetermineSystem ifTrue: [</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>self<span class="Apple-tab-span" style="white-space:pre">        </span>puts: 'include(CMakeDetermineSystem)'.</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>]</div></div><div><br></div><div>and add in&nbsp;CPlatformConfig</div><div><br></div><div>A method :</div><div>CPlatformConfig&gt;&gt;#requiresDetermineSystem</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^true</div><div><br></div><div>Create a WindowConfiguration as you wish and create a method&nbsp;</div><div><br></div><div>MyWindowConfiguration&gt;&gt;#requiresDetermineSystem</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^false</div><div><span class="Apple-style-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>"</div><div>SET(CMAKE_SYSTEM_NAME Windows)</div><div>SET(CMAKE_C_COMPILER&nbsp;i386-mingw32-gcc)</div><div>SET(CMAKE_CXX_COMPILER&nbsp;i386-mingw32-g++)</div><div>SET(CMAKE_RC_COMPILER&nbsp;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>"</div><div><br></div><div>A generate your source and do :&nbsp;</div><div>cmake -DMAKE_TOOLCHAIN_FILE=MyToolchain.cmake</div><div>and make</div><div>that should work :</div><div><br></div><div>Possible error :&nbsp;</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 class="Apple-tab-span" style="white-space:pre">        </span>maker cmd: 'add_custom_command' params: 'OUTPUT ', res ,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>'</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>COMMAND <span class="Apple-tab-span" style="white-space:pre">        </span>windres --include-dir ${targetPlatform}/misc -D_WIN32 -i ${buildDir}/Cog.rc -o ', res , '</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>COMMENT "Generating resource file..."</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>'.</div></div><div>[...]</div><div>Should be change in :</div><div><div>[...]<span class="Apple-tab-span" style="white-space: pre; ">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>maker cmd: 'add_custom_command' params: 'OUTPUT ', res ,</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>'</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>COMMAND&nbsp;<span class="Apple-tab-span" style="white-space: pre; ">        </span><b>i386-mingw32-windres</b>&nbsp;--include-dir ${targetPlatform}/misc -D_WIN32 -i ${buildDir}/Cog.rc -o ', res , '</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>COMMENT "Generating resource file..."</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>'.</div></div><div>[...]</div><div><br></div><div>PS:&nbsp;i have a old version on my repository (JBARepo) under the CMakerVMMaker, but it is completely deprecated &nbsp;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 class="Apple-interchange-newline"><blockquote type="cite"><div><br>On 12 December 2011 16:33, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">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?&nbsp; 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">&nbsp; Unix Makefiles&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = Generates standard UNIX makefiles.<br></blockquote><blockquote type="cite">&nbsp; Xcode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = Generate XCode project files.<br></blockquote><blockquote type="cite">&nbsp; CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.<br></blockquote><blockquote type="cite">&nbsp; Eclipse CDT4 - Unix Makefiles<br></blockquote><blockquote type="cite">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = Generates Eclipse CDT 4.0 project files.<br></blockquote><blockquote type="cite">&nbsp; KDevelop3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = Generates KDevelop 3 project files.<br></blockquote><blockquote type="cite">&nbsp; KDevelop3 - Unix Makefiles&nbsp; = 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">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 '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't find some include beginning by Uppercase(cause the file isn'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;&nbsp;instead &nbsp;#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;&nbsp;instead&nbsp;#include&nbsp;&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">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">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; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Regard</div><div>Jean Baptiste Arnaud</div><div><a href="mailto:jbaptiste.arnaud@gmail.com">jbaptiste.arnaud@gmail.com</a></div><div><br></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>