<div><div>Great!<br><br>A while ago I tried to
cross-compile code for win32 with mingw from linux and ran into the same problem with the library PREFIX and SUFFIX. Setting the PREFIX and SUFFIX globally works great, cross-compiling now works good for my project (and much faster than the native compile with mingw on windows.)
<br><br>SET(CMAKE_STATIC_LIBRARY_PREFIX &quot;&quot;)<br>SET(CMAKE_STATIC_LIBRARY_SUFFIX &quot;.dll&quot;)<br>SET(CMAKE_EXECUTABLE_SUFFIX &quot;.exe&quot;)<br><br>Thanks,<br><br>Peter.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This problem is now solved. For anyone else facing this with<br>crosscompiling here are is what I did. In the top level CMakeLists.txt I<br>put in the following:<br><br>PROJECT(myProj)<br><br>SET(CMAKE_STATIC_LIBRARY_PREFIX &quot;lib&quot;)
<br>SET(CMAKE_STATIC_LIBRARY_SUFFIX &quot;.a&quot;)<br>SET(CMAKE_EXECUTABLE_SUFFIX &quot;.elf&quot;)<br><br>Some of my leqrnings;<br>1) The prefix and suffix information must and should be placed after<br>declaring the project. If it is put before, then it gets overwritten
<br>when project is declared. Can any of the developers throw more light on<br>the various effects that declaring a project has?<br><br>2) When cross-compiling, the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER<br>must be set *before* declaring the project. It gets *committed* when a
<br>project is declared and cannot be changed without deleting the build.<br><br>Warm regards,<br>Kishore<br>_______________________________________________<br>CMake mailing list<br><a href="mailto:CMake@cmake.org">CMake@cmake.org
</a><br><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>