Thanks very much for the quick reply. I was under the seemingly mistaken 
<br/>impression that the CMakeRCInformation.cmake module should automatically take 
<br/>care of this. I will try your toolchain file with the suggested ammendments.
<br/><br/>Cheers, &nbsp;Martin.
<br/><br/><br/>On Tuesday 17 January 2012 16:14:39 Eric Noulard wrote:
<div class='shrinkable-quote'><br/>&gt; 2011/5/15 Eduardo Sánchez Muñoz &lt;<a href="/user/SendEmail.jtp?type=node&node=7197240&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt;:
<br/>&gt; &gt; I get the following error when I use a toolchain file to cross-compile
<br/>&gt; &gt; with mingw32:
<br/>&gt; &gt; $ cmake -DCMAKE_TOOLCHAIN_FILE=~/Documentos/mingw32.cmake
<br/>&gt; &gt; -DCMAKE_INSTALL_PREFIX=/usr/i486-mingw32 .
<br/>&gt; &gt; -- The C compiler identification is GNU
<br/>&gt; &gt; -- The CXX compiler identification is GNU
<br/>&gt; &gt; CMake Error: your RC compiler: &quot;CMAKE_RC_COMPILER-NOTFOUND&quot; was not
<br/>&gt; &gt; found. Please set CMAKE_RC_COMPILER to a valid compiler path or name.
<br/>&gt; &gt; -- Check for working C compiler: /usr/bin/i486-mingw32-gcc
<br/>&gt; &gt; CMake Error at /usr/share/cmake-2.8/Modules/CMakeRCInformation.cmake:22
<br/>&gt; &gt; (GET_FILENAME_COMPONENT):
<br/>&gt; &gt; &nbsp; get_filename_component called with incorrect number of arguments
<br/>&gt; &gt; Call Stack (most recent call first):
<br/>&gt; &gt; &nbsp; /usr/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake:59
<br/>&gt; &gt; (enable_language)
<br/>&gt; &gt; &nbsp; /usr/share/cmake-2.8/Modules/Platform/Windows-GNU-C.cmake:1 (include)
<br/>&gt; &gt; &nbsp; /usr/share/cmake-2.8/Modules/CMakeCInformation.cmake:56 (INCLUDE)
<br/>&gt; &gt; &nbsp; CMakeLists.txt:2 (PROJECT)
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; CMake Error: CMAKE_RC_COMPILER not set, after EnableLanguage
<br/>&gt; &gt; CMake Error: Internal CMake error, TryCompile configure of cmake failed
<br/>&gt; &gt; -- Check for working C compiler: /usr/bin/i486-mingw32-gcc -- broken
<br/>&gt; &gt; CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
<br/>&gt; &gt; (MESSAGE):
<br/>&gt; &gt; &nbsp; The C compiler &quot;/usr/bin/i486-mingw32-gcc&quot; is not able to compile a
<br/>&gt; &gt; simple test program.
<br/>&gt; &gt; 
<br/>&gt; &gt; &nbsp; It fails with the following output:
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; &nbsp; CMake will not be able to correctly generate this project.
<br/>&gt; &gt; Call Stack (most recent call first):
<br/>&gt; &gt; &nbsp; CMakeLists.txt:3 (PROJECT)
<br/>&gt; &gt; 
<br/>&gt; &gt; 
<br/>&gt; &gt; -- Configuring incomplete, errors occurred!
<br/>&gt; &gt; 
<br/>&gt; &gt; My toolchain file is:
<br/>&gt; &gt; set(CMAKE_SYSTEM_NAME Windows)
<br/>&gt; &gt; set(CMAKE_C_COMPILER i486-mingw32-gcc)
<br/>&gt; &gt; set(CMAKE_CXX_COMPILER i486-mingw32-g++)
<br/>&gt; 
<br/>&gt; you lack the definition of CMAKE_RC_COMPILER
<br/>&gt; which for your case should be something like:
<br/>&gt; 
<br/>&gt; SET(CMAKE_RC_COMPILER i486-mingw32-windres)
<br/>&gt; 
<br/>&gt; The attached toolchain file may be easier to tailor to you need on several
<br/>&gt; host, just comment/set the appropriate value for &quot;COMPILER_PREFIX&quot;
<br/>&gt; and USER_ROOT_PATH.
<br/></div>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://cmake.3232098.n2.nabble.com/CMake-fails-to-use-a-toolchain-to-cross-compile-tp6365554p7197240.html">Re: [CMake] CMake fails to use a toolchain to cross-compile</a><br/>
Sent from the <a href="http://cmake.3232098.n2.nabble.com/">CMake mailing list archive</a> at Nabble.com.<br/>