1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0029063: Configuration - improve paths in environment files

Change absolute paths to relative in OCCT environment files.
Move content of vcver.bat to env.bat.
This commit is contained in:
apn 2017-08-28 14:17:45 +03:00 committed by bugmaster
parent a975e06e70
commit 249dd6ed46
8 changed files with 83 additions and 74 deletions

View File

@ -870,6 +870,22 @@ else()
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}") OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}")
endif() endif()
if (WIN32)
set (THIRDPARTY_DIR_REPLACE "%THIRDPARTY_DIR%")
else()
set (THIRDPARTY_DIR_REPLACE "\${THIRDPARTY_DIR}")
endif()
get_cmake_property(USED_3RDPARTY_CACHE_VARIABLES VARIABLES)
string (REGEX MATCHALL "(^|;)USED_3RDPARTY_[^;]+_DIR[^;]*" USED_3RDPARTY_CACHE_VARIABLES "${USED_3RDPARTY_CACHE_VARIABLES}")
file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
foreach (USED_3RDPARTY_CACHE_VARIABLE ${USED_3RDPARTY_CACHE_VARIABLES})
file (TO_CMAKE_PATH "${${USED_3RDPARTY_CACHE_VARIABLE}}" ${USED_3RDPARTY_CACHE_VARIABLE})
string (REPLACE "${3RDPARTY_DIR}" "${THIRDPARTY_DIR_REPLACE}" ${USED_3RDPARTY_CACHE_VARIABLE} "${${USED_3RDPARTY_CACHE_VARIABLE}}")
if (NOT WIN32)
string (REGEX REPLACE ";" ":" ${USED_3RDPARTY_CACHE_VARIABLE} "${${USED_3RDPARTY_CACHE_VARIABLE}}")
endif()
endforeach()
# write current custom.bat/sh (for install directory) # write current custom.bat/sh (for install directory)
set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}") set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}")
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR_SCRIPT}") OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR_SCRIPT}")

View File

@ -24,18 +24,15 @@ if /I "%VCVER%" == "@COMPILER@" (
set "TCL_VERSION_WITH_DOT=@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@" set "TCL_VERSION_WITH_DOT=@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
set "TK_VERSION_WITH_DOT=@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@" set "TK_VERSION_WITH_DOT=@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
set "CSF_OCCTBinPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_BIN@%3" set "CSF_OCCTBinPath=%CASROOT%/@INSTALL_DIR_BIN@%3"
set "CSF_OCCTLibPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_LIB@%3" set "CSF_OCCTLibPath=%CASROOT%/@INSTALL_DIR_LIB@%3"
set "CSF_OCCTIncludePath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_INCLUDE@" set "CSF_OCCTIncludePath=%CASROOT%/@INSTALL_DIR_INCLUDE@"
set "CSF_OCCTResourcePath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_RESOURCE@" set "CSF_OCCTResourcePath=%CASROOT%/@INSTALL_DIR_RESOURCE@"
set "CSF_OCCTDataPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_DATA@" set "CSF_OCCTDataPath=%CASROOT%/@INSTALL_DIR_DATA@"
set "CSF_OCCTSamplesPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_SAMPLES@" set "CSF_OCCTSamplesPath=%CASROOT%/@INSTALL_DIR_SAMPLES@"
set "CSF_OCCTTestsPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_TESTS@" set "CSF_OCCTTestsPath=%CASROOT%/@INSTALL_DIR_TESTS@"
set "CSF_OCCTDocPath=@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_DOC@" set "CSF_OCCTDocPath=%CASROOT%/@INSTALL_DIR_DOC@"
rem for compatability with external application using CASROOT
set "CASROOT=@INSTALL_DIR_ABSOLUTE@"
) )
) )

View File

@ -21,17 +21,14 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@" export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@" export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
export CSF_OCCTBinPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_BIN@" export CSF_OCCTBinPath="${CASROOT}/@INSTALL_DIR_BIN@"
export CSF_OCCTLibPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_LIB@" export CSF_OCCTLibPath="${CASROOT}/@INSTALL_DIR_LIB@"
export CSF_OCCTIncludePath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_INCLUDE@" export CSF_OCCTIncludePath="${CASROOT}/@INSTALL_DIR_INCLUDE@"
export CSF_OCCTResourcePath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_RESOURCE@" export CSF_OCCTResourcePath="${CASROOT}/@INSTALL_DIR_RESOURCE@"
export CSF_OCCTDataPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_DATA@" export CSF_OCCTDataPath="${CASROOT}/@INSTALL_DIR_DATA@"
export CSF_OCCTSamplesPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_SAMPLES@" export CSF_OCCTSamplesPath="${CASROOT}/@INSTALL_DIR_SAMPLES@"
export CSF_OCCTTestsPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_TESTS@" export CSF_OCCTTestsPath="${CASROOT}/@INSTALL_DIR_TESTS@"
export CSF_OCCTDocPath="@INSTALL_DIR_ABSOLUTE@/@INSTALL_DIR_DOC@" export CSF_OCCTDocPath="${CASROOT}/@INSTALL_DIR_DOC@"
# for compatability with external application using CASROOT
export CASROOT="@INSTALL_DIR_ABSOLUTE@"
fi fi
fi fi

View File

@ -31,14 +31,14 @@ set "CSF_OPT_LIB64="
set "CSF_OPT_BIN32=" set "CSF_OPT_BIN32="
set "CSF_OPT_BIN64=" set "CSF_OPT_BIN64="
rem ----- Load local settings -----
if exist "%~dp0custom.bat" (
call "%~dp0custom.bat" %1 %2 %3 %4 %5
)
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%" if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%" if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
rem ----- Load local settings -----
if exist "%CASROOT%\custom.bat" (
call "%CASROOT%\custom.bat" %1 %2 %3 %4 %5
)
rem ----- Read script arguments (override local settings) ----- rem ----- Read script arguments (override local settings) -----
if not ["%1"] == [""] set "VCVER=%1" if not ["%1"] == [""] set "VCVER=%1"
if not ["%2"] == [""] set "ARCH=%2" if not ["%2"] == [""] set "ARCH=%2"
@ -49,8 +49,33 @@ if /I ["%3"] == ["d"] set "CASDEB=d"
if /I ["%3"] == ["i"] set "CASDEB=i" if /I ["%3"] == ["i"] set "CASDEB=i"
if /I ["%3"] == ["relwithdeb"] set "CASDEB=i" if /I ["%3"] == ["relwithdeb"] set "CASDEB=i"
rem Decode VCVER rem Decode VCVER variable and define related ones:
call "%~dp0adm\vcver.bat" rem
rem VCFMT - "vc" followed by full version number of Visual Studio toolset
rem (same as VCVER without optional suffix "-uwp")
rem VCLIB - name of folder contining binaries
rem (same as VCVER except without third version in number)
rem VCPROP - name of required Visual Studion Workload (starting with VS 2017)
rem
rem Note that for VS before 2015 (vc14) always
rem VCFMT=VCLIB=VCVER and VCPROP=NativeDesktop
rem Since VS 2017, environment variables like VS100COMNTOOLS are not defined
rem any more, we can only use vswhere.exe tool to find Visual Studio.
rem Add path to vswhere.exe
set "PATH=%PATH%;%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
rem for vc10-12, interpretation is trivial
set VCFMT=%VCVER%
set VCLIB=%VCVER:~0,4%
set VCPROP=NativeDesktop
rem vc14 and later can have optional suffix "-uwp"
if "%VCVER:~-4%" == "-uwp" (
set VCFMT=%VCVER:~0,-4%
set VCLIB=%VCLIB%-uwp
set VCPROP=Universal
)
rem echo VCVER=%VCVER% VCFMT=%VCFMT% VCLIB=%VCLIB% VCPROP=%VCPROP%
rem ----- Parsing of Visual Studio platform ----- rem ----- Parsing of Visual Studio platform -----
set "VisualStudioExpressName=VCExpress" set "VisualStudioExpressName=VCExpress"

View File

@ -101,17 +101,20 @@ if /I "%VCFMT%" == "vc10" (
exit exit
) )
rem ----- For compatability with external application using CASROOT -----
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
rem ----- Define path to 3rdparty products -----
set "THIRDPARTY_DIR=@3RDPARTY_DIR@"
if ["%ARCH%"] == ["32"] set VCARCH=x86 if ["%ARCH%"] == ["32"] set VCARCH=x86
if ["%ARCH%"] == ["64"] set VCARCH=amd64 if ["%ARCH%"] == ["64"] set VCARCH=amd64
if /I ["%1"] == ["vc141"] set "VCVER=vc14" if /I ["%1"] == ["vc141"] set "VCVER=vc14"
if exist "%~dp0custom.bat" ( if exist "%CASROOT%\custom.bat" (
call "%~dp0custom.bat" %VCVER% %ARCH% %CASDEB% call "%CASROOT%\custom.bat" %VCVER% %ARCH% %CASDEB%
) )
rem for compatability with external application using CASROOT
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%" if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%" if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%" if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
@ -152,7 +155,7 @@ set "CSF_STEPDefaults=%CSF_OCCTResourcePath%\XSTEPResource"
set "CSF_XmlOcafResource=%CSF_OCCTResourcePath%\XmlOcafResource" set "CSF_XmlOcafResource=%CSF_OCCTResourcePath%\XmlOcafResource"
set "CSF_MIGRATION_TYPES=%CSF_OCCTResourcePath%\StdResource\MigrationSheet.txt" set "CSF_MIGRATION_TYPES=%CSF_OCCTResourcePath%\StdResource\MigrationSheet.txt"
rem Draw Harness special stuff rem ----- Draw Harness special stuff -----
if exist "%CSF_OCCTResourcePath%\DrawResources" ( if exist "%CSF_OCCTResourcePath%\DrawResources" (
set "DRAWHOME=%CSF_OCCTResourcePath%\DrawResources" set "DRAWHOME=%CSF_OCCTResourcePath%\DrawResources"
set "CSF_DrawPluginDefaults=%CSF_OCCTResourcePath%\DrawResources" set "CSF_DrawPluginDefaults=%CSF_OCCTResourcePath%\DrawResources"

View File

@ -24,15 +24,13 @@ export CSF_OPT_BIN32=""
export CSF_OPT_BIN64="" export CSF_OPT_BIN64=""
# ----- Set local settings ----- # ----- Set local settings -----
if [ "${CASROOT}" != "" ] && [ -e "${CASROOT}/custom.sh" ]; then source "${CASROOT}/custom.sh"; fi
if [ -e "${aScriptPath}/custom.sh" ]; then source "${aScriptPath}/custom.sh"; fi
if [ "${CASROOT}" != "" ] && [ -d "${aScriptPath}/${CASROOT}" ]; then if [ "${CASROOT}" != "" ] && [ -d "${aScriptPath}/${CASROOT}" ]; then
export CASROOT="${aScriptPath}/${CASROOT}" export CASROOT="${aScriptPath}/${CASROOT}"
fi fi
if [ "${CASROOT}" == "" ]; then if [ "${CASROOT}" == "" ]; then
export CASROOT="${aScriptPath}" export CASROOT="${aScriptPath}"
fi fi
if [ -e "${CASROOT}/custom.sh" ]; then source "${CASROOT}/custom.sh"; fi
# Read script arguments # Read script arguments
shopt -s nocasematch shopt -s nocasematch

View File

@ -2,12 +2,15 @@
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD"; aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
# ----- for compatability with external application using CASROOT ----- # ----- For compatability with external application using CASROOT -----
if [ "${CASROOT}" == "" ]; then if [ "${CASROOT}" == "" ]; then
export CASROOT="${aScriptPath}" export CASROOT="@INSTALL_DIR@"
fi fi
# Read script arguments # ----- Define path to 3rdparty products -----
export THIRDPARTY_DIR="@3RDPARTY_DIR@"
# ----- Read script arguments -----
shopt -s nocasematch shopt -s nocasematch
export CASDEB=""; export CASDEB="";
if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
@ -33,8 +36,8 @@ else
fi fi
# ----- Set local settings ----- # ----- Set local settings -----
if [ -e "${aScriptPath}/custom.sh" ]; then if [ -e "${CASROOT}/@INSTALL_DIR_SCRIPT@/custom.sh" ]; then
source "${aScriptPath}/custom.sh" "${CASDEB}" "${ARCH}" source "${CASROOT}/@INSTALL_DIR_SCRIPT@/custom.sh" "${CASDEB}" "${ARCH}"
fi fi
THRDPARTY_PATH="" THRDPARTY_PATH=""
@ -127,7 +130,7 @@ export CSF_STEPDefaults="${CSF_OCCTResourcePath}/XSTEPResource"
export CSF_XmlOcafResource="${CSF_OCCTResourcePath}/XmlOcafResource" export CSF_XmlOcafResource="${CSF_OCCTResourcePath}/XmlOcafResource"
export CSF_MIGRATION_TYPES="${CSF_OCCTResourcePath}/StdResource/MigrationSheet.txt" export CSF_MIGRATION_TYPES="${CSF_OCCTResourcePath}/StdResource/MigrationSheet.txt"
# Draw Harness special stuff # ----- Draw Harness special stuff -----
if [ -e "${CSF_OCCTResourcePath}/DrawResources" ]; then if [ -e "${CSF_OCCTResourcePath}/DrawResources" ]; then
export DRAWHOME="${CSF_OCCTResourcePath}/DrawResources" export DRAWHOME="${CSF_OCCTResourcePath}/DrawResources"
export CSF_DrawPluginDefaults="${CSF_OCCTResourcePath}/DrawResources" export CSF_DrawPluginDefaults="${CSF_OCCTResourcePath}/DrawResources"

View File

@ -1,30 +0,0 @@
@echo off
rem Decode VCVER variable and define related ones:
rem
rem VCFMT - "vc" followed by full version number of Visual Studio toolset
rem (same as VCVER without optional suffix "-uwp")
rem VCLIB - name of folder contining binaries
rem (same as VCVER except without third version in number)
rem VCPROP - name of required Visual Studion Workload (starting with VS 2017)
rem
rem Note that for VS before 2015 (vc14) always
rem VCFMT=VCLIB=VCVER and VCPROP=NativeDesktop
rem Since VS 2017, environment variables like VS100COMNTOOLS are not defined
rem any more, we can only use vswhere.exe tool to find Visual Studio.
rem Add path to vswhere.exe
set "PATH=%PATH%;%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
rem for vc10-12, interpretation is trivial
set VCFMT=%VCVER%
set VCLIB=%VCVER:~0,4%
set VCPROP=NativeDesktop
rem vc14 and later can have optional suffix "-uwp"
if "%VCVER:~-4%" == "-uwp" (
set VCFMT=%VCVER:~0,-4%
set VCLIB=%VCLIB%-uwp
set VCPROP=Universal
)
rem echo VCVER=%VCVER% VCFMT=%VCFMT% VCLIB=%VCLIB% VCPROP=%VCPROP%