0029589: Configuration - allow MFC samples to be built when OCCT is linked statically
[occt.git] / samples / mfc / standard / msvc.bat
index a90bea6..19d0f0b 100644 (file)
@@ -1,7 +1,19 @@
+@echo off
+
+Setlocal EnableDelayedExpansion
+
+rem Setup environment
 call "%~dp0env.bat" %1 %2 %3
 
-if ["%CASDEB%"] == [""] (
-  call "%~dp0..\..\..\msvc.bat" %VCVER% win%ARCH% "" %~dp0All-%VCVER%.sln
+rem Define path to project file
+set "PRJFILE=%~dp0All-%VCFMT%.sln"
+
+rem Launch Visual Studio - either professional (devenv) or Express, as available
+if exist "%DevEnvDir%\devenv.exe"  (
+  start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
+) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe"  (
+  start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
 ) else (
-  call "%~dp0..\..\..\msvc.bat" %VCVER% win%ARCH% %CASDEB% %~dp0All-%VCVER%.sln
-)
\ No newline at end of file
+  echo Error: Could not find MS Visual Studio ^(%VCFMT%^)
+  echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
+)