I've got a batch file that does something like this to detect the "most recent" available Visual Studio:

@rem ** Add "Developer Command Prompt" for VS2013, 2012 or 2010 environment:
@set _vsver=

@set _vs12env=%VS120COMNTOOLS%VsDevCmd.bat
@if "%_vsver%" equ "" if exist "%_vs12env%" set _vsver=12

@set _vs11env=%VS110COMNTOOLS%VsDevCmd.bat
@if "%_vsver%" equ "" if exist "%_vs11env%" set _vsver=11

@set _vs10env=%VS100COMNTOOLS%vsvars32.bat
@if "%_vsver%" equ "" if exist "%_vs10env%" set _vsver=10

@if "%_vsver%" equ "10" set _vsenv=%_vs10env%
@if "%_vsver%" equ "10" set _vstools=%VS100COMNTOOLS%

@if "%_vsver%" equ "11" set _vsenv=%_vs11env%
@if "%_vsver%" equ "11" set _vstools=%VS110COMNTOOLS%

@if "%_vsver%" equ "12" set _vsenv=%_vs12env%
@if "%_vsver%" equ "12" set _vstools=%VS120COMNTOOLS%

@if exist "%_vsenv%" call "%_vsenv%"

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to