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:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -46,7 +46,6 @@ Release
|
|||||||
/*.am
|
/*.am
|
||||||
/*.m4
|
/*.m4
|
||||||
/*.ac
|
/*.ac
|
||||||
/*.sh
|
|
||||||
/codeblocks.bat
|
/codeblocks.bat
|
||||||
/custom.bat
|
/custom.bat
|
||||||
/autom4te.cache
|
/autom4te.cache
|
||||||
@@ -60,3 +59,6 @@ Release
|
|||||||
/build*
|
/build*
|
||||||
/install
|
/install
|
||||||
env_custom.bat
|
env_custom.bat
|
||||||
|
env_custom.sh
|
||||||
|
cmake_gen_custom.bat
|
||||||
|
cmake_gen_custom.sh
|
||||||
|
37
cmake_gen.bat
Normal file
37
cmake_gen.bat
Normal 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
36
cmake_gen.sh
Executable 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 ..
|
8
cmake_gen_custom.bat.template
Normal file
8
cmake_gen_custom.bat.template
Normal 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
|
9
cmake_gen_custom.sh.template
Normal file
9
cmake_gen_custom.sh.template
Normal 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
|
Reference in New Issue
Block a user