1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Add batch files for cmake build

This commit is contained in:
msv
2020-04-01 19:13:46 +03:00
parent 80c4c42abd
commit b3a1dc7c7f
5 changed files with 93 additions and 1 deletions

4
.gitignore vendored
View File

@@ -46,7 +46,6 @@ Release
/*.am
/*.m4
/*.ac
/*.sh
/codeblocks.bat
/custom.bat
/autom4te.cache
@@ -60,3 +59,6 @@ Release
/build*
/install
env_custom.bat
env_custom.sh
cmake_gen_custom.bat
cmake_gen_custom.sh

37
cmake_gen.bat Normal file
View File

@@ -0,0 +1,37 @@
@echo off
setlocal
if exist "%~dp0cmake_gen_custom.bat" call "%~dp0cmake_gen_custom.bat"
if "%VS%"=="" set VS=14
if "%VSDATA%"=="" set VSDATA=2015
if "%VSPLATFORM%"=="" set VSPLATFORM=Win64
if "%BUILD_DIR%"=="" set BUILD_DIR=build
if "%OCCT3RDPARTY%"=="" set "OCCT3RDPARTY=%~dp0..\3rdparty"
if "%INSTALL_DIR%"=="" set "INSTALL_DIR=%~dp0install"
set BUILD_DOC=OFF
set USE_FPE_SIGNAL=ON
set USE_OCCT_DEBUG=OFF
set USE_FREEIMAGE=OFF
set USE_TBB=ON
set USE_VTK=OFF
set USE_PCH=OFF
if not "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA% %VSPLATFORM%"
if "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA%"
set "INSTALL_DIR=%INSTALL_DIR:\=/%"
set "OCCT3RDPARTY=%OCCT3RDPARTY:\=/%"
if not exist %BUILD_DIR% mkdir %BUILD_DIR%
cd %BUILD_DIR%
cmake -G "%arch_compile%" -D3RDPARTY_DIR:STRING=%OCCT3RDPARTY% ^
-DBUILD_DOC_Overview:BOOL=%BUILD_DOC% -DINSTALL_DIR:STRING=%INSTALL_DIR% ^
-DBUILD_WITH_DEBUG:BOOL=%USE_OCCT_DEBUG% -DBUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%USE_FPE_SIGNAL% ^
-DUSE_FREEIMAGE:BOOL=%USE_FREEIMAGE% ^
-DUSE_TBB:BOOL=%USE_TBB% -DUSE_VTK:BOOL=%USE_VTK% -DBUILD_USE_PCH:BOOL=%USE_PCH% ^
..
endlocal

36
cmake_gen.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
if [ -f cmake_gen_custom.sh ]; then
. cmake_gen_custom.sh
fi
DEB=
if [ -z "$BUILD_DIR" ]; then BUILD_DIR=build; fi
if [ -z "$GENERATOR" ]; then GENERATOR="Unix Makefiles"; fi
if [ -z "$OCCT3RDPARTY" ]; then OCCT3RDPARTY=`pwd`/../3rdparty; fi
if [ -z "$INSTALL_DIR" ]; then INSTALL_DIR=$OCCT3RDPARTY/occt740; fi
if [ -z "$FREETYPE_DIR" ]; then FREETYPE_DIR=$OCCT3RDPARTY/freetype-2.7.1; fi
CMAKE_BUILD_TYPE=Release
if [ "$1" = "-d" ]; then
DEB=d
BUILD_DIR=${BUILD_DIR}-deb
BUILD_TYPE=Debug
fi
if [ -z "$USE_TBB" ]; then USE_TBB=ON; fi
if [ -z "$DIR_BIN" ]; then DIR_BIN=lin64/gcc/bin$DEB; fi
if [ -z "$DIR_LIB" ]; then DIR_LIB=lin64/gcc/lib$DEB; fi
USE_FPE_SIGNAL=ON
BUILD_DOC=OFF
if [ ! -d $BUILD_DIR ]; then mkdir $BUILD_DIR; fi
cd $BUILD_DIR
cmake -G "$GENERATOR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DINSTALL_DIR_BIN:STRING=$DIR_BIN \
-DINSTALL_DIR_LIB:STRING=$DIR_LIB -D3RDPARTY_DIR:STRING=$OCCT3RDPARTY \
-DINSTALL_DIR_LAYOUT:STRING=Windows -DINSTALL_DIR:STRING=$INSTALL_DIR \
-DBUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=$USE_FPE_SIGNAL -DUSE_TBB:BOOL=$USE_TBB \
-D3RDPARTY_FREETYPE_DIR:PATH=$FREETYPE_DIR -DBUILD_DOC_Overview:BOOL=$BUILD_DOC \
$AUX_ARGS ..

View File

@@ -0,0 +1,8 @@
rem Copy this file to cmake_gen_custom.bat and tune to your local needs
set "OCCT3RDPARTY=%~dp0..\3rdparty"
set "INSTALL_DIR=%~dp0install"
set BUILD_DIR=build
set VS=14
set VSDATA=2015
set VSPLATFORM=Win64

View File

@@ -0,0 +1,9 @@
# Copy this file to cmake_gen_custom.sh and tune to your local needs
OCCT3RDPARTY=`pwd`/../3rdparty
INSTALL_DIR=$OCCT3RDPARTY/occt740
BUILD_DIR=build
FREETYPE_DIR=$OCCT3RDPARTY/freetype-2.7.1
# This is to avoid cmake DEV warnings about TCL
AUX_ARGS=-Wno-dev