1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/genconf.bat
ski 4b3541c68b 0027176: Configuration, CMake - INSTALL_DIR is a common prefix for all other install variables
Possibility to customize layout of installation of OCCT is introduced by:
- variable INSTALL_DIR_LAYOUT - select one of the two predefined layouts: either Windows (classic OCCT layout) or Unix (Linux standard)
- variables INSTALL_DIR_* (BIN, LIB, INCLUDE, RESOURCE, DOC, TESTS, SCRIPT, SAMPLES, DATA) - specify locations of relevant components
- variable INSTALL_DIR_WITH_VERSION (bool) - specifies whether full version of OCCT should be used in paths in Unix layout

Files LICENSE_LGPL_21.txt and OCCT_LGPL_EXCEPTION.txt are always installed.

Environment is extended to support non-default layouts.
For that, environment variables "CSF_OCCT*Path" are defined, corresponding to CMake variables INSTALL_DIR_* described above.
Visual Studio environment, DRAW, tests, samples are amended to use these variables instead of (or as alternative to) CASROOT.

Settings of Products-specific vars are removed from environment scripts.

File genconf.bat was corrected to avoid error message for the case when path to TCL contains spaces.

Product name in rc files changed to "Open CASCADE Technology".
2016-03-18 09:44:11 +03:00

60 lines
1.4 KiB
Batchfile

@echo off
rem Helper script to configure environment for building with genproj tool.
rem Running it requires that Tcl should be in the PATH
SET "OLD_PATH=%PATH%"
rem create env.bat if it does not exist yet
if exist "%~dp0env.bat" (
call "%~dp0env.bat"
) else (
type "%~dp0adm\templates\env.bat" | findstr /i /v "__CASROOT__" > "%~dp0env.bat"
)
rem find Tcl
set "TCL_EXEC=tclsh.exe"
for %%X in (%TCL_EXEC%) do (set TCL_FOUND=%%~$PATH:X)
set "TCL_EXEC2=tclsh86.exe"
if not defined TCL_FOUND (
for %%X in (%TCL_EXEC2%) do (
set TCL_FOUND=%%~$PATH:X
set TCL_EXEC=%TCL_EXEC2%
)
)
rem Prompt the user to specify location of Tcl if not found in PATH
if not defined TCL_FOUND (
set /P TCL_PATH=This script requires Tcl, but tclsh.exe cannot be found in PATH.^
Please enter path to folder containing tclsh.exe^
^:
rem NOTE: KEEP LINE AFTER "set" ABOVE EMPTY !
)
if exist %TCL_PATH%\tclsh.exe (
set "TCL_FOUND=%TCL_PATH%\tclsh.exe"
) else if exist %TCL_PATH%\tclsh86.exe (
set "TCL_FOUND=%TCL_PATH%\tclsh86.exe"
) else (
set "TCL_EXEC=%TCL_PATH%\tclsh.exe"
)
rem Initialize custom.bat if it does not exist yet
rem if not exist %%dp0custom.bat (
rem echo set "PATH=%%PATH%%;%TCL_PATH%" >%~dp0custom.bat
rem )
rem fail if Tcl is not found
if not defined TCL_FOUND (
echo Error: "%TCL_EXEC%" is not found. Please update PATH variable ^(use custom.bat^)
goto :eof
)
:: run GUI tool
"%TCL_FOUND%" %~dp0adm/genconf.tcl
SET "PATH=%OLD_PATH%"