Hi,<br><br>Thank you for your answer.<br><br>I want to compile on both Linux and Windows with the same CMakeLists.txt. I will have a look to the different variables.<br><br>Cheers,<br><br>Romain<br><br><div class="gmail_quote">
2009/11/30 Johannes Stallkamp <span dir="ltr">&lt;<a href="mailto:johannes.stallkamp@rub.de">johannes.stallkamp@rub.de</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Romain,<br>
<br>
Romain CHANU schrieb:<br>
<div class="im">&gt; If I need to compile a library on both Linux and Windows, the best<br>
&gt; CMake practice would be to write toolchain files for Linux and<br>
&gt; Windows (cf. <a href="http://www.cmake.org/Wiki/CMake_Cross_Compiling" target="_blank">http://www.cmake.org/Wiki/CMake_Cross_Compiling</a>)<br>
&gt;<br>
&gt; Is that correct?<br>
</div>Do you really want to cross-compile (i.e. build your Linux library on<br>
Windows or vice versa) or do you just want to be able to compile your<br>
platform-independent library natively on Linux or Windows but with the<br>
same CMakeLists.txt ?<br>
In the latter case, just go for it. Basically, your Windows<br>
CMakeLists.txt should work just fine on Linux and vice versa. You<br>
might need to adjust some paths if you use some 3rd party libraries or<br>
use some compiler specific additional options. But you can implement<br>
that just fine within the same CMakeLists.txt using IF( MSVC ) ....<br>
ENDIF() (or other compiler/system-variables, see<br>
<a href="http://www.itk.org/Wiki/CMake_Useful_Variables" target="_blank">http://www.itk.org/Wiki/CMake_Useful_Variables</a> )<br>
<br>
HTH<br>
<font color="#888888">Johannes<br>
</font><div><div></div><div class="h5"><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>
</div></div></blockquote></div><br>