Salome HOME
Merge from V6_main 01/04/2013
[modules/paravis.git] / src / Plugins / MedReader / CMakeLists.txt
1 # Copyright (C) 2010-2013  CEA/DEN, EDF R&D
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 project(MedReader)
21          
22 cmake_minimum_required(VERSION 2.8)
23         
24 if(COMMAND cmake_policy)
25          cmake_policy(SET CMP0003 NEW)
26 endif(COMMAND cmake_policy)
27                 
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}")
33
34 #
35 # Load the ParaView/VTK packages
36 #
37 set(MedReader_BUILD_ParaView_Plugin ON CACHE BOOL "Build the ParaView plugin")
38
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)
49     if(NOT VTK_FOUND)
50         MESSAGE(FATAL_ERROR "Please locate VTK." )
51     ENDIF(NOT VTK_FOUND)
52     INCLUDE(${VTK_USE_FILE})
53 endif(MedReader_BUILD_ParaView_Plugin)
54
55          
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})
60 #
61 # Find dependant Library
62 #
63 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
64 FIND_PACKAGE(MED REQUIRED)
65 include_directories(${MED_INCLUDE_DIRS})
66
67 #
68 # process all vtk-modules defined in this plugin. This generates the necessary
69 # wrappings for all these modules as well.
70 #
71 SET(VTK_INSTALL_RUNTIME_DIR lib/salome)
72 SET(VTK_INSTALL_LIBRARY_DIR lib/salome)
73 SET(VTK_INSTALL_ARCHIVE_DIR lib/salome)
74
75 pv_process_modules()
76
77 #
78 # Build the vtkMedReader
79 #
80 # add_subdirectory(IO)
81
82 #
83 # Build the parallel vtkPMedReader
84 #
85 set(MedReader_BUILD_PARALLEL ${VTK_USE_PARALLEL} CACHE BOOL "Build the Med Reader with parallel support.")
86 # MESSAGE(${MedReader_BUILD_PARALLEL})
87
88 #
89 # Build the ParaView Plugin
90 #
91 if(MedReader_BUILD_ParaView_Plugin)
92         add_subdirectory(ParaViewPlugin)
93 endif(MedReader_BUILD_ParaView_Plugin)
94
95
96