1 # Copyright (C) 2010-2013 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 cmake_minimum_required(VERSION 2.8)
24 if(COMMAND cmake_policy)
25 cmake_policy(SET CMP0003 NEW)
26 endif(COMMAND cmake_policy)
28 SET(MED_READER_MAJOR_VERSION 3)
29 SET(MED_READER_MINOR_VERSION 1)
30 SET(MED_READER_BUILD_VERSION 0)
31 SET(MED_READER_VERSION
32 "${MED_READER_MAJOR_VERSION}.${MED_READER_MINOR_VERSION}.${MED_READER_BUILD_VERSION}")
35 # Load the ParaView/VTK packages
37 set(MedReader_BUILD_ParaView_Plugin ON CACHE BOOL "Build the ParaView plugin")
39 if(MedReader_BUILD_ParaView_Plugin)
40 FIND_PACKAGE(ParaView REQUIRED)
41 if(NOT ParaView_FOUND)
42 MESSAGE(FATAL_ERROR "Please locate ParaView." )
43 ENDIF(NOT ParaView_FOUND)
44 INCLUDE(${PARAVIEW_USE_FILE})
45 # Load information about VTK/ParaView modules loaded/available.
46 pv_setup_module_environment("vtkMedReader")
47 else(MedReader_BUILD_ParaView_Plugin)
48 FIND_PACKAGE(VTK REQUIRED)
50 MESSAGE(FATAL_ERROR "Please locate VTK." )
52 INCLUDE(${VTK_USE_FILE})
53 endif(MedReader_BUILD_ParaView_Plugin)
56 # Standard CMake option for building libraries shared or static by default.
57 OPTION(BUILD_SHARED_LIBS
58 "Build with shared libraries."
59 ${VTK_BUILD_SHARED_LIBS})
61 # Find dependant Library
63 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
64 FIND_PACKAGE(MED REQUIRED)
65 include_directories(${MED_INCLUDE_DIRS})
66 include_directories(${MEDFILE_INCLUDE_DIRS})
69 # process all vtk-modules defined in this plugin. This generates the necessary
70 # wrappings for all these modules as well.
72 SET(VTK_INSTALL_RUNTIME_DIR lib/salome)
73 SET(VTK_INSTALL_LIBRARY_DIR lib/salome)
74 SET(VTK_INSTALL_ARCHIVE_DIR lib/salome)
79 # Build the vtkMedReader
81 # add_subdirectory(IO)
84 # Build the parallel vtkPMedReader
86 set(MedReader_BUILD_PARALLEL ${VTK_USE_PARALLEL} CACHE BOOL "Build the Med Reader with parallel support.")
87 # MESSAGE(${MedReader_BUILD_PARALLEL})
90 # Build the ParaView Plugin
92 if(MedReader_BUILD_ParaView_Plugin)
93 add_subdirectory(ParaViewPlugin)
94 endif(MedReader_BUILD_ParaView_Plugin)