1 # Copyright (C) 2010-2012 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 else(MedReader_BUILD_ParaView_Plugin)
46 FIND_PACKAGE(VTK REQUIRED)
48 MESSAGE(FATAL_ERROR "Please locate VTK." )
50 INCLUDE(${VTK_USE_FILE})
51 endif(MedReader_BUILD_ParaView_Plugin)
54 # Standard CMake option for building libraries shared or static by default.
55 OPTION(BUILD_SHARED_LIBS
56 "Build with shared libraries."
57 ${VTK_BUILD_SHARED_LIBS})
59 # Find dependant Library
61 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
62 FIND_PACKAGE(MED REQUIRED)
63 include_directories(${MED_INCLUDE_DIRS})
66 # Build the vtkMedReader
71 # Build the parallel vtkPMedReader
73 set(MedReader_BUILD_PARALLEL ${VTK_USE_PARALLEL} CACHE BOOL "Build the Med Reader with parallel support.")
76 # Build the ParaView Plugin
78 if(MedReader_BUILD_ParaView_Plugin)
79 add_subdirectory(ParaViewPlugin)
80 endif(MedReader_BUILD_ParaView_Plugin)