From 48223481edb4c16c7363f7dbc7e7b75b92e07d88 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 28 Jul 2016 14:14:29 +0300 Subject: [PATCH] 1) Add new *.cmake files from the SALOME modules in the CONFIGURATION repository. 2) Udate several macros from GUI. --- cmake/FindBLSURFPLUGIN.cmake | 24 ++++++ cmake/FindGHS3DPRLPLUGIN.cmake | 24 ++++++ cmake/FindHYBRIDPLUGIN.cmake | 24 ++++++ cmake/FindHexoticPLUGIN.cmake | 24 ++++++ cmake/FindMESHGEMS.cmake | 63 ++++++++++++++ cmake/FindNetgen.cmake | 114 ++++++++++++++++++++++++++ cmake/FindSalomeBLSURFPLUGIN.cmake | 34 ++++++++ cmake/FindSalomeCALCULATOR.cmake | 34 ++++++++ cmake/FindSalomeCOMPONENT.cmake | 34 ++++++++ cmake/FindSalomeGHS3DPLUGIN.cmake | 34 ++++++++ cmake/FindSalomeGHS3DPRLPLUGIN.cmake | 34 ++++++++ cmake/FindSalomeHEXABLOCK.cmake | 34 ++++++++ cmake/FindSalomeHEXABLOCKPLUGIN.cmake | 34 ++++++++ cmake/FindSalomeHOMARD.cmake | 34 ++++++++ cmake/FindSalomeHYBRIDPLUGIN.cmake | 34 ++++++++ cmake/FindSalomeHexoticPLUGIN.cmake | 34 ++++++++ cmake/FindSalomeMESHGEMS.cmake | 26 ++++++ cmake/FindSalomeNETGENPLUGIN.cmake | 34 ++++++++ cmake/FindSalomeNetgen.cmake | 26 ++++++ cmake/FindSalomeQt5.cmake | 35 ++++++-- cmake/SalomeDocumentationMacros.cmake | 112 +++++++++++++++++++++++++ cmake/UsePyQt.cmake | 3 +- cmake/UseQtExt.cmake | 42 +++++++++- 23 files changed, 881 insertions(+), 10 deletions(-) create mode 100644 cmake/FindBLSURFPLUGIN.cmake create mode 100644 cmake/FindGHS3DPRLPLUGIN.cmake create mode 100644 cmake/FindHYBRIDPLUGIN.cmake create mode 100644 cmake/FindHexoticPLUGIN.cmake create mode 100644 cmake/FindMESHGEMS.cmake create mode 100644 cmake/FindNetgen.cmake create mode 100644 cmake/FindSalomeBLSURFPLUGIN.cmake create mode 100644 cmake/FindSalomeCALCULATOR.cmake create mode 100644 cmake/FindSalomeCOMPONENT.cmake create mode 100644 cmake/FindSalomeGHS3DPLUGIN.cmake create mode 100644 cmake/FindSalomeGHS3DPRLPLUGIN.cmake create mode 100644 cmake/FindSalomeHEXABLOCK.cmake create mode 100644 cmake/FindSalomeHEXABLOCKPLUGIN.cmake create mode 100644 cmake/FindSalomeHOMARD.cmake create mode 100644 cmake/FindSalomeHYBRIDPLUGIN.cmake create mode 100644 cmake/FindSalomeHexoticPLUGIN.cmake create mode 100644 cmake/FindSalomeMESHGEMS.cmake create mode 100644 cmake/FindSalomeNETGENPLUGIN.cmake create mode 100644 cmake/FindSalomeNetgen.cmake create mode 100644 cmake/SalomeDocumentationMacros.cmake diff --git a/cmake/FindBLSURFPLUGIN.cmake b/cmake/FindBLSURFPLUGIN.cmake new file mode 100644 index 0000000..5a4e383 --- /dev/null +++ b/cmake/FindBLSURFPLUGIN.cmake @@ -0,0 +1,24 @@ +# Copyright (C) 2013-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# + +SET(BLSURFPLUGIN_CXXFLAGS -I${BLSURFPLUGIN_ROOT_DIR}/include/salome) + +FIND_LIBRARY(BLSURFEngine BLSURFEngine ${BLSURFPLUGIN_ROOT_DIR}/lib/salome) +FIND_LIBRARY(BLSURFPluginGUI BLSURFPluginGUI ${BLSURFPLUGIN_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeIDLBLSURFPLUGIN SalomeIDLBLSURFPLUGIN ${BLSURFPLUGIN_ROOT_DIR}/lib/salome) diff --git a/cmake/FindGHS3DPRLPLUGIN.cmake b/cmake/FindGHS3DPRLPLUGIN.cmake new file mode 100644 index 0000000..2745a73 --- /dev/null +++ b/cmake/FindGHS3DPRLPLUGIN.cmake @@ -0,0 +1,24 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# + +SET(GHS3DPRLPLUGIN_CXXFLAGS -I${GHS3DPRLPLUGIN_ROOT_DIR}/include/salome) + +FIND_LIBRARY(GHS3DPRLEngine GHS3DPRLEngine ${GHS3DPRLPLUGIN_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GHS3DPRLPluginGUI GHS3DPRLPluginGUI ${GHS3DPRLPLUGIN_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeIDLGHS3DPRLPLUGIN SalomeIDLGHS3DPRLPLUGIN ${GHS3DPRLPLUGIN_ROOT_DIR}/lib/salome) diff --git a/cmake/FindHYBRIDPLUGIN.cmake b/cmake/FindHYBRIDPLUGIN.cmake new file mode 100644 index 0000000..8839b1f --- /dev/null +++ b/cmake/FindHYBRIDPLUGIN.cmake @@ -0,0 +1,24 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# + +SET(HYBRIDPLUGIN_CXXFLAGS -I${HYBRIDPLUGIN_ROOT_DIR}/include/salome) + +FIND_LIBRARY(HYBRIDEngine HYBRIDEngine ${HYBRIDPLUGIN_ROOT_DIR}/lib/salome) +FIND_LIBRARY(HYBRIDPluginGUI HYBRIDPluginGUI ${HYBRIDPLUGIN_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeIDLHYBRIDPLUGIN SalomeIDLHYBRIDPLUGIN ${HYBRIDPLUGIN_ROOT_DIR}/lib/salome) diff --git a/cmake/FindHexoticPLUGIN.cmake b/cmake/FindHexoticPLUGIN.cmake new file mode 100644 index 0000000..dc0c2ca --- /dev/null +++ b/cmake/FindHexoticPLUGIN.cmake @@ -0,0 +1,24 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# + +SET(HexoticPLUGIN_CXXFLAGS -I${HexoticPLUGIN_ROOT_DIR}/include/salome) + +FIND_LIBRARY(HexoticEngine HexoticEngine ${HexoticPLUGIN_ROOT_DIR}/lib/salome) +FIND_LIBRARY(HexoticPluginGUI HexoticPluginGUI ${HexoticPLUGIN_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeIDLHexoticPLUGIN SalomeIDLHexoticPLUGIN ${HexoticPLUGIN_ROOT_DIR}/lib/salome) diff --git a/cmake/FindMESHGEMS.cmake b/cmake/FindMESHGEMS.cmake new file mode 100644 index 0000000..079f0c3 --- /dev/null +++ b/cmake/FindMESHGEMS.cmake @@ -0,0 +1,63 @@ +# Copyright (C) 2013-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# + +# - Find MESHGEMS +# Sets the following variables: +# MESHGEMS_INCLUDE_DIRS - path to the MESHGEMS include directory +# MESHGEMS_LIBRARIES - path to the MESHGEMS libraries to be linked against + +# ------ + +MESSAGE(STATUS "Check for MESHGEMS ...") + +# ------ + +SET(MESHGEMS_ROOT_DIR $ENV{MESHGEMS_ROOT_DIR}) + +IF(MESHGEMS_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${MESHGEMS_ROOT_DIR}") +ENDIF(MESHGEMS_ROOT_DIR) + +FIND_PATH(MESHGEMS_INCLUDE_DIRS meshgems/cadsurf.h PATH_SUFFIXES include) + +IF(MACHINE_IS_64) + SET(_suff "_64") +ELSE() + SET(_suff) +ENDIF(MACHINE_IS_64) +IF(WIN32) + SET(_plt WinXP${_suff}_VC9 WinXP${_suff}_VC10) +ELSE() + SET(_plt Linux${_suff}) +ENDIF(WIN32) + +FIND_LIBRARY(MESHGEMS_LIBRARY_mg-cadsurf NAMES mg-cadsurf PATH_SUFFIXES ${_plt}) +FIND_LIBRARY(MESHGEMS_LIBRARY_mg-precad NAMES mg-precad PATH_SUFFIXES ${_plt}) +FIND_LIBRARY(MESHGEMS_LIBRARY_meshgems NAMES meshgems PATH_SUFFIXES ${_plt}) + +# TODO: search all components +SET(MESHGEMS_LIBRARIES) +SET(MESHGEMS_LIBRARIES ${MESHGEMS_LIBRARIES} ${MESHGEMS_LIBRARY_mg-cadsurf}) +SET(MESHGEMS_LIBRARIES ${MESHGEMS_LIBRARIES} ${MESHGEMS_LIBRARY_mg-precad}) +IF(MESHGEMS_LIBRARY_meshgems) + SET(MESHGEMS_LIBRARIES ${MESHGEMS_LIBRARIES} ${MESHGEMS_LIBRARY_meshgems}) +ENDIF(MESHGEMS_LIBRARY_meshgems) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(MESHGEMS REQUIRED_VARS MESHGEMS_INCLUDE_DIRS MESHGEMS_LIBRARIES) diff --git a/cmake/FindNetgen.cmake b/cmake/FindNetgen.cmake new file mode 100644 index 0000000..51db700 --- /dev/null +++ b/cmake/FindNetgen.cmake @@ -0,0 +1,114 @@ +# - Find NETGEN +# Sets the following variables: +# NETGEN_INCLUDE_DIRS - path to the NETGEN include directories +# NETGEN_LIBRARIES - path to the NETGEN libraries to be linked against +# + +######################################################################### +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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, or (at your option) any later version. +# +# 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 Netgen_FIND_QUIETLY) + MESSAGE(STATUS "Check for Netgen ...") +ENDIF() + +# ------ + +SET(NETGEN_ROOT_DIR $ENV{NETGEN_ROOT_DIR}) + +IF(NETGEN_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${NETGEN_ROOT_DIR}") +ENDIF(NETGEN_ROOT_DIR) + +FIND_PATH(_netgen_base_inc_dir nglib.h) +SET(NETGEN_INCLUDE_DIRS ${_netgen_base_inc_dir}) +FIND_PATH(_netgen_add_inc_dir occgeom.hpp HINTS ${_netgen_base_inc_dir} PATH_SUFFIXES share/netgen/include) +LIST(APPEND NETGEN_INCLUDE_DIRS ${_netgen_add_inc_dir}) +LIST(REMOVE_DUPLICATES NETGEN_INCLUDE_DIRS) + +FIND_LIBRARY(NETGEN_nglib NAMES nglib) +IF(WIN32) + FIND_LIBRARY(NETGEN_csg NAMES csg) + FIND_LIBRARY(NETGEN_gen NAMES gen) + FIND_LIBRARY(NETGEN_geom2d NAMES geom2d) + FIND_LIBRARY(NETGEN_gprim NAMES gprim) + FIND_LIBRARY(NETGEN_interface NAMES interface) + FIND_LIBRARY(NETGEN_la NAMES la) + FIND_LIBRARY(NETGEN_mesh NAMES mesh) + FIND_LIBRARY(NETGEN_occ NAMES occ) + FIND_LIBRARY(NETGEN_stl NAMES stl) +ENDIF(WIN32) + +SET(NETGEN_LIBRARIES ${NETGEN_nglib}) + +IF(WIN32) + SET(NETGEN_LIBRARIES ${NETGEN_LIBRARIES} + ${NETGEN_csg} + ${NETGEN_gen} + ${NETGEN_geom2d} + ${NETGEN_gprim} + ${NETGEN_interface} + ${NETGEN_la} + ${NETGEN_mesh} + ${NETGEN_occ} + ${NETGEN_stl} + ) +ENDIF(WIN32) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETGEN REQUIRED_VARS NETGEN_INCLUDE_DIRS NETGEN_LIBRARIES) + +INCLUDE(CheckCXXSourceCompiles) + +IF(NETGEN_FOUND) + + SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} ${NETGEN_INCLUDE_DIRS}") + SET(CMAKE_REQUIRED_LIBRARIES "${NETGEN_LIBRARIES}") + CHECK_CXX_SOURCE_COMPILES(" + #include + + int main() + { + netgen::Mesh* ngMesh; + ngMesh->CalcLocalH(1.0); + } +" NETGEN_V5 + ) + + IF(NOT Netgen_FIND_QUIETLY) + MESSAGE(STATUS "Netgen library: ${NETGEN_LIBRARIES}") + ENDIF() + SET(NETGEN_DEFINITIONS "-DOCCGEOMETRY") + + IF(NETGEN_V5) + MESSAGE(STATUS "NETGEN V5 or later found") + SET(NETGEN_DEFINITIONS "${NETGEN_DEFINITIONS} -DNETGEN_V5") + ENDIF(NETGEN_V5) + + #RNV: currently on windows use netgen without thread support. + #TODO: check support of the multithreading on windows + IF(WIN32) + SET(NETGEN_DEFINITIONS "${NETGEN_DEFINITIONS} -DNO_PARALLEL_THREADS") + ENDIF(WIN32) +ENDIF() diff --git a/cmake/FindSalomeBLSURFPLUGIN.cmake b/cmake/FindSalomeBLSURFPLUGIN.cmake new file mode 100644 index 0000000..d0dafc7 --- /dev/null +++ b/cmake/FindSalomeBLSURFPLUGIN.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 SalomeBLSURFPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome BLSURFPLUGIN ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${BLSURFPLUGIN_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeBLSURFPLUGIN SalomeBLSURFPLUGIN CONFIG) + +IF(NOT SalomeBLSURFPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome BLSURFPLUGIN: ${BLSURFPLUGIN_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeBLSURFPLUGIN_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeBLSURFPLUGIN_EXTRA_ENV_${_res}}") +ENDFOREACH() diff --git a/cmake/FindSalomeCALCULATOR.cmake b/cmake/FindSalomeCALCULATOR.cmake new file mode 100644 index 0000000..e33c452 --- /dev/null +++ b/cmake/FindSalomeCALCULATOR.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 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, or (at your option) any later version. +# +# 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 SalomeCALCULATOR_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome CALCULATOR ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${CALCULATOR_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeCALCULATOR SalomeCALCULATOR CONFIG) + +IF(NOT SalomeCALCULATOR_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome CALCULATOR: ${CALCULATOR_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeCALCULATOR_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeCALCULATOR_EXTRA_ENV_${_res}}") +ENDFOREACH() diff --git a/cmake/FindSalomeCOMPONENT.cmake b/cmake/FindSalomeCOMPONENT.cmake new file mode 100644 index 0000000..f4953b7 --- /dev/null +++ b/cmake/FindSalomeCOMPONENT.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 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, or (at your option) any later version. +# +# 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 SalomeCOMPONENT_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome COMPONENT ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${COMPONENT_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeCOMPONENT SalomeCOMPONENT CONFIG) + +IF(NOT SalomeCOMPONENT_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome COMPONENT: ${COMPONENT_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeCOMPONENT_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeCOMPONENT_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeGHS3DPLUGIN.cmake b/cmake/FindSalomeGHS3DPLUGIN.cmake new file mode 100644 index 0000000..1364088 --- /dev/null +++ b/cmake/FindSalomeGHS3DPLUGIN.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 SalomeGHS3DPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome GHS3DPLUGIN ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${GHS3DPLUGIN_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeGHS3DPLUGIN SalomeGHS3DPLUGIN CONFIG) + +IF(NOT SalomeGHS3DPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome GHS3DPLUGIN: ${GHS3DPLUGIN_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeGHS3DPLUGIN_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeGHS3DPLUGIN_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeGHS3DPRLPLUGIN.cmake b/cmake/FindSalomeGHS3DPRLPLUGIN.cmake new file mode 100644 index 0000000..afc34cc --- /dev/null +++ b/cmake/FindSalomeGHS3DPRLPLUGIN.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 SalomeGHS3DPRLPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome GHS3DPRLPLUGIN ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${GHS3DPRLPLUGIN_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeGHS3DPRLPLUGIN SalomeGHS3DPRLPLUGIN CONFIG) + +IF(NOT SalomeGHS3DPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome GHS3DPRLPLUGIN: ${GHS3DPRLPLUGIN_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeGHS3DPRLPLUGIN_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeGHS3DPRLPLUGIN_EXTRA_ENV_${_res}}") +ENDFOREACH() diff --git a/cmake/FindSalomeHEXABLOCK.cmake b/cmake/FindSalomeHEXABLOCK.cmake new file mode 100644 index 0000000..6c82681 --- /dev/null +++ b/cmake/FindSalomeHEXABLOCK.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 SalomeHEXABLOCK_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome HEXABLOCK ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${HEXABLOCK_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeHEXABLOCK SalomeHEXABLOCK CONFIG) + +IF(NOT SalomeHEXABLOCK_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome HEXABLOCK: ${HEXABLOCK_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeHEXABLOCK_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeHEXABLOCK_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeHEXABLOCKPLUGIN.cmake b/cmake/FindSalomeHEXABLOCKPLUGIN.cmake new file mode 100644 index 0000000..6b4c31e --- /dev/null +++ b/cmake/FindSalomeHEXABLOCKPLUGIN.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 SalomeHEXABLOCKPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome HEXABLOCKPLUGIN ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${HEXABLOCKPLUGIN_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeHEXABLOCKPLUGIN SalomeHEXABLOCKPLUGIN CONFIG) + +IF(NOT SalomeHEXABLOCKPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome HEXABLOCKPLUGIN: ${HEXABLOCKPLUGIN_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeHEXABLOCKPLUGIN_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeHEXABLOCKPLUGIN_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeHOMARD.cmake b/cmake/FindSalomeHOMARD.cmake new file mode 100644 index 0000000..8ff273a --- /dev/null +++ b/cmake/FindSalomeHOMARD.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 SalomeHOMARD_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome HOMARD ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${HOMARD_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeHOMARD SalomeHOMARD CONFIG) + +IF(NOT SalomeHOMARD_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome HOMARD: ${HOMARD_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeHOMARD_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeHOMARD_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeHYBRIDPLUGIN.cmake b/cmake/FindSalomeHYBRIDPLUGIN.cmake new file mode 100644 index 0000000..0e22795 --- /dev/null +++ b/cmake/FindSalomeHYBRIDPLUGIN.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 SalomeHYBRIDPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome HYBRIDPLUGIN ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${HYBRIDPLUGIN_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeHYBRIDPLUGIN SalomeHYBRIDPLUGIN CONFIG) + +IF(NOT SalomeHYBRIDPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome HYBRIDPLUGIN: ${HYBRIDPLUGIN_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeHYBRIDPLUGIN_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeHYBRIDPLUGIN_EXTRA_ENV_${_res}}") +ENDFOREACH() diff --git a/cmake/FindSalomeHexoticPLUGIN.cmake b/cmake/FindSalomeHexoticPLUGIN.cmake new file mode 100644 index 0000000..9776340 --- /dev/null +++ b/cmake/FindSalomeHexoticPLUGIN.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 SalomeHexoticPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome HexoticPLUGIN ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${HexoticPLUGIN_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeHexoticPLUGIN SalomeHexoticPLUGIN CONFIG) + +IF(NOT SalomeHexoticPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome HexoticPLUGIN: ${HexoticPLUGIN_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeHexoticPLUGIN_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeHexoticPLUGIN_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeMESHGEMS.cmake b/cmake/FindSalomeMESHGEMS.cmake new file mode 100644 index 0000000..1eadf6f --- /dev/null +++ b/cmake/FindSalomeMESHGEMS.cmake @@ -0,0 +1,26 @@ +# Copyright (C) 2013-2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(MESHGEMS MESHGEMS_INCLUDE_DIRS 1) +MARK_AS_ADVANCED(MESHGEMS_INCLUDE_DIRS MESHGEMS_LIBRARIES) + +IF(MESHGEMS_FOUND) + SALOME_ACCUMULATE_HEADERS(MESHGEMS_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MESHGEMS_LIBRARIES}) +ENDIF() diff --git a/cmake/FindSalomeNETGENPLUGIN.cmake b/cmake/FindSalomeNETGENPLUGIN.cmake new file mode 100644 index 0000000..9bc1d34 --- /dev/null +++ b/cmake/FindSalomeNETGENPLUGIN.cmake @@ -0,0 +1,34 @@ +# Copyright (C) 2007-2016 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, or (at your option) any later version. +# +# 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 SalomeNETGENPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome NETGENPLUGIN ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${NETGENPLUGIN_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeNETGENPLUGIN SalomeNETGENPLUGIN CONFIG) + +IF(NOT SalomeNETGENPLUGIN_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome NETGENPLUGIN: ${NETGENPLUGIN_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeNETGENPLUGIN_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeNETGENPLUGIN_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeNetgen.cmake b/cmake/FindSalomeNetgen.cmake new file mode 100644 index 0000000..b640634 --- /dev/null +++ b/cmake/FindSalomeNetgen.cmake @@ -0,0 +1,26 @@ +# Copyright (C) 2013-2016 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, or (at your option) any later version. +# +# 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 +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Netgen NETGEN_INCLUDE_DIRS 1) +MARK_AS_ADVANCED(NETGEN_INCLUDE_DIRS NETGEN_LIBRARIES) + +IF(NETGEN_FOUND) + SALOME_ACCUMULATE_HEADERS(NETGEN_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${NETGEN_LIBRARIES}) +ENDIF() diff --git a/cmake/FindSalomeQt5.cmake b/cmake/FindSalomeQt5.cmake index 31168f3..8e723d0 100644 --- a/cmake/FindSalomeQt5.cmake +++ b/cmake/FindSalomeQt5.cmake @@ -26,18 +26,38 @@ # Qt5_FIND_COMPONENTS variable is set here to prevent ParaView to reset list of Qt5 modules, # just to avoid extra dependencies -SET(Qt5_FIND_COMPONENTS Core Gui Widgets Network Xml OpenGL PrintSupport WebKit WebKitWidgets Help Test Sql Sensors Positioning Quick Qml Multimedia MultimediaWidgets WebChannel UiTools) - -IF(NOT WIN32) - LIST(APPEND Qt5_FIND_COMPONENTS X11Extras) -ENDIF() SET(QT_INCLUDES) SET(QT_DEFINITIONS) SET(QT_LIBRARIES) +# Find Qt5Core to get Qt version +SET(Qt5_FIND_COMPONENTS QtCore) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Core Qt5Core_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +IF(Qt5Core_FOUND) + LIST(APPEND QT_INCLUDES ${Qt5Core_INCLUDE_DIRS}) + LIST(APPEND QT_DEFINITIONS ${Qt5Core_DEFINITIONS}) + LIST(APPEND QT_LIBRARIES ${Qt5Core_LIBRARIES}) + SET(QT_VERSION "${Qt5Core_VERSION}") +ENDIF() + +SET(Qt5_FIND_COMPONENTS Gui Widgets Network Xml OpenGL PrintSupport Help Test Sql Sensors Positioning Quick Qml Multimedia MultimediaWidgets WebChannel UiTools) -FOREACH(_Qt5_COMPONENT ${Qt5_FIND_COMPONENTS}) - SET(_Qt5_COMPONENT Qt5${_Qt5_COMPONENT}) +IF ("${QT_VERSION}" VERSION_LESS "5.6.0") + LIST(APPEND Qt5_FIND_COMPONENTS WebKit WebKitWidgets) +ELSE() + LIST(APPEND Qt5_OPTIONAL_COMPONENTS WebEngine WebEngineWidgets) +ENDIF() + +IF(NOT WIN32) + LIST(APPEND Qt5_FIND_COMPONENTS X11Extras) +ENDIF() + +FOREACH(_Qt5_COMPONENT_ ${Qt5_FIND_COMPONENTS} ${Qt5_OPTIONAL_COMPONENTS}) + SET(_Qt5_COMPONENT Qt5${_Qt5_COMPONENT_}) + LIST(FIND Qt5_OPTIONAL_COMPONENTS ${_Qt5_COMPONENT_} idx) + IF(${idx} GREATER -1) + SET(Salome${_Qt5_COMPONENT}_FIND_QUIETLY TRUE) + ENDIF() SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(${_Qt5_COMPONENT} ${_Qt5_COMPONENT}_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) LIST(APPEND QT_INCLUDES ${${_Qt5_COMPONENT}_INCLUDE_DIRS}) LIST(APPEND QT_DEFINITIONS ${${_Qt5_COMPONENT}_DEFINITIONS}) @@ -64,7 +84,6 @@ IF(Qt5Core_FOUND) SALOME_ACCUMULATE_HEADERS(QT_INCLUDES) SALOME_ACCUMULATE_ENVIRONMENT(PATH ${LINGUIST_PATH}) SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Qt5Core_LIBRARIES}) - SET(QT_VERSION "${Qt5Core_VERSION}") GET_FILENAME_COMPONENT(Qt5_DIR ${Qt5Core_DIR} PATH) FILE(TO_NATIVE_PATH "${Qt5_DIR}/Qt5" Qt5_DIR) SET(SalomeQt5_COMPONENTS ${Qt5_FIND_COMPONENTS}) diff --git a/cmake/SalomeDocumentationMacros.cmake b/cmake/SalomeDocumentationMacros.cmake new file mode 100644 index 0000000..b23f251 --- /dev/null +++ b/cmake/SalomeDocumentationMacros.cmake @@ -0,0 +1,112 @@ +# Copyright (C) 2013-2016 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, or (at your option) any later version. +# +# 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 +# +# Author: Roman NIKOLAEV +# + +#---------------------------------------------------------------------------- +# SALOME_ADD_SPHINX_DOC is a macro useful for generating sphinx documentation +# +# USAGE: SALOME_ADD_SPHINX_DOC(sphinx_type sphinx_name src_dir cfg_dir) +# +# ARGUMENTS: +# +# sphinx_type: IN - type of the sphinx generator, use one of the following types: +# +# html - to make standalone HTML files +# dirhtml - to make HTML files named index.html in directories +# singlehtml - to make a single large HTML file +# pickle - to make pickle files +# json - to make JSON files +# htmlhelp - to make HTML files and a HTML help project +# qthelp - to make HTML files and a qthelp project" +# devhelp to make HTML files and a Devhelp project" +# epub to make an epub" +# latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter +# latexpdf to make LaTeX files and run them through pdflatex" +# text to make text files" +# man to make manual pages" +# texinfo to make Texinfo files" +# info to make Texinfo files and run them through makeinfo +# gettext to make PO message catalogs" +# changes to make an overview of all changed/added/deprecated items +# linkcheck to check all external links for integrity" +# doctest to run all doctests embedded in the documentation (if enabled)\ +# +# sphinx_name: IN - documentation target name +# +# src_dir : IN - path to directory that contains the sphinx source files +# +# cfg_dir : IN - path to directory that contains sphinx configuration file (if not specified, +# it is considered equal to src_dir) +# +# ADDITIONAL SETTINGS: +# +# Also you can set these variables to define additional sphinx settings: +# +# SPHINXOPTS - sphinx executable options +# PAPER - LaTeX paper type ("a4" by default) +# BUILDDIR - local sphinx build directory ("_build" by default) +#---------------------------------------------------------------------------- + +MACRO(SALOME_ADD_SPHINX_DOC sphinx_type sphinx_name src_dir cfg_dir) + + # Get type and additional settings + SET(SPHINX_TYPE ${sphinx_type}) + IF(${SPHINX_TYPE} STREQUAL "") + SET(SPHINX_TYPE html) + ENDIF(${SPHINX_TYPE} STREQUAL "") + + IF("${PAPER}" STREQUAL "") + SET(PAPER a4) + ENDIF() + + IF("${BUILDDIR}" STREQUAL "") + SET(BUILDDIR _build) + ENDIF() + + SET(SPHINX_CFG ${cfg_dir}) + IF("${SPHINX_CFG}" STREQUAL "") + SET(SPHINX_CFG ${src_dir}) + ENDIF() + + # Initialize internal variables + SET(PAPEROPT_a4 -D latex_paper_size=a4) + SET(PAPEROPT_letter -D latex_paper_size=letter) + SET(ALLSPHINXOPTS -d ${BUILDDIR}/doctrees ${PAPEROPT_${PAPER}} ${SPHINXOPTS}) + SET(I18NSPHINXOPTS ${PAPEROPT_${PAPER}} ${SPHINXOPTS}) + + SET(ALLSPHINXOPTS ${ALLSPHINXOPTS} ${src_dir}) + SET(I18NSPHINXOPTS ${I18NSPHINXOPTS} ${src_dir}) + + # Set internal out directory + SET(_OUT_DIR ${SPHINX_TYPE}) + IF(${SPHINX_TYPE} STREQUAL "gettext") + SET(_OUT_DIR gettext) + SET(ALLSPHINXOPTS ${I18NSPHINXOPTS}) + ENDIF(${SPHINX_TYPE} STREQUAL "gettext") + + # Build sphinx command + SET(_CMD_OPTIONS -b ${SPHINX_TYPE} -c ${SPHINX_CFG} ${ALLSPHINXOPTS} ${BUILDDIR}/${_OUT_DIR}) + + # This macro mainly prepares the environment in which sphinx should run: + # this sets the PYTHONPATH and LD_LIBRARY_PATH to include OMNIORB, DOCUTILS, SETUPTOOLS, etc ... + SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_CMD_OPTIONS}") + ADD_CUSTOM_TARGET(${sphinx_name} ALL ${_cmd}) + +ENDMACRO(SALOME_ADD_SPHINX_DOC) diff --git a/cmake/UsePyQt.cmake b/cmake/UsePyQt.cmake index 1c07ecd..587aef2 100644 --- a/cmake/UsePyQt.cmake +++ b/cmake/UsePyQt.cmake @@ -95,6 +95,7 @@ MACRO(PYQT_WRAP_UIC outfiles) SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName) ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL) + SET_TARGET_PROPERTIES(${_uniqueTargetName} PROPERTIES FOLDER PYQT_WRAP_UIC_TARGETS) FOREACH(_input ${ARGN}) GET_FILENAME_COMPONENT(_input_name ${_input} NAME) STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name}) @@ -104,7 +105,7 @@ MACRO(PYQT_WRAP_UIC outfiles) DEPENDS ${_input} ) SET_TARGET_PROPERTIES(${_TgName} PROPERTIES FOLDER PYQT_WRAP_UIC_TARGETS) - ADD_DEPENDENCIES(${_uniqueTargetName} DEPEND ${_TgName}) + ADD_DEPENDENCIES(${_uniqueTargetName} ${_TgName}) SET(${outfiles} ${${outfiles}} ${_output}) ENDFOREACH() ENDIF(NOT WIN32) diff --git a/cmake/UseQtExt.cmake b/cmake/UseQtExt.cmake index 95985b7..db787c6 100644 --- a/cmake/UseQtExt.cmake +++ b/cmake/UseQtExt.cmake @@ -47,7 +47,47 @@ MACRO(QT_WRAP_MOC) IF (QT_VERSION VERSION_LESS "5.0") QT4_WRAP_CPP(${ARGN}) ELSE() - QT5_WRAP_CPP(${ARGN}) + QT5_WRAP_CPP(${ARGN}) + # Workaround to avoid problem with bug in moc preprocessor: + # The problem is reproduced on Linux in case if native system Qt is installed + # and "-I/usr/include" parameter is presented in the moc command line before + # custom Qt includes. This bug takes place in Qt-5.6.0 and newer. To avoid this + # bug move "-I/usr/include" parameter in the "moc parameters" file to the end + # of the "include section". + IF (NOT WIN32) + FOREACH(IT ${ARGN}) + GET_FILENAME_COMPONENT(IT ${IT} ABSOLUTE) + GET_FILENAME_COMPONENT(PFILE ${IT} NAME_WE) + SET(OUTFILE ${CMAKE_CURRENT_BINARY_DIR}/moc_${PFILE}.cpp_parameters) + IF(EXISTS ${OUTFILE}) + SET(NEW_CONTENT) + SET(IS_INCLUDE_SECTION TRUE) + SET(HAS_SYSTEM_INC FALSE) + FILE(READ ${OUTFILE} CONTENT) + STRING(REGEX REPLACE "\n" ";" CONTENT "${CONTENT}") + list(REMOVE_DUPLICATES CONTENT) + FOREACH(S ${CONTENT}) + IF("${S}" MATCHES "^-I") + IF("${S}" STREQUAL "-I/usr/include") + SET(HAS_SYSTEM_INC TRUE) + ELSE() + SET(NEW_CONTENT ${NEW_CONTENT} "${S}\n") + ENDIF() + ELSE() + SET(IS_INCLUDE_SECTION FALSE) + ENDIF() + IF(NOT IS_INCLUDE_SECTION) + IF(HAS_SYSTEM_INC) + SET(NEW_CONTENT ${NEW_CONTENT} "-I/usr/include\n") + SET(HAS_SYSTEM_INC FALSE) + ENDIF() + SET(NEW_CONTENT ${NEW_CONTENT} "${S}\n") + ENDIF() + ENDFOREACH() + FILE(WRITE ${OUTFILE} ${NEW_CONTENT}) + ENDIF() + ENDFOREACH() + ENDIF() ENDIF() ENDMACRO(QT_WRAP_MOC) -- 2.39.2