]> OCCT Git - occt-copy.git/commitdiff
Add batch files for cmake build
authormsv <msv@opencascade.com>
Wed, 1 Apr 2020 16:13:46 +0000 (19:13 +0300)
committermsv <msv@opencascade.com>
Wed, 1 Apr 2020 19:04:21 +0000 (22:04 +0300)
.gitignore
cmake_gen.bat [new file with mode: 0644]
cmake_gen.sh [new file with mode: 0755]
cmake_gen_custom.bat.template [new file with mode: 0644]
cmake_gen_custom.sh.template [new file with mode: 0644]

index 652aa4b8aee85c2dba85a1bdf946fc43f303ecec..67f7486ad757cda31fb8683f412fbd6d1a4cec8c 100644 (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
diff --git a/cmake_gen.bat b/cmake_gen.bat
new file mode 100644 (file)
index 0000000..75ceb3e
--- /dev/null
@@ -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
\ No newline at end of file
diff --git a/cmake_gen.sh b/cmake_gen.sh
new file mode 100755 (executable)
index 0000000..82acfa1
--- /dev/null
@@ -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 ..
diff --git a/cmake_gen_custom.bat.template b/cmake_gen_custom.bat.template
new file mode 100644 (file)
index 0000000..e2146fd
--- /dev/null
@@ -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
diff --git a/cmake_gen_custom.sh.template b/cmake_gen_custom.sh.template
new file mode 100644 (file)
index 0000000..62174a1
--- /dev/null
@@ -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