]> OCCT Git - occt-copy.git/commitdiff
0028198: Add FPE signals enabling from CMake
authorski <ski@opencascade.com>
Tue, 13 Dec 2016 12:30:45 +0000 (15:30 +0300)
committerapn <apn@opencascade.com>
Thu, 19 Jan 2017 14:24:51 +0000 (17:24 +0300)
CMake variable BUILD_ENABLE_FPE_SIGNAL_HANDLER was added to enable FPE signals during runtime.
Updated description of BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR variable.

CMakeLists.txt
adm/cmake/vardescr.cmake
adm/templates/custom.build.bat.in
adm/templates/custom.build.sh.in
adm/templates/custom.install.bat.in
adm/templates/custom.install.sh.in
dox/dev_guides/building/cmake/cmake.md

index b8ee36b09a40aa662f99d9871e371448fa742de4..37d38648e4848e2da773e1d2611cd109b39b0cd7 100644 (file)
@@ -338,6 +338,17 @@ if (WIN32)
   set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
 endif()
 
+# Enable/Disable the floating point exceptions (FPE) during runtime.
+if (NOT BUILD_ENABLE_FPE_SIGNAL_HANDLER)
+  set (BUILD_ENABLE_FPE_SIGNAL_HANDLER OFF CACHE BOOL "${BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR}" FORCE)
+endif()
+
+if (BUILD_ENABLE_FPE_SIGNAL_HANDLER)
+  set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 1)
+else()
+  set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 0)
+endif()
+
 # include the patched or original list of modules
 # list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
 # list <OCCT_MODULES> will contain all modules
index bf578f87e566d0ca04e9d027c3283ce472265720..f8bab3b4958a510763995d8668df5a7fcb398183 100644 (file)
@@ -28,6 +28,11 @@ Applies only for Debug configuration.")
 set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
 "Append the postfix to names of output libraries")
 
+set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
+"Enable/Disable the floating point exceptions (FPE) during DRAW execution only.
+Corresponding environment variable (CSF_FPE) can be changed manually
+in custom.bat/sh scripts without regeneration by CMake.")
+
 # install variables
 set (INSTALL_DIR_DESCR 
 "The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable),
index 7682b07697b34396eac5f3146e76516d89f3b55b..25cc9c097172400af79ed32bac7d0fdeee9d5eca 100644 (file)
@@ -2,6 +2,9 @@ echo off
 
 if /I "%VCVER%" == "@COMPILER@" (
   if "%ARCH%" == "@COMPILER_BITNESS@" (
+    rem set environment variables used by OCCT
+    set CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
+
     set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
     set "TK_DIR=@3RDPARTY_TK_DLL_DIR@"
     set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
index 1c87faab5a9a33d0ab4fa383bdb9c9d85deabfcb..6830a6bf03a69e185af6a64f46e77b6aa0b77dfd 100644 (file)
@@ -2,6 +2,9 @@
 
 if [ "$1" == "@BIN_LETTER@" ]; then
   if [ "$2" == "@COMPILER_BITNESS@" ]; then
+    # set environment variables used by OCCT
+    export CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
+
     export TCL_DIR="@3RDPARTY_TCL_LIBRARY_DIR@"
     export TK_DIR="@3RDPARTY_TK_LIBRARY_DIR@"
     export FREETYPE_DIR="@3RDPARTY_FREETYPE_LIBRARY_DIR@"
index 7ddd9d42d5a5063d15bf714151d8dbdc98500716..4cdd0b8d35f63f3f4323cf38c823fd1ea099b175 100644 (file)
@@ -4,6 +4,9 @@ rem CASDEB comes as third argument
 
 if /I "%VCVER%" == "@COMPILER@" (
   if "%ARCH%" == "@COMPILER_BITNESS@" (
+    rem set environment variables used by OCCT
+    set CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
+
     set "TCL_DIR=@USED_3RDPARTY_TCL_DIR@"
     set "TK_DIR=@USED_3RDPARTY_TK_DIR@"
     set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"
index 4a8a8e7c32199fd41c9a69ac79207d58e168dfe4..855970a43d33af28ed13f7972f0c1e5bd9a2f052 100644 (file)
@@ -2,6 +2,9 @@
 
 if [ "$1" == "@BIN_LETTER@" ]; then
   if [ "$2" == "@COMPILER_BITNESS@" ]; then
+    # set environment variables used by OCCT
+    export CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
+
     export TCL_DIR="@USED_3RDPARTY_TCL_DIR@"
     export TK_DIR="@USED_3RDPARTY_TK_DIR@"
     export FREETYPE_DIR="@USED_3RDPARTY_FREETYPE_DIR@"
index 5b334f2da53f0b9b1e53068804123ba6255f8bfc..bdfa189b01a05e1caff2babf326405c7db8991ea 100644 (file)
@@ -100,6 +100,7 @@ The following table gives the full list of environment variables used at the con
 | BUILD_DOC_Overview | Boolean flag | Indicates whether OCCT overview documentation project should be created together with OCCT. It is not built together with OCCT. Checking this option leads to automatic search of Doxygen binaries. Its building calls Doxygen command to generate the documentation in HTML format |
 | BUILD_PATCH | Path | Points to the directory recognized as a "patch" for OCCT. If specified, the files from this directory take precedence over the corresponding native OCCT sources. This way you are able to introduce patches to Open CASCADE Technology not affecting the original source distribution |
 | BUILD_WITH_DEBUG | Boolean flag | Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing, etc. |
+| BUILD_ENABLE_FPE_SIGNAL_HANDLER | Boolean flag | Enable/Disable the floating point exceptions (FPE) during DRAW execution only. Corresponding environment variable (CSF_FPE) can be changed manually in custom.bat/sh scripts without regeneration by CMake. |
 | CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations |
 | INSTALL_DIR | Path | Points to the installation directory. *INSTALL_DIR* is a synonym of *CMAKE_INSTALL_PREFIX*. The user can specify both *INSTALL_DIR* or *CMAKE_INSTALL_PREFIX* |
 | INSTALL_DIR_BIN | Path | Relative path to the binaries installation directory (absolute path is ${INSTALL_DIR}/${INSTALL_DIR_BIN}) |