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&#39;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=&#39;-O2 -g -debug inline-debug-info&#39;  \</div>
<div><div>   -DCMAKE_C_FLAGS_RELWITHDEBINFO=&#39;-O2 -g -debug inline-debug-info&#39;  \</div><div><div>   -DCMAKE_Fortran_FLAGS_RELWITHDEBINFO=&#39;-O2 -g -debug inline-debug-info&#39;  \</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 &quot;configuration&quot; line is that the settings are not specific to a given project. It just &quot;activates&quot; 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="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
&gt;&gt; [Will Dicharry wrote:]</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
&gt;&gt; Am I misusing the toolchain file capability?</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
&gt; [Bill Hoffman wrote:]</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
&gt; Yes, that should only be used for cross-compiling.</blockquote><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
&gt; 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><div>Levent</div></div></div>