From 6c6670a91df29cd807fcd023e9563d685704739f Mon Sep 17 00:00:00 2001 From: abn Date: Tue, 5 Jul 2016 11:53:45 +0200 Subject: [PATCH] Following conversion of core modules to use the config repo --- cmake/FindCGNS.cmake | 46 +++++++++ cmake/FindGEOM.cmake | 80 +++++++++++++++ cmake/FindGUI.cmake | 66 ++++++++++++ cmake/FindLibBatch.cmake | 54 ++++++++++ cmake/FindMetis.cmake | 50 ++++++++++ cmake/FindOpenCV.cmake | 160 +++++++++++++++++++++++++++++ cmake/FindPaco.cmake | 70 +++++++++++++ cmake/FindParMetis.cmake | 36 +++++++ cmake/FindPyQt4.cmake | 97 ++++++++++++++++++ cmake/FindPyQt5.cmake | 97 ++++++++++++++++++ cmake/FindQScintilla.cmake | 116 +++++++++++++++++++++ cmake/FindQwt.cmake | 64 ++++++++++++ cmake/FindSIP.cmake | 46 +++++++++ cmake/FindSMESH.cmake | 43 ++++++++ cmake/FindSalomeCGNS.cmake | 26 +++++ cmake/FindSalomeGEOM.cmake | 34 +++++++ cmake/FindSalomeGUI.cmake | 109 ++++++++++++++++++++ cmake/FindSalomeKERNEL.cmake | 63 ++++++++++++ cmake/FindSalomeLibBatch.cmake | 33 ++++++ cmake/FindSalomeMED.cmake | 46 +++++++++ cmake/FindSalomeMEDCoupling.cmake | 42 ++++++++ cmake/FindSalomeMetis.cmake | 33 ++++++ cmake/FindSalomeOpenCV.cmake | 38 +++++++ cmake/FindSalomeOpenGL.cmake | 38 +++++++ cmake/FindSalomePARAVIS.cmake | 42 ++++++++ cmake/FindSalomePaco.cmake | 32 ++++++ cmake/FindSalomeParMetis.cmake | 33 ++++++ cmake/FindSalomeParaView.cmake | 39 ++++++++ cmake/FindSalomePyQt4.cmake | 37 +++++++ cmake/FindSalomePyQt5.cmake | 37 +++++++ cmake/FindSalomeQScintilla.cmake | 32 ++++++ cmake/FindSalomeQt4.cmake | 44 ++++++++ cmake/FindSalomeQt5.cmake | 72 +++++++++++++ cmake/FindSalomeQwt.cmake | 32 ++++++ cmake/FindSalomeSIP.cmake | 34 +++++++ cmake/FindSalomeSMESH.cmake | 34 +++++++ cmake/FindSalomeScotch.cmake | 33 ++++++ cmake/FindSalomeTBB.cmake | 26 +++++ cmake/FindSalomeXDR.cmake | 33 ++++++ cmake/FindSalomeYACS.cmake | 34 +++++++ cmake/FindSalomef2c.cmake | 26 +++++ cmake/FindScotch.cmake | 35 +++++++ cmake/FindTBB.cmake | 105 +++++++++++++++++++ cmake/FindXDR.cmake | 40 ++++++++ cmake/FindYACS.cmake | 35 +++++++ cmake/Findf2c.cmake | 55 ++++++++++ cmake/UsePyQt.cmake | 161 ++++++++++++++++++++++++++++++ cmake/UseQtExt.cmake | 68 +++++++++++++ cmake/UseSIP.cmake | 117 ++++++++++++++++++++++ 49 files changed, 2723 insertions(+) create mode 100644 cmake/FindCGNS.cmake create mode 100644 cmake/FindGEOM.cmake create mode 100644 cmake/FindGUI.cmake create mode 100644 cmake/FindLibBatch.cmake create mode 100644 cmake/FindMetis.cmake create mode 100644 cmake/FindOpenCV.cmake create mode 100644 cmake/FindPaco.cmake create mode 100644 cmake/FindParMetis.cmake create mode 100644 cmake/FindPyQt4.cmake create mode 100644 cmake/FindPyQt5.cmake create mode 100644 cmake/FindQScintilla.cmake create mode 100644 cmake/FindQwt.cmake create mode 100644 cmake/FindSIP.cmake create mode 100644 cmake/FindSMESH.cmake create mode 100644 cmake/FindSalomeCGNS.cmake create mode 100644 cmake/FindSalomeGEOM.cmake create mode 100644 cmake/FindSalomeGUI.cmake create mode 100644 cmake/FindSalomeKERNEL.cmake create mode 100644 cmake/FindSalomeLibBatch.cmake create mode 100644 cmake/FindSalomeMED.cmake create mode 100644 cmake/FindSalomeMEDCoupling.cmake create mode 100644 cmake/FindSalomeMetis.cmake create mode 100644 cmake/FindSalomeOpenCV.cmake create mode 100644 cmake/FindSalomeOpenGL.cmake create mode 100644 cmake/FindSalomePARAVIS.cmake create mode 100644 cmake/FindSalomePaco.cmake create mode 100644 cmake/FindSalomeParMetis.cmake create mode 100644 cmake/FindSalomeParaView.cmake create mode 100644 cmake/FindSalomePyQt4.cmake create mode 100644 cmake/FindSalomePyQt5.cmake create mode 100644 cmake/FindSalomeQScintilla.cmake create mode 100644 cmake/FindSalomeQt4.cmake create mode 100644 cmake/FindSalomeQt5.cmake create mode 100644 cmake/FindSalomeQwt.cmake create mode 100644 cmake/FindSalomeSIP.cmake create mode 100644 cmake/FindSalomeSMESH.cmake create mode 100644 cmake/FindSalomeScotch.cmake create mode 100644 cmake/FindSalomeTBB.cmake create mode 100644 cmake/FindSalomeXDR.cmake create mode 100644 cmake/FindSalomeYACS.cmake create mode 100755 cmake/FindSalomef2c.cmake create mode 100644 cmake/FindScotch.cmake create mode 100644 cmake/FindTBB.cmake create mode 100644 cmake/FindXDR.cmake create mode 100644 cmake/FindYACS.cmake create mode 100755 cmake/Findf2c.cmake create mode 100644 cmake/UsePyQt.cmake create mode 100644 cmake/UseQtExt.cmake create mode 100644 cmake/UseSIP.cmake diff --git a/cmake/FindCGNS.cmake b/cmake/FindCGNS.cmake new file mode 100644 index 0000000..a60b776 --- /dev/null +++ b/cmake/FindCGNS.cmake @@ -0,0 +1,46 @@ +# - Find CGNS +# Sets the following variables: +# CGNS_INCLUDE_DIRS - path to the CGNS include directory +# CGNS_LIBRARIES - path to the CGNS 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 +# + +# ------ + +MESSAGE(STATUS "Check for CGNS ...") + +# ------ + +SET(CGNS_ROOT_DIR $ENV{CGN_ROOT_DIR} CACHE PATH "Path to the CGNS.") + +IF(CGNS_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${CGNS_ROOT_DIR}") +ENDIF(CGNS_ROOT_DIR) + +FIND_PATH(CGNS_INCLUDE_DIRS cgnslib.h) +FIND_LIBRARY(CGNS_LIBRARIES NAMES cgns) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(CGNS REQUIRED_VARS CGNS_INCLUDE_DIRS CGNS_LIBRARIES) diff --git a/cmake/FindGEOM.cmake b/cmake/FindGEOM.cmake new file mode 100644 index 0000000..e9cf725 --- /dev/null +++ b/cmake/FindGEOM.cmake @@ -0,0 +1,80 @@ +# 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 +# + +SET(GEOM_CXXFLAGS -I${GEOM_ROOT_DIR}/include/salome) # to be removed +SET(GEOM_INCLUDE_DIRS ${GEOM_ROOT_DIR}/include/salome) + +FIND_LIBRARY(GEOM_GEOMArchimede GEOMArchimede ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BlockFix BlockFix ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMbasic GEOMbasic ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMAlgo GEOMAlgo ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMClient GEOMClient ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMimpl GEOMimpl ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMUtils GEOMUtils ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMEngine GEOMEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SupervEngine GEOM_SupervEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMSketcher GEOMSketcher ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLGEOM SalomeIDLGEOM ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLGEOMSuperv SalomeIDLGEOMSuperv ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLSTLPlugin SalomeIDLSTLPlugin ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLBREPPlugin SalomeIDLBREPPlugin ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLSTEPPlugin SalomeIDLSTEPPlugin ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLIGESPlugin SalomeIDLIGESPlugin ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLVTKPlugin SalomeIDLVTKPlugin ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLXAOPlugin SalomeIDLXAOPlugin ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_ShHealOper ShHealOper ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_XAO XAO ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_AdvancedEngine AdvancedEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_AdvancedGUI AdvancedGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BasicGUI BasicGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BlocksGUI BlocksGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BooleanGUI BooleanGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BuildGUI BuildGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_DisplayGUI DisplayGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_DlgRef DlgRef ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_EntityGUI EntityGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMBase GEOMBase ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMFiltersSelection GEOMFiltersSelection ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOM GEOM ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMToolsGUI GEOMToolsGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_DependencyTree DependencyTree ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GenerationGUI GenerationGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GroupGUI GroupGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_Material Material ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_MeasureGUI MeasureGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMObject GEOMObject ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_OCC2VTK OCC2VTK ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_OperationGUI OperationGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_PrimitiveGUI PrimitiveGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_RepairGUI RepairGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_TransformationGUI TransformationGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_STLPluginGUI STLPluginGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_STLPluginEngine STLPluginEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BREPPluginGUI BREPPluginGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BREPPluginEngine BREPPluginEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_STEPPluginGUI STEPPluginGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_STEPPluginEngine STEPPluginEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_IGESPluginGUI IGESPluginGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_IGESPluginEngine IGESPluginEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_XAOPluginGUI XAOPluginGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_XAOPluginEngine XAOPluginEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_VTKPluginGUI VTKPluginGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_VTKPluginEngine VTKPluginEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMShapeRec GEOMShapeRec ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_CurveCreator CurveCreator ${GEOM_ROOT_DIR}/lib/salome) diff --git a/cmake/FindGUI.cmake b/cmake/FindGUI.cmake new file mode 100644 index 0000000..55d2638 --- /dev/null +++ b/cmake/FindGUI.cmake @@ -0,0 +1,66 @@ +# 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 +# + +# +# TODO: this file should be removed when switching to full CMake +# + +SET(GUI_CXXFLAGS -I${GUI_ROOT_DIR}/include/salome) + +FIND_LIBRARY(caf caf ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(CAM CAM ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(CASCatch CASCatch ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(DDS DDS ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(Event Event ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GLViewer GLViewer ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(LightApp LightApp ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(LogWindow LogWindow ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(ObjBrowser ObjBrowser ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(OCCViewer OCCViewer ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(OpenGLUtils OpenGLUtils ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(Plot2d Plot2d ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(PyConsole PyConsole ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(PyInterp PyInterp ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(QDS QDS ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(qtx qtx ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(QxScene QxScene ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeApp SalomeApp ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeIDLGUI SalomeIDLGUI ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeObject SalomeObject ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomePrs SalomePrs ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomePyQtGUILight SalomePyQtGUILight ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomePyQtGUI SalomePyQtGUI ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomePyQt SalomePyQt ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomePy SalomePy ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeSession SalomeSession ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeStyle SalomeStyle ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SOCC SOCC ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SPlot2d SPlot2d ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(std std ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SUITApp SUITApp ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(suit suit ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SVTK SVTK ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(ToolsGUI ToolsGUI ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(ViewerTools ViewerTools ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(ViewerData ViewerData ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(VTKViewer VTKViewer ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(vtkEDFOverloads vtkEDFOverloads ${GUI_ROOT_DIR}/lib/paraview) +FIND_LIBRARY(vtkTools vtkTools ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeGuiHelpers SalomeGuiHelpers ${GUI_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeTreeData SalomeTreeData ${GUI_ROOT_DIR}/lib/salome) diff --git a/cmake/FindLibBatch.cmake b/cmake/FindLibBatch.cmake new file mode 100644 index 0000000..3d66a80 --- /dev/null +++ b/cmake/FindLibBatch.cmake @@ -0,0 +1,54 @@ +# - Find LibBatch installation +# +# The following variable are set: +# LIBBATCH_FOUND - TRUE if LibBatch installation has been found +# LIBBATCH_INCLUDE_DIRS - LibBatch headers path +# LIBBATCH_LIBRARIES - LibBatch libraries +# +# The CMake (or environment) variable LIBBATCH_ROOT_DIR can be set to +# guide the detection and indicate a root directory to look into. +# +############################################################################ +# Copyright (C) 2012-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 LIBBATCH_FIND_QUIETLY) + MESSAGE(STATUS "Check for LibBatch ...") +ENDIF() + +# ------ + +SET(LIBBATCH_ROOT_DIR $ENV{LIBBATCH_ROOT_DIR} CACHE PATH "Path to the LibBatch.") +IF(LIBBATCH_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${LIBBATCH_ROOT_DIR}") +ENDIF() + +FIND_PATH(LIBBATCH_INCLUDE_DIRS libbatch/BatchManager.hxx) +FIND_LIBRARY(LIBBATCH_LIBRARIES NAMES batch) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibBatch REQUIRED_VARS LIBBATCH_INCLUDE_DIRS LIBBATCH_LIBRARIES) + +IF(LIBBATCH_FOUND) + IF(NOT LIBBATCH_FIND_QUIETLY) + MESSAGE(STATUS "LibBatch library: ${LIBBATCH_LIBRARIES}") + ENDIF() +ENDIF() diff --git a/cmake/FindMetis.cmake b/cmake/FindMetis.cmake new file mode 100644 index 0000000..2596305 --- /dev/null +++ b/cmake/FindMetis.cmake @@ -0,0 +1,50 @@ +# 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 +# + +# ------ + +MESSAGE(STATUS "Check for metis ...") + +SET(METIS_ROOT_DIR $ENV{METIS_ROOT_DIR} CACHE PATH "Path to the METIS.") +IF(METIS_ROOT_DIR) + LIST(APPEND CMAKE_LIBRARY_PATH "${METIS_ROOT_DIR}") + LIST(APPEND CMAKE_LIBRARY_PATH "${METIS_ROOT_DIR}/lib") + LIST(APPEND CMAKE_INCLUDE_PATH "${METIS_ROOT_DIR}/Lib") + LIST(APPEND CMAKE_INCLUDE_PATH "${METIS_ROOT_DIR}/include") +ENDIF(METIS_ROOT_DIR) + +FIND_LIBRARY(METIS_LIBRARIES metis) +FIND_PATH(METIS_INCLUDE_DIRS metis.h) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Metis REQUIRED_VARS METIS_INCLUDE_DIRS METIS_LIBRARIES) +FILE(READ ${METIS_INCLUDE_DIRS}/metis.h metis_h_content) +STRING(REPLACE "\n" ";" list_metis_h_content ${metis_h_content}) +FOREACH(ln ${list_metis_h_content}) + IF("${ln}" MATCHES "^#define METIS_VER_MAJOR") + STRING(REPLACE "#define METIS_VER_MAJOR" "" metis_major_version "${ln}") + STRING(STRIP "${metis_major_version}" metis_major_version) + ENDIF("${ln}" MATCHES "^#define METIS_VER_MAJOR") +ENDFOREACH(ln ${list_metis_h_content}) +IF(metis_major_version STREQUAL 5) + SET(MEDCOUPLING_METIS_V5 1) + MESSAGE(STATUS "Metis maj version 5 detected.") +ELSE(metis_major_version STREQUAL 5) + MESSAGE(STATUS "Metis maj version 4 detected.") +ENDIF(metis_major_version STREQUAL 5) diff --git a/cmake/FindOpenCV.cmake b/cmake/FindOpenCV.cmake new file mode 100644 index 0000000..8d0b141 --- /dev/null +++ b/cmake/FindOpenCV.cmake @@ -0,0 +1,160 @@ +########################################################### +# Find OpenCV Library +# See http://sourceforge.net/projects/opencvlibrary/ +#---------------------------------------------------------- +# +## 1: Setup: +# The following variables are optionally searched for defaults +# OpenCV_DIR: Base directory of OpenCv tree to use. +# +## 2: Variable +# The following are set after configuration is done: +# +# OpenCV_FOUND +# OpenCV_LIBS +# OpenCV_INCLUDE_DIR +# OpenCV_VERSION (OpenCV_VERSION_MAJOR, OpenCV_VERSION_MINOR, OpenCV_VERSION_PATCH) +# +# +# Deprecated variable are used to maintain backward compatibility with +# the script of Jan Woetzel (2006/09): www.mip.informatik.uni-kiel.de/~jw +# OpenCV_INCLUDE_DIRS +# OpenCV_LIBRARIES +# OpenCV_LINK_DIRECTORIES +# +## 3: Version +# +# 2010/04/07 Benoit Rat, Correct a bug when OpenCVConfig.cmake is not found. +# 2010/03/24 Benoit Rat, Add compatibility for when OpenCVConfig.cmake is not found. +# 2010/03/22 Benoit Rat, Creation of the script. +# +# +# tested with: +# - OpenCV 2.1: MinGW, MSVC2008 +# - OpenCV 2.0: MinGW, MSVC2008, GCC4 +# +# +## 4: Licence: +# +# LGPL 2.1 : GNU Lesser General Public License Usage +# Alternatively, this file may be used under the terms of the GNU Lesser + +# General Public License version 2.1 as published by the Free Software +# Foundation and appearing in the file LICENSE.LGPL included in the +# packaging of this file. Please review the following information to +# ensure the GNU Lesser General Public License version 2.1 requirements +# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +# +#---------------------------------------------------------- + + +find_path(OpenCV_DIR "OpenCVConfig.cmake" DOC "Root directory of OpenCV") + +##==================================================== +## Find OpenCV libraries +##---------------------------------------------------- +if(EXISTS "${OpenCV_DIR}") + + #When its possible to use the Config script use it. + if(EXISTS "${OpenCV_DIR}/OpenCVConfig.cmake") + + ## Include the standard CMake script + include("${OpenCV_DIR}/OpenCVConfig.cmake") + + ## Search for a specific version + set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}") + + #Otherwise it try to guess it. + else(EXISTS "${OpenCV_DIR}/OpenCVConfig.cmake") + + set(OPENCV_LIB_COMPONENTS cxcore cv ml highgui cvaux) + find_path(OpenCV_INCLUDE_DIR "cv.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "") + if(EXISTS ${OpenCV_INCLUDE_DIR}) + include_directories(${OpenCV_INCLUDE_DIR}) + endif(EXISTS ${OpenCV_INCLUDE_DIR}) + + #Find OpenCV version by looking at cvver.h + file(STRINGS ${OpenCV_INCLUDE_DIR}/cvver.h OpenCV_VERSIONS_TMP REGEX "^#define CV_[A-Z]+_VERSION[ \t]+[0-9]+$") + string(REGEX REPLACE ".*#define CV_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MAJOR ${OpenCV_VERSIONS_TMP}) + string(REGEX REPLACE ".*#define CV_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MINOR ${OpenCV_VERSIONS_TMP}) + string(REGEX REPLACE ".*#define CV_SUBMINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_PATCH ${OpenCV_VERSIONS_TMP}) + set(OpenCV_VERSION ${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH} CACHE STRING "" FORCE) + set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}") + + endif(EXISTS "${OpenCV_DIR}/OpenCVConfig.cmake") + + + + + ## Initiate the variable before the loop + set(GLOBAL OpenCV_LIBS "") + set(OpenCV_FOUND_TMP true) + + ## Loop over each components + foreach(__CVLIB ${OPENCV_LIB_COMPONENTS}) + + find_library(OpenCV_${__CVLIB}_LIBRARY_DEBUG NAMES "${__CVLIB}${CVLIB_SUFFIX}d" "lib${__CVLIB}${CVLIB_SUFFIX}d" PATHS "${OpenCV_DIR}/lib" NO_DEFAULT_PATH) + find_library(OpenCV_${__CVLIB}_LIBRARY_RELEASE NAMES "${__CVLIB}${CVLIB_SUFFIX}" "lib${__CVLIB}${CVLIB_SUFFIX}" PATHS "${OpenCV_DIR}/lib" NO_DEFAULT_PATH) + + #Remove the cache value + set(OpenCV_${__CVLIB}_LIBRARY "" CACHE STRING "" FORCE) + + #both debug/release + if(OpenCV_${__CVLIB}_LIBRARY_DEBUG AND OpenCV_${__CVLIB}_LIBRARY_RELEASE) + set(OpenCV_${__CVLIB}_LIBRARY debug ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} optimized ${OpenCV_${__CVLIB}_LIBRARY_RELEASE} CACHE STRING "" FORCE) + #only debug + elseif(OpenCV_${__CVLIB}_LIBRARY_DEBUG) + set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} CACHE STRING "" FORCE) + #only release + elseif(OpenCV_${__CVLIB}_LIBRARY_RELEASE) + set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_RELEASE} CACHE STRING "" FORCE) + #no library found + else() + set(OpenCV_FOUND_TMP false) + endif() + + #Add to the general list + if(OpenCV_${__CVLIB}_LIBRARY) + set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_${__CVLIB}_LIBRARY}) + endif(OpenCV_${__CVLIB}_LIBRARY) + + endforeach(__CVLIB) + + + set(OpenCV_FOUND ${OpenCV_FOUND_TMP} CACHE BOOL "" FORCE) + + +else(EXISTS "${OpenCV_DIR}") + set(ERR_MSG "Please specify OpenCV directory using OpenCV_DIR env. variable") +endif(EXISTS "${OpenCV_DIR}") +##==================================================== + + +##==================================================== +## Print message +##---------------------------------------------------- +if(NOT OpenCV_FOUND) + # make FIND_PACKAGE friendly + if(NOT OpenCV_FIND_QUIETLY) + if(OpenCV_FIND_REQUIRED) + message(FATAL_ERROR "OpenCV required but some headers or libs not found. ${ERR_MSG}") + else(OpenCV_FIND_REQUIRED) + message(STATUS "WARNING: OpenCV was not found. ${ERR_MSG}") + endif(OpenCV_FIND_REQUIRED) + endif(NOT OpenCV_FIND_QUIETLY) +endif(NOT OpenCV_FOUND) +##==================================================== + + +##==================================================== +## Backward compatibility +##---------------------------------------------------- +if(OpenCV_FOUND) + option(OpenCV_BACKWARD_COMPA "Add some variable to make this script compatible with the other version of FindOpenCV.cmake" false) + if(OpenCV_BACKWARD_COMPA) + find_path(OpenCV_INCLUDE_DIRS "cv.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "Include directory") + find_path(OpenCV_INCLUDE_DIR "cv.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "Include directory") + set(OpenCV_LIBRARIES "${OpenCV_LIBS}" CACHE STRING "" FORCE) + endif(OpenCV_BACKWARD_COMPA) +endif(OpenCV_FOUND) +##==================================================== \ No newline at end of file diff --git a/cmake/FindPaco.cmake b/cmake/FindPaco.cmake new file mode 100644 index 0000000..28571c1 --- /dev/null +++ b/cmake/FindPaco.cmake @@ -0,0 +1,70 @@ +# - Find Paco installation +# +# Variables set are: +# PACO_INCLUDE_DIRS - include directories to add when compiling +# PACO_LIBRARIES - Paco libraries to link against +# +# You can set the environment or CMake variable PACO_ROOT_DIR to guide +# the detection mechanism. +# +############################################################# +# 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 Paco_FIND_QUIETLY) + MESSAGE(STATUS "Check for Paco ...") +ENDIF() + +# ------ + +SET(PACO_ROOT_DIR $ENV{PACO_ROOT_DIR} CACHE PATH "Path to Paco.") +IF(PACO_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${PACO_ROOT_DIR}") +ENDIF(PACO_ROOT_DIR) + +FIND_PATH(PACO_INCLUDE_DIRS PaCO++_InterfaceManager_impl.h) + +FIND_LIBRARY(PACO_LIBRARY_PaCO PaCO) +FIND_LIBRARY(PACO_LIBRARY_GaBro GaBro) +FIND_LIBRARY(PACO_LIBRARY_BasicBC BasicBC) +FIND_LIBRARY(PACO_LIBRARY_PaCO_dummy PaCO_dummy) +FIND_LIBRARY(PACO_LIBRARY_PaCO_mpi PaCO_mpi) +FIND_LIBRARY(PACO_LIBRARY_PaCO_omnithread PaCO_omnithread) + +FIND_PROGRAM(PACO_IDL PaCOIdlTool.sh) + +MARK_AS_ADVANCED(PACO_INCLUDE_DIRS PACO_LIBRARY_PaCO PACO_LIBRARY_GaBro + PACO_LIBRARY_BasicBC PACO_LIBRARY_PaCO_dummy + PACO_LIBRARY_PaCO_mpi PACO_LIBRARY_PaCO_omnithread PACO_IDL) + +SET(PACO_LIBRARIES + ${PACO_LIBRARY_PaCO} + ${PACO_LIBRARY_GaBro} + ${PACO_LIBRARY_BasicBC} + ${PACO_LIBRARY_PaCO_dummy} + ${PACO_LIBRARY_PaCO_mpi} + ${PACO_LIBRARY_PaCO_omnithread}) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Paco + REQUIRED_VARS PACO_INCLUDE_DIRS PACO_LIBRARY_PaCO PACO_LIBRARY_GaBro + PACO_LIBRARY_BasicBC PACO_LIBRARY_PaCO_dummy + PACO_LIBRARY_PaCO_mpi PACO_LIBRARY_PaCO_omnithread PACO_IDL) diff --git a/cmake/FindParMetis.cmake b/cmake/FindParMetis.cmake new file mode 100644 index 0000000..103ab1c --- /dev/null +++ b/cmake/FindParMetis.cmake @@ -0,0 +1,36 @@ +# 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 +# + +# ------ + +MESSAGE(STATUS "Check for parmetis ...") + +SET(PARMETIS_ROOT_DIR $ENV{PARMETIS_ROOT_DIR} CACHE PATH "Path to the PARMETIS.") +IF(PARMETIS_ROOT_DIR) + LIST(APPEND CMAKE_LIBRARY_PATH "${PARMETIS_ROOT_DIR}") + LIST(APPEND CMAKE_INCLUDE_PATH "${PARMETIS_ROOT_DIR}/Lib") +ENDIF(PARMETIS_ROOT_DIR) + +FIND_LIBRARY(PARMETIS_LIBRARIES parmetis) +FIND_LIBRARY(PARMETIS_SEQ_LIBRARIES metis) +SET(PARMETIS_LIBRARIES ${PARMETIS_LIBRARIES} ${PARMETIS_SEQ_LIBRARIES}) +FIND_PATH(PARMETIS_INCLUDE_DIRS parmetis.h) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ParMetis REQUIRED_VARS PARMETIS_INCLUDE_DIRS PARMETIS_LIBRARIES) diff --git a/cmake/FindPyQt4.cmake b/cmake/FindPyQt4.cmake new file mode 100644 index 0000000..e9f0795 --- /dev/null +++ b/cmake/FindPyQt4.cmake @@ -0,0 +1,97 @@ +# 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 +# + +# - Find PyQt4 installation +# Sets the following variables: +# PYQT_PYUIC_EXECUTABLE - path to the pyuic executable +# PYQT_PYRCC_EXECUTABLE - path to the pyrcc executable +# PYQT_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH +# PYQT_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH +# PYQT_PYTHONPATH - path to the PyQt Python modules +# PYQT_SIPS_DIR - path to main include directory (which contains several sub folders) +# PYQT_SIPFLAGS - compilation flags extracted from PyQt +# +# The executables +# pyuic4 (pyuic4.bat) +# are searched. +# The Python command +# pyqtconfig.Configuration().pyqt_sip_flags +# is called to get the compilation flags. +# Headers are located by looking for the header file +# qobject.sip + +IF(NOT PyQt4_FIND_QUIETLY) + MESSAGE(STATUS "Looking for PyQt4 ...") +ENDIF() + +IF(NOT SIP_FOUND AND NOT PyQt4_FIND_QUIETLY) + MESSAGE(WARNING "PyQt4 needs SIP to be detected correctly!") +ENDIF() + +FIND_PROGRAM(PYQT_PYUIC_EXECUTABLE NAMES pyuic4 pyuic4.bat) +FIND_PROGRAM(PYQT_PYRCC_EXECUTABLE NAMES pyrcc4 pyrcc4.bat) + +# Get root dir locally, going up two levels from the exec: +GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${PYQT_PYUIC_EXECUTABLE}" PATH) +GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH) + + +# Typical locations of qobject.sip are: +# - /usr/share/sip/PyQt4/QtCore, for a system install +# - or /sip/QtCore, for a custom install +# - or /share/sip/QtCore, for a custom install +FIND_FILE(PYQT_SIP_MAIN_FILE qobject.sip PATH_SUFFIXES share/sip/QtCore sip/QtCore share/sip/PyQt4/QtCore) + +IF(PYQT_SIP_MAIN_FILE) + GET_FILENAME_COMPONENT(PYQT_SIPS_DIR "${PYQT_SIP_MAIN_FILE}" PATH) + GET_FILENAME_COMPONENT(PYQT_SIPS_DIR "${PYQT_SIPS_DIR}" PATH) +ENDIF() +MARK_AS_ADVANCED(PYQT_SIP_MAIN_FILE) + +# Get PyQt compilation flags: +SET(PYQT_PYTHONPATH ${_tmp_ROOT_DIR}/PyQt4) +SET(PYQT_SIPFLAGS) + +EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; +sys.path[:0] = '${PYQT_PYTHONPATH}'.split(';'); +sys.path[:0] = '${SIP_PYTHONPATH}'.split(';'); +from PyQt4 import pyqtconfig; +sys.stdout.write(pyqtconfig.Configuration().pyqt_sip_flags)" + OUTPUT_VARIABLE PYQT_SIPFLAGS) +SEPARATE_ARGUMENTS(PYQT_SIPFLAGS) + +SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} -I "${PYQT_SIPS_DIR}") + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PyQt4 REQUIRED_VARS PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_SIPFLAGS ) + +# Wrap the final executables so that they always use the proper environment (PYTHONPATH): +# The results are put to variables: +# PYQT_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH +# PYQT_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH +# TODO: should be done like Sphinx in KERNEL (i.e. generating a shell script)? + +IF(WIN32 AND NOT CYGWIN) + SET(PYQT_PYUIC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYUIC_EXECUTABLE}) + SET(PYQT_PYRCC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYRCC_EXECUTABLE}) +ELSE() + STRING(REPLACE ";" ":" PYQT_PYTHONPATH "${PYQT_PYTHONPATH}") + SET(PYQT_PYUIC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYUIC_EXECUTABLE}) + SET(PYQT_PYRCC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYRCC_EXECUTABLE}) +ENDIF() diff --git a/cmake/FindPyQt5.cmake b/cmake/FindPyQt5.cmake new file mode 100644 index 0000000..b72c418 --- /dev/null +++ b/cmake/FindPyQt5.cmake @@ -0,0 +1,97 @@ +# Copyright (C) 2013-2015 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 +# + +# - Find PyQt5 installation +# Sets the following variables: +# PYQT_PYUIC_EXECUTABLE - path to the pyuic executable +# PYQT_PYRCC_EXECUTABLE - path to the pyrcc executable +# PYQT_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH +# PYQT_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH +# PYQT_PYTHONPATH - path to the PyQt Python modules +# PYQT_SIPS_DIR - path to main include directory (which contains several sub folders) +# PYQT_SIPFLAGS - compilation flags extracted from PyQt +# +# The executables +# pyuic5 (pyuic5.bat) +# are searched. +# The Python command +# pyqtconfig.Configuration().pyqt_sip_flags +# is called to get the compilation flags. +# Headers are located by looking for the header file +# qobject.sip + +IF(NOT PyQt5_FIND_QUIETLY) + MESSAGE(STATUS "Looking for PyQt5 ...") +ENDIF() + +IF(NOT SIP_FOUND AND NOT PyQt5_FIND_QUIETLY) + MESSAGE(WARNING "PyQt5 needs SIP to be detected correctly!") +ENDIF() + +FIND_PROGRAM(PYQT_PYUIC_EXECUTABLE NAMES pyuic5 pyuic5.bat) +FIND_PROGRAM(PYQT_PYRCC_EXECUTABLE NAMES pyrcc5 pyrcc5.bat) + +# Get root dir locally, going up two levels from the exec: +GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${PYQT_PYUIC_EXECUTABLE}" PATH) +GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH) + + +# Typical locations of qobject.sip are: +# - /usr/share/sip/PyQt5/QtCore, for a system install +# - or /sip/QtCore, for a custom install +# - or /share/sip/QtCore, for a custom install +FIND_FILE(PYQT_SIP_MAIN_FILE qobject.sip PATH_SUFFIXES share/sip/QtCore sip/QtCore share/sip/PyQt5/QtCore) + +IF(PYQT_SIP_MAIN_FILE) + GET_FILENAME_COMPONENT(PYQT_SIPS_DIR "${PYQT_SIP_MAIN_FILE}" PATH) + GET_FILENAME_COMPONENT(PYQT_SIPS_DIR "${PYQT_SIPS_DIR}" PATH) +ENDIF() +MARK_AS_ADVANCED(PYQT_SIP_MAIN_FILE) + +# Get PyQt compilation flags: +SET(PYQT_PYTHONPATH ${_tmp_ROOT_DIR}/PyQt5) +SET(PYQT_SIPFLAGS) + +EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; +sys.path[:0] = '${PYQT_PYTHONPATH}'.split(';'); +sys.path[:0] = '${SIP_PYTHONPATH}'.split(';'); +from PyQt5.QtCore import PYQT_CONFIGURATION; +sys.stdout.write(PYQT_CONFIGURATION['sip_flags'])" + OUTPUT_VARIABLE PYQT_SIPFLAGS) +SEPARATE_ARGUMENTS(PYQT_SIPFLAGS) + +SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} -I "${PYQT_SIPS_DIR}") + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PyQt5 REQUIRED_VARS PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_SIPFLAGS ) + +# Wrap the final executables so that they always use the proper environment (PYTHONPATH): +# The results are put to variables: +# PYQT_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH +# PYQT_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH +# TODO: should be done like Sphinx in KERNEL (i.e. generating a shell script)? + +IF(WIN32 AND NOT CYGWIN) + SET(PYQT_PYUIC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYUIC_EXECUTABLE}) + SET(PYQT_PYRCC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYRCC_EXECUTABLE}) +ELSE() + STRING(REPLACE ";" ":" PYQT_PYTHONPATH "${PYQT_PYTHONPATH}") + SET(PYQT_PYUIC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYUIC_EXECUTABLE}) + SET(PYQT_PYRCC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYRCC_EXECUTABLE}) +ENDIF() diff --git a/cmake/FindQScintilla.cmake b/cmake/FindQScintilla.cmake new file mode 100644 index 0000000..ee814ec --- /dev/null +++ b/cmake/FindQScintilla.cmake @@ -0,0 +1,116 @@ +# QScintilla is a port to Qt of Neil Hodgson's Scintilla C++ editor control +# available at http://www.riverbankcomputing.com/software/qscintilla/ +# +# The module defines the following variables: +# QSCINTILLA_FOUND - the system has QScintilla +# QSCINTILLA_INCLUDE_DIR - where to find Qsci/qsciscintilla.h +# QSCINTILLA_INCLUDE_DIRS - qwt includes +# QSCINTILLA_LIBRARY - where to find the QScintilla library +# QSCINTILLA_LIBRARIES - aditional libraries +# QSCINTILLA_MAJOR_VERSION - major version +# QSCINTILLA_MINOR_VERSION - minor version +# QSCINTILLA_PATCH_VERSION - patch version +# QSCINTILLA_VERSION_STRING - version (ex. 2.6.2) +# QSCINTILLA_ROOT_DIR - root dir (ex. /usr/local) + +#============================================================================= +# Copyright 2010-2013, Julien Schueller +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# The views and conclusions contained in the software and documentation are those +# of the authors and should not be interpreted as representing official policies, +# either expressed or implied, of the FreeBSD Project. +#============================================================================= + + +find_path ( QSCINTILLA_INCLUDE_DIR + NAMES Qsci/qsciscintilla.h + HINTS ${QT_INCLUDE_DIR} +) + +set ( QSCINTILLA_INCLUDE_DIRS ${QSCINTILLA_INCLUDE_DIR} ${QSCINTILLA_INCLUDE_DIR}/Qsci ) + +# version +set ( _VERSION_FILE ${QSCINTILLA_INCLUDE_DIR}/Qsci/qsciglobal.h ) +if ( EXISTS ${_VERSION_FILE} ) + file ( STRINGS ${_VERSION_FILE} _VERSION_LINE REGEX "define[ ]+QSCINTILLA_VERSION_STR" ) + if ( _VERSION_LINE ) + string ( REGEX REPLACE ".*define[ ]+QSCINTILLA_VERSION_STR[ ]+\"(.*)\".*" "\\1" QSCINTILLA_VERSION_STRING "${_VERSION_LINE}" ) + string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" QSCINTILLA_MAJOR_VERSION "${QSCINTILLA_VERSION_STRING}" ) + string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" QSCINTILLA_MINOR_VERSION "${QSCINTILLA_VERSION_STRING}" ) + string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" QSCINTILLA_PATCH_VERSION "${QSCINTILLA_VERSION_STRING}" ) + endif () +endif () + + +# check version +set ( _QSCINTILLA_VERSION_MATCH TRUE ) +if ( QScintilla_FIND_VERSION AND QSCINTILLA_VERSION_STRING ) + if ( QScintilla_FIND_VERSION_EXACT ) + if ( NOT QScintilla_FIND_VERSION VERSION_EQUAL QSCINTILLA_VERSION_STRING ) + set ( _QSCINTILLA_VERSION_MATCH FALSE ) + endif () + else () + if ( QSCINTILLA_VERSION_STRING VERSION_LESS QScintilla_FIND_VERSION ) + set ( _QSCINTILLA_VERSION_MATCH FALSE ) + endif () + endif () +endif () + + +find_library ( QSCINTILLA_LIBRARY + NAMES qscintilla qscintilla2 libqscintilla2 + HINTS ${QT_LIBRARY_DIR} +) + +set ( QSCINTILLA_LIBRARIES ${QSCINTILLA_LIBRARY} ) + + +# try to guess root dir from include dir +if ( QSCINTILLA_INCLUDE_DIR ) + string ( REGEX REPLACE "(.*)/include.*" "\\1" QSCINTILLA_ROOT_DIR ${QSCINTILLA_INCLUDE_DIR} ) +# try to guess root dir from library dir +elseif ( QSCINTILLA_LIBRARY ) + string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" QSCINTILLA_ROOT_DIR ${QSCINTILLA_LIBRARY} ) +endif () + + +# handle the QUIETLY and REQUIRED arguments +include ( FindPackageHandleStandardArgs ) +if ( CMAKE_VERSION LESS 2.8.3 ) + find_package_handle_standard_args( QScintilla DEFAULT_MSG QSCINTILLA_LIBRARY QSCINTILLA_INCLUDE_DIR _QSCINTILLA_VERSION_MATCH ) +else () + find_package_handle_standard_args( QScintilla REQUIRED_VARS QSCINTILLA_LIBRARY QSCINTILLA_INCLUDE_DIR _QSCINTILLA_VERSION_MATCH VERSION_VAR QSCINTILLA_VERSION_STRING ) +endif () + +mark_as_advanced ( + QSCINTILLA_LIBRARY + QSCINTILLA_LIBRARIES + QSCINTILLA_INCLUDE_DIR + QSCINTILLA_INCLUDE_DIRS + QSCINTILLA_MAJOR_VERSION + QSCINTILLA_MINOR_VERSION + QSCINTILLA_PATCH_VERSION + QSCINTILLA_VERSION_STRING + QSCINTILLA_ROOT_DIR +) diff --git a/cmake/FindQwt.cmake b/cmake/FindQwt.cmake new file mode 100644 index 0000000..e499361 --- /dev/null +++ b/cmake/FindQwt.cmake @@ -0,0 +1,64 @@ +# 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 +# + +# - Find Qwt installation +# Sets the following variables: +# QWT_LIBRARY - path to the Qwt library +# QWT_INCLUDE_DIR - path to the Qwt headers +# +# The header qwt_plot.h is looked for. +# The libraries +# qwt-qt4, qwt +# are looked for. +# + +IF(NOT Qwt_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Qwt ...") +ENDIF() + +FIND_PATH(QWT_INCLUDE_DIR qwt_plot.h PATH_SUFFIXES qwt) +FIND_PATH(QWT_INCLUDE_DIR qwt_plot.h PATH_SUFFIXES qwt-qt4) + +IF(WIN32) + SET(QWT_DEFINITIONS "-DQWT_DLL") + + IF(CMAKE_BUILD_TYPE STREQUAL Debug) + FIND_LIBRARY(QWT_LIBRARY qwtd) + ENDIF() + FIND_LIBRARY(QWT_LIBRARY qwt) +ELSE(WIN32) + # Give precedence to qwt-qt4 library. + # Note: on some platforms there can be several native qwt libraries linked against different + # versions of Qt; for example /usr/lib/libqwt.so for qwt linked against Qt 3 and + # /usr/lib/libqwt-qt4.so for qwt linked against Qt 4. + # We need only qt4-based qwt library, so we search libqwt-qt4, then libqwt library + # first ignoring system paths, then including system paths. + FIND_LIBRARY(QWT_LIBRARY qwt-qt4 PATH_SUFFIXES lib lib64 PATHS "${QWT_ROOT_DIR}" NO_DEFAULT_PATH) + FIND_LIBRARY(QWT_LIBRARY qwt-qt4 PATHS "${QWT_ROOT_DIR}" NO_DEFAULT_PATH) + FIND_LIBRARY(QWT_LIBRARY qwt PATH_SUFFIXES lib lib64 PATHS "${QWT_ROOT_DIR}" NO_DEFAULT_PATH) + FIND_LIBRARY(QWT_LIBRARY qwt PATHS "${QWT_ROOT_DIR}" NO_DEFAULT_PATH) + FIND_LIBRARY(QWT_LIBRARY qwt-qt4 PATH_SUFFIXES lib lib64) + FIND_LIBRARY(QWT_LIBRARY qwt-qt4) + FIND_LIBRARY(QWT_LIBRARY qwt PATH_SUFFIXES lib lib64) + FIND_LIBRARY(QWT_LIBRARY qwt) +ENDIF(WIN32) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qwt REQUIRED_VARS QWT_INCLUDE_DIR QWT_LIBRARY) + diff --git a/cmake/FindSIP.cmake b/cmake/FindSIP.cmake new file mode 100644 index 0000000..601cd45 --- /dev/null +++ b/cmake/FindSIP.cmake @@ -0,0 +1,46 @@ +# 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 +# + +# - Find SIP +# Sets the following variables: +# SIP_EXECUTABLE - path to the SIP executable +# SIP_INCLUDE_DIR - path to the SIP headers +# SIP_PYTHONPATH - path to the SIP Python packages +# +# The header sip.h is looked for. +# The binary 'sip' is looked for. +# + +IF(NOT SIP_FIND_QUIETLY) + MESSAGE(STATUS "Looking for SIP ...") +ENDIF() + +FIND_PROGRAM(SIP_EXECUTABLE sip) +FIND_PATH(SIP_INCLUDE_DIR sip.h PATH_SUFFIXES python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) + +IF(SIP_INCLUDE_DIR) + GET_FILENAME_COMPONENT(SIP_PYTHONPATH "${SIP_INCLUDE_DIR}" PATH) + GET_FILENAME_COMPONENT(SIP_PYTHONPATH "${SIP_PYTHONPATH}" PATH) + SET(SIP_PYTHONPATH "${SIP_PYTHONPATH}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") +ENDIF() + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SIP REQUIRED_VARS SIP_INCLUDE_DIR SIP_EXECUTABLE SIP_PYTHONPATH) + + diff --git a/cmake/FindSMESH.cmake b/cmake/FindSMESH.cmake new file mode 100644 index 0000000..9a4ba3c --- /dev/null +++ b/cmake/FindSMESH.cmake @@ -0,0 +1,43 @@ +# 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 +# + +SET(SMESH_CXXFLAGS -I${SMESH_ROOT_DIR}/include/salome) + +FIND_LIBRARY(GeomSelectionTools GeomSelectionTools ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MEFISTO2D MEFISTO2D ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MeshDriverDAT MeshDriverDAT ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MeshDriverMED MeshDriverMED ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MeshDriver MeshDriver ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MeshDriverSTL MeshDriverSTL ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MeshDriverUNV MeshDriverUNV ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeIDLSMESH SalomeIDLSMESH ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMDS SMDS ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESHClient SMESHClient ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESHControls SMESHControls ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESHDS SMESHDS ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESHEngine SMESHEngine ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESHFiltersSelection SMESHFiltersSelection ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESHimpl SMESHimpl ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESHObject SMESHObject ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESH SMESH ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(StdMeshersEngine StdMeshersEngine ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(StdMeshersGUI StdMeshersGUI ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(StdMeshers StdMeshers ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SMESHUtils SMESHUtils ${SMESH_ROOT_DIR}/lib/salome) +FIND_LIBRARY(MeshDriverGMF MeshDriverGMF ${SMESH_ROOT_DIR}/lib/salome) diff --git a/cmake/FindSalomeCGNS.cmake b/cmake/FindSalomeCGNS.cmake new file mode 100644 index 0000000..c3cf745 --- /dev/null +++ b/cmake/FindSalomeCGNS.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(CGNS CGNS_INCLUDE_DIRS 1) +MARK_AS_ADVANCED(CGNS_INCLUDE_DIRS CGNS_LIBRARIES) + +IF(CGNS_FOUND) + SALOME_ACCUMULATE_HEADERS(CGNS_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CGNS_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/cmake/FindSalomeGEOM.cmake b/cmake/FindSalomeGEOM.cmake new file mode 100644 index 0000000..309df0f --- /dev/null +++ b/cmake/FindSalomeGEOM.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 SalomeGEOM_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome GEOM ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${GEOM_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeGEOM SalomeGEOM CONFIG) + +IF(NOT SalomeGEOM_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome GEOM: ${GEOM_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeGEOM_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeGEOM_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeGUI.cmake b/cmake/FindSalomeGUI.cmake new file mode 100644 index 0000000..66d5b9f --- /dev/null +++ b/cmake/FindSalomeGUI.cmake @@ -0,0 +1,109 @@ +# 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 +# +# Author: Adrien Bruneton +# + +# GUI detection for Salome - this is typically called by dependent modules +# (PARAVIS, etc ...) +# +# The detection is simpler than for other prerequisites. +# See explanation in FindSalomeKERNEL.cmake. +# + +IF(NOT SalomeGUI_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome GUI ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${GUI_ROOT_DIR}") +SALOME_FIND_PACKAGE(SalomeGUI SalomeGUI CONFIG) + +IF(NOT SalomeGUI_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome GUI: ${GUI_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeGUI_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeGUI_EXTRA_ENV_${_res}}") +ENDFOREACH() + +#---------------------------------------------------------------------------- +# SALOME_GUI_WITH_CORBA is a macro useful for determining whether a SALOME GUI module +# is built in not light mode (with CORBA) +#---------------------------------------------------------------------------- +MACRO(SALOME_GUI_WITH_CORBA) + IF(SALOME_GUI_LIGHT_ONLY) + MESSAGE(FATAL_ERROR "\nWe absolutely need a Salome GUI module with CORBA.\nPlease set option SALOME_LIGHT_ONLY to OFF when building GUI module.") + ENDIF() +ENDMACRO(SALOME_GUI_WITH_CORBA) + + +#---------------------------------------------------------------------------- +# SALOME_GUI_MODE is a macro useful for determining whether a GUI module +# builded in particular mode +#---------------------------------------------------------------------------- +######################################################################### +# SALOME_GUI_MODE() +# +# USAGE: SALOME_GUI_MODE(_options) +# +# ARGUMENTS: +# _options [input] List - The list of CMake options given to SALOME GUI +# +# Notes: +# - The arguments list can include "OPTIONAL" keywords: +# * All arguments preceded by "OPTIONAL" keyword are mandatory for current module. +# If GUI module was compiled without this functionality, further installation +# of the current module becomes impossible. +# * All arguments following "OPTIONAL" keyword are optional for current module, which +# uses this functionality, but can be installed without it. +# +# - At present there are next options in the GUI module: +# SALOME_USE_OCCVIEWER, SALOME_USE_VTKVIEWER, SALOME_USE_GLVIEWER, SALOME_USE_PLOT2DVIEWER, +# SALOME_USE_GRAPHICSVIEW, SALOME_USE_QXGRAPHVIEWER, SALOME_USE_PVVIEWER, SALOME_USE_PYVIEWER, +# SALOME_USE_PYCONSOLE, SALOME_USE_SALOMEOBJECT +# +# Example of usage: +# SALOME_GUI_MODE(SALOME_USE_OCCVIEWER SALOME_USE_SALOMEOBJECT OPTIONAL SALOME_USE_PYCONSOLE) +# +MACRO(SALOME_GUI_MODE) + MESSAGE(STATUS "") + MESSAGE(STATUS " Checking status of GUI options") + MESSAGE(STATUS " ==================================== ") + MESSAGE(STATUS "") + SET(_message) + SET(_length 25) + SET(_is_optional OFF) + FOREACH(_option ${ARGN}) + IF(${_option} STREQUAL "OPTIONAL") + SET(_is_optional ON) + MESSAGE(STATUS " Optional:") + ELSE() + SALOME_JUSTIFY_STRING(${_option} ${_length} _option_name) + MESSAGE(STATUS " * ${_option_name} -> ${${_option}}") + IF(NOT ${_option} AND NOT ${_is_optional}) + LIST(APPEND _message ${_option}) + ENDIF() + ENDIF() + ENDFOREACH() + MESSAGE(STATUS "") + + IF(_message) + SET(_message "We absolutely need a Salome GUI module in special mode. The following options should be set to ON when building GUI module: \n${_message}\n") + MESSAGE(FATAL_ERROR "${_message}") + ENDIF() +ENDMACRO(SALOME_GUI_MODE) diff --git a/cmake/FindSalomeKERNEL.cmake b/cmake/FindSalomeKERNEL.cmake new file mode 100644 index 0000000..0f951f3 --- /dev/null +++ b/cmake/FindSalomeKERNEL.cmake @@ -0,0 +1,63 @@ +# 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 +# +# Author: Adrien Bruneton +# + +# KERNEL detection for salome - this is typically called by dependent modules +# (GUI, PARAVIS, etc ...) +# +# The detection is simpler than for other prerequisites. +# Indeed calling SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() with SalomeKERNEL is tricky: +# - one would write SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(KERNEL xyz n) +# - then the macro would look first for a file named SalomeKERNELConfig.cmake (=the normal situation) +# - if not found (because KERNEL_ROOT_DIR was badly set for example) the macro would then look +# for a file named FindSalomeKERNEL.cmake +# => this is the current file, and that would trigger an infinite recursion ... :-) +# This could be detected with a flag mechanism, but honestly this becomes an overkill. +# +# So we go for a simple lookup, without conflict check: +# + +IF(NOT SalomeKERNEL_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome KERNEL ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${KERNEL_ROOT_DIR}") +SALOME_FIND_PACKAGE(SalomeKERNEL SalomeKERNEL CONFIG) + +IF(NOT SalomeKERNEL_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome KERNEL: ${KERNEL_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeKERNEL_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeKERNEL_EXTRA_ENV_${_res}}") +ENDFOREACH() + +#---------------------------------------------------------------------------- +# KERNEL_WITH_CORBA is a macro useful for determining whether a KERNEL module +# builded in not light mode(with CORBA) +#---------------------------------------------------------------------------- +MACRO(KERNEL_WITH_CORBA) + IF(SALOME_KERNEL_LIGHT_ONLY) + MESSAGE(FATAL_ERROR "\nWe absolutely need a Salome KERNEL module with CORBA.\nPlease set option SALOME_LIGHT_ONLY to OFF when building KERNEL module.") + ENDIF() +ENDMACRO(KERNEL_WITH_CORBA) diff --git a/cmake/FindSalomeLibBatch.cmake b/cmake/FindSalomeLibBatch.cmake new file mode 100644 index 0000000..43155b2 --- /dev/null +++ b/cmake/FindSalomeLibBatch.cmake @@ -0,0 +1,33 @@ +# 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: Adrien Bruneton +# + +# LibBatch detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibBatch LIBBATCH_INCLUDE_DIRS 1) +#MARK_AS_ADVANCED() + +IF(SALOMELIBBATCH_FOUND) + SALOME_ACCUMULATE_HEADERS(LIBBATCH_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${LIBBATCH_LIBRARIES}) +ENDIF() diff --git a/cmake/FindSalomeMED.cmake b/cmake/FindSalomeMED.cmake new file mode 100644 index 0000000..9b3701e --- /dev/null +++ b/cmake/FindSalomeMED.cmake @@ -0,0 +1,46 @@ +# 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 +# +# Author: Adrien Bruneton +# + +# MED detection for Salome - this is typically called by dependent modules +# (PARAVIS, etc ...) +# +# The detection is simpler than for other prerequisites. +# See explanation in FindSalomeKERNEL.cmake. +# + +IF(NOT SalomeMED_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome MED ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${MED_ROOT_DIR}") +SALOME_FIND_PACKAGE(SalomeMED SalomeMED CONFIG) + +IF(NOT SalomeMED_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome MED: ${MED_ROOT_DIR}") +ENDIF() + +FIND_LIBRARY(medcouplingcorba medcouplingcorba ${MED_ROOT_DIR}/lib/salome) +FIND_LIBRARY(medcouplingclient medcouplingclient ${MED_ROOT_DIR}/lib/salome) +FIND_LIBRARY(SalomeIDLMED SalomeIDLMED ${MED_ROOT_DIR}/lib/salome) + +FOREACH(_res ${SalomeMED_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeMED_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeMEDCoupling.cmake b/cmake/FindSalomeMEDCoupling.cmake new file mode 100644 index 0000000..1fd2fce --- /dev/null +++ b/cmake/FindSalomeMEDCoupling.cmake @@ -0,0 +1,42 @@ +# 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 +# +# Author: Adrien Bruneton +# + +# MED detection for Salome - this is typically called by dependent modules +# (PARAVIS, etc ...) +# +# The detection is simpler than for other prerequisites. +# See explanation in FindSalomeKERNEL.cmake. +# + +IF(NOT SalomeMEDCoupling_FIND_QUIETLY) + MESSAGE(STATUS "Looking for MEDCoupling tool ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files") +SALOME_FIND_PACKAGE(SalomeMEDCoupling MEDCoupling CONFIG) + +IF(NOT SalomeMEDCoupling_FIND_QUIETLY) + MESSAGE(STATUS "Found MEDCoupling: ${MEDCOUPLING_ROOT_DIR}") +ENDIF() + +#FOREACH(_res ${SalomeMED_EXTRA_ENV}) +# SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeMED_EXTRA_ENV_${_res}}") +#ENDFOREACH() diff --git a/cmake/FindSalomeMetis.cmake b/cmake/FindSalomeMetis.cmake new file mode 100644 index 0000000..47f47a5 --- /dev/null +++ b/cmake/FindSalomeMetis.cmake @@ -0,0 +1,33 @@ +# 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: Adrien Bruneton +# + +# Medfile detection dor Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Metis METIS_INCLUDE_DIRS 1) +#MARK_AS_ADVANCED() + +IF(METIS_FOUND) + SALOME_ACCUMULATE_HEADERS(METIS_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${METIS_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/cmake/FindSalomeOpenCV.cmake b/cmake/FindSalomeOpenCV.cmake new file mode 100644 index 0000000..bcab5e7 --- /dev/null +++ b/cmake/FindSalomeOpenCV.cmake @@ -0,0 +1,38 @@ +# 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: Adrien Bruneton +# + +# OpenCV detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# +SET(UpCount 2) + +IF (WIN32) + SET(UpCount 0) +ENDIF (WIN32) + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OpenCV OpenCV_DIR ${UpCount}) + +#MARK_AS_ADVANCED() + +IF(OpenCV_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OpenCV_LIBRARIES}) +ENDIF() diff --git a/cmake/FindSalomeOpenGL.cmake b/cmake/FindSalomeOpenGL.cmake new file mode 100644 index 0000000..1cf4d2e --- /dev/null +++ b/cmake/FindSalomeOpenGL.cmake @@ -0,0 +1,38 @@ +# 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: Adrien Bruneton +# + +# OpenGL detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# +IF(WIN32) + # The variable is not even set under Windows 32. Force it to blank so that + # we don't get a warning in the big macro. + SET(OPENGL_INCLUDE_DIR "") +ENDIF() +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OpenGL OPENGL_INCLUDE_DIR 1) +#MARK_AS_ADVANCED() + +IF(OPENGL_FOUND) + SALOME_ACCUMULATE_HEADERS(OPENGL_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OPENGL_LIBRARIES}) +ENDIF() + diff --git a/cmake/FindSalomePARAVIS.cmake b/cmake/FindSalomePARAVIS.cmake new file mode 100644 index 0000000..ec6b6b9 --- /dev/null +++ b/cmake/FindSalomePARAVIS.cmake @@ -0,0 +1,42 @@ +# 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 +# +# Author: Adrien Bruneton +# + +# PARAVIS detection for Salome - this is typically called by dependent modules +# (PARAVIS, etc ...) +# +# The detection is simpler than for other prerequisites. +# See explanation in FindSalomeKERNEL.cmake. +# + +IF(NOT SalomePARAVIS_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome PARAVIS ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${PARAVIS_ROOT_DIR}") +SALOME_FIND_PACKAGE(SalomePARAVIS SalomePARAVIS CONFIG) + +IF(NOT SalomePARAVIS_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome PARAVIS: ${PARAVIS_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomePARAVIS_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomePARAVIS_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomePaco.cmake b/cmake/FindSalomePaco.cmake new file mode 100644 index 0000000..2a1505e --- /dev/null +++ b/cmake/FindSalomePaco.cmake @@ -0,0 +1,32 @@ +# 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: Renaud Barate +# + +# Paco detection for SALOME +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Paco PACO_INCLUDE_DIRS 1) +#MARK_AS_ADVANCED() + +IF(SALOMEPACO_FOUND) + SALOME_ACCUMULATE_HEADERS(PACO_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PACO_LIBRARIES}) +ENDIF() diff --git a/cmake/FindSalomeParMetis.cmake b/cmake/FindSalomeParMetis.cmake new file mode 100644 index 0000000..eb10285 --- /dev/null +++ b/cmake/FindSalomeParMetis.cmake @@ -0,0 +1,33 @@ +# 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: Adrien Bruneton +# + +# Medfile detection dor Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParMetis PARMETIS_INCLUDE_DIRS 0) +#MARK_AS_ADVANCED() + +IF(PARMETIS_FOUND) + SALOME_ACCUMULATE_HEADERS(PARMETIS_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PARMETIS_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/cmake/FindSalomeParaView.cmake b/cmake/FindSalomeParaView.cmake new file mode 100644 index 0000000..db40437 --- /dev/null +++ b/cmake/FindSalomeParaView.cmake @@ -0,0 +1,39 @@ +# Copyright (C) 2010-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: Adrien Bruneton +# + +# ParaView detection for salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +IF(NOT QT_VERSION) + MESSAGE(FATAL_ERROR "Detection of ParaView requires Qt to be detected first!") +ENDIF() + +IF (QT_VERSION VERSION_LESS "5.0") + SET(PARAVIEW_QT_VERSION "4") +ELSE() + SET(PARAVIEW_QT_VERSION "5") +ENDIF() + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParaView PARAVIEW_USE_FILE 4) + +INCLUDE(${PARAVIEW_USE_FILE}) diff --git a/cmake/FindSalomePyQt4.cmake b/cmake/FindSalomePyQt4.cmake new file mode 100644 index 0000000..eb66796 --- /dev/null +++ b/cmake/FindSalomePyQt4.cmake @@ -0,0 +1,37 @@ +# 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: Adrien Bruneton +# + +# PyQt4 detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +# PyQt needs SIP, call it automatically +FIND_PACKAGE(SalomeSIP REQUIRED) + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PyQt4 PYQT_PYUIC_EXECUTABLE 2) +MARK_AS_ADVANCED(PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_PYUIC_PATH PYQT_PYRCC_PATH) + +IF(PYQT4_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYQT_PYUIC_EXECUTABLE}) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYQT_PYTHONPATH}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYQT_PYTHONPATH}) +ENDIF() diff --git a/cmake/FindSalomePyQt5.cmake b/cmake/FindSalomePyQt5.cmake new file mode 100644 index 0000000..22598cc --- /dev/null +++ b/cmake/FindSalomePyQt5.cmake @@ -0,0 +1,37 @@ +# Copyright (C) 2013-2015 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: Adrien Bruneton +# + +# PyQt5 detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +# PyQt needs SIP, call it automatically +FIND_PACKAGE(SalomeSIP REQUIRED) + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PyQt5 PYQT_PYUIC_EXECUTABLE 2) +MARK_AS_ADVANCED(PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_PYUIC_PATH PYQT_PYRCC_PATH) + +IF(PYQT5_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYQT_PYUIC_EXECUTABLE}) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYQT_PYTHONPATH}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYQT_PYTHONPATH}) +ENDIF() diff --git a/cmake/FindSalomeQScintilla.cmake b/cmake/FindSalomeQScintilla.cmake new file mode 100644 index 0000000..639b13b --- /dev/null +++ b/cmake/FindSalomeQScintilla.cmake @@ -0,0 +1,32 @@ +# 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 +# + +# QScintilla detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(QScintilla QSCINTILLA_ROOT_DIR 0) +# IF(QScintilla_FOUND OR QSCINTILLA_FOUND) +# MESSAGE(STATUS "QScintilla include dir is: ${QSCINTILLA_INCLUDE_DIRS}") +# ENDIF() + +IF(QSCINTILLA_FOUND) + SALOME_ACCUMULATE_HEADERS(QSCINTILLA_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QSCINTILLA_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/cmake/FindSalomeQt4.cmake b/cmake/FindSalomeQt4.cmake new file mode 100644 index 0000000..b4fb9bf --- /dev/null +++ b/cmake/FindSalomeQt4.cmake @@ -0,0 +1,44 @@ +# 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: Adrien Bruneton +# + +# Qt4 detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt4 QT_INCLUDES 2) +MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE) + +# This is only needed to correctly detect Qt help generator tool, to workaround an error +# coming from ParaView detection procedure +FIND_PROGRAM(QT_HELP_GENERATOR qhelpgenerator + PATHS "${QT_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH + DOC "qhelpgenerator used to compile Qt help project files" + ) +MARK_AS_ADVANCED(QT_HELP_GENERATOR) + +IF(QT4_FOUND) + SALOME_ACCUMULATE_HEADERS(QT_INCLUDES) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${QT_QMAKE_EXECUTABLE}) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QT_QTCORE_LIBRARY}) + SET(QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}") + MESSAGE(STATUS "Qt version is ${QT_VERSION}") +ENDIF() diff --git a/cmake/FindSalomeQt5.cmake b/cmake/FindSalomeQt5.cmake new file mode 100644 index 0000000..31168f3 --- /dev/null +++ b/cmake/FindSalomeQt5.cmake @@ -0,0 +1,72 @@ +# Copyright (C) 2013-2015 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: Adrien Bruneton +# + +# Qt5 detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +# 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) + +FOREACH(_Qt5_COMPONENT ${Qt5_FIND_COMPONENTS}) + SET(_Qt5_COMPONENT Qt5${_Qt5_COMPONENT}) + 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}) + LIST(APPEND QT_LIBRARIES ${${_Qt5_COMPONENT}_LIBRARIES}) +ENDFOREACH() + +FIND_PACKAGE(Qt5LinguistTools) +GET_TARGET_PROPERTY(QT_LRELEASE_EXECUTABLE Qt5::lrelease LOCATION) +MARK_AS_ADVANCED(QT_LRELEASE_EXECUTABLE) + +GET_FILENAME_COMPONENT(QT_BINARY_DIR ${QT_LRELEASE_EXECUTABLE} DIRECTORY) +MARK_AS_ADVANCED(QT_BINARY_DIR) + +# This is only needed to correctly detect Qt help generator tool, to workaround an error +# coming from ParaView detection procedure +FIND_PROGRAM(QT_HELP_GENERATOR + qhelpgenerator + PATHS "${QT_BINARY_DIR}" + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH + DOC "qhelpgenerator used to compile Qt help project files") +MARK_AS_ADVANCED(QT_HELP_GENERATOR) + +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}) + MESSAGE(STATUS "Qt version is ${QT_VERSION}") +ENDIF() diff --git a/cmake/FindSalomeQwt.cmake b/cmake/FindSalomeQwt.cmake new file mode 100644 index 0000000..cec84e6 --- /dev/null +++ b/cmake/FindSalomeQwt.cmake @@ -0,0 +1,32 @@ +# 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: Adrien Bruneton +# + +# Qwt detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qwt QWT_INCLUDE_DIR 1) +MARK_AS_ADVANCED(QWT_INCLUDE_DIR QWT_LIBRARY) + +IF(QWT_FOUND) + SALOME_ACCUMULATE_HEADERS(QWT_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QWT_LIBRARY}) +ENDIF() \ No newline at end of file diff --git a/cmake/FindSalomeSIP.cmake b/cmake/FindSalomeSIP.cmake new file mode 100644 index 0000000..788e2e5 --- /dev/null +++ b/cmake/FindSalomeSIP.cmake @@ -0,0 +1,34 @@ +# 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: Adrien Bruneton +# + +# SIP detection for Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SIP SIP_EXECUTABLE 2) +MARK_AS_ADVANCED(SIP_EXECUTABLE SIP_INCLUDE_DIR) + +IF(SIP_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SIP_EXECUTABLE}) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SIP_PYTHONPATH}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SIP_PYTHONPATH}) +ENDIF() + diff --git a/cmake/FindSalomeSMESH.cmake b/cmake/FindSalomeSMESH.cmake new file mode 100644 index 0000000..da6fbd6 --- /dev/null +++ b/cmake/FindSalomeSMESH.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 SalomeSMESH_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome SMESH ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${SMESH_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeSMESH SalomeSMESH CONFIG) + +IF(NOT SalomeSMESH_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome SMESH: ${SMESH_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeSMESH_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeSMESH_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomeScotch.cmake b/cmake/FindSalomeScotch.cmake new file mode 100644 index 0000000..487d53d --- /dev/null +++ b/cmake/FindSalomeScotch.cmake @@ -0,0 +1,33 @@ +# 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: Adrien Bruneton +# + +# Medfile detection dor Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Scotch SCOTCH_INCLUDE_DIRS 1) +#MARK_AS_ADVANCED() + +IF(SCOTCH_FOUND) + SALOME_ACCUMULATE_HEADERS(SCOTCH_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SCOTCH_LIBRARIES}) +ENDIF() diff --git a/cmake/FindSalomeTBB.cmake b/cmake/FindSalomeTBB.cmake new file mode 100644 index 0000000..5934aa5 --- /dev/null +++ b/cmake/FindSalomeTBB.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(TBB TBB_INCLUDE_DIRS 1) +MARK_AS_ADVANCED(TBB_INCLUDE_DIRS TBB_LIBRARIES) + +IF(TBB_FOUND) + SALOME_ACCUMULATE_HEADERS(TBB_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${TBB_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/cmake/FindSalomeXDR.cmake b/cmake/FindSalomeXDR.cmake new file mode 100644 index 0000000..00a3b9b --- /dev/null +++ b/cmake/FindSalomeXDR.cmake @@ -0,0 +1,33 @@ +# 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: Anthony Geay +# + +# XDR detection dor Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(XDR XDR_INCLUDE_DIRS 1) +#MARK_AS_ADVANCED() + +#IF(XDR_FOUND) # useless here because XDR is used only in CXX of MEDLoader +# SALOME_ACCUMULATE_HEADERS(XDR_INCLUDE_DIRS) +# SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${XDR_LIBRARIES}) +#ENDIF() \ No newline at end of file diff --git a/cmake/FindSalomeYACS.cmake b/cmake/FindSalomeYACS.cmake new file mode 100644 index 0000000..e97e32a --- /dev/null +++ b/cmake/FindSalomeYACS.cmake @@ -0,0 +1,34 @@ +# 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 +# + +IF(NOT SalomeYACS_FIND_QUIETLY) + MESSAGE(STATUS "Looking for Salome YACS ...") +ENDIF() + +SET(CMAKE_PREFIX_PATH "${YACS_ROOT_DIR}") + +SALOME_FIND_PACKAGE(SalomeYACS SalomeYACS CONFIG) + +IF(NOT SalomeYACS_FIND_QUIETLY) + MESSAGE(STATUS "Found Salome YACS: ${YACS_ROOT_DIR}") +ENDIF() + +FOREACH(_res ${SalomeYACS_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeYACS_EXTRA_ENV_${_res}}") +ENDFOREACH() \ No newline at end of file diff --git a/cmake/FindSalomef2c.cmake b/cmake/FindSalomef2c.cmake new file mode 100755 index 0000000..08f824b --- /dev/null +++ b/cmake/FindSalomef2c.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(f2c f2c_INCLUDE_DIRS 0) +MARK_AS_ADVANCED(F2C_INCLUDE_DIRS F2C_LIBRARIES F2C_GENERATOR) + +IF(F2C_FOUND) + SALOME_ACCUMULATE_HEADERS(F2C_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${F2C_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/cmake/FindScotch.cmake b/cmake/FindScotch.cmake new file mode 100644 index 0000000..60612ef --- /dev/null +++ b/cmake/FindScotch.cmake @@ -0,0 +1,35 @@ +# 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 +# + +# ------ + +MESSAGE(STATUS "Check for scotch ...") + +SET(SCOTCH_ROOT_DIR $ENV{SCOTCH_ROOT_DIR} CACHE PATH "Path to the SCOTCH.") +IF(SCOTCH_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${SCOTCH_ROOT_DIR}") +ENDIF(SCOTCH_ROOT_DIR) + +FIND_LIBRARY(SCOTCH_LIBRARIES scotch) +FIND_LIBRARY(SCOTCH_ERR_LIBRARIES scotcherr) +SET(SCOTCH_LIBRARIES ${SCOTCH_LIBRARIES} ${SCOTCH_ERR_LIBRARIES}) +FIND_PATH(SCOTCH_INCLUDE_DIRS scotch.h PATH_SUFFIXES "/scotch") + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Scotch REQUIRED_VARS SCOTCH_INCLUDE_DIRS SCOTCH_LIBRARIES) diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake new file mode 100644 index 0000000..0f4077f --- /dev/null +++ b/cmake/FindTBB.cmake @@ -0,0 +1,105 @@ +# - Find TBB +# Sets the following variables: +# TBB_INCLUDE_DIRS - path to the TBB include directory +# TBB_LIBRARIES - path to the TBB 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 +# + +# ------ + +MESSAGE(STATUS "Check for TBB ...") + +# ------ + +SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR}) + +IF(TBB_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${TBB_ROOT_DIR}") +ENDIF(TBB_ROOT_DIR) + +FIND_PATH(TBB_INCLUDE_DIRS tbb/tbb.h PATH_SUFFIXES include) + +IF(MACHINE_IS_64) + SET(PLT_SUFFIX intel64) +ELSE(MACHINE_IS_64) + SET(PLT_SUFFIX ia32) +ENDIF(MACHINE_IS_64) + +include(CheckCXXSourceCompiles) + +FOREACH(_kernel cc4.1.0_libc2.4_kernel2.6.16.21 gcc4.4 gcc4.1) + + FIND_LIBRARY(_tbb_library_tbb${_kernel} NAMES tbb PATH_SUFFIXES lib/${PLT_SUFFIX}/${_kernel}) + FIND_LIBRARY(_tbb_library_tbbmalloc${_kernel} NAMES tbbmalloc PATH_SUFFIXES lib/${PLT_SUFFIX}/${_kernel}) + + SET(_tbb_libraries${_kernel} ${_tbb_library_tbb${_kernel}} ${_tbb_library_tbbmalloc${_kernel}}) + + IF(_tbb_libraries${_kernel}) + + SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + SET(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) + SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES} ${TBB_INCLUDE_DIRS}") + SET(CMAKE_REQUIRED_LIBRARIES "${_tbb_libraries${_kernel}}") + + CHECK_CXX_SOURCE_COMPILES(" + #include + using namespace tbb; + size_t testme(size_t n) + { + return n*n; + } + int main(int argc, char* argv[]) + { + parallel_for( 1, 10, 1, testme ); + } + " + _tbb_link_ok${_kernel} + ) + + SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) + + IF(_tbb_link_ok${_kernel}) + SET(_tbb_link_ok ${_tbb_link_ok${_kernel}}) + SET(TBB_LIBRARY_tbb ${_tbb_library_tbb${_kernel}} CACHE FILEPATH "Path to a library") + SET(TBB_LIBRARY_tbbmalloc ${_tbb_library_tbbmalloc${_kernel}} CACHE FILEPATH "Path to a library") + SET(TBB_LIBRARIES ${TBB_LIBRARY_tbb} ${TBB_LIBRARY_tbbmalloc}) + ENDIF() + + UNSET(_tbb_link_ok${_kernel} CACHE) + + ENDIF(_tbb_libraries${_kernel}) + + UNSET(_tbb_library_tbb${_kernel} CACHE) + UNSET(_tbb_library_tbbmalloc${_kernel} CACHE) + + IF(_tbb_link_ok) + BREAK() + ENDIF() + +ENDFOREACH() + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARY_tbb TBB_LIBRARY_tbbmalloc) diff --git a/cmake/FindXDR.cmake b/cmake/FindXDR.cmake new file mode 100644 index 0000000..e8e8625 --- /dev/null +++ b/cmake/FindXDR.cmake @@ -0,0 +1,40 @@ +# 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 +# + +MESSAGE(STATUS "Check for XDR ...") + +FIND_PATH(XDR_INCLUDE_DIRS rpc/xdr.h) +IF(XDR_INCLUDE_DIRS) + SET(XDR_DEFINITIONS "-DHAS_XDR") +ENDIF() + +IF(WIN32) + FIND_LIBRARY(XDR_LIBRARIES xdr) # To get the .lib file from XDR + FIND_PATH(XDR_INCLUDE_DIRS2 stdint.h PATH_SUFFIXES src/msvc) # To get the stdint.h from XDR (needed by types.h) + IF(XDR_INCLUDE_DIRS) + IF(XDR_INCLUDE_DIRS2) + LIST(APPEND XDR_INCLUDE_DIRS "${XDR_INCLUDE_DIRS2}") + ELSE() + SET(XDR_INCLUDE_DIRS "${XDR_INCLUDE_DIRS2}") # Make the detection fail + ENDIF() + ENDIF() +ENDIF(WIN32) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_INCLUDE_DIRS) diff --git a/cmake/FindYACS.cmake b/cmake/FindYACS.cmake new file mode 100644 index 0000000..cd0081c --- /dev/null +++ b/cmake/FindYACS.cmake @@ -0,0 +1,35 @@ +# 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(YACS_CXXFLAGS -I${YACS_ROOT_DIR}/include/salome) # to be removed +SET(YACS_INCLUDE_DIRS ${YACS_ROOT_DIR}/include/salome) + +FIND_LIBRARY(YACS_YACSloader YACSloader ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_YACSBases YACSBases ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_YACSlibEngine YACSlibEngine ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_YACSRuntimeSALOME YACSRuntimeSALOME ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_YACSDLTest YACSDLTest ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_SalomeIDLYACS SalomeIDLYACS ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_TestComponentLocal TestComponentLocal ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_PluginSimplex PluginSimplex ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_PluginOptEvTest1 PluginOptEvTest1 ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_HMI HMI ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_GenericGui GenericGui ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_YACS YACS ${YACS_ROOT_DIR}/lib/salome) +FIND_LIBRARY(YACS_SalomeWrap SalomeWrap ${YACS_ROOT_DIR}/lib/salome) diff --git a/cmake/Findf2c.cmake b/cmake/Findf2c.cmake new file mode 100755 index 0000000..08a131c --- /dev/null +++ b/cmake/Findf2c.cmake @@ -0,0 +1,55 @@ +# - Find F2C +# Sets the following variables: +# f2c_INCLUDE_DIRS - path to the f2c include directory +# f2c_LIBRARIES - path to the f2c libraries to be linked against +# f2c_GENERATOR - f2c executable +# + +######################################################################### +# 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 +# + +# ------ + +MESSAGE(STATUS "Check for f2c ...") + +# ------ + +SET(f2c_ROOT_DIR $ENV{F2C_ROOT_DIR}) + +IF(f2c_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${f2c_ROOT_DIR}") +ENDIF(f2c_ROOT_DIR) + +FIND_PATH(f2c_INCLUDE_DIRS F2c.h) +FIND_LIBRARY(f2c_LIBRARY_LIBF77 NAMES LIBF77) +FIND_LIBRARY(f2c_LIBRARY_LIBI77 NAMES LIBI77) + +SET(f2c_LIBRARIES + ${f2c_LIBRARY_LIBF77} + ${f2c_LIBRARY_LIBI77} +) + +FIND_PROGRAM(f2c_GENERATOR F2c) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(f2c REQUIRED_VARS f2c_INCLUDE_DIRS f2c_LIBRARIES f2c_GENERATOR) \ No newline at end of file diff --git a/cmake/UsePyQt.cmake b/cmake/UsePyQt.cmake new file mode 100644 index 0000000..1c07ecd --- /dev/null +++ b/cmake/UsePyQt.cmake @@ -0,0 +1,161 @@ +# Copyright (C) 2012-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: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) + +INCLUDE(UseSIP) + +#################################################################### +# +# _PYQT_WRAP_GET_UNIQUE_TARGET_NAME: internal function +# +# Used to generate unique custom target name for usage in +# PYQT_WRAP_UIC macro. +# +# USAGE: _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(prefix unique_name) +# +# ARGUMENTS: +# prefix [in] prefix for the name +# unique_name [out] unique name generated by function +# +#################################################################### +FUNCTION(_PYQT_WRAP_GET_UNIQUE_TARGET_NAME name unique_name) + SET(_propertyName "_PYQT_WRAP_UNIQUE_COUNTER_${name}") + GET_PROPERTY(_currentCounter GLOBAL PROPERTY "${_propertyName}") + IF(NOT _currentCounter) + SET(_currentCounter 1) + ENDIF() + SET(${unique_name} "${name}_${_currentCounter}" PARENT_SCOPE) + MATH(EXPR _currentCounter "${_currentCounter} + 1") + SET_PROPERTY(GLOBAL PROPERTY ${_propertyName} ${_currentCounter} ) +ENDFUNCTION() + +#################################################################### +# +# PYQT_WRAP_UIC macro +# +# Create Python modules by processing input *.ui (Qt designer) files with +# PyQt pyuic tool. +# +# USAGE: PYQT_WRAP_UIC(output_files pyuic_files) +# +# ARGUMENTS: +# output_files [out] variable where output file names are listed to +# pyuic_files [in] list of *.ui files +# +# NOTES: +# - Input files are considered relative to the current source directory. +# - Output files are generated in the current build directory. +# - Macro automatically adds custom build target to generate output files +# +#################################################################### +MACRO(PYQT_WRAP_UIC outfiles) + + IF(NOT WIN32) + + FOREACH(_input ${ARGN}) + GET_FILENAME_COMPONENT(_input_name ${_input} NAME) + STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name}) + SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name}) + ADD_CUSTOM_COMMAND( + OUTPUT ${_output} + COMMAND ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input} + MAIN_DEPENDENCY ${_input} + ) + SET(${outfiles} ${${outfiles}} ${_output}) + ENDFOREACH() + _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName) + ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}}) + + ELSE(NOT WIN32) + +#### +# ANA: Workaround for the Microsoft Visual Studio 2010. Seems there is a bug in +# the Microsoft Visual Studio 2010 or CMake 2.8.10.2: custom target doesn't work +# for the list of the dependencies. It works only for the first dependency in the +# list. So generate separate target for the each input file. This problem will be +#investigated in the future. +#### + + SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) + _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName) + ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL) + FOREACH(_input ${ARGN}) + GET_FILENAME_COMPONENT(_input_name ${_input} NAME) + STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name}) + SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name}) + _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _TgName) + ADD_CUSTOM_TARGET(${_TgName} ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input} + DEPENDS ${_input} + ) + SET_TARGET_PROPERTIES(${_TgName} PROPERTIES FOLDER PYQT_WRAP_UIC_TARGETS) + ADD_DEPENDENCIES(${_uniqueTargetName} DEPEND ${_TgName}) + SET(${outfiles} ${${outfiles}} ${_output}) + ENDFOREACH() + ENDIF(NOT WIN32) +ENDMACRO(PYQT_WRAP_UIC) + +#################################################################### +# +# PYQT_WRAP_SIP macro +# +# Generate C++ wrappings for *.sip files by processing them with sip. +# +# USAGE: PYQT_WRAP_SIP(output_files sip_file [sip_file...] [OPTIONS options] [SOURCES sources]) +# +# NOTES: See SIP_WRAP_SIP macro from UseSIP.cmake for the usage description. +# +#################################################################### +MACRO(PYQT_WRAP_SIP outfiles) + SIP_WRAP_SIP(${outfiles} ${ARGN} OPTIONS ${PYQT_SIPFLAGS}) +ENDMACRO(PYQT_WRAP_SIP) + +#################################################################### +# +# PYQT_WRAP_QRC macro +# +# Generate Python wrappings for *.qrc files by processing them with pyrcc5. +# +# USAGE: PYQT_WRAP_QRC(output_files qrc_files) +# +# ARGUMENTS: +# output_files [out] variable where output file names are listed to +# qrc_files [in] list of *.qrc files +# +# NOTES: +# - Input files are considered relative to the current source directory. +# - Output files are generated in the current build directory. +# - Macro automatically adds custom build target to generate output files +# +#################################################################### + +MACRO(PYQT_WRAP_QRC outfiles) + FOREACH(_input ${ARGN}) + GET_FILENAME_COMPONENT(_input_name ${_input} NAME) + STRING(REPLACE ".qrc" "_qrc.py" _input_name ${_input_name}) + SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name}) + ADD_CUSTOM_COMMAND( + OUTPUT ${_output} + COMMAND ${PYQT_PYRCC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input} + MAIN_DEPENDENCY ${_input} + ) + SET(${outfiles} ${${outfiles}} ${_output}) + ENDFOREACH() + _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_QRC_PY_FILES _uniqueTargetName) + ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}}) +ENDMACRO(PYQT_WRAP_QRC) diff --git a/cmake/UseQtExt.cmake b/cmake/UseQtExt.cmake new file mode 100644 index 0000000..95985b7 --- /dev/null +++ b/cmake/UseQtExt.cmake @@ -0,0 +1,68 @@ +# 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 (QT_VERSION VERSION_LESS "5.0") + INCLUDE(${QT_USE_FILE}) +ENDIF() + +INSTALL(CODE "MACRO(QT_COMPILE_TS_ON_INSTALL MYLRELEASE MYTSFILE MYFULLDIR MYOUTQMFILE) + FILE(MAKE_DIRECTORY \${MYFULLDIR}) + MESSAGE(STATUS \"Compiling \${MYTSFILE}\") + EXECUTE_PROCESS(COMMAND \${MYLRELEASE} \${MYTSFILE} -qm \${MYFULLDIR}/\${MYOUTQMFILE}) +ENDMACRO(QT_COMPILE_TS_ON_INSTALL)") + +# This MACRO uses the following vars +# - QT_LRELEASE_EXECUTABLE : (given by default by FindQT.cmake) +# +# MYTSFILES containing all ts files to be compiled. +# WHERETOINSTALL contains directory (relative to install_prefix) where to install files after compilation of ts files too qm. +MACRO(QT_INSTALL_TS_RESOURCES MYTSFILES WHERETOINSTALL) + INSTALL(CODE "SET(INSTALL_TS_DIR ${WHERETOINSTALL})") + SET(MYSOURCES) + FOREACH(input ${MYTSFILES}) + GET_FILENAME_COMPONENT(input2 ${input} NAME) + STRING(REGEX REPLACE ".ts" "" base ${input2}) + SET(output "${base}.qm") + INSTALL(CODE "QT_COMPILE_TS_ON_INSTALL( \"${QT_LRELEASE_EXECUTABLE}\" \"${CMAKE_CURRENT_SOURCE_DIR}/${input}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_TS_DIR}\" ${output})") + ENDFOREACH(input ${MYIDLFILES}) +ENDMACRO(QT_INSTALL_TS_RESOURCES) + +MACRO(QT_WRAP_MOC) +IF (QT_VERSION VERSION_LESS "5.0") + QT4_WRAP_CPP(${ARGN}) +ELSE() + QT5_WRAP_CPP(${ARGN}) +ENDIF() +ENDMACRO(QT_WRAP_MOC) + +MACRO(QT_WRAP_UIC) +IF (QT_VERSION VERSION_LESS "5.0") + QT4_WRAP_UI(${ARGN}) +ELSE() + QT5_WRAP_UI(${ARGN}) +ENDIF() +ENDMACRO(QT_WRAP_UIC) + +MACRO(QT_ADD_RESOURCES) +IF (QT_VERSION VERSION_LESS "5.0") + QT4_ADD_RESOURCES(${ARGN}) +ELSE() + QT5_ADD_RESOURCES(${ARGN}) +ENDIF() +ENDMACRO(QT_ADD_RESOURCES) diff --git a/cmake/UseSIP.cmake b/cmake/UseSIP.cmake new file mode 100644 index 0000000..9ccfd07 --- /dev/null +++ b/cmake/UseSIP.cmake @@ -0,0 +1,117 @@ +# Copyright (C) 2012-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: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) + +#################################################################### +# +# SIP_WRAP_SIP macro +# +# Generate C++ wrappings for *.sip files by processing them with sip. +# +# USAGE: SIP_WRAP_SIP(output_files sip_file [sip_file...] [OPTIONS options] [SOURCES sources]) +# +# ARGUMENTS: +# output_files [out] variable where output file names are listed to +# sip_file [in] input sip file (a sequence can be provided) +# options [in] additional options to be specified to sip +# sources [in] additional source files to be included into output (see below) +# +# NOTES: +# - Input files are considered relative to the current source directory. +# - Output files are generated in the current build directory. +# +# WARNING: +# - Macro requires class(es) definition in the *.sip file(s) to be started +# on a new line without any preceeding characters. +# - Macro does not properly processes sip features which are wrapped +# with sip conditionals. +# - Macro works correctly only if one single sip module is processed +# (there's only one %Module directive within the set of input sip files). +# - Macro sometimes does not correctly computes full set of source files +# generated by sip; SOURCES option can be used to specify additional source +# files. +# +# TODO: +# - Check if dependency of static sources on generated headers works properly: +# if header is changed, dependant sources should be recompiled. +# - Process sip conditionals. +# - Process several sip modules. +# +#################################################################### +MACRO(SIP_WRAP_SIP outfiles) + SET(_output) + SET(_src_ext ".cc") + SET(_options -s ${_src_ext} -c .) + SET(_sip_files) + SET(_get_options "0") + SET(_get_sources "0") + FOREACH(_input ${ARGN}) + IF(${_input} STREQUAL "OPTIONS") + SET(_get_options "1") + SET(_get_sources "0") + ELSEIF(${_input} STREQUAL "SOURCES") + SET(_get_sources "1") + SET(_get_options "0") + ELSE() + IF(${_get_options} STREQUAL "1") + SET(_options ${_options} ${_input}) + ELSEIF(${_get_sources} STREQUAL "1") + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_input}) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_input}) + ELSE() + SET(_sip_files ${_sip_files} ${_input}) + ENDIF() + ENDIF() + ENDFOREACH() + SET(_module_input) + FOREACH(_input ${_sip_files}) + FILE(STRINGS ${_input} _sip_modules REGEX "%Module( |\\()") + FILE(STRINGS ${_input} _sip_classes REGEX "^class ") + FOREACH(_sip_module ${_sip_modules}) + STRING(REGEX MATCH ".*%Module *\\( *name=.*\\).*" _mod_name "${_sip_module}") + IF (_mod_name) + STRING(REGEX REPLACE ".*%Module *\\( *name=(.*).*\\).*" "\\1" _mod_name ${_sip_module}) + ELSE() + STRING(REGEX REPLACE ".*%Module *(.*)" "\\1" _mod_name ${_sip_module}) + ENDIF() + SET(_mod_header "sipAPI${_mod_name}.h") + SET(_mod_source "sip${_mod_name}cmodule${_src_ext}") + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_mod_source}) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_mod_source}) + SET(_module_input ${_input}) + ENDFOREACH() + FOREACH(_sip_class ${_sip_classes}) + STRING(REGEX MATCH ".*class +.* *:" _class_name "${_sip_class}") + IF (_class_name) + STRING(REGEX REPLACE ".*class +(.*) *:.*" "\\1" _class_name ${_sip_class}) + ELSE() + STRING(REGEX REPLACE ".*class *(.*)" "\\1" _class_name ${_sip_class}) + ENDIF() + STRING(STRIP ${_class_name} _class_name) + SET(_class_source "sip${_mod_name}${_class_name}${_src_ext}") + LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_class_source}) + SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_class_source}) + ENDFOREACH() + ENDFOREACH() + ADD_CUSTOM_COMMAND( + OUTPUT ${_output} + COMMAND ${SIP_EXECUTABLE} ${_options} ${CMAKE_CURRENT_SOURCE_DIR}/${_module_input} + MAIN_DEPENDENCY ${_module_input} + ) +ENDMACRO(SIP_WRAP_SIP) -- 2.39.2