I'm going to commit this as a fix in CMake 'next' -- but I'm extending it to the VS8 and VS9 chunks as well. And I'm eliminating the duplicate use of:<br><br> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"<br>
<br><div class="im">as one of the PATHS and just going with:<br><br> "${msvc_install_path}/../../VC/redist"<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"><<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>></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 <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
> 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>
> Are there still problems building/using 64-bit CMake using the official<br>
> 2.8.4 release? (Rather than whatever you were using when you reported<br>
> this... which must be prior to 2.8.4, or you'd have the above chunk of code<br>
> rather than the one you referred to.)<br>
><br>
<br>
</div>Yes; with a target of 'Visual Studio 10 Win64' but not with 'Visual Studio 10'.<br>
<br>
C:\tools\startups>cmake --version<br>
cmake version 2.8.4<br>
<br>
C:\general\build\vs10\sack\Debug_solution\alltype-core>cmake -G<br>
"Visual Studio 10 Win64" 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>
'MSVC10_REDIST_DIR-NOTFOUND/Debug_NonRedist/x64/Microsoft.VC100.DebugCRT/msvcp100d.dll'<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>
'MSVC10_REDIST_DIR-NOTFOUND/Debug_NonRedist/x64/Microsoft.VC100.DebugCRT/msvcr100d.dll'<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>
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]"<br>
ABSOLUTE )<br>
FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT<br>
PATHS<br>
</div><div class="im"> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"<br>
</div><div class="im"> "${msvc_install_path}/../../VC/redist"<br>
"${base_dir}/VC/redist"<br>
</div> "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/VC/redist"<br>
"$ENV{ProgramFiles(x86)}/Microsoft Visual Studio 10.0/VC/redist"<br>
<div><div></div><div class="h5"> )<br>
<br>
<br>
<br>
<br>
><br>
> Thanks,<br>
> David<br>
><br>
><br>
> On Wed, Mar 9, 2011 at 2:43 PM, J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
>><br>
>> In InstallRequiredSystemLibraries<br>
>><br>
>> IF(CMAKE_CL_64)<br>
>> SET(CMAKE_MSVC_ARCH amd64)<br>
>> ELSE(CMAKE_CL_64)<br>
>> SET(CMAKE_MSVC_ARCH x86)<br>
>> ENDIF(CMAKE_CL_64)<br>
>><br>
>><br>
>> amd64 should be x64 for vs2010<br>
>> SET(CMAKE_MSVC_ARCH x64)<br>
>><br>
>> --------------------<br>
>><br>
>> If cmake is built as 64bit this won't work<br>
>><br>
>> FIND_PATH(MSVC10_REDIST_DIR NAMES<br>
>> ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT<br>
>> PATHS<br>
>><br>
>> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"<br>
>> "${base_dir}/VC/redist"<br>
>> )<br>
>><br>
>> because that key is only installed as a 32 bit key (which is under<br>
>> Wow6432Node with x64)<br>
>><br>
>> ---------------------<br>
>> This part is really confusing me - I really thought I had it , then I<br>
>> tested a few other modes and it doesn't work.<br>
>><br>
>> Also, and I don't know why, but the following code works with vs2010<br>
>> 32bit, but not with vs2010 64bit<br>
>><br>
>> FIND_PATH(MSVC10_REDIST_DIR NAMES<br>
>> ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT<br>
>> PATHS<br>
>><br>
>> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"<br>
>> "${base_dir}/VC/redist"<br>
>> )<br>
>><br>
>> the previous seems to work only in 32 bit mode... with x64 (other than<br>
>> the arch change from amd64 to x64, it was still unable to locate the<br>
>> redist, until I grabbed the value into a seperate variable....<br>
>><br>
>> Grabbing the registry value into a variable and then using that to<br>
>> search works in 32 and 64 bit targets. (actually after confirming<br>
>> that it worked, the following doesn't actually work, but what's at the<br>
>> end does)<br>
>><br>
>> Changing the search for the redist path like this works in all modes<br>
>> 32/64 debug/release....<br>
>><br>
>> GET_FILENAME_COMPONENT( msvc_install_path<br>
>> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]"<br>
>> ABSOLUTE )<br>
>> FIND_PATH(MSVC10_REDIST_DIR NAMES<br>
>> ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT<br>
>> PATHS<br>
>> "${msvc_install_path}/../../VC/redist"<br>
>> "${base_dir}/VC/redist"<br>
>> )<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<br>
>> <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:<br>
>> <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>
><br>
><br>
</div></div></blockquote></div><br>