1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/adm/templates/env.sh.in
ibs 9f33b387e2 0024888: Refactoring of OCCT CMake meta-project
user sees just dirs of libs, shared libs and headers of 3rdparty products
documentation updated

3rdparty search priority was fixed: 1. user paths; 2. system paths
3rdparty debug usage fixed
vtk search introduced
occt information, generated by wok, was divided onto two files: occt_toolkits.cmake and occt_inc_toolkits.cmake
additional behavior of cmake search for freetype 2.5.1 and above

CMake (version < 3.0) don't know about new place of config/ftheader.h in freetype 2.5.1. There are cases when cmake seeks config/ftheader.h in defined place (3RDPARTY_FREETYPE_DIR variable), doesn't find it and start new search in system places. If system has own freetype header- cmake will find it and 3RDPARTY_FREETYPE* variables will point to different places. This situation is avoided

tcl, freetype, vtk are checked before usage of it (CSF variables usage)
tbb search mechanism was refactored
freetype search is processed by default cmake mechanism
tcl search is processed by default cmake mechanism

3rdparty macro seeks debug libraries (and release if debug ones aren't found); 3rdparty dll is sought in win case only

ADD_SUBDIRECTORY preferred to SUBDIRS

gendoc.bat search for tclsh.exe in user's system

0025141: CMake / MinGW: link recipe fails due to long command

0025146: Porting to Android

OCCT documentation updated. "Building with CMake and ADT for Android" article added

[CMAKE] custom.sh.in uses library variables instead unused dll ones.

-DDEBUG remove from CMAKE_CXX_FLAGS_DEBUG and CMAKE_C_FLAGS_DEBUG

hide unused 3rdparty in android case

also messages of freetype search mechanism slightly updated
2014-09-18 15:22:41 +04:00

114 lines
3.4 KiB
Bash

#!/bin/bash
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
if [ "${CASROOT}" == "" ]; then
export CASROOT="${aScriptPath}"
fi
# Read script arguments
shopt -s nocasematch
export CASDEB="@BUILD_POSTFIX@";
if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
shopt -u nocasematch
export COMPILER="@COMPILER@"
# ----- Set path to 3rd party and OCCT libraries -----
anArch=`uname -m`
if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
export ARCH="32";
else
export ARCH="64";
fi
aSystem=`uname -s`
if [ "$aSystem" == "Darwin" ]; then
export WOKSTATION="mac";
export ARCH="64";
else
export WOKSTATION="lin";
fi
# ----- Set local settings -----
if [ -e "${aScriptPath}/custom.sh" ]; then
source "${aScriptPath}/custom.sh" "${COMPILER}" "${WOKSTATION}${ARCH}" "${CASDEB}"
fi
THRDPARTY_PATH=""
if [ "$TCL_DIR" != "" ]; then
THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
fi
if [ "$FREETYPE_DIR" != "" ]; then
THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
fi
if [ "$FREEIMAGE_DIR" != "" ]; then
THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}"
fi
if [ "$GL2PS_DIR" != "" ]; then
THRDPARTY_PATH="${GL2PS_DIR}:${THRDPARTY_PATH}"
fi
if [ "$TBB_DIR" != "" ]; then
THRDPARTY_PATH="${TBB_DIR}:${THRDPARTY_PATH}"
fi
BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
export PATH="${CASROOT}/${BIN_PATH}:${PATH}"
if [ "$LD_LIBRARY_PATH" != "" ]; then
export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
else
export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}"
fi
if [ "$WOKSTATION" == "mac" ]; then
if [ "$DYLD_LIBRARY_PATH" != "" ]; then
export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
else
export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
fi
fi
# ----- Set envoronment variables used by OCCT -----
export CSF_LANGUAGE=us
export MMGT_CLEAR=1
export CSF_EXCEPTION_PROMPT=1
export CSF_SHMessage="${CASROOT}/src/SHMessage"
export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures"
export CSF_ShadersDirectory="${CASROOT}/src/Shaders"
export CSF_XSMessage="${CASROOT}/src/XSMessage"
export CSF_TObjMessage="${CASROOT}/src/TObj"
export CSF_StandardDefaults="${CASROOT}/src/StdResource"
export CSF_PluginDefaults="${CASROOT}/src/StdResource"
export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
export CSF_TObjDefaults="${CASROOT}/src/StdResource"
export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat"
export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat"
export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"
export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt"
# Draw Harness special stuff
if [ -e "${CASROOT}/src/DrawResources" ]; then
export DRAWHOME="${CASROOT}/src/DrawResources"
export CSF_DrawPluginDefaults="${CASROOT}/src/DrawResources"
if [ -e "${CASROOT}/src/DrawResources/DrawDefault" ]; then
export DRAWDEFAULT="${CASROOT}/src/DrawResources/DrawDefault"
fi
fi
if [ -e "${CASROOT}/src/DrawResourcesProducts" ]; then
export CSF_DrawPluginProductsDefaults="${CASROOT}/src/DrawResourcesProducts"
fi