title: Portable Visual Studio 2010 and cmake
body: <p>Good day everyone,</p>
  
  <p>I'm trying to do the following:</p>
  
  <p>1) Create portable version of Microsoft Visual Studio (vs2010 sp1) + platform SDK (winsdk 7.0a). <br/> 
  2) Drop those files on a machine, run cmake on the project and build the project
  <br>
  I'm assuming machines have .net framework 4.0, VS 2010 win32/x64 redistributables installed to the default location.</p>
  
  <p>VS 2010 files:<br/>
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7<br/>
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC<br/>
  I put them into the <code>d:\distr\msvc100sp1</code> directory.</p>
  
  <p>WinSDK files:<br/>
  C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A<br/>
  I put them into the <code>d:\distr\WinSDK\7.0a</code> directory<br/><br/></p>
  
  <p>I'm running this script before doing anything - it recreates environment exactly if vcvars (in this case amd64) was called:</p>
  
  <pre><code>@set NV_MSVC100INSTALLDIR=d:\distr\msvc100sp1
  @set NV_WINSDK_70A=d:\distr\WinSDK\7.0a
  
  @set CommandPromptType=Native
  @set INCLUDE=%NV_MSVC100INSTALLDIR%\VC\INCLUDE;%NV_MSVC100INSTALLDIR%\VC\ATLMFC\INCLUDE;%NV_WINSDK_70A%\include;
  @set LIB=%NV_MSVC100INSTALLDIR%\VC\LIB\amd64;%NV_MSVC100INSTALLDIR%\VC\ATLMFC\LIB\amd64;%NV_WINSDK_70A%\lib\x64;
  @set LIBPATH=%NV_MSVC100INSTALLDIR%\VC\LIB\amd64;%NV_MSVC100INSTALLDIR%\VC\ATLMFC\LIB\amd64;
  @set PATH=%NV_MSVC100INSTALLDIR%\VC\bin\amd64;%NV_MSVC100INSTALLDIR%\VC\VCPackages;%NV_MSVC100INSTALLDIR%\Common7\IDE;%NV_MSVC100INSTALLDIR%\Common7\Tools;%NV_WINSDK_70A%\bin\NETFX 4.0 Tools\x64;%NV_WINSDK_70A%\bin\x64;%NV_WINSDK_70A%\bin;%PATH%
  @set Platform=x64
  @set VCINSTALLDIR=%NV_MSVC100INSTALLDIR%\VC\
  @set VSINSTALLDIR=%NV_MSVC100INSTALLDIR%\
  @set WindowsSdkDir=%NV_WINSDK_70A%\
  @set PROCESSOR_ARCHITECTURE=AMD64
  @set VS100COMNTOOLS=%NV_MSVC100INSTALLDIR%\Common7\Tools
  
  ::framework
  
  @set Framework35Version=v3.5
  @set FrameworkDir=C:\Windows\Microsoft.NET\Framework64
  @set FrameworkDIR64=C:\Windows\Microsoft.NET\Framework64
  @set FrameworkVersion=v4.0.30319
  @set FrameworkVersion64=v4.0.30319
  
  @set NV_FRAMEWORK_INSTALL_DIR=%FrameworkDIR64%\%FrameworkVersion64%
  
  @set LIBPATH=%NV_FRAMEWORK_INSTALL_DIR%;%NV_FRAMEWORK_INSTALL_DIR%\..\v3.5;%LIBPATH%
  @set PATH=%NV_FRAMEWORK_INSTALL_DIR%;%NV_FRAMEWORK_INSTALL_DIR%\..\v3.5;%PATH%
  </code></pre>
  
  <p>However running devenv (it's on the path after script above) i'm getting this error:<br/></p>
  
  <pre><code>Cannot find one or more components. Please reinstall the application.
  </code></pre>
  
  <p>I thought cmake could figure out what to do with compiler, but it complains on compiler version checking:<br/></p>
  
  <pre><code>CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
    execute_process given COMMAND argument with no value.
  Call Stack (most recent call first):
    C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
    C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
    CMakeLists.txt:9 (project)
  
  
  The C compiler identification is unknown
  CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process):
    execute_process given COMMAND argument with no value.
      Call Stack (most recent call first):
    C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
    C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127 (CMAKE_DETERMINE_COMPILER_ID)
    CMakeLists.txt:9 (project)
  
  The CXX compiler identification is unknown
  Configuring incomplete, errors occurred!
  See also "d:/vs2010_test/build/CMakeFiles/CMakeOutput.log".
  See also "d:/vs2010_test/build/CMakeFiles/CMakeError.log".
  </code></pre>
  
  <p>There is same error in the output file about missing components.</p>
  
  <p>Is the desired thing even possible? What are possible missing components? <br> What i'd like to have is to perform what i want and then clean up machine automatically, even if it will require registry keys changes.</p>