[CMake] InstallRequiredSystemLibraries fails for msvc10 x64

David Cole david.cole at kitware.com
Wed Mar 9 14:56:36 EST 2011


This is already at least partially fixed in CMake 2.8.4...

The chunk you reference:
IF(CMAKE_CL_64)
   SET(CMAKE_MSVC_ARCH amd64)
ELSE(CMAKE_CL_64)
  SET(CMAKE_MSVC_ARCH x86)
ENDIF(CMAKE_CL_64)

Now looks like this:
  IF(CMAKE_CL_64)
    IF(MSVC_VERSION GREATER 1599)
      # VS 10 and later:
      SET(CMAKE_MSVC_ARCH x64)
    ELSE()
      # VS 9 and earlier:
      SET(CMAKE_MSVC_ARCH amd64)
    ENDIF()
  ELSE(CMAKE_CL_64)
    SET(CMAKE_MSVC_ARCH x86)
  ENDIF(CMAKE_CL_64)

Are there still problems building/using 64-bit CMake using the official
2.8.4 release? (Rather than whatever you were using when you reported
this... which must be prior to 2.8.4, or you'd have the above chunk of code
rather than the one you referred to.)


Thanks,
David


On Wed, Mar 9, 2011 at 2:43 PM, J Decker <d3ck0r at gmail.com> wrote:

> In InstallRequiredSystemLibraries
>
>  IF(CMAKE_CL_64)
>    SET(CMAKE_MSVC_ARCH amd64)
>  ELSE(CMAKE_CL_64)
>    SET(CMAKE_MSVC_ARCH x86)
>  ENDIF(CMAKE_CL_64)
>
>
> amd64 should be x64 for vs2010
>    SET(CMAKE_MSVC_ARCH x64)
>
> --------------------
>
> If cmake is built as 64bit this won't work
>
>    FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT
>      PATHS
>
>  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"
>        "${base_dir}/VC/redist"
>      )
>
> because that key is only installed as a 32 bit key (which is under
> Wow6432Node with x64)
>
> ---------------------
> This part is really confusing me - I really thought I had it , then I
> tested a few other modes and it doesn't work.
>
> Also, and I don't know why, but the following code works with vs2010
> 32bit, but not with vs2010 64bit
>
>    FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT
>      PATHS
>
>  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"
>        "${base_dir}/VC/redist"
>      )
>
> the previous seems to work only in 32 bit mode... with x64 (other than
> the arch change from amd64 to x64, it was still unable to locate the
> redist, until I grabbed the value into a seperate variable....
>
> Grabbing the registry value into a variable and then using that to
> search works in 32 and 64 bit targets.  (actually after confirming
> that it worked, the following doesn't actually work, but what's at the
> end does)
>
> Changing the search for the redist path like this works in all modes
> 32/64 debug/release....
>
>    GET_FILENAME_COMPONENT( msvc_install_path
> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]"
> ABSOLUTE )
>    FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT
>      PATHS
>        "${msvc_install_path}/../../VC/redist"
>        "${base_dir}/VC/redist"
>      )
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110309/dfd3f593/attachment.htm>


More information about the CMake mailing list