I&#39;m going to commit this as a fix in CMake &#39;next&#39; -- but I&#39;m extending it to the VS8 and VS9 chunks as well. And I&#39;m eliminating the duplicate use of:<br><br>  &quot;[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist&quot;<br>
<br><div class="im">as one of the PATHS and just going with:<br><br>  &quot;${msvc_install_path}/../../VC/redist&quot;<br></div><br>Should make it into 2.8.5. (Barring unforeseen madness, of course.)<br><br><br>Thanks,<br>
David<br><br><br><div class="gmail_quote">On Wed, Mar 9, 2011 at 3:42 PM, J Decker <span dir="ltr">&lt;<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Wed, Mar 9, 2011 at 11:56 AM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>
&gt; This is already at least partially fixed in CMake 2.8.4...<br>
<br>
</div>Ya I saw that - thought I was working against 2.8.4 until I got to the<br>
next box... so I started checking again...<br>
<div class="im"><br>
&gt; Are there still problems building/using 64-bit CMake using the official<br>
&gt; 2.8.4 release? (Rather than whatever you were using when you reported<br>
&gt; this... which must be prior to 2.8.4, or you&#39;d have the above chunk of code<br>
&gt; rather than the one you referred to.)<br>
&gt;<br>
<br>
</div>Yes; with a target of &#39;Visual Studio 10 Win64&#39; but not with &#39;Visual Studio 10&#39;.<br>
<br>
C:\tools\startups&gt;cmake --version<br>
cmake version 2.8.4<br>
<br>
C:\general\build\vs10\sack\Debug_solution\alltype-core&gt;cmake -G<br>
&quot;Visual Studio 10 Win64&quot; M:/sack -DCMAKE_BUILD_TYPE=Debug<br>
EFIX=C:\general\build\vs10/sack/Debug_out/core -DBUILD_MONOLITHIC=1<br>
CMake Warning at<br>
c:/tools/unix/cmake/share/cmake-2.8/Modules/InstallRequiredSystemLibraries.cmake:314<br>
(MESSAGE):<br>
  system runtime library file does not exist:<br>
  &#39;MSVC10_REDIST_DIR-NOTFOUND/Debug_NonRedist/x64/Microsoft.VC100.DebugCRT/msvcp100d.dll&#39;<br>
Call Stack (most recent call first):<br>
  CMakeLists.txt:1080 (INCLUDE)<br>
<br>
<br>
CMake Warning at<br>
c:/tools/unix/cmake/share/cmake-2.8/Modules/InstallRequiredSystemLibraries.cmake:314<br>
(MESSAGE):<br>
  system runtime library file does not exist:<br>
  &#39;MSVC10_REDIST_DIR-NOTFOUND/Debug_NonRedist/x64/Microsoft.VC100.DebugCRT/msvcr100d.dll&#39;<br>
Call Stack (most recent call first):<br>
  CMakeLists.txt:1080 (INCLUDE)<br>
<br>
<br>
---- My Fix ----<br>
<div class="im">    GET_FILENAME_COMPONENT( msvc_install_path<br>
&quot;[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]&quot;<br>
ABSOLUTE )<br>
    FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT<br>
      PATHS<br>
</div><div class="im">        &quot;[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist&quot;<br>
</div><div class="im">        &quot;${msvc_install_path}/../../VC/redist&quot;<br>
        &quot;${base_dir}/VC/redist&quot;<br>
</div>        &quot;$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/VC/redist&quot;<br>
        &quot;$ENV{ProgramFiles(x86)}/Microsoft Visual Studio 10.0/VC/redist&quot;<br>
<div><div></div><div class="h5">      )<br>
<br>
<br>
<br>
<br>
&gt;<br>
&gt; Thanks,<br>
&gt; David<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Mar 9, 2011 at 2:43 PM, J Decker &lt;<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; In InstallRequiredSystemLibraries<br>
&gt;&gt;<br>
&gt;&gt;  IF(CMAKE_CL_64)<br>
&gt;&gt;    SET(CMAKE_MSVC_ARCH amd64)<br>
&gt;&gt;  ELSE(CMAKE_CL_64)<br>
&gt;&gt;    SET(CMAKE_MSVC_ARCH x86)<br>
&gt;&gt;  ENDIF(CMAKE_CL_64)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; amd64 should be x64 for vs2010<br>
&gt;&gt;    SET(CMAKE_MSVC_ARCH x64)<br>
&gt;&gt;<br>
&gt;&gt; --------------------<br>
&gt;&gt;<br>
&gt;&gt; If cmake is built as 64bit this won&#39;t work<br>
&gt;&gt;<br>
&gt;&gt;    FIND_PATH(MSVC10_REDIST_DIR NAMES<br>
&gt;&gt; ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT<br>
&gt;&gt;      PATHS<br>
&gt;&gt;<br>
&gt;&gt;  &quot;[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist&quot;<br>
&gt;&gt;        &quot;${base_dir}/VC/redist&quot;<br>
&gt;&gt;      )<br>
&gt;&gt;<br>
&gt;&gt; because that key is only installed as a 32 bit key (which is under<br>
&gt;&gt; Wow6432Node with x64)<br>
&gt;&gt;<br>
&gt;&gt; ---------------------<br>
&gt;&gt; This part is really confusing me - I really thought I had it , then I<br>
&gt;&gt; tested a few other modes and it doesn&#39;t work.<br>
&gt;&gt;<br>
&gt;&gt; Also, and I don&#39;t know why, but the following code works with vs2010<br>
&gt;&gt; 32bit, but not with vs2010 64bit<br>
&gt;&gt;<br>
&gt;&gt;    FIND_PATH(MSVC10_REDIST_DIR NAMES<br>
&gt;&gt; ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT<br>
&gt;&gt;      PATHS<br>
&gt;&gt;<br>
&gt;&gt;  &quot;[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist&quot;<br>
&gt;&gt;        &quot;${base_dir}/VC/redist&quot;<br>
&gt;&gt;      )<br>
&gt;&gt;<br>
&gt;&gt; the previous seems to work only in 32 bit mode... with x64 (other than<br>
&gt;&gt; the arch change from amd64 to x64, it was still unable to locate the<br>
&gt;&gt; redist, until I grabbed the value into a seperate variable....<br>
&gt;&gt;<br>
&gt;&gt; Grabbing the registry value into a variable and then using that to<br>
&gt;&gt; search works in 32 and 64 bit targets.  (actually after confirming<br>
&gt;&gt; that it worked, the following doesn&#39;t actually work, but what&#39;s at the<br>
&gt;&gt; end does)<br>
&gt;&gt;<br>
&gt;&gt; Changing the search for the redist path like this works in all modes<br>
&gt;&gt; 32/64 debug/release....<br>
&gt;&gt;<br>
&gt;&gt;    GET_FILENAME_COMPONENT( msvc_install_path<br>
&gt;&gt; &quot;[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]&quot;<br>
&gt;&gt; ABSOLUTE )<br>
&gt;&gt;    FIND_PATH(MSVC10_REDIST_DIR NAMES<br>
&gt;&gt; ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT<br>
&gt;&gt;      PATHS<br>
&gt;&gt;        &quot;${msvc_install_path}/../../VC/redist&quot;<br>
&gt;&gt;        &quot;${base_dir}/VC/redist&quot;<br>
&gt;&gt;      )<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt;&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>