This is one of those things where you have to have the setting right before any possible TRY_COMPILE actions in any CMakeLists files. It&#39;s *conceptually* equivalent to changing the compiler.<br><br>What you tried by using -DCMAKE_AR should work if you start with an empty binary tree. (And starting with an empty binary tree is a reasonable thing to do when essentially everything needs to be rebuilt anyway.)<br>
<br>Does that make sense?<br><br>HTH,<br>David<br><br><div class="gmail_quote">On Thu, Apr 17, 2008 at 5:44 PM, Blezek, Daniel J., Ph.D. &lt;<a href="mailto:Blezek.Daniel@mayo.edu">Blezek.Daniel@mayo.edu</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">






<div>


<p><font face="Arial" size="2">Hi all,</font>
</p>

<p><font face="Arial" size="2">&nbsp; We&#39;re using the Intel compiler for some of our builds of ITK.&nbsp; The &quot;-fast&quot; option tries to statically link.&nbsp; So I thought I&#39;d build Insight statically.&nbsp; The problem occurred when I tried to use the static libraries generated by &quot;/usr/bin/ar&quot;, and the symbols could not be found.&nbsp; Turns out that the Intel compiler requires you to use their version of ar, namely xiar.</font></p>


<p><font face="Arial" size="2">&nbsp; I tried all the obvious things like changing &quot;CMAKE_AR&quot; in my cache file, defining an AR environment variable, a -DCMAKE_AR=xiar to CMake, etc.&nbsp; Turns out that the value is cached in CMakeFiles/CMakeCXXCompiler.cmake, but no good way to change it (the CMakeCXXCompiler.cmake overrides CMakeCache.txt) short of editing the file (which is what I ended up doing).</font></p>


<p><font face="Arial" size="2">&nbsp; Could the CMake developers provide an easy way to override the CMAKE_AR command to make linking statically with the Intel compiler straightforward?</font></p>

<p><font face="Arial" size="2">Thanks much,</font>

<br><font face="Arial" size="2">-dan</font>
</p>

<p><b><font face="Arial" size="2">Daniel Blezek, PhD</font></b>

<br><font face="Arial" size="2">Medical Imaging Informatics Innovation Center</font>

<br><font face="Arial" size="2">Enterprise Imaging Systems Unit</font>
</p>

<p><font face="Arial" size="2">P 127 or (77) 8 8886</font>

<br><font face="Arial" size="2">T 507 538 8886</font>

<br><font face="Arial" size="2">E <a href="mailto:blezek.daniel@mayo.edu" target="_blank">blezek.daniel@mayo.edu</a></font>
</p>

<p><font face="Arial" size="2">Mayo Clinic</font>

<br><font face="Arial" size="2">200 First St. S.W.</font>

<br><font face="Arial" size="2">Harwick SL-44</font>

<br><font face="Arial" size="2">Rochester, MN 55905</font>

<br><font face="Arial" size="2"><a href="http://mayoclinic.org" target="_blank">mayoclinic.org</a></font>
</p>

</div>
<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" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>