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, Martin.
<br/><br/><br/>On Tuesday 17 January 2012 16:14:39 Eric Noulard wrote:
<div class='shrinkable-quote'><br/>> 2011/5/15 Eduardo Sánchez Muñoz <<a href="/user/SendEmail.jtp?type=node&node=7197240&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>>:
<br/>> > I get the following error when I use a toolchain file to cross-compile
<br/>> > with mingw32:
<br/>> > $ cmake -DCMAKE_TOOLCHAIN_FILE=~/Documentos/mingw32.cmake
<br/>> > -DCMAKE_INSTALL_PREFIX=/usr/i486-mingw32 .
<br/>> > -- The C compiler identification is GNU
<br/>> > -- The CXX compiler identification is GNU
<br/>> > CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not
<br/>> > found. Please set CMAKE_RC_COMPILER to a valid compiler path or name.
<br/>> > -- Check for working C compiler: /usr/bin/i486-mingw32-gcc
<br/>> > CMake Error at /usr/share/cmake-2.8/Modules/CMakeRCInformation.cmake:22
<br/>> > (GET_FILENAME_COMPONENT):
<br/>> > get_filename_component called with incorrect number of arguments
<br/>> > Call Stack (most recent call first):
<br/>> > /usr/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake:59
<br/>> > (enable_language)
<br/>> > /usr/share/cmake-2.8/Modules/Platform/Windows-GNU-C.cmake:1 (include)
<br/>> > /usr/share/cmake-2.8/Modules/CMakeCInformation.cmake:56 (INCLUDE)
<br/>> > CMakeLists.txt:2 (PROJECT)
<br/>> >
<br/>> >
<br/>> > CMake Error: CMAKE_RC_COMPILER not set, after EnableLanguage
<br/>> > CMake Error: Internal CMake error, TryCompile configure of cmake failed
<br/>> > -- Check for working C compiler: /usr/bin/i486-mingw32-gcc -- broken
<br/>> > CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
<br/>> > (MESSAGE):
<br/>> > The C compiler "/usr/bin/i486-mingw32-gcc" is not able to compile a
<br/>> > simple test program.
<br/>> >
<br/>> > It fails with the following output:
<br/>> >
<br/>> >
<br/>> >
<br/>> >
<br/>> >
<br/>> > CMake will not be able to correctly generate this project.
<br/>> > Call Stack (most recent call first):
<br/>> > CMakeLists.txt:3 (PROJECT)
<br/>> >
<br/>> >
<br/>> > -- Configuring incomplete, errors occurred!
<br/>> >
<br/>> > My toolchain file is:
<br/>> > set(CMAKE_SYSTEM_NAME Windows)
<br/>> > set(CMAKE_C_COMPILER i486-mingw32-gcc)
<br/>> > set(CMAKE_CXX_COMPILER i486-mingw32-g++)
<br/>>
<br/>> you lack the definition of CMAKE_RC_COMPILER
<br/>> which for your case should be something like:
<br/>>
<br/>> SET(CMAKE_RC_COMPILER i486-mingw32-windres)
<br/>>
<br/>> The attached toolchain file may be easier to tailor to you need on several
<br/>> host, just comment/set the appropriate value for "COMPILER_PREFIX"
<br/>> 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/>