Hi Eric<br><br><div class="gmail_quote">On Wed, Feb 6, 2013 at 2:46 AM, Eric Gross <span dir="ltr"><<a href="mailto:eric.gross@ni.com" target="_blank">eric.gross@ni.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font face="sans-serif">Hi,</font>
<br>
<br><font face="sans-serif">I'm using CMake 2.8.10.2 with the "Unix
Makefiles" generator on Windows and cross-compiling for Linux using
GCC. I have Cygwin in the path for make/sh/etc.</font>
<br>
<br><font face="sans-serif">To cross compile I have the following
items set:</font>
<br><font face="sans-serif">CMAKE_SYSTEM_NAME:STRING=Linux</font>
<br><font face="sans-serif">CMAKE_CXX_COMPILER:STRING=<path to
cross-compiler gcc></font>
<br><font face="sans-serif">CMAKE_C_COMPILER:STRING=<path to
cross-compiler gcc></font>
<br>
<br><font face="sans-serif">This process works perfectly with the
exception of some larger components that have a few hundred object files
to link in. When linking those larger components I get an error about unterminated
quotes from sh.exe. By cutting down the number of objects I have deduced
that I am reaching the command line length limits of Cygwin's sh.exe (or
possibly OS limits).</font>
<br>
<br></blockquote><div>I've come across this limitation only for Cygwin, since you don't mention where did you get CMake, it's a better approach to use the one provided by the Cygwin distribution instead. As for MingGW, by using CMake 2.8.9 and MinGW <span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">x86_64-w64-mingw32 (reads mingw 32 bits toolchain in windows to build windows 64 bits apps) i was able to build projects i couldn't do with Cygwin targeted Makefiles. I've no idea why Makefiles generated for cygwin didn't use response files while MinGW ones did.</span></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="sans-serif">It appears that the generated Makefiles
are passing all the objects on the command line rather than using a response
file. Googling the CMake email lists seems to indicate that on Windows
this is worked around already in the platform-specific files used by CMake
and it uses a response file there. I'm guessing that code is not being
used here for me because I am cross-compiling. Is this correct? Is there
any way to force it to use that same mechanism?</font>
<br></blockquote><div><br></div><div>No clue, i'm also interested. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><font face="sans-serif">I thought about trying the "MinGW
Makefiles" generator which appears to use cmd.exe, but it does not
allow Cygwin's sh.exe to be in the path and our larger build system that
calls into CMake requires it. I'm also not clear if it would expect to
use the MinGW version of GCC rather than the cross-compiler GCC.</font>
<br>
<br></blockquote><div>You can use MinGW as well, you should generate "MSYS Makefiles", get rid of cygwin in the %path% and use, if you don't feel like using cmd try the MSYS shell instead which is started by msys.bat. For CMake, depending on the toolchain you choose you might have to manually set up CMake like this:</div>
<div><br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">set CC=x86_64-w64-mingw32-gcc</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
set CXX=x86_64-w64-mingw32-g++</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">set AR=x86_64-w64-mingw32-ar</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">
set LINKER=x86_64-w64-mingw32-ld</div></div><div> ...</div><div>etc,</div><div>Regards</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote>
</div>