Adjusting test cases at current state of OCCT master
[occt.git] / genproj.bat
index ab7d259..0610af6 100644 (file)
@@ -5,15 +5,26 @@ rem Running it requires that Tcl should be in the PATH
 
 SET "OLD_PATH=%PATH%"
 
+if exist "%~dp0env.bat" (
+  call "%~dp0env.bat"
+)
+
+set "TCL_EXEC=tclsh.exe"
+
+for %%X in (%TCL_EXEC%) do (set TCL_FOUND=%%~$PATH:X)
+
+if not defined TCL_FOUND (
+  echo "Error. %TCL_EXEC% is not found. Please update PATH variable"
+  goto :eof
+)
+
 if not exist "%~dp0custom.bat" (
-  tclsh.exe ./adm/genconf.tcl
+  %TCL_EXEC% %~dp0adm/genconf.tcl
 )
 
 if not exist "%~dp0custom.bat" (
-  echo custom.bat is not created. Run the script again and generate custom.bat
+  echo custom.bat is not created. Run the script again or create custom.bat manually
   goto :eof
-) else (
-  call "%~dp0custom.bat"
 )
 
 if exist "%~dp0env.bat" (
@@ -21,5 +32,5 @@ if exist "%~dp0env.bat" (
 )
 
 cd %~dp0
-tclsh.exe ./adm/genproj.tcl -path=. -target=%VCVER% 
+%TCL_EXEC% %~dp0adm/start.tcl genproj -path=. -target=%VCVER%
 SET "PATH=%OLD_PATH%"