<div>First, use the correct spelling:</div><div>-DCMAKE_TOOLACHAIN_FILE</div><div><br></div><div>should be:</div><div>-DCMAKE_TOOLCHAIN_FILE</div><div><br></div><div>If that doesn&#39;t solve it entirely, then try using a name without the &quot;+&quot; character in it for the PROJECT command.</div>
<div><br></div><div>If that doesn&#39;t do it, give us more details, I guess.</div><div><br></div><div>I&#39;m not a cross-compiling expert, so hopefully somebody else who is can chime in here as well.</div><div><br></div>
<div><br></div><div>HTH,</div><div>David</div><div><br></div><br><div><div><br><div class="gmail_quote">On Wed, Jan 12, 2011 at 1:41 PM, Enrique Izaguirre <span dir="ltr">&lt;<a href="mailto:enrique.izaguirre@gmail.com">enrique.izaguirre@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;">Hello again:<br>For some reason when I try to compile a simple C++ program, it takes the wrong compiler, even though I am setting the appropriate one in the Toolchain file; I am working on Cygwin, and I am trying to compile for a LInux environment using g++-linux compiler, which I tested it and works correctly. <br>

<br>I have a folder named helloC++-linux, where I have all my stuff:<br>A simple hello.cpp program<br>My CMakeLists.txt contains:<br>    #CMakeLists.txt :  CMake configuration file<br>    PROJECT(helloC++-linux CXX)<br>    #States that CMake required version must be &gt;= 2.6<br>

    CMAKE_MINIMUM_REQUIRED(VERSION 2.6)<br>    #File to build and executable:<br>    ADD_EXECUTABLE(hello.o hello.cpp)<br><br>My Toolchain file (named Toolchain-linuxcpp.cmake) contains:<br>   SET(CMAKE_SYSTEM_NAME Linux)<br>

   #specify the cross-compiler<br>   SET(CMAKE_CXX_COMPILER /bin/g++-linux)<br><br><br>and I tried to build it using following command:<br>cmake -DCMAKE_TOOLACHAIN_FILE=./Toolchain-linuxcpp.cmake .<br><div><br>But when building, CMake looks for a compiler, and takes  /usr/bin/c++.exe instead of /bin/g++-linux.<br>

<br>I tried also using CMAKE_FORCE_CXX_COMPILER, but I got the same results. Is there any way of<br>make it take the compiler from /bin, instead of from /usr/bin ?<br><br>Thanks<br><br>Best Regards<br><br>Enrique<br></div>

<br>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div></div>