-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-IF(NOT CAS_FIND_QUIETLY)
- MESSAGE(STATUS "Looking for OpenCascade (CAS) ...")
-ENDIF()
-
-SET(_CAS_VERSION_FILE_NAME Standard_Version.hxx)
-
-# Include directories:
-FIND_PATH(CAS_INCLUDE_DIRS NAMES ${_CAS_VERSION_FILE_NAME} HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES inc)
-FIND_FILE(CAS_VERSION_FILE NAMES ${_CAS_VERSION_FILE_NAME} HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES inc)
-
-MARK_AS_ADVANCED(CAS_VERSION_FILE)
-
-# Is this a development version:
-SET(CAS_VERSION_DEVELOPMENT 0)
-IF(CAS_VERSION_FILE)
- FILE(STRINGS ${CAS_VERSION_FILE} CAS_VERSION_DEVELOPMENT_STR
- REGEX "^ *#define OCC_VERSION_DEVELOPMENT *\"dev\".*$")
- IF(CAS_VERSION_DEVELOPMENT_STR)
- SET(CAS_VERSION_DEVELOPMENT 1)
- ENDIF(CAS_VERSION_DEVELOPMENT_STR)
-
- # Extract normal version:
- FILE(STRINGS ${CAS_VERSION_FILE} _tmp
- REGEX "^ *#define OCC_VERSION_COMPLETE *\"[^\"]*\".*$")
- STRING(REGEX REPLACE ".*\"([^\"]*)\".*" "\\1" CAS_VERSION_STR "${_tmp}")
-
-ENDIF()
-
-IF(CAS_VERSION_DEVELOPMENT AND (NOT CAS_FIND_QUIETLY))
- MESSAGE(STATUS "OpenCascade: development version is being used!")
-ENDIF()
-
-# Win specific stuff:
-IF(WIN32)
- IF(CMAKE_BUILD_TYPE STREQUAL Debug)
- SET(CMAKE_LIBRARY_PATH $ENV{CAS_ROOT_DIR}/win32/libd)
- ELSE()
- SET(CMAKE_LIBRARY_PATH $ENV{CAS_ROOT_DIR}/win32/lib)
- ENDIF()
-ENDIF()
-
-# Definitions:
-SET(CAS_DEFINITIONS "-DLIN -DLINTEL -DCSFDB")
-SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DNo_exception")
-
-# No config.h file in the OPEN CASCADE on WINDOWS platform
-IF(NOT WIN32)
- SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_CONFIG_H")
-ELSE()
- SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DWNT")
-ENDIF()
-
-SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DOCC_CONVERT_SIGNALS")
-
-# Test for 64 bit machine:
-IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
- SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -D_OCC64")
-ENDIF()
-
-IF(CAS_VERSION_DEVELOPMENT STREQUAL 1)
- SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DCAS_VERSION_DEVELOPMENT")
-ENDIF()
-
-# Find Xmu library (X11 widgets?)
-IF(NOT WIN32)
- FIND_LIBRARY(CAS_Xmu Xmu)
- IF(Xmu)
- SET(CAS_LDPATH ${Xmu})
- ENDIF()
-ENDIF()
-
-FIND_LIBRARY(CAS_FWOSPlugin NAMES FWOSPlugin HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-
-MESSAGE(STATUS "FWOS " ${CAS_FWOSPlugin})
-
-FIND_LIBRARY(CAS_PTKernel PTKernel HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKBin TKBin HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKBinL TKBinL HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKBinTObj TKBinTObj HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKBinXCAF TKBinXCAF HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKBO TKBO HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKBool TKBool HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKBRep TKBRep HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKCAF TKCAF HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKCDF TKCDF HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKernel TKernel HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKFeat TKFeat HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKFillet TKFillet HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKG2d TKG2d HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKG3d TKG3d HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKGeomAlgo TKGeomAlgo HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKGeomBase TKGeomBase HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKHLR TKHLR HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKIGES TKIGES HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKLCAF TKLCAF HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKMath TKMath HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKMesh TKMesh HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKMeshVS TKMeshVS HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKNIS TKNIS HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKOffset TKOffset HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKOpenGl TKOpenGl HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKPCAF TKPCAF HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKPLCAF TKPLCAF HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKPrim TKPrim HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKPShape TKPShape HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKService TKService HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKShapeSchema TKShapeSchema HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKShHealing TKShHealing HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKStdLSchema TKStdLSchema HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKStdSchema TKStdSchema HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKSTEP TKSTEP HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKSTEP209 TKSTEP209 HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKSTEPAttr TKSTEPAttr HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKSTEPBase TKSTEPBase HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKSTL TKSTL HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKTObj TKTObj HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKTopAlgo TKTopAlgo HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKV3d TKV3d HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKVRML TKVRML HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXCAF TKXCAF HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXCAFSchema TKXCAFSchema HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXDEIGES TKXDEIGES HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXDESTEP TKXDESTEP HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXMesh TKXMesh HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXml TKXml HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXmlL TKXmlL HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXmlTObj TKXmlTObj HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXmlXCAF TKXmlXCAF HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-FIND_LIBRARY(CAS_TKXSBase TKXSBase HINTS ENV CAS_ROOT_DIR PATH_SUFFIXES lib)
-
-SET(CAS_KERNEL ${CAS_TKernel} ${CAS_TKMath})
-SET(CAS_OCAF ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKCDF} ${CAS_TKLCAF})
-SET(CAS_VIEWER ${CAS_TKService} ${CAS_TKV3d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKBRep})
-SET(CAS_OCAFVIS ${CAS_TKCAF} ${CAS_TKBRep} ${CAS_TKG2d})
-SET(CAS_MODELER ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo} ${CAS_TKBRep} ${CAS_TKTopAlgo} ${CAS_TKG2d} ${CAS_TKFeat})
-# TODO(mpv, vsv) Give a proper name for the following variable
-SET(CAS_SHAPE ${CAS_TKShHealing} ${CAS_TKMesh} ${CAS_TKHLR})
-
-
-SET(CAS_TKV3d_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKV3d})
-SET(CAS_TKBool_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKBRep} ${CAS_TKG2d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo} ${CAS_TKTopAlgo} ${CAS_TKBool})
-SET(CAS_TKBRep_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKBRep})
-SET(CAS_TKIGES_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKXSBase} ${CAS_TKBRep} ${CAS_TKIGES})
-SET(CAS_TKSTEP_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKXSBase} ${CAS_TKBRep} ${CAS_TKSTEP})
-SET(CAS_TKSTL_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKSTL})
-SET(CAS_TKCAF_EA ${CAS_TKPrim} ${CAS_TKCAF})
-
-SET(CAS_TKV3d ${CAS_TKV3d_EA})
-SET(CAS_TKBool ${CAS_TKBool_EA})
-SET(CAS_TKBRep ${CAS_TKBRep_EA})
-SET(CAS_TKIGES ${CAS_TKIGES_EA})
-SET(CAS_TKSTEP ${CAS_TKSTEP_EA})
-SET(CAS_TKSTL ${CAS_TKSTL_EA})
-SET(CAS_TKCAF ${CAS_TKCAF_EA})
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(CAS
- REQUIRED_VARS CAS_INCLUDE_DIRS
- CAS_FWOSPlugin
- CAS_PTKernel
- CAS_TKBin
- CAS_TKBinL
- CAS_TKBinTObj
- CAS_TKBinXCAF
- CAS_TKBO
- CAS_TKBool
- CAS_TKBRep
- CAS_TKCAF
- CAS_TKCDF
- CAS_TKernel
- CAS_TKFeat
- CAS_TKFillet
- CAS_TKG2d
- CAS_TKG3d
- CAS_TKGeomAlgo
- CAS_TKGeomBase
- CAS_TKHLR
- CAS_TKIGES
- CAS_TKLCAF
- CAS_TKMath
- CAS_TKMesh
- CAS_TKMeshVS
- CAS_TKNIS
- CAS_TKOffset
- CAS_TKOpenGl
- CAS_TKPCAF
- CAS_TKPLCAF
- CAS_TKPrim
- CAS_TKPShape
- CAS_TKService
- CAS_TKShapeSchema
- CAS_TKShHealing
- CAS_TKStdLSchema
- CAS_TKStdSchema
- CAS_TKSTEP
- CAS_TKSTEP209
- CAS_TKSTEPAttr
- CAS_TKSTEPBase
- CAS_TKSTL
- CAS_TKTObj
- CAS_TKTopAlgo
- CAS_TKV3d
- CAS_TKVRML
- CAS_TKXCAF
- CAS_TKXCAFSchema
- CAS_TKXDEIGES
- CAS_TKXDESTEP
- CAS_TKXMesh
- CAS_TKXml
- CAS_TKXmlL
- CAS_TKXmlTObj
- CAS_TKXmlXCAF
- CAS_TKXSBase
-)
-
-IF(CAS_FOUND AND NOT CAS_FIND_QUIETLY)
- MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR}")
-ENDIF()
-
-
+# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2.1 of the License, or (at your option) any later version.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+#\r
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+#\r
+\r
+IF(NOT CAS_FIND_QUIETLY)\r
+ MESSAGE(STATUS "Looking for Open CASCADE Technology ...")\r
+ENDIF()\r
+\r
+SET(_CAS_VERSION_FILE_NAME Standard_Version.hxx)\r
+\r
+# Include directories:\r
+FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include/opencascade)\r
+FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include/opencascade)\r
+IF(CAS_INCLUDE_DIRS)\r
+ SET(CAS_UPCOUNT 2)\r
+ELSE()\r
+ FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include inc)\r
+ FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES include inc)\r
+ENDIF()\r
+MARK_AS_ADVANCED(CAS_VERSION_FILE)\r
+\r
+SET(CAS_VERSION_DEVELOPMENT 0)\r
+IF(CAS_VERSION_FILE)\r
+ # Check if this is a development version:\r
+ FILE(STRINGS ${CAS_VERSION_FILE} CAS_VERSION_DEVELOPMENT_STR\r
+ REGEX "^ *#define OCC_VERSION_DEVELOPMENT")\r
+ IF(CAS_VERSION_DEVELOPMENT_STR)\r
+ SET(CAS_VERSION_DEVELOPMENT 1)\r
+ ENDIF(CAS_VERSION_DEVELOPMENT_STR)\r
+ \r
+ # Extract actual version number:\r
+ FILE(STRINGS ${CAS_VERSION_FILE} _tmp\r
+ REGEX "^ *#define OCC_VERSION_COMPLETE *\"[^\"]*\".*$")\r
+ STRING(REGEX REPLACE ".*\"([^\"]*)\".*" "\\1" CAS_VERSION_STR "${_tmp}")\r
+ENDIF()\r
+\r
+# Win specific stuff:\r
+IF(WIN32)\r
+ IF(CMAKE_BUILD_TYPE STREQUAL Debug)\r
+ SET(CMAKE_LIBRARY_PATH ${CAS_ROOT_DIR}/win32/libd ${CAS_ROOT_DIR}/win64/lib/vc10)\r
+ ELSE()\r
+ SET(CMAKE_LIBRARY_PATH ${CAS_ROOT_DIR}/win32/lib ${CAS_ROOT_DIR}/win64/lib/vc10)\r
+ ENDIF()\r
+ENDIF()\r
+\r
+# Definitions:\r
+SET(CAS_DEFINITIONS "-DLIN -DLINTEL -DCSFDB")\r
+SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DNo_exception")\r
+\r
+# Check config.h file\r
+FIND_FILE(CAS_CONFIG_H config.h PATHS ${CAS_INCLUDE_DIRS} NO_DEFAULT_PATH)\r
+IF(CAS_CONFIG_H)\r
+ SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DHAVE_CONFIG_H")\r
+ENDIF()\r
+\r
+# Test for 64 bit machine:\r
+IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)\r
+ SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -D_OCC64")\r
+ENDIF()\r
+\r
+# Find Xmu library (X11 widgets?)\r
+IF(NOT WIN32)\r
+ FIND_LIBRARY(CAS_Xmu Xmu)\r
+ IF(Xmu)\r
+ SET(CAS_LDPATH ${Xmu})\r
+ ENDIF()\r
+ENDIF()\r
+\r
+IF(CAS_VERSION_STR VERSION_LESS "7.0.1")\r
+ FIND_LIBRARY(CAS_FWOSPlugin FWOSPlugin PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ELSE()\r
+ FIND_LIBRARY(CAS_TKStd TKStd PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ENDIF()\r
+FIND_LIBRARY(CAS_TKBin TKBin PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKBinL TKBinL PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKBinTObj TKBinTObj PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKBinXCAF TKBinXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKBO TKBO PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKBool TKBool PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKBRep TKBRep PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKCAF TKCAF PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKCDF TKCDF PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKernel TKernel PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKFeat TKFeat PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKFillet TKFillet PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKG2d TKG2d PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKG3d TKG3d PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKGeomAlgo TKGeomAlgo PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKGeomBase TKGeomBase PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKHLR TKHLR PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKIGES TKIGES PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKLCAF TKLCAF PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKMath TKMath PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKMesh TKMesh PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKMeshVS TKMeshVS PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+IF(CAS_VERSION_STR VERSION_LESS "6.9.1")\r
+ FIND_LIBRARY(CAS_TKNIS TKNIS PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ENDIF()\r
+FIND_LIBRARY(CAS_TKOffset TKOffset PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKOpenGl TKOpenGl PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKPrim TKPrim PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKService TKService PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKShHealing TKShHealing PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKSTEP TKSTEP PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKSTEP209 TKSTEP209 PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKSTEPAttr TKSTEPAttr PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKSTEPBase TKSTEPBase PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKSTL TKSTL PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKTObj TKTObj PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKTopAlgo TKTopAlgo PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKV3d TKV3d PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKVRML TKVRML PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXCAF TKXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXDEIGES TKXDEIGES PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXDESTEP TKXDESTEP PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXMesh TKXMesh PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXml TKXml PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXmlL TKXmlL PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXmlTObj TKXmlTObj PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXmlXCAF TKXmlXCAF PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+FIND_LIBRARY(CAS_TKXSBase TKXSBase PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+\r
+IF(CAS_VERSION_STR VERSION_LESS "7.0")\r
+ FIND_LIBRARY(CAS_PTKernel PTKernel PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ FIND_LIBRARY(CAS_TKPCAF TKPCAF PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ FIND_LIBRARY(CAS_TKPLCAF TKPLCAF PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ FIND_LIBRARY(CAS_TKPShape TKPShape PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ FIND_LIBRARY(CAS_TKShapeSchema TKShapeSchema PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ FIND_LIBRARY(CAS_TKStdLSchema TKStdLSchema PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ FIND_LIBRARY(CAS_TKStdSchema TKStdSchema PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ FIND_LIBRARY(CAS_TKXCAFSchema TKXCAFSchema PATH_SUFFIXES lib lin64/gcc/lib bin)\r
+ENDIF()\r
+\r
+SET(CAS_KERNEL ${CAS_TKernel} ${CAS_TKMath})\r
+SET(CAS_OCAF ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKCDF} ${CAS_TKLCAF})\r
+SET(CAS_VIEWER ${CAS_TKService} ${CAS_TKV3d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKBRep})\r
+SET(CAS_OCAFVIS ${CAS_TKCAF} ${CAS_TKBRep} ${CAS_TKG2d})\r
+SET(CAS_MODELER ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo} ${CAS_TKBRep} ${CAS_TKTopAlgo} ${CAS_TKG2d})\r
+\r
+SET(CAS_TKV3d_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKV3d})\r
+SET(CAS_TKBool_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKBRep} ${CAS_TKG2d} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo} ${CAS_TKTopAlgo} ${CAS_TKBool})\r
+SET(CAS_TKBRep_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKBRep})\r
+SET(CAS_TKIGES_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKXSBase} ${CAS_TKBRep} ${CAS_TKIGES})\r
+SET(CAS_TKSTEP_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKXSBase} ${CAS_TKBRep} ${CAS_TKSTEP})\r
+SET(CAS_TKSTL_EA ${CAS_TKernel} ${CAS_TKMath} ${CAS_TKSTL})\r
+SET(CAS_TKCAF_EA ${CAS_TKPrim} ${CAS_TKCAF})\r
+\r
+SET(CAS_TKV3d ${CAS_TKV3d_EA})\r
+SET(CAS_TKBool ${CAS_TKBool_EA})\r
+SET(CAS_TKBRep ${CAS_TKBRep_EA})\r
+SET(CAS_TKIGES ${CAS_TKIGES_EA})\r
+SET(CAS_TKSTEP ${CAS_TKSTEP_EA})\r
+SET(CAS_TKSTL ${CAS_TKSTL_EA})\r
+SET(CAS_TKCAF ${CAS_TKCAF_EA})\r
+\r
+SET(_libs\r
+ CAS_TKBin\r
+ CAS_TKBinL\r
+ CAS_TKBinTObj\r
+ CAS_TKBinXCAF\r
+ CAS_TKBO\r
+ CAS_TKBool\r
+ CAS_TKBRep\r
+ CAS_TKCAF\r
+ CAS_TKCDF\r
+ CAS_TKernel\r
+ CAS_TKFeat\r
+ CAS_TKFillet\r
+ CAS_TKG2d\r
+ CAS_TKG3d\r
+ CAS_TKGeomAlgo\r
+ CAS_TKGeomBase\r
+ CAS_TKHLR\r
+ CAS_TKIGES\r
+ CAS_TKLCAF\r
+ CAS_TKMath\r
+ CAS_TKMesh\r
+ CAS_TKMeshVS\r
+ CAS_TKOffset\r
+ CAS_TKOpenGl\r
+ CAS_TKPrim\r
+ CAS_TKService\r
+ CAS_TKShHealing\r
+ CAS_TKSTEP\r
+ CAS_TKSTEP209\r
+ CAS_TKSTEPAttr\r
+ CAS_TKSTEPBase\r
+ CAS_TKSTL\r
+ CAS_TKTObj\r
+ CAS_TKTopAlgo\r
+ CAS_TKV3d\r
+ CAS_TKVRML\r
+ CAS_TKXCAF\r
+ CAS_TKXDEIGES\r
+ CAS_TKXDESTEP\r
+ CAS_TKXMesh\r
+ CAS_TKXml\r
+ CAS_TKXmlL\r
+ CAS_TKXmlTObj\r
+ CAS_TKXmlXCAF\r
+ CAS_TKXSBase\r
+)\r
+\r
+IF(CAS_VERSION_STR VERSION_LESS "7.0.1")\r
+ LIST(APPEND _libs CAS_FWOSPlugin)\r
+ELSE()\r
+ LIST(APPEND _libs CAS_TKStd)\r
+ENDIF()\r
+\r
+IF(CAS_VERSION_STR VERSION_LESS "6.9.1")\r
+ LIST(APPEND _libs CAS_TKNIS)\r
+ENDIF()\r
+\r
+IF(CAS_VERSION_STR VERSION_LESS "7.0")\r
+ LIST(APPEND _libs\r
+ CAS_PTKernel\r
+ CAS_TKPCAF\r
+ CAS_TKPLCAF\r
+ CAS_TKPShape\r
+ CAS_TKShapeSchema\r
+ CAS_TKStdLSchema\r
+ CAS_TKStdSchema\r
+ CAS_TKXCAFSchema\r
+ )\r
+ENDIF()\r
+\r
+\r
+INCLUDE(FindPackageHandleStandardArgs)\r
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CAS REQUIRED_VARS CAS_INCLUDE_DIRS ${_libs})\r
+\r
+IF(CAS_FOUND AND NOT CAS_FIND_QUIETLY)\r
+ IF(CAS_VERSION_DEVELOPMENT)\r
+ MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR} (development)")\r
+ ELSE(CAS_VERSION_DEVELOPMENT)\r
+ MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR}")\r
+ ENDIF(CAS_VERSION_DEVELOPMENT)\r
+ENDIF()\r
+++ /dev/null
-## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
-IF(WIN32)
- SET(QT_USE_QTMAIN ON)
-ENDIF()
-
-# Widgets finds its own dependencies (QtGui and QtCore).
-FIND_PACKAGE(Qt4 REQUIRED)
-
-IF(NOT QT4_FOUND)
- MESSAGE(FATAL_ERROR "Qt not found.")
-ENDIF()
-
-INCLUDE(${QT_USE_FILE})
-
-# The Qt5Widgets_INCLUDES also includes the include directories for
-# dependencies QtCore and QtGui
-INCLUDE_DIRECTORIES(${QT_INCLUDES})
-
-# We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5.
-ADD_DEFINITIONS(${QT_DEFINITIONS})
-
-# Executables fail to build with Qt 5 in the default configuration
-# without -fPIE. We add that here.
-#SET(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2.1 of the License, or (at your option) any later version.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+#\r
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+#\r
+# Author: Adrien Bruneton\r
+#\r
+\r
+# Qt5 detection for Salome\r
+#\r
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!\r
+#\r
+\r
+# Qt5_FIND_COMPONENTS variable is set here to prevent ParaView to reset list of Qt5 modules,\r
+# just to avoid extra dependencies\r
+\r
+SET(QT_INCLUDES)\r
+SET(QT_DEFINITIONS)\r
+SET(QT_LIBRARIES)\r
+# Find Qt5Core to get Qt version\r
+SET(Qt5_FIND_COMPONENTS QtCore)\r
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Core Qt5Core_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)\r
+IF(Qt5Core_FOUND)\r
+ LIST(APPEND QT_INCLUDES ${Qt5Core_INCLUDE_DIRS})\r
+ LIST(APPEND QT_DEFINITIONS ${Qt5Core_DEFINITIONS})\r
+ LIST(APPEND QT_LIBRARIES ${Qt5Core_LIBRARIES})\r
+ SET(QT_VERSION "${Qt5Core_VERSION}")\r
+ENDIF()\r
+\r
+SET(Qt5_FIND_COMPONENTS Gui Widgets Network Xml OpenGL PrintSupport Help Test Sql Sensors Positioning Quick Qml Multimedia MultimediaWidgets WebChannel UiTools)\r
+\r
+IF ("${QT_VERSION}" VERSION_LESS "5.6.0")\r
+ LIST(APPEND Qt5_FIND_COMPONENTS WebKit WebKitWidgets)\r
+ELSE()\r
+ LIST(APPEND Qt5_OPTIONAL_COMPONENTS WebEngine WebEngineWidgets)\r
+ENDIF()\r
+\r
+IF(NOT WIN32)\r
+ LIST(APPEND Qt5_FIND_COMPONENTS X11Extras)\r
+ENDIF()\r
+\r
+FOREACH(_Qt5_COMPONENT_ ${Qt5_FIND_COMPONENTS} ${Qt5_OPTIONAL_COMPONENTS})\r
+ SET(_Qt5_COMPONENT Qt5${_Qt5_COMPONENT_})\r
+ LIST(FIND Qt5_OPTIONAL_COMPONENTS ${_Qt5_COMPONENT_} idx)\r
+ IF(${idx} GREATER -1)\r
+ SET(Salome${_Qt5_COMPONENT}_FIND_QUIETLY TRUE)\r
+ ENDIF()\r
+ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(${_Qt5_COMPONENT} ${_Qt5_COMPONENT}_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)\r
+ LIST(APPEND QT_INCLUDES ${${_Qt5_COMPONENT}_INCLUDE_DIRS})\r
+ LIST(APPEND QT_DEFINITIONS ${${_Qt5_COMPONENT}_DEFINITIONS})\r
+ LIST(APPEND QT_LIBRARIES ${${_Qt5_COMPONENT}_LIBRARIES})\r
+ENDFOREACH()\r
+\r
+FIND_PACKAGE(Qt5LinguistTools)\r
+GET_TARGET_PROPERTY(QT_LRELEASE_EXECUTABLE Qt5::lrelease LOCATION)\r
+MARK_AS_ADVANCED(QT_LRELEASE_EXECUTABLE)\r
+\r
+GET_FILENAME_COMPONENT(QT_BINARY_DIR ${QT_LRELEASE_EXECUTABLE} DIRECTORY)\r
+MARK_AS_ADVANCED(QT_BINARY_DIR)\r
+\r
+# This is only needed to correctly detect Qt help generator tool, to workaround an error \r
+# coming from ParaView detection procedure\r
+FIND_PROGRAM(QT_HELP_GENERATOR\r
+ qhelpgenerator\r
+ PATHS "${QT_BINARY_DIR}"\r
+ NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH\r
+ DOC "qhelpgenerator used to compile Qt help project files")\r
+MARK_AS_ADVANCED(QT_HELP_GENERATOR)\r
+\r
+IF(Qt5Core_FOUND) \r
+ SALOME_ACCUMULATE_HEADERS(QT_INCLUDES)\r
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${LINGUIST_PATH})\r
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Qt5Core_LIBRARIES})\r
+ GET_FILENAME_COMPONENT(Qt5_DIR ${Qt5Core_DIR} PATH)\r
+ FILE(TO_NATIVE_PATH "${Qt5_DIR}/Qt5" Qt5_DIR)\r
+ SET(SalomeQt5_COMPONENTS ${Qt5_FIND_COMPONENTS})\r
+ MESSAGE(STATUS "Qt version is ${QT_VERSION}")\r
+ENDIF()\r
--- /dev/null
+# Copyright (C) 2012-2016 CEA/DEN, EDF R&D, OPEN CASCADE\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2.1 of the License, or (at your option) any later version.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+#\r
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+#\r
+# Author: A.Geay, V. Sandler, A. Bruneton\r
+#\r
+\r
+#----------------------------------------------------------------------------\r
+# LIST_CONTAINS is a macro useful for determining whether a list has a \r
+# particular entry\r
+#----------------------------------------------------------------------------\r
+MACRO(LIST_CONTAINS var value)\r
+ SET(${var})\r
+ FOREACH(value2 ${ARGN})\r
+ IF(${value} STREQUAL "${value2}")\r
+ SET(${var} TRUE)\r
+ ENDIF (${value} STREQUAL "${value2}")\r
+ ENDFOREACH (value2)\r
+ENDMACRO(LIST_CONTAINS)\r
+\r
+#----------------------------------------------------------------------------\r
+# The PARSE_ARGUMENTS macro will take the arguments of another macro and\r
+# define several variables.\r
+#\r
+# USAGE: PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)\r
+#\r
+# ARGUMENTS:\r
+#\r
+# prefix: IN: a prefix to put on all variables it creates.\r
+#\r
+# arg_names: IN: a list of names.\r
+# For each item in arg_names, PARSE_ARGUMENTS will create a \r
+# variable with that name, prefixed with prefix_. Each variable will be filled\r
+# with the arguments that occur after the given arg_name is encountered\r
+# up to the next arg_name or the end of the arguments. All options are\r
+# removed from these lists. PARSE_ARGUMENTS also creates a\r
+# prefix_DEFAULT_ARGS variable containing the list of all arguments up\r
+# to the first arg_name encountered.\r
+#\r
+# options: IN: a list of options.\r
+# For each item in options, PARSE_ARGUMENTS will create a\r
+# variable with that name, prefixed with prefix_. So, for example, if prefix is\r
+# MY_MACRO and options is OPTION1;OPTION2, then PARSE_ARGUMENTS will\r
+# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These\r
+# variables will be set to true if the option exists in the command line\r
+# or false otherwise.\r
+# arg_names and options lists should be quoted.\r
+#\r
+# The rest of PARSE_ARGUMENTS are arguments from another macro to be parsed.\r
+#----------------------------------------------------------------------------\r
+MACRO(PARSE_ARGUMENTS prefix arg_names option_names)\r
+ SET(DEFAULT_ARGS)\r
+ FOREACH(arg_name ${arg_names})\r
+ SET(${prefix}_${arg_name})\r
+ ENDFOREACH(arg_name)\r
+ FOREACH(option ${option_names})\r
+ SET(${prefix}_${option} FALSE)\r
+ ENDFOREACH(option)\r
+ SET(current_arg_name DEFAULT_ARGS)\r
+ SET(current_arg_list)\r
+ FOREACH(arg ${ARGN})\r
+ LIST_CONTAINS(is_arg_name ${arg} ${arg_names})\r
+ IF (is_arg_name)\r
+ SET(${prefix}_${current_arg_name} ${current_arg_list})\r
+ SET(current_arg_name ${arg})\r
+ SET(current_arg_list)\r
+ ELSE (is_arg_name)\r
+ LIST_CONTAINS(is_option ${arg} ${option_names})\r
+ IF (is_option)\r
+ SET(${prefix}_${arg} TRUE)\r
+ ELSE (is_option)\r
+ SET(current_arg_list ${current_arg_list} ${arg})\r
+ ENDIF (is_option)\r
+ ENDIF (is_arg_name)\r
+ ENDFOREACH(arg)\r
+ SET(${prefix}_${current_arg_name} ${current_arg_list})\r
+ENDMACRO(PARSE_ARGUMENTS)\r
+\r
+#----------------------------------------------------------------------------\r
+# SALOME_INSTALL_SCRIPTS is a macro useful for installing scripts.\r
+#\r
+# USAGE: SALOME_INSTALL_SCRIPTS(file_list path [WORKING_DIRECTORY dir] [DEF_PERMS])\r
+#\r
+# ARGUMENTS:\r
+# file_list: IN : list of files to be installed. This list should be quoted.\r
+# path: IN : full pathname for installing.\r
+# \r
+# By default files to be installed as executable scripts.\r
+# If DEF_PERMS option is provided, than permissions for installed files are\r
+# only OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ. \r
+#----------------------------------------------------------------------------\r
+MACRO(SALOME_INSTALL_SCRIPTS file_list path)\r
+ PARSE_ARGUMENTS(SALOME_INSTALL_SCRIPTS "WORKING_DIRECTORY" "DEF_PERMS" ${ARGN})\r
+ SET(PERMS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)\r
+ IF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS)\r
+ SET(PERMS ${PERMS} OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)\r
+ ENDIF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS)\r
+ SET(_all_pyc)\r
+ SET(_all_pyo)\r
+ SET(_all_subdirs)\r
+ FOREACH(file ${file_list})\r
+ SET(PREFIX "")\r
+ SET(_source_prefix "")\r
+ GET_FILENAME_COMPONENT(file_name ${file} NAME)\r
+ IF(NOT IS_ABSOLUTE ${file})\r
+ IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY)\r
+ SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/")\r
+ ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY)\r
+ SET(_source_prefix "${CMAKE_CURRENT_SOURCE_DIR}/")\r
+ ENDIF(NOT IS_ABSOLUTE ${file})\r
+ INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS})\r
+ GET_FILENAME_COMPONENT(ext ${file} EXT)\r
+ GET_FILENAME_COMPONENT(we_ext ${file} NAME_WE)\r
+\r
+ IF(ext STREQUAL .py) \r
+ # Generate and install the pyc and pyo\r
+ # [ABN] Important: we avoid references or usage of CMAKE_INSTALL_PREFIX which is not correctly set \r
+ # when using CPack. \r
+ SET(_pyc_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.pyc")\r
+ SET(_pyo_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.pyo")\r
+ LIST(APPEND _all_pyc ${_pyc_file})\r
+ LIST(APPEND _all_pyo ${_pyo_file})\r
+ ADD_CUSTOM_COMMAND(\r
+ OUTPUT ${_pyc_file}\r
+ COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile ; py_compile.compile('${_source_prefix}${file}', '${_pyc_file}', doraise=True )"\r
+ DEPENDS ${PREFIX}${file}\r
+ VERBATIM\r
+ )\r
+ ADD_CUSTOM_COMMAND(\r
+ OUTPUT ${_pyo_file}\r
+ COMMAND ${PYTHON_EXECUTABLE} -O -c "import py_compile ; py_compile.compile('${_source_prefix}${file}', '${_pyo_file}', doraise=True )"\r
+ DEPENDS ${PREFIX}${file}\r
+ VERBATIM\r
+ )\r
+ # Install the .pyo and the .pyc\r
+ INSTALL(FILES ${_pyc_file} DESTINATION ${path} PERMISSIONS ${PERMS})\r
+ INSTALL(FILES ${_pyo_file} DESTINATION ${path} PERMISSIONS ${PERMS})\r
+ ENDIF(ext STREQUAL .py)\r
+\r
+ # get relativa path (from CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR)\r
+ STRING(REGEX REPLACE ${CMAKE_SOURCE_DIR} "" rel_dir ${CMAKE_CURRENT_SOURCE_DIR})\r
+ # convert "/" to "_"\r
+ IF(rel_dir)\r
+ STRING(REGEX REPLACE "/" "_" unique_name ${rel_dir})\r
+ ELSE(rel_dir)\r
+ SET(unique_name _)\r
+ ENDIF(rel_dir)\r
+\r
+ ENDFOREACH(file ${file_list})\r
+ # Generate only one target for all requested Python script compilation.\r
+ # Make sure that the target name is unique too. \r
+ IF(_all_pyc)\r
+ SET(_cnt 0)\r
+ WHILE(TARGET "PYCOMPILE${unique_name}_${_cnt}")\r
+ MATH(EXPR _cnt ${_cnt}+1)\r
+ ENDWHILE()\r
+ ADD_CUSTOM_TARGET("PYCOMPILE${unique_name}_${_cnt}" ALL DEPENDS ${_all_pyc} ${_all_pyo})\r
+ ENDIF()\r
+ENDMACRO(SALOME_INSTALL_SCRIPTS)\r
+\r
+#----------------------------------------------------------------------------\r
+# SALOME_CONFIGURE_FILE is a macro useful for copying a file to another location \r
+# and modify its contents.\r
+#\r
+# USAGE: SALOME_CONFIGURE_FILE(in_file out_file [INSTALL dir])\r
+#\r
+# ARGUMENTS:\r
+# in_file: IN : input file (if relative path is given, full file path is computed from current source dir).\r
+# out_file: IN : output file (if relative path is given, full file path is computed from current build dir).\r
+# If INSTALL is specified, then 'out_file' will be installed to the 'dir' directory.\r
+#----------------------------------------------------------------------------\r
+MACRO(SALOME_CONFIGURE_FILE IN_FILE OUT_FILE)\r
+ IF(IS_ABSOLUTE ${IN_FILE})\r
+ SET(_in_file ${IN_FILE})\r
+ ELSE()\r
+ SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${IN_FILE})\r
+ ENDIF()\r
+ IF(IS_ABSOLUTE ${OUT_FILE})\r
+ SET(_out_file ${OUT_FILE})\r
+ ELSE()\r
+ SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${OUT_FILE})\r
+ ENDIF()\r
+ MESSAGE(STATUS "Creation of ${_out_file}")\r
+ CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)\r
+ PARSE_ARGUMENTS(SALOME_CONFIGURE_FILE "INSTALL" "" ${ARGN})\r
+ IF(SALOME_CONFIGURE_FILE_INSTALL)\r
+ INSTALL(FILES ${_out_file} DESTINATION ${SALOME_CONFIGURE_FILE_INSTALL})\r
+ ENDIF(SALOME_CONFIGURE_FILE_INSTALL)\r
+ENDMACRO(SALOME_CONFIGURE_FILE)\r
+\r
+\r
+#######################################################################################\r
+# Useful macros for SALOME own package detection system\r
+#\r
+\r
+###\r
+# SALOME_CHECK_EQUAL_PATHS(result path1 path2)\r
+# Check if two paths are identical, resolving links. If the paths do not exist a simple\r
+# text comparison is performed.\r
+# result is a boolean.\r
+###\r
+MACRO(SALOME_CHECK_EQUAL_PATHS varRes path1 path2) \r
+ SET("${varRes}" OFF)\r
+ IF(EXISTS "${path1}")\r
+ GET_FILENAME_COMPONENT(_tmp1 "${path1}" REALPATH)\r
+ ELSE()\r
+ SET(_tmp1 "${path1}")\r
+ ENDIF() \r
+\r
+ IF(EXISTS "${path2}")\r
+ GET_FILENAME_COMPONENT(_tmp2 "${path2}" REALPATH)\r
+ ELSE()\r
+ SET(_tmp2 "${path2}")\r
+ ENDIF() \r
+\r
+ IF("${_tmp1}" STREQUAL "${_tmp2}")\r
+ SET("${varRes}" ON)\r
+ ENDIF()\r
+# MESSAGE(${${varRes}})\r
+ENDMACRO()\r
+\r
+####\r
+# SALOME_LOG_OPTIONAL_PACKAGE(pkg flag)\r
+#\r
+# Register in global variables the detection status (found or not) of the optional package 'pkg' \r
+# and the configuration flag that should be turned off to avoid detection of the package.\r
+# The global variables are read again by SALOME_PACKAGE_REPORT_AND_CHECK to produce \r
+# a summary report of the detection status and stops the process if necessary.\r
+MACRO(SALOME_LOG_OPTIONAL_PACKAGE pkg flag)\r
+ # Was the package found\r
+ STRING(TOUPPER ${pkg} _pkg_UC)\r
+ IF(${pkg}_FOUND OR ${_pkg_UC}_FOUND)\r
+ SET(_isFound TRUE)\r
+ ELSE()\r
+ SET(_isFound FALSE)\r
+ ENDIF()\r
+\r
+ # Is the package already in the list? Then update its status:\r
+ LIST(FIND _SALOME_OPTIONAL_PACKAGES_names ${pkg} _result)\r
+ IF(NOT ${_result} EQUAL -1)\r
+ LIST(REMOVE_AT _SALOME_OPTIONAL_PACKAGES_found ${_result})\r
+ LIST(REMOVE_AT _SALOME_OPTIONAL_PACKAGES_flags ${_result})\r
+ LIST(INSERT _SALOME_OPTIONAL_PACKAGES_found ${_result} ${_isFound})\r
+ LIST(INSERT _SALOME_OPTIONAL_PACKAGES_flags ${_result} ${flag})\r
+ ELSE()\r
+ # Otherwise insert it\r
+ LIST(APPEND _SALOME_OPTIONAL_PACKAGES_names ${pkg})\r
+ LIST(APPEND _SALOME_OPTIONAL_PACKAGES_found ${_isFound})\r
+ LIST(APPEND _SALOME_OPTIONAL_PACKAGES_flags ${flag})\r
+ ENDIF() \r
+ \r
+ENDMACRO(SALOME_LOG_OPTIONAL_PACKAGE)\r
+\r
+####\r
+# SALOME_JUSTIFY_STRING()\r
+#\r
+# Justifies the string specified as an argument to the given length\r
+# adding required number of spaces to the end. Does noting if input\r
+# string is longer as required length.\r
+# Puts the result to the output variable.\r
+#\r
+# USAGE: SALOME_JUSTIFY_STRING(input length result)\r
+#\r
+# ARGUMENTS:\r
+# input [in] input string\r
+# length [in] required length of resulting string\r
+# result [out] name of variable where the result string is put to\r
+#\r
+MACRO(SALOME_JUSTIFY_STRING input length result)\r
+ SET(${result} ${input})\r
+ STRING(LENGTH ${input} _input_length)\r
+ MATH(EXPR _nb_spaces "${length}-${_input_length}-1")\r
+ IF (_nb_spaces GREATER 0)\r
+ FOREACH(_idx RANGE ${_nb_spaces}) \r
+ SET(${result} "${${result}} ")\r
+ ENDFOREACH()\r
+ ENDIF()\r
+ENDMACRO(SALOME_JUSTIFY_STRING)\r
+\r
+####\r
+# SALOME_PACKAGE_REPORT_AND_CHECK()\r
+#\r
+# Print a quick summary of the detection of optional prerequisites.\r
+# If a package was not found, the configuration is stopped. The summary also indicates \r
+# which flag should be turned off to skip the detection of the package. \r
+#\r
+# If optional JUSTIFY argument is specified, names of packages\r
+# are left-justified to the given length; default value is 10.\r
+#\r
+# USAGE: SALOME_PACKAGE_REPORT_AND_CHECK([JUSTIFY length])\r
+#\r
+MACRO(SALOME_PACKAGE_REPORT_AND_CHECK)\r
+ SET(_will_fail OFF)\r
+ PARSE_ARGUMENTS(SALOME_PACKAGE_REPORT "JUSTIFY" "" ${ARGN})\r
+ IF(SALOME_PACKAGE_REPORT_JUSTIFY)\r
+ SET(_length ${SALOME_PACKAGE_REPORT_JUSTIFY})\r
+ ELSE()\r
+ SET(_length 23)\r
+ ENDIF()\r
+ MESSAGE(STATUS "") \r
+ MESSAGE(STATUS " Optional packages - Detection report ")\r
+ MESSAGE(STATUS " ==================================== ")\r
+ MESSAGE(STATUS "")\r
+ IF(DEFINED _SALOME_OPTIONAL_PACKAGES_names)\r
+ LIST(LENGTH _SALOME_OPTIONAL_PACKAGES_names _list_len)\r
+ # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...\r
+ MATH(EXPR _range "${_list_len}-1")\r
+ FOREACH(_idx RANGE ${_range}) \r
+ LIST(GET _SALOME_OPTIONAL_PACKAGES_names ${_idx} _pkg_name)\r
+ LIST(GET _SALOME_OPTIONAL_PACKAGES_found ${_idx} _pkg_found)\r
+ LIST(GET _SALOME_OPTIONAL_PACKAGES_flags ${_idx} _pkg_flag)\r
+ SALOME_JUSTIFY_STRING(${_pkg_name} ${_length} _pkg_name)\r
+ IF(_pkg_found)\r
+ SET(_found_msg "Found")\r
+ SET(_flag_msg "")\r
+ ELSE()\r
+ SET(_will_fail ON)\r
+ SET(_found_msg "NOT Found")\r
+ SET(_flag_msg " - ${_pkg_flag} can be switched OFF to skip this prerequisite.")\r
+ ENDIF()\r
+ \r
+ MESSAGE(STATUS " * ${_pkg_name} -> ${_found_msg}${_flag_msg}")\r
+ ENDFOREACH()\r
+ ENDIF(DEFINED _SALOME_OPTIONAL_PACKAGES_names)\r
+ MESSAGE(STATUS "")\r
+ MESSAGE(STATUS "")\r
+ \r
+ # Failure if some packages were missing:\r
+ IF(_will_fail)\r
+ MESSAGE(FATAL_ERROR "Some required prerequisites have NOT been found. Take a look at the report above to fix this.")\r
+ ENDIF()\r
+ENDMACRO(SALOME_PACKAGE_REPORT_AND_CHECK)\r
+\r
+####\r
+# SALOME_FIND_PACKAGE(englobingPackageName standardPackageName modus [onlyTryQuietly])\r
+#\r
+# example: SALOME_FIND_PACKAGE(SalomeVTK VTK CONFIG)\r
+#\r
+# Encapsulate the call to the standard FIND_PACKAGE(standardPackageName) passing all the options\r
+# given when calling the command FIND_PACKAGE(SalomeXYZ). Those options are stored implicitly in \r
+# CMake variables: xyz__FIND_QUIETLY, xyz_FIND_REQUIRED, etc ...\r
+# \r
+# If a list of components was specified when invoking the initial FIND_PACKAGE(SalomeXyz ...) this is \r
+# also handled properly.\r
+#\r
+# Modus is either MODULE or CONFIG (cf standard FIND_PACKAGE() documentation).\r
+# The last argument is optional and if set to TRUE will force the search to be OPTIONAL and QUIET.\r
+# If the package is looked for in CONFIG mode, the standard system paths are skipped. If you still want a \r
+# system installation to be found in this mode, you have to set the ROOT_DIR variable explicitly to /usr (for\r
+# example). \r
+# \r
+# This macro is to be called from within the FindSalomeXXXX.cmake file.\r
+#\r
+####\r
+MACRO(SALOME_FIND_PACKAGE englobPkg stdPkg mode)\r
+ SET(_OPT_ARG ${ARGV3})\r
+ # Only bother if the package was not already found:\r
+ # Some old packages use the lower case version - standard should be to always use\r
+ # upper case:\r
+ STRING(TOUPPER ${stdPkg} stdPkgUC)\r
+ IF(NOT (${stdPkg}_FOUND OR ${stdPkgUC}_FOUND))\r
+ IF(${englobPkg}_FIND_QUIETLY OR _OPT_ARG)\r
+ SET(_tmp_quiet "QUIET")\r
+ ELSE()\r
+ SET(_tmp_quiet)\r
+ ENDIF() \r
+ IF(${englobPkg}_FIND_REQUIRED AND NOT _OPT_ARG)\r
+ SET(_tmp_req "REQUIRED")\r
+ ELSE()\r
+ SET(_tmp_req)\r
+ ENDIF() \r
+ IF(${englobPkg}_FIND_VERSION_EXACT)\r
+ SET(_tmp_exact "EXACT")\r
+ ELSE()\r
+ SET(_tmp_exact)\r
+ ENDIF()\r
+\r
+ # Call the CMake FIND_PACKAGE() command: \r
+ STRING(TOLOWER ${stdPkg} _pkg_lc)\r
+ IF(("${mode}" STREQUAL "NO_MODULE") OR ("${mode}" STREQUAL "CONFIG"))\r
+ # Hope to find direclty a CMake config file, indicating the SALOME CMake file\r
+ # paths (the command already looks in places like "share/cmake", etc ... by default)\r
+ # Note the options NO_CMAKE_BUILDS_PATH, NO_CMAKE_PACKAGE_REGISTRY to avoid (under Windows)\r
+ # looking into a previous CMake build done via a GUI, or into the Win registry.\r
+ # NO_CMAKE_SYSTEM_PATH and NO_SYSTEM_ENVIRONMENT_PATH ensure any _system_ files like 'xyz-config.cmake' \r
+ # don't get loaded (typically Boost). To force their loading, set the XYZ_ROOT_DIR variable to '/usr'. \r
+ # See documentation of FIND_PACKAGE() for full details.\r
+ \r
+ # Do we need to call the signature using components?\r
+ IF(${englobPkg}_FIND_COMPONENTS)\r
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} \r
+ NO_MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS}\r
+ PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files" "adm/cmake"\r
+ NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH\r
+ NO_SYSTEM_ENVIRONMENT_PATH)\r
+ ELSE()\r
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} \r
+ NO_MODULE ${_tmp_quiet} ${_tmp_req}\r
+ PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files" "adm/cmake"\r
+ NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH\r
+ NO_SYSTEM_ENVIRONMENT_PATH)\r
+ ENDIF()\r
+ MARK_AS_ADVANCED(${stdPkg}_DIR)\r
+ \r
+ ELSEIF("${mode}" STREQUAL "MODULE")\r
+ \r
+ # Do we need to call the signature using components?\r
+ IF(${englobPkg}_FIND_COMPONENTS)\r
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} \r
+ MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS})\r
+ ELSE()\r
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} \r
+ MODULE ${_tmp_quiet} ${_tmp_req})\r
+ ENDIF()\r
+ \r
+ ELSE()\r
+ \r
+ MESSAGE(FATAL_ERROR "Invalid mode argument in the call to the macro SALOME_FIND_PACKAGE. Should be CONFIG or MODULE.")\r
+ \r
+ ENDIF()\r
+ \r
+ ENDIF()\r
+ENDMACRO()\r
+\r
+\r
+####################################################################\r
+# SALOME_FIND_PACKAGE_DETECT_CONFLICTS(pkg referenceVariable upCount)\r
+# pkg : name of the system package to be detected\r
+# referenceVariable: variable containing a path that can be browsed up to \r
+# retrieve the package root directory (xxx_ROOT_DIR)\r
+# upCount : number of times we have to go up from the path <referenceVariable>\r
+# to obtain the package root directory.\r
+# If this is a path to a file, going up one time gives the directory containing the file\r
+# going up 2 times gives the parent directory.\r
+# \r
+# For example: SALOME_FIND_PACKAGE_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2)\r
+# with SWIG_EXECUTABLE set to '/usr/bin/swig'\r
+# will produce '/usr' \r
+#\r
+# Generic detection (and conflict check) procedure for package XYZ:\r
+# 1. Load a potential env variable XYZ_ROOT_DIR as a default choice for the cache entry XYZ_ROOT_DIR\r
+# If empty, load a potential XYZ_ROOT_DIR_EXP as default value (path exposed by another package depending\r
+# directly on XYZ)\r
+# 2. Invoke FIND_PACKAGE() in this order:\r
+# * in CONFIG mode first (if possible): priority is given to a potential \r
+# "XYZ-config.cmake" file\r
+# * then switch to the standard MODULE mode, appending on CMAKE_PREFIX_PATH \r
+# the above XYZ_ROOT_DIR variable\r
+# 3. Extract the path actually found into a temp variable _XYZ_TMP_DIR\r
+# 4. Warn if XYZ_ROOT_DIR is set and doesn't match what was found (e.g. when CMake found the system installation\r
+# instead of what is pointed to by XYZ_ROOT_DIR - happens when a typo in the content of XYZ_ROOT_DIR).\r
+# 5. Conflict detection:\r
+# * check the temp variable against a potentially existing XYZ_ROOT_DIR_EXP\r
+# 6. Finally expose what was *actually* found in XYZ_ROOT_DIR. \r
+# 7. Specific stuff: for example exposing a prerequisite of XYZ to the rest of the world for future \r
+# conflict detection. This is added after the call to the macro by the callee.\r
+#\r
+MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount)\r
+ ##\r
+ ## 0. Initialization\r
+ ##\r
+ PARSE_ARGUMENTS(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS "ENVVAR" "" ${ARGN})\r
+ \r
+ # Package name, upper case\r
+ STRING(TOUPPER ${pkg} pkg_UC)\r
+\r
+ ##\r
+ ## 1. Load environment or any previously detected root dir for the package\r
+ ##\r
+ SET(_envvar ${pkg_UC}_ROOT_DIR)\r
+ IF(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS_ENVVAR)\r
+ SET(_envvar "${SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS_ENVVAR}")\r
+ ENDIF()\r
+ IF(DEFINED ENV{${_envvar}})\r
+ FILE(TO_CMAKE_PATH "$ENV{${_envvar}}" _${pkg_UC}_ROOT_DIR_ENV)\r
+ SET(_dflt_value "${_${pkg_UC}_ROOT_DIR_ENV}")\r
+ ELSE()\r
+ # will be blank if no package was previously loaded:\r
+ SET(_dflt_value "${${pkg_UC}_ROOT_DIR_EXP}")\r
+ ENDIF()\r
+ # Detect if the variable has been set on the command line or elsewhere:\r
+ IF(DEFINED ${_envvar})\r
+ SET(_var_already_there TRUE)\r
+ ELSE()\r
+ SET(_var_already_there FALSE)\r
+ ENDIF()\r
+ # Make cache entry \r
+ SET(${_envvar} "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory")\r
+\r
+ ##\r
+ ## 2. Find package - try CONFIG mode first (i.e. looking for XYZ-config.cmake)\r
+ ##\r
+ \r
+ # Override the variable - don't append to it, as it would give precedence\r
+ # to what was stored there before! \r
+ IF(DEFINED ${_envvar})\r
+ SET(CMAKE_PREFIX_PATH "${${_envvar}}")\r
+ ENDIF()\r
+ \r
+ # Try find_package in config mode. This has the priority, but is \r
+ # performed QUIET and not REQUIRED:\r
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} NO_MODULE TRUE)\r
+ \r
+ IF (${pkg_UC}_FOUND OR ${pkg}_FOUND)\r
+ MESSAGE(STATUS "Found ${pkg} in CONFIG mode!")\r
+ ENDIF()\r
+\r
+ # Otherwise try the standard way (module mode, with the standard CMake Find*** macro):\r
+ # We do it quietly to produce our own error message, except if we are in debug mode:\r
+ IF(SALOME_CMAKE_DEBUG)\r
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE FALSE)\r
+ ELSE()\r
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE TRUE)\r
+ ENDIF()\r
+ \r
+ # Set the "FOUND" variable for the SALOME wrapper:\r
+ IF(${pkg_UC}_FOUND OR ${pkg}_FOUND)\r
+ SET(SALOME${pkg_UC}_FOUND TRUE)\r
+ ELSE()\r
+ SET(SALOME${pkg_UC}_FOUND FALSE)\r
+ IF(NOT Salome${pkg}_FIND_QUIETLY)\r
+ IF(Salome${pkg}_FIND_REQUIRED)\r
+ MESSAGE(FATAL_ERROR "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "\r
+ "It currently contains ${_envvar}=${${_envvar}} "\r
+ "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")\r
+ ELSE()\r
+ MESSAGE(WARNING "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "\r
+ "It currently contains ${_envvar}=${${_envvar}} "\r
+ "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")\r
+ ENDIF()\r
+ ENDIF()\r
+ ENDIF()\r
+ \r
+ IF (${pkg_UC}_FOUND OR ${pkg}_FOUND)\r
+ ## 3. Set the root dir which was finally retained by going up "upDir" times\r
+ ## from the given reference path. The variable "referenceVariable" may be a list.\r
+ ## In this case we take its first element. \r
+ \r
+ # First test if the variable exists, warn otherwise:\r
+ IF(NOT DEFINED ${referenceVariable})\r
+ MESSAGE(WARNING "${pkg}: the reference variable '${referenceVariable}' used when calling the macro "\r
+ "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() is not defined.")\r
+ ENDIF()\r
+ \r
+ LIST(LENGTH ${referenceVariable} _tmp_len)\r
+ IF(_tmp_len)\r
+ LIST(GET ${referenceVariable} 0 _tmp_ROOT_DIR)\r
+ ELSE()\r
+ # Note the double de-reference of "referenceVariable":\r
+ SET(_tmp_ROOT_DIR "${${referenceVariable}}")\r
+ ENDIF()\r
+ # Up cound can be reset by detection procedure\r
+ SET(_upCount ${upCount})\r
+ IF(DEFINED ${pkg_UC}_UPCOUNT)\r
+ SET(_upCount ${${pkg_UC}_UPCOUNT})\r
+ ENDIF()\r
+ IF(${_upCount}) \r
+ FOREACH(_unused RANGE 1 ${_upCount}) \r
+ GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)\r
+ ENDFOREACH()\r
+ ENDIF()\r
+\r
+ ##\r
+ ## 4. Warn if CMake found something not located under ENV(XYZ_ROOT_DIR)\r
+ ##\r
+ IF(DEFINED ENV{${_envvar}})\r
+ SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${_${pkg_UC}_ROOT_DIR_ENV}")\r
+ IF(NOT _res)\r
+ MESSAGE(WARNING "${pkg} was found, but not at the path given by the "\r
+ "environment ${_envvar}! Is the variable correctly set? "\r
+ "The two paths are: ${_tmp_ROOT_DIR} and: ${_${pkg_UC}_ROOT_DIR_ENV}")\r
+ \r
+ ELSE()\r
+ MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${_envvar} variable, all good!") \r
+ ENDIF()\r
+ ELSE()\r
+ IF(NOT _var_already_there) \r
+ MESSAGE(STATUS "Variable ${_envvar} was not explicitly defined. "\r
+ "An installation was found anyway: ${_tmp_ROOT_DIR}")\r
+ ENDIF()\r
+ ENDIF()\r
+\r
+ ##\r
+ ## 5. Conflict detection\r
+ ## From another prerequisite using the package:\r
+ ##\r
+ IF(${pkg_UC}_ROOT_DIR_EXP)\r
+ SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${${pkg_UC}_ROOT_DIR_EXP}") \r
+ IF(NOT _res)\r
+ MESSAGE(WARNING "Warning: ${pkg}: detected version conflicts with a previously found ${pkg}!"\r
+ " The two paths are " ${_tmp_ROOT_DIR} " vs " ${${pkg_UC}_ROOT_DIR_EXP})\r
+ ELSE()\r
+ MESSAGE(STATUS "${pkg} directory matches what was previously exposed by another prereq, all good!")\r
+ ENDIF() \r
+ ENDIF()\r
+ \r
+ ##\r
+ ## 6. Save the detected installation\r
+ ##\r
+ SET(${_envvar} "${_tmp_ROOT_DIR}")\r
+ \r
+ ELSE()\r
+ MESSAGE(STATUS "${pkg} was not found.") \r
+ ENDIF()\r
+ \r
+ SET(Salome${pkg}_FOUND "${pkg}_FOUND")\r
+ENDMACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS)\r
+\r
+\r
+####################################################################\r
+# SALOME_ADD_MPI_TO_HDF5()\r
+# \r
+# Overload the HDF5 flags so that they also contain MPI references.\r
+# This is to be used when HDF5 was compiled with MPI support;\r
+MACRO(SALOME_ADD_MPI_TO_HDF5) \r
+ SET(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS} ${MPI_INCLUDE_DIRS})\r
+ SET(HDF5_DEFINITIONS "${HDF5_DEFINITIONS} ${MPI_DEFINITIONS}")\r
+ SET(HDF5_LIBRARIES ${HDF5_LIBRARIES} ${MPI_LIBRARIES})\r
+ENDMACRO(SALOME_ADD_MPI_TO_HDF5)\r
+\r
+####################################################################\r
+# SALOME_TOHEXA()\r
+# Convert a number (smaller than 16) into hexadecimal representation\r
+# with a leading 0.\r
+MACRO(SALOME_TOHEXA num result)\r
+ SET(_hexa_map a b c d e f)\r
+ IF(${num} LESS 10)\r
+ SET(${result} "0${num}")\r
+ ELSE()\r
+ MATH(EXPR _res "${num}-10" )\r
+ LIST(GET _hexa_map ${_res} _out)\r
+ SET(${result} "0${_out}")\r
+ ENDIF()\r
+ENDMACRO(SALOME_TOHEXA)\r
+\r
+####################################################################\r
+# SALOME_XVERSION()\r
+# \r
+# Computes hexadecimal version of SALOME package\r
+#\r
+# USAGE: SALOME_XVERSION(package)\r
+#\r
+# ARGUMENTS:\r
+#\r
+# package: IN: SALOME package name\r
+#\r
+# The macro reads SALOME package version from PACKAGE_VERSION variable\r
+# (note package name in uppercase as assumed for SALOME modules);\r
+# hexadecimal version value in form 0xAABBCC (where AA, BB and CC are\r
+# major, minor and maintenance components of package version in\r
+# hexadecimal form) is put to the PACKAGE_XVERSION variable\r
+MACRO(SALOME_XVERSION pkg)\r
+ STRING(TOUPPER ${pkg} _pkg_UC)\r
+ IF(${_pkg_UC}_VERSION)\r
+ SET(_major)\r
+ SET(_minor)\r
+ SET(_patch)\r
+ SALOME_TOHEXA(${${_pkg_UC}_MAJOR_VERSION} _major)\r
+ SALOME_TOHEXA(${${_pkg_UC}_MINOR_VERSION} _minor)\r
+ SALOME_TOHEXA(${${_pkg_UC}_PATCH_VERSION} _patch)\r
+ SET(${_pkg_UC}_XVERSION "0x${_major}${_minor}${_patch}")\r
+ ENDIF()\r
+ENDMACRO(SALOME_XVERSION)\r
+\r
+\r
+#########################################################################\r
+# SALOME_ACCUMULATE_HEADERS()\r
+# \r
+# This macro is called in the various FindSalomeXYZ.cmake modules to accumulate\r
+# internally the list of include headers to be saved for future export. \r
+# The full set of include is saved in a variable called \r
+# _${PROJECT_NAME}_EXTRA_HEADERS\r
+#\r
+MACRO(SALOME_ACCUMULATE_HEADERS lst)\r
+ FOREACH(l IN LISTS ${lst})\r
+ LIST(FIND _${PROJECT_NAME}_EXTRA_HEADERS "${l}" _res)\r
+ IF(_res EQUAL "-1")\r
+ IF(NOT "${l}" STREQUAL "/usr/include")\r
+ LIST(APPEND _${PROJECT_NAME}_EXTRA_HEADERS "${l}")\r
+ ENDIF()\r
+ ENDIF()\r
+ ENDFOREACH()\r
+ENDMACRO(SALOME_ACCUMULATE_HEADERS)\r
+\r
+#########################################################################\r
+# SALOME_ACCUMULATE_ENVIRONMENT()\r
+# \r
+# USAGE: SALOME_ACCUMULATE_ENVIRONMENT(envvar value [value ...])\r
+#\r
+# ARGUMENTS:\r
+# envvar [in] environment variable name, e.g. PATH\r
+# value [in] value(s) to be added to environment variable\r
+#\r
+# This macro is called in the various FindSalomeXYZ.cmake modules to \r
+# accumulate environment variables, to be used later to run some command\r
+# in proper environment.\r
+#\r
+# 1. Each envrironment variable is stored in specific CMake variable\r
+# _${PROJECT_NAME}_EXTRA_ENV_<var>, where <var> is name of variable.\r
+# 2. Full list of environment variable names is stored in CMake variable\r
+# _${PROJECT_NAME}_EXTRA_ENV.\r
+#\r
+# Notes:\r
+# - The arguments list can include optional CHECK or NOCHECK keywords:\r
+# * For all arguments following CHECK keyword the macro perform an\r
+# additional check (see below); this is the default mode, it is suitable\r
+# for path variables (PATH, LD_LIBRARY_PATH, etc).\r
+# * For all arguments following NOCHECK keyword, no additional check is\r
+# performed.\r
+# Checking an argument means that we check:\r
+# - That the path actually exists\r
+# - That this is not a standard system path (starting with "/usr"); this avoids\r
+# polluting LD_LIBRARY_PATH or PATH with things like "/usr/lib64" ...\r
+#\r
+MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar)\r
+ SET(_is_check ON)\r
+ FOREACH(_item ${ARGN})\r
+ IF(${_item} STREQUAL "NOCHECK")\r
+ SET(_is_check OFF)\r
+ ELSEIF(${_item} STREQUAL "CHECK")\r
+ SET(_is_check ON)\r
+ ELSE()\r
+ IF(_is_check)\r
+ IF(NOT IS_DIRECTORY ${_item})\r
+ IF(TARGET ${_item})\r
+ GET_TARGET_PROPERTY(_item ${_item} LOCATION)\r
+ ENDIF() \r
+ GET_FILENAME_COMPONENT(_item ${_item} PATH)\r
+ ENDIF() \r
+ IF(EXISTS ${_item})\r
+ STRING(REGEX MATCH "^(/usr|/lib|/bin)" _usr_find ${_item})\r
+ LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)\r
+ IF(NOT _usr_find AND _res EQUAL -1)\r
+ LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item})\r
+ ENDIF() \r
+ ENDIF()\r
+ ELSE(_is_check)\r
+ LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)\r
+ IF( _res EQUAL -1)\r
+ LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item})\r
+ ENDIF() \r
+ ENDIF(_is_check)\r
+ ENDIF() \r
+ ENDFOREACH()\r
+ \r
+ LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res)\r
+ IF(_res EQUAL -1)\r
+ LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV ${envvar})\r
+ ENDIF()\r
+ SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "SET\(${PROJECT_NAME}_EXTRA_ENV ${_${PROJECT_NAME}_EXTRA_ENV}\)")\r
+ FOREACH(_res ${_${PROJECT_NAME}_EXTRA_ENV})\r
+ STRING(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}" _res_path "${_${PROJECT_NAME}_EXTRA_ENV_${_res}}")\r
+ SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "${_${PROJECT_NAME}_EXTRA_ENV_FULL}\nSET\(${PROJECT_NAME}_EXTRA_ENV_${_res} ${_res_path}\)")\r
+ ENDFOREACH()\r
+ENDMACRO(SALOME_ACCUMULATE_ENVIRONMENT)\r
+\r
+#########################################################################\r
+# SALOME_GENERATE_ENVIRONMENT_SCRIPT()\r
+# \r
+# USAGE: SALOME_GENERATE_ENVIRONMENT_SCRIPT(output script cmd opts)\r
+#\r
+# ARGUMENTS:\r
+# output [out] output command, e.g. for creation of target.\r
+# script [in] output environement script name\r
+# cmd [in] input command, e.g. sphinx or python command.\r
+# opts [in] options for input command (cmd).\r
+#\r
+# This macro is called when it's necessary to use given environment to run some command. \r
+# Macro generates environement script using previously created variables\r
+# _${PROJECT_NAME}_EXTRA_ENV_<var>, where <var> is name of variable and\r
+# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT);\r
+# and puts generated command in proper environment into <output> argument.\r
+# \r
+# Notes:\r
+# - If <script> is specified as relative path, it is computed from the current build\r
+# directory.\r
+#\r
+MACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT output script cmd opts)\r
+ IF(IS_ABSOLUTE ${script})\r
+ SET(_script ${script})\r
+ ELSE()\r
+ SET(_script ${CMAKE_CURRENT_BINARY_DIR}/${script})\r
+ ENDIF()\r
+\r
+ IF(WIN32)\r
+ SET(_ext "bat")\r
+ SET(_call_cmd "call")\r
+ ELSE()\r
+ SET(_ext "sh")\r
+ SET(_call_cmd ".")\r
+ ENDIF()\r
+ \r
+ SET(_env)\r
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})\r
+ FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})\r
+ IF(WIN32)\r
+ IF(${_item} STREQUAL "LD_LIBRARY_PATH")\r
+ SET(_item PATH)\r
+ ENDIF()\r
+ STRING(REPLACE "/" "\\" _env "${_env} @SET ${_item}=${_val};%${_item}%\n") \r
+ ELSE(WIN32)\r
+ SET(_env "${_env} export ${_item}=${_val}:\${${_item}}\n")\r
+ ENDIF(WIN32)\r
+ ENDFOREACH()\r
+ ENDFOREACH()\r
+ \r
+ SET(_script ${_script}.${_ext})\r
+ FILE(WRITE ${_script} "${_env}")\r
+ \r
+ SET(${output} ${_call_cmd} ${_script} && ${cmd} ${opts})\r
+ \r
+ENDMACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT)\r
+\r
+#########################################################################\r
+# SALOME_GENERATE_TESTS_ENVIRONMENT()\r
+# \r
+# USAGE: SALOME_GENERATE_TESTS_ENVIRONMENT(output)\r
+#\r
+# ARGUMENTS:\r
+# output [out] output environement variable.\r
+#\r
+# This macro generates <output> variable to use given environment to run some tests. \r
+# Macro generates environement variable using previously created variables\r
+# _${PROJECT_NAME}_EXTRA_ENV_<var>, where <var> is name of variable and\r
+# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT);\r
+# and puts this variable into <output> argument.\r
+#\r
+MACRO(SALOME_GENERATE_TESTS_ENVIRONMENT output)\r
+ SET(_env)\r
+ SET(_WIN_LD_LIBRARY OFF)\r
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})\r
+ IF(${_item} STREQUAL "LD_LIBRARY_PATH")\r
+ SET(_WIN_LD_LIBRARY ON)\r
+ ENDIF()\r
+ SET(_env_${_item})\r
+ FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})\r
+ IF(WIN32)\r
+ STRING(REPLACE "/" "\\" _val "${_val}")\r
+ SET(_env_${_item} "${_val};${_env_${_item}}")\r
+ ELSE()\r
+ SET(_env_${_item} "${_val}:${_env_${_item}}")\r
+ ENDIF()\r
+ ENDFOREACH()\r
+ ENDFOREACH()\r
+\r
+ IF(_WIN_LD_LIBRARY AND WIN32)\r
+ SET(_env_PATH "${_env_PATH}$ENV{LD_LIBRARY_PATH};${_env_LD_LIBRARY_PATH}")\r
+ ENDIF()\r
+\r
+ IF(WIN32)\r
+ SET(sep ",")\r
+ ELSE()\r
+ SET(sep ";")\r
+ ENDIF()\r
+ \r
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})\r
+ IF(WIN32)\r
+ IF(NOT ${_item} STREQUAL "LD_LIBRARY_PATH")\r
+ SET(_env "${_item}=$ENV{${_item}};${_env_${_item}}${sep}${_env}")\r
+ ENDIF()\r
+ ELSE()\r
+ STRING(REPLACE ";" ":" _iii "$ENV{${_item}}")\r
+ SET(_env "${_item}=${_iii}:${_env_${_item}}${sep}${_env}")\r
+ ENDIF()\r
+ ENDFOREACH()\r
+\r
+ # Get module name as substring of "Salome<ModuleName>"\r
+ STRING(REGEX MATCH "^Salome" _is_salome_project ${PROJECT_NAME})\r
+ IF(_is_salome_project)\r
+ STRING(SUBSTRING "${PROJECT_NAME}" 6 -1 PRNAME) \r
+ ELSE()\r
+ SET(PRNAME ${PROJECT_NAME})\r
+ ENDIF()\r
+ SET(_env "${PRNAME}_ROOT_DIR=${CMAKE_INSTALL_PREFIX}${sep}${_env}")\r
+ \r
+ # Creating follow string for Windows environement:\r
+ # "VAR1_ENV=1\;2\;3\;...\;...\;...;VAR2_ENV=1\;2\;3\;...\;...\;...;VAR3_ENV=1\;2\;3\;...\;...\;...;..."\r
+ IF(WIN32)\r
+ STRING(REGEX REPLACE "\\\\*;" "\\\\;" _env "${_env}")\r
+ STRING(REGEX REPLACE "\\\\*;*," ";" _env "${_env}")\r
+ ENDIF()\r
+\r
+ SET(${output} "${_env}")\r
+\r
+ENDMACRO(SALOME_GENERATE_TESTS_ENVIRONMENT) \r
+\r
+#########################################################################\r
+# SALOME_APPEND_LIST_OF_LIST()\r
+# \r
+# USAGE: SALOME_APPEND_LIST_OF_LIST(result element_list)\r
+#\r
+# Build a list of lists. The element_list is first parsed to convert it \r
+# from \r
+# a;b;c;d;e\r
+# to \r
+# a,b,c,d,e\r
+#\r
+# It is then added to the big list 'result'. Hence 'result' looks like:\r
+# a,b,c,d,e;f,g,h; ...\r
+#\r
+MACRO(SALOME_APPEND_LIST_OF_LIST result element_list)\r
+ SET(_tmp_res)\r
+ STRING(REPLACE ";" "," _tmp_res "${${element_list}}")\r
+\r
+ # Yet another CMake stupidity - LIST(LENGTH ";" var) returns 0\r
+ STRING(LENGTH result _list_len)\r
+ IF(NOT _list_len EQUAL 0)\r
+ SET(${result} "${${result}}${_tmp_res};") # LIST(APPEND ...) doesn't handle well empty elements!?\r
+ ELSE()\r
+ SET(${result} "${_tmp_res};") # to avoid redundant ';' at the beginning of the list\r
+ ENDIF()\r
+\r
+ENDMACRO(SALOME_APPEND_LIST_OF_LIST)\r
+\r
+#########################################################################\r
+# SALOME_CONFIGURE_PREPARE()\r
+# \r
+# USAGE: SALOME_CONFIGURE_PREPARE(pkg1 pkg2 ...)\r
+#\r
+# Prepare the variable that will be used to configure the file Salome<MODULE>Config.cmake,\r
+# namely:\r
+# - _PREREQ_LIST : the list of level 1 external prerequisites\r
+# - _PREREQ_DIR_LIST : their corresponding CMake directories (i.e. where the CMake configuration\r
+# file for this package can be found, if there is any!)\r
+# - _PREREQ_COMPO_LIST: the list of components requested when this package was invoked\r
+#\r
+# All this information is built from the package_list, the list of level 1 packages for this module.\r
+# Only the packages found in CONFIG mode are retained.\r
+#\r
+MACRO(SALOME_CONFIGURE_PREPARE)\r
+ SET(_tmp_prereq "${ARGV}")\r
+ SET(_PREREQ_LIST)\r
+ SET(_PREREQ_DIR_LIST)\r
+ SET(_PREREQ_COMPO_LIST)\r
+ FOREACH(_prereq IN LISTS _tmp_prereq)\r
+ IF(${_prereq}_DIR)\r
+ SET(_PREREQ_LIST "${_PREREQ_LIST} ${_prereq}")\r
+ FILE(TO_CMAKE_PATH ${${_prereq}_DIR} CURR_DIR)\r
+ SET(_PREREQ_DIR_LIST "${_PREREQ_DIR_LIST} \"${CURR_DIR}\"")\r
+ SALOME_APPEND_LIST_OF_LIST(_PREREQ_COMPO_LIST Salome${_prereq}_COMPONENTS)\r
+ ENDIF()\r
+ ENDFOREACH()\r
+ENDMACRO(SALOME_CONFIGURE_PREPARE)\r
+\r
+#######################################################################\r
+#\r
+# From a version string like "2.7.12+" extract the major, minor and patch number\r
+# taking ONLY the numerical part.\r
+# This macro was created to treat Ubuntu Python version number where the libs are\r
+# version 2.7.12+ and the interp is 2.7.12 ...\r
+#\r
+MACRO(SALOME_EXTRACT_VERSION version_string major minor patch)\r
+ IF(${version_string} MATCHES "[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.[0-9]+[^0-9]*")\r
+ STRING(REGEX REPLACE "^([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*\\.[0-9]+[^0-9]*" "\\1" ${major} "${version_string}")\r
+ STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*\\.[0-9]+[^0-9]*" "\\1" ${minor} "${version_string}")\r
+ STRING(REGEX REPLACE "^[0-9]+[^0-9]*\\.[0-9]+[^0-9]*\\.([0-9]+)[^0-9]*" "\\1" ${patch} "${version_string}")\r
+ ELSE()\r
+ MESSAGE("MACRO(SALOME_EXTRACT_VERSION ${version_string} ${major} ${minor} ${patch}")\r
+ MESSAGE(FATAL_ERROR "Problem parsing version string, I can't parse it properly.")\r
+ ENDIF()\r
+ENDMACRO(SALOME_EXTRACT_VERSION)\r
--- /dev/null
+# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2.1 of the License, or (at your option) any later version.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+#\r
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+#\r
+\r
+IF (QT_VERSION VERSION_LESS "5.0")\r
+ INCLUDE(${QT_USE_FILE})\r
+ENDIF()\r
+\r
+# This MACRO uses the following vars\r
+# - QT_LRELEASE_EXECUTABLE : (given by default by FindQT.cmake)\r
+#\r
+# tsfiles containing all ts files to be compiled.\r
+# installdir contains directory (relative to install_prefix) where to install files after compilation of ts files too qm.\r
+MACRO(QT_INSTALL_TS_RESOURCES tsfiles installdir)\r
+ FOREACH(_input ${tsfiles})\r
+ GET_FILENAME_COMPONENT(_name ${_input} NAME_WE)\r
+ SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_name}.qm)\r
+ SET(_cmd_${_name} ${QT_LRELEASE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${_input} -qm ${_output})\r
+ ADD_CUSTOM_TARGET(QT_INSTALL_TS_RESOURCES_${_name} ALL COMMAND ${_cmd_${_name}} DEPENDS ${_input})\r
+ INSTALL(FILES ${_output} DESTINATION ${installdir})\r
+ ENDFOREACH()\r
+ENDMACRO(QT_INSTALL_TS_RESOURCES)\r
+\r
+MACRO(QT_WRAP_MOC)\r
+IF (QT_VERSION VERSION_LESS "5.0")\r
+ QT4_WRAP_CPP(${ARGN})\r
+ELSE()\r
+ QT5_WRAP_CPP(${ARGN}) \r
+ # Workaround to avoid problem with bug in moc preprocessor:\r
+ # The problem is reproduced on Linux in case if native system Qt is installed\r
+ # and "-I/usr/include" parameter is presented in the moc command line before\r
+ # custom Qt includes. This bug takes place in Qt-5.6.0 and newer. To avoid this\r
+ # bug move "-I/usr/include" parameter in the "moc parameters" file to the end\r
+ # of the "include section".\r
+ IF (NOT WIN32)\r
+ FOREACH(IT ${ARGN})\r
+ GET_FILENAME_COMPONENT(IT ${IT} ABSOLUTE)\r
+ GET_FILENAME_COMPONENT(PFILE ${IT} NAME_WE)\r
+ SET(OUTFILE ${CMAKE_CURRENT_BINARY_DIR}/moc_${PFILE}.cpp_parameters)\r
+ IF(EXISTS ${OUTFILE}) \r
+ SET(NEW_CONTENT)\r
+ SET(IS_INCLUDE_SECTION TRUE)\r
+ SET(HAS_SYSTEM_INC FALSE)\r
+ FILE(READ ${OUTFILE} CONTENT)\r
+ STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}")\r
+ list(REMOVE_DUPLICATES CONTENT)\r
+ FOREACH(S ${CONTENT})\r
+ IF("${S}" MATCHES "^-I")\r
+ IF("${S}" STREQUAL "-I/usr/include")\r
+ SET(HAS_SYSTEM_INC TRUE)\r
+ ELSE()\r
+ SET(NEW_CONTENT ${NEW_CONTENT} "${S}\n")\r
+ ENDIF()\r
+ ELSE()\r
+ SET(IS_INCLUDE_SECTION FALSE)\r
+ ENDIF()\r
+ IF(NOT IS_INCLUDE_SECTION)\r
+ IF(HAS_SYSTEM_INC)\r
+ SET(NEW_CONTENT ${NEW_CONTENT} "-I/usr/include\n")\r
+ SET(HAS_SYSTEM_INC FALSE)\r
+ ENDIF()\r
+ SET(NEW_CONTENT ${NEW_CONTENT} "${S}\n")\r
+ ENDIF()\r
+ ENDFOREACH()\r
+ FILE(WRITE ${OUTFILE} ${NEW_CONTENT}) \r
+ ENDIF()\r
+ ENDFOREACH()\r
+ ENDIF()\r
+ENDIF()\r
+ENDMACRO(QT_WRAP_MOC)\r
+\r
+MACRO(QT_WRAP_UIC)\r
+IF (QT_VERSION VERSION_LESS "5.0")\r
+ QT4_WRAP_UI(${ARGN})\r
+ELSE()\r
+ QT5_WRAP_UI(${ARGN})\r
+ENDIF()\r
+ENDMACRO(QT_WRAP_UIC)\r
+\r
+MACRO(QT_ADD_RESOURCES)\r
+IF (QT_VERSION VERSION_LESS "5.0")\r
+ QT4_ADD_RESOURCES(${ARGN})\r
+ELSE()\r
+ QT5_ADD_RESOURCES(${ARGN})\r
+ENDIF()\r
+ENDMACRO(QT_ADD_RESOURCES)\r
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
PROJECT (SHAPER)
+# Ensure a proper linker behavior:
+CMAKE_POLICY(SET CMP0003 NEW)
+IF(WIN32)
+ CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib
+ENDIF(WIN32)
+
SET (SHAPER_Version 2.6.0)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
+INCLUDE(SalomeMacros)
+
INCLUDE(FindEclipse)
INCLUDE(Common)
-INCLUDE(FindQt)
+INCLUDE(FindSalomeQt5)
INCLUDE(FindPython)
INCLUDE(FindSalome)
INCLUDE(FindCAS)
mkdir %ROOT_DIR%\build
cd %ROOT_DIR%\build
-cmake %SRC_DIR% -G "Visual Studio 10 Win64" -DPYTHON_EXECUTABLE=%PYTHONHOME%\python_d.exe -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
+cmake %SRC_DIR% -G "Visual Studio 10 Win64" -DPYTHON_EXECUTABLE=%PYTHONHOME%\python.exe -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
start "" %MSVC_EXE% SHAPER.sln
@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_BUILD_TYPE=Debug
@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=OFF
@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install
-@SET CMAKE_ARGS=%CMAKE_ARGS% -DPYTHON_EXECUTABLE=%PYTHONHOME%\python_d.exe
+@SET CMAKE_ARGS=%CMAKE_ARGS% -DPYTHON_EXECUTABLE=%PYTHONHOME%\python.exe
@SET CMAKE_ARGS=%CMAKE_ARGS% %SRC_DIR%
cmake %CMAKE_ARGS%
INCLUDE(Common)
INCLUDE(UnitTest)
-SET(CMAKE_AUTOMOC ON)
SET(PROJECT_HEADERS
CollectionPlugin.h
GeomAlgoAPI
GeomValidators
ModuleBase
- XGUI
+ XGUI
)
ADD_DEFINITIONS(-DCOLLECTIONPLUGIN_EXPORTS ${CAS_DEFINITIONS})
${CAS_TKTopAlgo}
${CAS_TKXSBase}
${CAS_TKOffset}
+ ${CAS_TKShHealing}
)
ADD_DEFINITIONS(-DGEOMALGOAPI_EXPORTS ${CAS_DEFINITIONS})
#include <BRepTools.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <Geom2d_Curve.hxx>
-#include <Handle_Geom2d_Curve.hxx>
+#include <Geom2d_Curve.hxx>
#include <BRepLib_CheckCurveOnSurface.hxx>
#include <BRep_Tool.hxx>
#include <Geom_Plane.hxx>
#include <Events_InfoMessage.h>
-#include <QString>
-#include <QMap>
-
typedef std::map<std::string, GeomAbs_SurfaceType> FaceTypes;
static FaceTypes MyFaceTypes;
#include <ModelAPI_Events.h>
-IMPLEMENT_STANDARD_HANDLE(Model_Application, TDocStd_Application)
IMPLEMENT_STANDARD_RTTIEXT(Model_Application, TDocStd_Application)
static Handle_Model_Application TheApplication = new Model_Application;
// CASCADE RTTI
/// Definition of "Handles" usage
/// \param Model_Application is the class name that is covered by the OCCT Handle
- DEFINE_STANDARD_RTTI(Model_Application);
+ DEFINE_STANDARD_RTTIEXT(Model_Application, TDocStd_Application)
//! Retuns the application: one per process
MODEL_EXPORT static Handle_Model_Application getApplication();
#include <TDF_AttributeIterator.hxx>
#include <TDF_ChildIterator.hxx>
#include <TDF_RelocationTable.hxx>
+#include <TDF_DeltaOnAddition.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <BRep_Tool.hxx>
#include <TNaming_Builder.hxx>
#include <TNaming_Iterator.hxx>
+#include <TNaming_NamedShape.hxx>
#include <NCollection_List.hxx>
void Model_AttributeSelectionList::append(
#include <TDF_ListIteratorOfAttributeDeltaList.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
#include <TDF_LabelMap.hxx>
+#include <TDF_DeltaOnAddition.hxx>
#include <TNaming_SameShapeIterator.hxx>
#include <TNaming_Iterator.hxx>
#include <TNaming_NamedShape.hxx>
## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
INCLUDE(Common)
-SET(CMAKE_AUTOMOC ON)
+INCLUDE(UseQtExt)
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(${QT_INCLUDES})
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(PROJECT_HEADERS
ModuleBase.h
)
SET(PROJECT_LIBRARIES
+ ${QT_LIBRARIES}
Config
Events
ModelAPI
${ViewerData}
)
-SET(PROJECT_AUTOMOC
- ${CMAKE_CURRENT_BINARY_DIR}/ModuleBase_automoc.cpp
-)
+# sources / moc wrappings
+QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_HEADERS})
-#QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
#QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
)
ADD_DEFINITIONS(-DMODULEBASE_EXPORTS ${CAS_DEFINITIONS})
-ADD_LIBRARY(ModuleBase SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+ADD_LIBRARY(ModuleBase SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${PROJECT_AUTOMOC})
TARGET_LINK_LIBRARIES(ModuleBase GeomAPI ${PROJECT_LIBRARIES})
INSTALL(TARGETS ModuleBase DESTINATION ${SHAPER_INSTALL_BIN})
#include <ModuleBase_ViewerPrs.h>
#include <ModuleBase_Tools.h>
-IMPLEMENT_STANDARD_HANDLE(ModuleBase_FilterValidated, SelectMgr_Filter);
IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_FilterValidated, SelectMgr_Filter);
Standard_Boolean ModuleBase_FilterValidated::
Standard_EXPORT virtual
Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
- DEFINE_STANDARD_RTTI(ModuleBase_FilterValidated)
-
+ DEFINE_STANDARD_RTTIEXT(ModuleBase_FilterValidated, SelectMgr_Filter)
protected:
/// Instance of workshop interface
ModuleBase_IWorkshop* myWorkshop;
class ModuleBase_IWorkshop;
class ModelAPI_Result;
-class Handle_AIS_InteractiveObject;
+class AIS_InteractiveObject;
/**
* \ingroup GUI
/// Create specific for the module presentation
/// \param theResult an object for presentation
/// \return created presentation or NULL(default value)
- virtual Handle_AIS_InteractiveObject createPresentation(
+ virtual Handle(AIS_InteractiveObject) createPresentation(
const std::shared_ptr<ModelAPI_Result>& theResult);
//! Returns data object by AIS
#include <QList>
class ModuleBase_ViewerPrs;
-class Handle_SelectMgr_EntityOwner;
+class SelectMgr_EntityOwner;
/**
* \ingroup GUI
/// \param thePrs a container for selection
/// \param theOwner a selection owner
virtual void fillPresentation(std::shared_ptr<ModuleBase_ViewerPrs>& thePrs,
- const Handle_SelectMgr_EntityOwner& theOwner) const = 0;
+ const Handle(SelectMgr_EntityOwner)& theOwner) const = 0;
/**
* Returns list of features currently selected in object browser
virtual void selectedAISObjects(AIS_ListOfInteractive& theList) const = 0;
//! Returns list of currently selected QModelIndexes
- virtual ObjectPtr getSelectableObject(const Handle_SelectMgr_EntityOwner& theOwner) const = 0;
+ virtual ObjectPtr getSelectableObject(const Handle(SelectMgr_EntityOwner)& theOwner) const = 0;
//! Return the shape from the viewer presentation.
//! If the shape is equal to the shape of selected object, it returns an empty shape
#include <SelectMgr_SequenceOfOwner.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_SelectionManager.hxx>
-#include <StdPrs_WFDeflectionShape.hxx>
+#include <StdPrs_WFShape.hxx>
#include <StdSelect_BRepSelectionTool.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_Selection.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <TopExp_Explorer.hxx>
-IMPLEMENT_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner);
IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_BRepOwner, StdSelect_BRepOwner);
//*******************************************************************************************
-IMPLEMENT_STANDARD_HANDLE(ModuleBase_ResultPrs, ViewerData_AISShape);
IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ResultPrs, ViewerData_AISShape);
for (int i = 1; i <= theOwners.Length(); i++) {
anOwner = theOwners.Value(i);
aCompOwner = Handle(ModuleBase_BRepOwner)::DownCast(anOwner);
- if (aCompOwner.IsNull())
- anOwner->Hilight(thePM);
+ if (aCompOwner.IsNull()) {
+ // PORTING_TO_SALOME_8
+ //anOwner->Hilight(thePM);
+ }
else {
TopoDS_Shape aShape = aCompOwner->Shape();
Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( thePM );
aSelectionPrs->Clear();
- StdPrs_WFDeflectionShape::Add(aSelectionPrs, aShape, myDrawer);
+ StdPrs_WFShape::Add(aSelectionPrs, aShape, myDrawer);
aSelectionPrs->SetDisplayPriority(9);
- aSelectionPrs->Highlight(Aspect_TOHM_COLOR, aSelectionPrs->HighlightColor());
+ // PORTING_TO_SALOME_8
+ //aSelectionPrs->Highlight(Aspect_TOHM_COLOR, aSelectionPrs->HighlightColor());
aSelectionPrs->Display();
- thePM->Highlight(this);
+ // PORTING_TO_SALOME_8
+ //thePM->Highlight(this);
}
}
}
const Quantity_NameOfColor theColor,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
+ // PORTING_TO_SALOME_8
+ /*
Handle(StdSelect_BRepOwner) aOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
if (aOwner.IsNull())
return;
Handle( Prs3d_Presentation ) aHilightPrs = GetHilightPresentation( thePM );
aHilightPrs->Clear();
- StdPrs_WFDeflectionShape::Add(aHilightPrs, aShape, myDrawer);
+ StdPrs_WFShape::Add(aHilightPrs, aShape, myDrawer);
aHilightPrs->Highlight(Aspect_TOHM_COLOR, theColor);
if (thePM->IsImmediateModeOn())
thePM->AddToImmediateList(aHilightPrs);
- }
+ }*/
}
/// \param aMode a drawing mode
virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& aPM,
const Quantity_NameOfColor aCol, const Standard_Integer aMode = 0)
- { Selectable()->HilightOwnerWithColor(aPM, aCol, this); }
+ {
+ //PORTING_TO_SALOME_8
+ //Selectable()->HilightOwnerWithColor(aPM, aCol, this);
+ }
- DEFINE_STANDARD_RTTI(ModuleBase_BRepOwner)
+ DEFINE_STANDARD_RTTIEXT(ModuleBase_BRepOwner, StdSelect_BRepOwner)
};
/// \param thePriority a new priority value
Standard_EXPORT void setAdditionalSelectionPriority(const int thePriority);
- DEFINE_STANDARD_RTTI(ModuleBase_ResultPrs)
+ DEFINE_STANDARD_RTTIEXT(ModuleBase_ResultPrs, ViewerData_AISShape)
protected:
/// Redefinition of virtual function
Standard_EXPORT virtual void Compute(
#include <map>
-class Handle_AIS_InteractiveContext;
-
class QWidget;
class QLayout;
class QDoubleSpinBox;
#include <Geom_Curve.hxx>
#include <gp_Pln.hxx>
-IMPLEMENT_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
return aValid;
}
-IMPLEMENT_STANDARD_HANDLE(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(
Standard_EXPORT virtual
Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
- DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter)
+ DEFINE_STANDARD_RTTIEXT(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter)
protected:
/// Reference to workshop
Standard_EXPORT virtual
Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
- DEFINE_STANDARD_RTTI(ModuleBase_ShapeInPlaneFilter)
+ DEFINE_STANDARD_RTTIEXT(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter)
private:
/// Working plane
std::shared_ptr<GeomAPI_Pln> myPlane;
(myShape.get() && myShape->isEqual(thePrs->shape()));
bool isEqualIO = (myInteractive == thePrs->interactive()) == Standard_True;
- bool isEqualOwner = (myOwner.Access() == thePrs->owner().Access());
+ bool isEqualOwner = myOwner.get() == thePrs->owner().get();
if (isEqualResult && isEqualShape && isEqualIO &&
!isEqualOwner) { /// owners are different
// as we might loading object with the same shape in different modes like
(myShape.get() && myShape->isEqual(thePrs.shape()));
bool isEqualIO = (myInteractive == thePrs.interactive()) == Standard_True;
- bool isEqualOwner = (myOwner.Access() == thePrs.owner().Access());
+ bool isEqualOwner = myOwner.get() == thePrs.owner().get();
if (isEqualResult && isEqualShape && isEqualIO &&
!isEqualOwner) { /// owners are different
// as we might loading object with the same shape in different modes like
/// \param theOwner a selection owner
MODULEBASE_EXPORT ModuleBase_ViewerPrs(ObjectPtr theResult = ObjectPtr(),
const GeomShapePtr& theShape = GeomShapePtr(),
- Handle_SelectMgr_EntityOwner theOwner = NULL);
+ Handle(SelectMgr_EntityOwner) theOwner = NULL);
/// Destructor
MODULEBASE_EXPORT virtual ~ModuleBase_ViewerPrs();
#include <QScrollBar>
#include <QFontMetrics>
#include <QPainter>
+#include <QStyle>
+#include <QAbstractItemView>
#include <memory>
#include <string>
class ModuleBase_WidgetSelectorStore;
class ModelAPI_Validator;
class Config_WidgetAPI;
-class Handle_SelectMgr_EntityOwner;
//#define LIST_OF_VALID_PRS
INCLUDE(Common)
INCLUDE(UnitTest)
-SET(CMAKE_AUTOMOC ON)
+INCLUDE(UseQtExt)
+
+# additional include directories
+INCLUDE_DIRECTORIES(${QT_INCLUDES})
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(PROJECT_HEADERS
ParametersPlugin.h
# OPTIONS -extensions cpp -no-recursive
# )
-SET(PROJECT_AUTOMOC
- ${CMAKE_CURRENT_BINARY_DIR}/ParametersPlugin_automoc.cpp
-)
+#SET(PROJECT_AUTOMOC
+# ${CMAKE_CURRENT_BINARY_DIR}/ParametersPlugin_automoc.cpp
+#)
+# sources / moc wrappings
+QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_HEADERS})
SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${QM_RESOURCES})
SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
-ADD_LIBRARY(ParametersPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES} ${QM_RESOURCES})
+ADD_LIBRARY(ParametersPlugin MODULE
+ ${PROJECT_SOURCES}
+ ${PROJECT_HEADERS}
+ ${XML_RESOURCES}
+ ${TEXT_RESOURCES}
+ ${QM_RESOURCES}
+ ${PROJECT_AUTOMOC}
+)
TARGET_LINK_LIBRARIES(ParametersPlugin ${PROJECT_LIBRARIES})
## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
INCLUDE(Common)
+INCLUDE(UseQtExt)
-SET(CMAKE_AUTOMOC ON)
+# additional include directories
+INCLUDE_DIRECTORIES(${QT_INCLUDES})
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(PROJECT_HEADERS
PartSet.h
${CAS_SHAPE}
)
-SET(PROJECT_AUTOMOC
- ${CMAKE_CURRENT_BINARY_DIR}/PartSet_automoc.cpp
-)
+#SET(PROJECT_AUTOMOC
+# ${CMAKE_CURRENT_BINARY_DIR}/PartSet_automoc.cpp
+#)
+# sources / moc wrappings
+QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_HEADERS})
-QT4_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
+# sources / rcc wrappings
+QT_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
#QT4_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
#QT4_CREATE_TRANSLATION(QM_RESOURCES
# ${PROJECT_SOURCES}
${PROJECT_SOURCES}
${PROJECT_HEADERS}
${PROJECT_COMPILED_RESOURCES}
+ ${PROJECT_AUTOMOC}
# ${TEXT_RESOURCES}
# ${QM_RESOURCES}
)
#include <TopoDS_Shape.hxx>
#include <StdSelect_BRepOwner.hxx>
-IMPLEMENT_STANDARD_HANDLE(PartSet_FilterInfinite, SelectMgr_Filter);
IMPLEMENT_STANDARD_RTTIEXT(PartSet_FilterInfinite, SelectMgr_Filter);
PartSet_FilterInfinite::PartSet_FilterInfinite(ModuleBase_IWorkshop* theWorkshop)
Standard_EXPORT virtual Standard_Boolean
IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
- DEFINE_STANDARD_RTTI(PartSet_FilterInfinite)
+ DEFINE_STANDARD_RTTIEXT(PartSet_FilterInfinite, SelectMgr_Filter)
protected:
/// Reference to workshop
#include <StdSelect_BRepOwner.hxx>
-IMPLEMENT_STANDARD_HANDLE(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter);
IMPLEMENT_STANDARD_RTTIEXT(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter);
Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const
return aValid;
}
-IMPLEMENT_STANDARD_HANDLE(PartSet_CirclePointFilter, SelectMgr_Filter);
IMPLEMENT_STANDARD_RTTIEXT(PartSet_CirclePointFilter, SelectMgr_Filter);
Standard_Boolean
Standard_EXPORT virtual Standard_Boolean
IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
- DEFINE_STANDARD_RTTI(PartSet_GlobalFilter)
+ DEFINE_STANDARD_RTTIEXT(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter)
};
Standard_EXPORT virtual Standard_Boolean
IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
- DEFINE_STANDARD_RTTI(PartSet_CirclePointFilter)
+ DEFINE_STANDARD_RTTIEXT(PartSet_CirclePointFilter, SelectMgr_Filter)
private:
#include <Config_PropManager.h>
#include <Config_Keywords.h>
+#include <AIS_Dimension.hxx>
+#include <AIS_InteractiveObject.hxx>
#include <StdSelect_TypeOfFace.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <BRep_Tool.hxx>
-#include <AIS_Dimension.hxx>
#include <QObject>
#include <QMouseEvent>
#include <GeomAPI_IPresentable.h>
-#include <StdPrs_WFDeflectionShape.hxx>
+#include <StdPrs_WFShape.hxx>
#include <QList>
#include <SketchPlugin_SketchEntity.h>
#endif
-IMPLEMENT_STANDARD_HANDLE(PartSet_OperationPrs, ViewerData_AISShape);
IMPLEMENT_STANDARD_RTTIEXT(PartSet_OperationPrs, ViewerData_AISShape);
PartSet_OperationPrs::PartSet_OperationPrs(ModuleBase_IWorkshop* theWorkshop)
setWidth(aDrawer, aWidth);
}
}
- StdPrs_WFDeflectionShape::Add(thePresentation, aShape, aDrawer);
+ StdPrs_WFShape::Add(thePresentation, aShape, aDrawer);
}
Set(aComp);
if (!aReadyToDisplay) {
#include <Quantity_Color.hxx>
#include <NCollection_List.hxx>
+#include <NCollection_DataMap.hxx>
+#include <TopoDS_Shape.hxx>
+#include <AIS_InteractiveObject.hxx>
#include <QMap>
#include <QList>
DEFINE_STANDARD_HANDLE(PartSet_OperationPrs, ViewerData_AISShape)
class XGUI_Displayer;
-class Handle_AIS_InteractiveObject;
+class SelectMgr_Selection;
/**
* \ingroup GUI
/// Switch on using of the AIS presentation with of the shape object increased on the delta
void useAISWidth();
- DEFINE_STANDARD_RTTI(PartSet_OperationPrs)
+ DEFINE_STANDARD_RTTIEXT(PartSet_OperationPrs, ViewerData_AISShape)
protected:
/// Redefinition of virtual function
protected:
/// list of visualized shapes
/// \return a map of shapes
- NCollection_DataMap<TopoDS_Shape, Handle_AIS_InteractiveObject>& shapesMap();
+ NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>& shapesMap();
private:
/// Fills the map by the feature object and shapes, which should be visuaziled
#include <Prs3d_PointAspect.hxx>
#include <TopoDS_Builder.hxx>
#include <SelectMgr_SelectionManager.hxx>
-#include <StdPrs_WFDeflectionShape.hxx>
+#include <StdPrs_WFShape.hxx>
#include <StdSelect_BRepSelectionTool.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Prs3d_LineAspect.hxx>
//*******************************************************************************************
-IMPLEMENT_STANDARD_HANDLE(PartSet_ResultSketchPrs, ViewerData_AISShape);
IMPLEMENT_STANDARD_RTTIEXT(PartSet_ResultSketchPrs, ViewerData_AISShape);
PartSet_ResultSketchPrs::PartSet_ResultSketchPrs(ResultPtr theResult)
setAuxiliaryPresentationStyle(true);
Handle(Prs3d_Drawer) aDrawer = Attributes();
- StdPrs_WFDeflectionShape::Add(thePresentation, myAuxiliaryCompound, aDrawer);
+ StdPrs_WFShape::Add(thePresentation, myAuxiliaryCompound, aDrawer);
}
if (!aReadyToDisplay) {
/// \param theResult a result object
Standard_EXPORT PartSet_ResultSketchPrs(ResultPtr theResult);
- DEFINE_STANDARD_RTTI(PartSet_ResultSketchPrs)
+ DEFINE_STANDARD_RTTIEXT(PartSet_ResultSketchPrs, ViewerData_AISShape)
protected:
/// Redefinition of virtual function
Standard_EXPORT virtual void Compute(
class XGUI_OperationMgr;
class XGUI_Workshop;
-class Handle_AIS_InteractiveObject;
+class AIS_InteractiveObject;
class QMouseEvent;
/// Create specific for the module presentation
/// \param theResult an object for presentation
/// \return created presentation or NULL(default value)
- virtual Handle_AIS_InteractiveObject createPresentation(const ResultPtr& theResult);
+ virtual Handle(AIS_InteractiveObject) createPresentation(const ResultPtr& theResult);
/// Connects or disconnects to the value changed signal of the property panel widgets
/// \param theWidget a property contol widget
bool PartSet_Tools::hasVertexShape(const ModuleBase_ViewerPrsPtr& thePrs, FeaturePtr theSketch,
- Handle_V3d_View theView, double& theX, double& theY)
+ Handle(V3d_View) theView, double& theX, double& theY)
{
bool aHasVertex = false;
#include <memory>
-class Handle_V3d_View;
+class V3d_View;
class ModuleBase_ViewerPrs;
class ModuleBase_IWorkshop;
class GeomDataAPI_Point2D;
/// Converts the 2D screen point to the 3D point on the view according to the point of view
/// \param thePoint a screen point
/// \param theView a 3D view
- static gp_Pnt convertClickToPoint(QPoint thePoint, Handle_V3d_View theView);
+ static gp_Pnt convertClickToPoint(QPoint thePoint, Handle(V3d_View) theView);
/// \brief Converts the 3D point to the projected coodinates on the sketch plane.
/// \param thePoint the 3D point in the viewer
/// \param theY the output vertical coordinate of the point
static bool hasVertexShape(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs,
FeaturePtr theSketch,
- Handle_V3d_View theView, double& theX, double& theY);
+ Handle(V3d_View) theView, double& theX, double& theY);
/**
## Copyright (C) 2014-20xx OPEN CASCADE
-
-SET(CMAKE_AUTOMOC ON)
-
INSTALL(DIRECTORY geom model examples DESTINATION ${SHAPER_INSTALL_PYTHON_API})
INSTALL(FILES shaper.py DESTINATION ${SHAPER_INSTALL_PYTHON_API})
## Copyright (C) 2014-20xx OPEN CASCADE
-
-SET(CMAKE_AUTOMOC ON)
-
SET(TEXT_RESOURCES
PythonAddons_msg_en.ts
)
## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+INCLUDE(UseQtExt)
-SET(CMAKE_AUTOMOC ON)
+# additional include directories
+INCLUDE_DIRECTORIES(${QT_INCLUDES})
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(PROJECT_HEADERS
SHAPER_SHAPERGUI.h
SHAPERGUI_NestedButton.h
)
-SET(PROJECT_AUTOMOC
- ${CMAKE_CURRENT_BINARY_DIR}/SHAPERGUI_automoc.cpp
-)
+# sources / moc wrappings
+QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_HEADERS})
SET(PROJECT_SOURCES
SHAPERGUI.cpp
SET(PROJECT_LIBRARIES
Events
Config
- XGUI
- ModuleBase
- ${QT_LIBRARIES}
- ${suit}
- ${std}
- ${LightApp}
- ${CAM}
- ${OCCViewer}
- ${qtx}
- ${CAS_SHAPE}
+ XGUI
+ ModuleBase
+ ${QT_LIBRARIES}
+ ${suit}
+ ${std}
+ ${LightApp}
+ ${CAM}
+ ${OCCViewer}
+ ${qtx}
+ ${CAS_SHAPE}
)
ADD_DEFINITIONS( -DSHAPERGUI_EXPORTS ${CAS_DEFINITIONS} )
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/XGUI
- ${PROJECT_SOURCE_DIR}/src/Events
- ${PROJECT_SOURCE_DIR}/src/ModuleBase
+ ${PROJECT_SOURCE_DIR}/src/Events
+ ${PROJECT_SOURCE_DIR}/src/ModuleBase
${PROJECT_SOURCE_DIR}/src/ModelAPI
${PROJECT_SOURCE_DIR}/src/GeomAPI
${PROJECT_SOURCE_DIR}/src/Config
- ${PROJECT_SOURCE_DIR}/src/ExchangePlugin
- ${SALOME_GUI_INCLUDE}
- ${SALOME_KERNEL_INCLUDE}
+ ${PROJECT_SOURCE_DIR}/src/ExchangePlugin
+ ${SALOME_GUI_INCLUDE}
+ ${SALOME_KERNEL_INCLUDE}
${CAS_INCLUDE_DIRS}
)
ADD_LIBRARY(SHAPER SHARED
${PROJECT_SOURCES}
${PROJECT_HEADERS}
+ ${PROJECT_AUTOMOC}
)
ADD_DEPENDENCIES(SHAPER XGUI)
## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
INCLUDE(Common)
-SET(CMAKE_AUTOMOC ON)
+INCLUDE(UseQtExt)
+
+# additional include directories
+INCLUDE_DIRECTORIES(${QT_INCLUDES})
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(PROJECT_HEADERS
SamplePanelPlugin.h
SET(XML_RESOURCES
plugin-SamplePanel.xml
)
+# sources / moc wrappings
+QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_HEADERS})
ADD_DEFINITIONS(-DSAMPLEPANELPLUGIN_EXPORTS -DWNT)
-ADD_LIBRARY(SamplePanelPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES})
+ADD_LIBRARY(SamplePanelPlugin MODULE
+ ${PROJECT_SOURCES}
+ ${PROJECT_HEADERS}
+ ${XML_RESOURCES}
+ ${PROJECT_AUTOMOC})
+
TARGET_LINK_LIBRARIES(SamplePanelPlugin ${PROJECT_LIBRARIES})
INCLUDE_DIRECTORIES(
#include <Config_PropManager.h>
class SketchPlugin_Sketch;
-class Handle_AIS_InteractiveObject;
/**\class SketchPlugin_Feature
* \ingroup Plugins
// #define COMPILATION_CORRECTION
//#endif
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Angle, AIS_AngleDimension);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Angle, AIS_AngleDimension);
SketcherPrs_Angle::SketcherPrs_Angle(ModelAPI_Feature* theConstraint,
switch (anAngleType) {
case SketcherPrs_Tools::ANGLE_DIRECT: {
#ifndef COMPILATION_CORRECTION
- SetArrowVisible(Standard_False/*first*/, Standard_True/*second*/);
+ SetArrowsVisibility(AIS_TOAV_Second);
#endif
SetMeasuredGeometry(myFirstPoint, myCenterPoint, mySecondPoint);
#ifndef COMPILATION_CORRECTION
bool isReversedPlanes = isAnglePlaneReversedToSketchPlane();
- SetAngleReversed(!isReversedPlanes);
+ SetType(!isReversedPlanes ? AIS_TypeOfAngle::AIS_TOA_Exterior
+ : AIS_TypeOfAngle::AIS_TOA_Interior);
#endif
}
break;
gp_Vec(myCenterPoint, myFirstPoint).Normalized() * (-anEdge1Length));
SetMeasuredGeometry(aFirstPoint, myCenterPoint, mySecondPoint);
#ifndef COMPILATION_CORRECTION
- SetAngleReversed(false);
+ SetType(AIS_TypeOfAngle::AIS_TOA_Interior);
#endif
}
break;
case SketcherPrs_Tools::ANGLE_BACKWARD: {
#ifndef COMPILATION_CORRECTION
- SetArrowVisible(Standard_False/*first*/, Standard_True/*second*/);
+ SetArrowsVisibility(AIS_TypeOfAngleArrowVisibility::AIS_TOAV_Second);
#endif
SetMeasuredGeometry(myFirstPoint, myCenterPoint, mySecondPoint);
bool isReversedPlanes = isAnglePlaneReversedToSketchPlane();
#ifndef COMPILATION_CORRECTION
- SetAngleReversed(isReversedPlanes);
+ SetType(isReversedPlanes ? AIS_TypeOfAngle::AIS_TOA_Exterior
+ : AIS_TypeOfAngle::AIS_TOA_Interior);
#endif
}
break;
/// Destructor
Standard_EXPORT ~SketcherPrs_Angle();
- DEFINE_STANDARD_RTTI(SketcherPrs_Angle)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Angle, AIS_AngleDimension)
/// Returns true if the constraint feature arguments are correcly filled
/// to build AIS presentation
#include <Select3D_SensitivePoint.hxx>
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Coincident, AIS_InteractiveObject);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Coincident, AIS_InteractiveObject);
SketcherPrs_Coincident::SketcherPrs_Coincident(ModelAPI_Feature* theConstraint,
static bool IsReadyToDisplay(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Coincident)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Coincident, AIS_InteractiveObject)
protected:
/// Redefinition of virtual function
Standard_EXPORT virtual void Compute(
#include <Prs3d_Root.hxx>
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Collinear, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Collinear, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
/// \param thePlane a coordinate plane of current sketch
Standard_EXPORT SketcherPrs_Collinear(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Collinear)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Collinear, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
// Author: Natalia ERMOLAEVA
#include "SketcherPrs_DimensionStyleListener.h"
+#include <Prs3d_DimensionAspect.hxx>
#include "SketcherPrs_Tools.h"
#include <Events_Loop.h>
#include <Prs3d_Root.hxx>
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Equal, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Equal, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
/// \param thePlane a coordinate plane of current sketch
Standard_EXPORT SketcherPrs_Equal(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Equal)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Equal, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
#include <Prs3d_Root.hxx>
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
const std::shared_ptr<GeomAPI_Ax3>& thePlane,
bool isHorisontal);
- DEFINE_STANDARD_RTTI(SketcherPrs_HVDirection)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
static const gp_Pnt MyDefEnd(1,0,0);
static const gp_Pln MyDefPln(gp_Pnt(0,0,0), gp_Dir(0,0,1));
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_LengthDimension, AIS_LengthDimension);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_LengthDimension, AIS_LengthDimension);
SketcherPrs_LengthDimension::SketcherPrs_LengthDimension(ModelAPI_Feature* theConstraint,
myDistance(1),
myValue(0., false, "")
{
- SetDimensionAspect(SketcherPrs_Tools::createDimensionAspect());
+ // PORTING_TO_SALOME_8
+ // SetDimensionAspect(SketcherPrs_Tools::createDimensionAspect());
myStyleListener = new SketcherPrs_DimensionStyleListener();
}
// Update variable aspect parameters (depending on viewer scale)
double aTextSize = 0.0;
GetValueString(aTextSize);
- SketcherPrs_Tools::updateArrows(DimensionAspect(), GetValue(), aTextSize);
+
+ // PORTING_TO_SALOME_8
+ //SketcherPrs_Tools::updateArrows(DimensionAspect(), GetValue(), aTextSize);
// Update text visualization: parameter value or parameter text
myStyleListener->updateDimensions(this, myValue);
/// Destructor
Standard_EXPORT ~SketcherPrs_LengthDimension();
- DEFINE_STANDARD_RTTI(SketcherPrs_LengthDimension)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_LengthDimension, AIS_LengthDimension)
/// Returns true if the constraint feature arguments are correcly filled
/// to build AIS presentation
#include <Prs3d_Root.hxx>
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Middle, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Middle, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
/// \param thePlane a coordinate plane of current sketch
Standard_EXPORT SketcherPrs_Middle(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Middle)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Middle, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Mirror, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Mirror, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
/// \param thePlane a coordinate plane of current sketch
Standard_EXPORT SketcherPrs_Mirror(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Mirror)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Mirror, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Parallel, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Parallel, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
/// \param thePlane a coordinate plane of current sketch
Standard_EXPORT SketcherPrs_Parallel(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Parallel)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Parallel, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Perpendicular, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Perpendicular, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
Standard_EXPORT SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Perpendicular)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Perpendicular, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
static const gp_Circ MyDefCirc(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)), 1);
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Radius, AIS_RadiusDimension);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Radius, AIS_RadiusDimension);
SketcherPrs_Radius::SketcherPrs_Radius(ModelAPI_Feature* theConstraint,
myAnchorPoint(gp_Pnt(0, 0, 2)),
myValue(1, false, "")
{
- SetDimensionAspect(SketcherPrs_Tools::createDimensionAspect());
+ // PORTING_TO_SALOME_8
+ // SetDimensionAspect(SketcherPrs_Tools::createDimensionAspect());
myStyleListener = new SketcherPrs_DimensionStyleListener();
}
// Update variable aspect parameters (depending on viewer scale)
double aTextSize = 0.0;
GetValueString(aTextSize);
- SketcherPrs_Tools::updateArrows(DimensionAspect(), GetValue(), aTextSize);
+ // PORTING_TO_SALOME_8
+ //SketcherPrs_Tools::updateArrows(DimensionAspect(), GetValue(), aTextSize);
AIS_RadiusDimension::Compute(thePresentationManager, thePresentation, theMode);
/// Destructor
Standard_EXPORT ~SketcherPrs_Radius();
- DEFINE_STANDARD_RTTI(SketcherPrs_Radius)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Radius, AIS_RadiusDimension)
/// Returns true if the constraint feature arguments are correcly filled
/// to build AIS presentation
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Rigid, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Rigid, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Rigid)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Rigid, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
#define DEBUG_SENSITIVE_TO_BE_CORRECTED
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
SketcherPrs_SensitivePoint::SketcherPrs_SensitivePoint(
/// Clear sub-elements
Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
- DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity)
private:
int myId;
//**************************************************************
-//! Definition of call back
+// PORTING_TO_SALOME_8
+/*//! Definition of call back
OpenGl_Element* SymbolPrsCallBack(const CALL_DEF_USERDRAW * theUserDraw)
{
Handle(SketcherPrs_SymbolPrs) anIObj = (SketcherPrs_SymbolPrs*)theUserDraw->Data;
<< std::endl;
}
return new SketcherPrs_Element(anIObj);
-}
+}*/
//*****************************************************************************
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_SymbolPrs, AIS_InteractiveObject);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SymbolPrs, AIS_InteractiveObject);
aSelectionPrs->SetDisplayPriority(9);
aSelectionPrs->Display();
- thePM->Highlight(this);
+ // PORTING_TO_SALOME_8
+ //thePM->Highlight(this);
}
void SketcherPrs_SymbolPrs::HilightOwnerWithColor(
const Quantity_NameOfColor theColor,
const Handle(SelectMgr_EntityOwner)& theOwner)
{
+ // PORTING_TO_SALOME_8
+ /*
thePM->Color(this, theColor);
Handle( Prs3d_Presentation ) aHilightPrs = GetHilightPresentation( thePM );
if (thePM->IsImmediateModeOn())
thePM->AddToImmediateList(aHilightPrs);
+ */
}
void SketcherPrs_SymbolPrs::Compute(
Handle(OpenGl_GraphicDriver)::DownCast(aCtx->CurrentViewer()->Driver());
if (!aDriver.IsNull()) {
// register the custom element factory function
- aDriver->UserDrawCallback() = SymbolPrsCallBack;
+ // PORTING_TO_SALOME_8
+ //aDriver->UserDrawCallback() = SymbolPrsCallBack;
}
// Update points with default shift value
}
// Pint the group with custom procedure (see Render)
- aGroup->UserDraw(this, true);
+ // PORTING_TO_SALOME_8
+ //aGroup->UserDraw(this, true);
// Disable frustum culling for this object by marking it as mutable
aGroup->Structure()->SetMutable(true);
void SketcherPrs_SymbolPrs::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
+ // PORTING_TO_SALOME_8
+ /*
// this method is a combination of OCCT OpenGL functions. The main purpose is to have
// equal distance from the source object to symbol indpendently of zoom.
// It is base on OCCT 6.9.1 and might need changes when using later OCCT versions.
GetContext()->MainSelector()->RebuildSensitivesTree (this);
GetContext()->MainSelector()->RebuildObjectsTree (false);
}
+*/
}
/// \param theBndBox the common bounding box to update
Standard_EXPORT virtual void BoundingBox (Bnd_Box& theBndBox) Standard_OVERRIDE;
- DEFINE_STANDARD_RTTI(SketcherPrs_SymbolPrs)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_SymbolPrs, AIS_InteractiveObject)
protected:
/// Redefinition of virtual function
#include <StdPrs_DeflectionCurve.hxx>
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Tangent, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Tangent, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
Standard_EXPORT SketcherPrs_Tangent(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane);
- DEFINE_STANDARD_RTTI(SketcherPrs_Tangent)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Tangent, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
-#include <Prs3d_DimensionAspect.hxx>
+//#include <Prs3d_DimensionAspect.hxx>
#include <BRep_Tool.hxx>
#include <Precision.hxx>
Events_Loop::loop()->flush(anId);
}
-Handle(Prs3d_DimensionAspect) createDimensionAspect()
+/*Handle(Prs3d_DimensionAspect) createDimensionAspect()
{
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
anAspect->MakeArrows3d(false);
theDimAspect->SetArrowTailSize(theDimAspect->ArrowAspect()->Length());
// The value of vertical aligment is sometimes changed
theDimAspect->TextAspect()->SetVerticalJustification(Graphic3d_VTA_CENTER);
-}
+}*/
void sendEmptyPresentationError(ModelAPI_Feature* theFeature, const std::string theError)
{
#include <Events_Loop.h>
#include <Events_Message.h>
+// PORTING_TO_SALOME_8
+//class Handle_Prs3d_DimensionAspect;
+
class GeomDataAPI_Point2D;
class AIS_Dimension;
-class Handle_Prs3d_DimensionAspect;
//#define MyTextHeight 20
/// Creates an aspect to be shown in length/radius dimension presentations
/// \return an instance of aspect
- SKETCHERPRS_EXPORT Handle_Prs3d_DimensionAspect createDimensionAspect();
+ //SKETCHERPRS_EXPORT Handle_Prs3d_DimensionAspect createDimensionAspect();
/// Update variable aspect parameters (depending on viewer scale)
/// \param theDimAspect an aspect to be changed
/// \param theDimValue an arrow value
/// \param theTextSize an arrow value
- SKETCHERPRS_EXPORT void updateArrows(Handle_Prs3d_DimensionAspect theDimAspect,
- double theDimValue, double theTextSize);
+ //SKETCHERPRS_EXPORT void updateArrows(Handle_Prs3d_DimensionAspect theDimAspect,
+ // double theDimValue, double theTextSize);
/// Throws an exception(in debug mode) and sends a signal about necessity to hide the object
/// \param theFeature a feature where AIS presentation is empty
-IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Transformation, SketcherPrs_SymbolPrs);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Transformation, SketcherPrs_SymbolPrs);
static Handle(Image_AlienPixMap) MyPixMap;
const std::shared_ptr<GeomAPI_Ax3>& thePlane,
bool isTranslation);
- DEFINE_STANDARD_RTTI(SketcherPrs_Transformation)
+ DEFINE_STANDARD_RTTIEXT(SketcherPrs_Transformation, SketcherPrs_SymbolPrs)
/// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
/// \param theConstraint a constraint feature
## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+INCLUDE(UseQtExt)
-SET(CMAKE_AUTOMOC ON)
+# additional include directories
+INCLUDE_DIRECTORIES(${QT_INCLUDES})
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(PROJECT_HEADERS
XGUI.h
XGUI_WorkshopListener.h
)
-SET(PROJECT_AUTOMOC
- ${CMAKE_CURRENT_BINARY_DIR}/XGUI_automoc.cpp
-)
+# sources / moc wrappings
+QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_HEADERS})
SET(PROJECT_SOURCES
XGUI_ActionsMgr.cpp
SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} GL)
ENDIF()
-QT4_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
+QT_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
#QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
-
# QT4_CREATE_TRANSLATION(QM_RESOURCES
# ${PROJECT_SOURCES}
# ${TEXT_RESOURCES}
${TEXT_RESOURCES}
${QM_RESOURCES}
${PREFERENCES_XML}
+ ${PROJECT_AUTOMOC}
)
ADD_DEPENDENCIES(XGUI ModelAPI)
#include <QIcon>
#include <QBrush>
-#define ACTIVE_COLOR Qt::black
+#define ACTIVE_COLOR QColor(Qt::black)
//#define ACTIVE_COLOR QColor(0,72,140)
//#define PASSIVE_COLOR Qt::black
else {
Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(anAISPrs);
if (!aShapePrs.IsNull())
- ModuleBase_Tools::setPointBallHighlighting((AIS_Shape*) aShapePrs.Access());
+ ModuleBase_Tools::setPointBallHighlighting((AIS_Shape*) aShapePrs.get());
}
anAIS->setImpl(new Handle(AIS_InteractiveObject)(anAISPrs));
//anAIS->createShape(aShapePtr);
const SelectMgr_ListOfFilter& aFilters = aContext->Filters();
SelectMgr_ListIteratorOfListOfFilter aIt(aFilters);
for (; aIt.More() && !aFilterFound; aIt.Next()) {
- if (theFilter.Access() == aIt.Value().Access())
+ if (theFilter.get() == aIt.Value().get())
aFilterFound = true;
}
Handle(SelectMgr_CompositionFilter) aCompositeFilter = GetFilter();
if (!aCompositeFilter.IsNull()) {
const SelectMgr_ListOfFilter& aStoredFilters = aCompositeFilter->StoredFilters();
for (aIt.Initialize(aStoredFilters); aIt.More() && !aFilterFound; aIt.Next()) {
- if (theFilter.Access() == aIt.Value().Access())
+ if (theFilter.get() == aIt.Value().get())
aFilterFound = true;
}
}
const NCollection_DataMap<TopoDS_Shape,
NCollection_Map<Handle(AIS_InteractiveObject)>>& theShapesToBeSelected)
{
+ /*
+ // PORTING_TO_SALOME_8
Handle(AIS_LocalContext) aLContext = theContext->LocalContext();
TCollection_AsciiString aSelectionName = aLContext->SelectionName();
aLContext->UnhilightPicked(Standard_False);
QList<long> aSelectedIds; // Remember of selected address in order to avoid duplicates
for (; anOwnersIt.More(); anOwnersIt.Next()) {
anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value());
- if (aSelectedIds.contains((long)anOwner.Access()))
+ if (aSelectedIds.contains((long)anOwner.get()))
continue;
- aSelectedIds.append((long)anOwner.Access());
+ aSelectedIds.append((long)anOwner.get());
Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(anOwner);
if (!BROwnr.IsNull() && BROwnr->HasShape()) {
}
}
aLContext->HilightPicked(Standard_False);
+*/
}
#include <ModuleBase_Definitions.h>
#include <ModuleBase_IWorkshop.h>
-class Handle_AIS_InteractiveContext;
class XGUI_Workshop;
class XGUI_Displayer;
aState &= ~QStyle::State_MouseOver;
QStyleOptionViewItemV4* aOpt = (QStyleOptionViewItemV4*) aOptions;
aOpt->state = aState;
- QWindowsVistaStyle::drawPrimitive(theElement, aOpt, thePainter, theWidget);
+ QCommonStyle/*QWindowsVistaStyle*/::drawPrimitive(theElement, aOpt, thePainter, theWidget);
}
}
- QWindowsVistaStyle::drawPrimitive(theElement, theOption, thePainter, theWidget);
+ QCommonStyle/*QWindowsVistaStyle*/::drawPrimitive(theElement, theOption, thePainter, theWidget);
}
#endif
#if (!defined HAVE_SALOME) && (defined WIN32)
-#include <QWindowsVistaStyle>
-/**
+// PORTING_TO_SALOME_8
+//#include <QWindowsVistaStyle>
+#include <QCommonStyle>
+ /**
* \ingroup GUI
* Implementation of XGUI_DataTree custom style
*/
-class XGUI_TreeViewStyle : public QWindowsVistaStyle
+class XGUI_TreeViewStyle : public QCommonStyle // PORTING_TO_SALOME_8 QWindowsVistaStyle
{
Q_OBJECT
public:
- XGUI_TreeViewStyle() : QWindowsVistaStyle() {}
+ XGUI_TreeViewStyle() : QCommonStyle/*QWindowsVistaStyle*/() {}
void drawPrimitive(PrimitiveElement theElement, const QStyleOption* theOption,
QPainter* thePainter, const QWidget* theWidget = 0) const;
ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
- if (aSelectedIds.contains((long)anOwner.Access()))
+ if (aSelectedIds.contains((long)anOwner.get()))
continue;
- aSelectedIds.append((long)anOwner.Access());
+ aSelectedIds.append((long)anOwner.get());
fillPresentation(aPrs, anOwner);
for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
Handle(SelectMgr_EntityOwner) anOwner = aContext->DetectedOwner();
if (!anOwner.IsNull()) {
- if (aSelectedIds.contains((long)anOwner.Access()))
+ if (aSelectedIds.contains((long)anOwner.get()))
continue;
- aSelectedIds.append((long)anOwner.Access());
+ aSelectedIds.append((long)anOwner.get());
ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
fillPresentation(aPrs, anOwner);
#include <SelectMgr_IndexedMapOfOwner.hxx>
class XGUI_Workshop;
-class Handle_SelectMgr_EntityOwner;
+class SelectMgr_EntityOwner;
class ModuleBase_ViewerPrs;
/**
/// \param thePrs a container for selection
/// \param theOwner a selection owner
virtual void fillPresentation(std::shared_ptr<ModuleBase_ViewerPrs>& thePrs,
- const Handle_SelectMgr_EntityOwner& theOwner) const;
+ const Handle(SelectMgr_EntityOwner)& theOwner) const;
/// Returns a list of viewer highlited presentations
/// \return list of presentations
QFileDialog dialog(desktop());
dialog.setWindowTitle(tr("Select directory to save files..."));
dialog.setFileMode(QFileDialog::Directory);
- dialog.setFilter(tr("Directories (*)"));
+ // PORTING_TO_SALOME_8
+ dialog.selectNameFilter(tr("Directories (*)"));
+ //dialog.setFilter(tr("Directories (*)");
dialog.setOptions(QFileDialog::HideNameFilterDetails | QFileDialog::ShowDirsOnly);
dialog.setViewMode(QFileDialog::Detail);