One alternative that comes into my mind would be to invoke cmake like<br><br>cmake -C initialCache.cmake<br><br>where initialCache.cmake is a script that preloads a set of cache variables, i.e., with entries like<br>set(CMAKE_CXX_COMPILER icpc CACHE STRING "CXX compiler." FORCE)<br>
<br>Would this accomplish what you want?<br><br>Adolfo.<br><br><div class="gmail_quote">On Fri, Jul 10, 2009 at 1:06 AM, S. Levent Yilmaz <span dir="ltr"><<a href="mailto:leventyilmaz@gmail.com">leventyilmaz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">This question was asked a while ago:<a href="http://www.cmake.org/pipermail/cmake/2009-June/030404.html" target="_blank">http://www.cmake.org/pipermail/cmake/2009-June/030404.html</a> with no definitive answer..
<div><br></div><div>So, I'll try to raise this issue from a different angle, perhaps this will make more sense to the developers. </div><div><br></div><div>Take a look at this line:</div><div><br></div><div>cmake \</div>
<div> -DCMAKE_CXX_COMPILER=icpc \</div><div> -DCMAKE_C_COMPILER=icc \</div><div> -DCMAKE_Fortran_COMPILER=ifort \</div><div><div> -DCMAKE_CXX_FLAGS_RELWITHDEBINFO='-O2 -g -debug inline-debug-info' \</div>
<div><div> -DCMAKE_C_FLAGS_RELWITHDEBINFO='-O2 -g -debug inline-debug-info' \</div><div><div> -DCMAKE_Fortran_FLAGS_RELWITHDEBINFO='-O2 -g -debug inline-debug-info' \</div><div> -DBLA_VENDOR=Intel \</div>
<div> -DBLA_BLA \</div><div> /path/to/source</div><div><br></div><div>Now, the thing I want to emphasize about this "configuration" line is that the settings are not specific to a given project. It just "activates" a custom compiler suite. Another perfectly reasonable scenario is further refinements made for specific platforms. And, really, compilation being cross or native is an orthogonal issue here. </div>
<div><br></div><div>The earlier dialog was: </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
>> [Will Dicharry wrote:]</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
>> Am I misusing the toolchain file capability?</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
> [Bill Hoffman wrote:]</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
> Yes, that should only be used for cross-compiling.</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
> To set the compilers you can set the environment variables FC, CC, and CXX before running CMake.</blockquote></div><div><br></div><div>So, now my question is, how can I reduce the above cmake configure line muddied with plethora of compiler (and/or platform) specific definitions (or preceding environment variables for that matter) into:</div>
<div><br></div><div>cmake -DCMAKE_OK_NOT_TOOLCHAIN_BUT_WHAT_FILE=site/macros/intel.cmake /path/to/source</div><div><br></div><div>? </div><div><br></div><font color="#888888"><div>Levent</div></font></div></div>
<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><br clear="all"><br>-- <br>Adolfo Rodríguez Tsouroukdissian<br><br>Robotics engineer<br>
PAL ROBOTICS S.L<br><a href="http://www.pal-robotics.com">http://www.pal-robotics.com</a><br>Tel. +34.93.414.53.47<br>Fax.+34.93.209.11.09<br>AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden contener información privilegiada y/o confidencial que está dirigida exclusivamente a su destinatario. Si usted recibe este mensaje y no es el destinatario indicado, o el empleado encargado de su entrega a dicha persona, por favor, notifíquelo inmediatamente y remita el mensaje original a la dirección de correo electrónico indicada. Cualquier copia, uso o distribución no autorizados de esta comunicación queda estrictamente prohibida.<br>
<br>CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may contain confidential information which is privileged and intended only for the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or accompanying document(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender at the above e-mail address.<br>