Salome HOME
Merge from V6_main (04/10/2012)
[modules/paravis.git] / src / Plugins / MedReader / IO / CMakeLists.txt
1 # Copyright (C) 2010-2012  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 #test if we have not yet included ParaView and/or VTK configuration files
21 IF(NOT VTK_FOUND)
22     FIND_PACKAGE(VTK REQUIRED)
23     INCLUDE(${VTK_USE_FILE})
24 ENDIF(NOT VTK_FOUND)
25
26 set(MedReader_CLASSES
27     vtkMedReader
28     vtkMedDriver
29     vtkMedDriver30
30     vtkMedFactory
31     vtkMedFile
32     vtkMedMesh
33     vtkMedGrid
34     vtkMedRegularGrid
35     vtkMedPolarGrid
36     vtkMedCartesianGrid
37     vtkMedCurvilinearGrid
38     vtkMedUnstructuredGrid
39     vtkMedFamily
40     vtkMedGroup
41     vtkMedField
42     vtkMedEntityArray
43     vtkMedProfile
44     vtkMedLocalization
45     vtkMedFieldOverEntity
46     vtkMedFieldStep
47     vtkMedUtilities
48     #vtkMedString
49     vtkMedIntArrayInternal
50     vtkMedIntArray
51     vtkMedFamilyOnEntity
52     vtkMedInterpolation
53     vtkMedFraction
54     vtkMedFilter
55     vtkMedFieldOnProfile
56     vtkExtractGroup
57     vtkMedSelection
58     vtkMedLink
59     vtkMedFamilyOnEntityOnProfile
60     vtkMedConstantAttribute
61     vtkMedVariableAttribute
62     vtkMedStructElement
63     vtkGenerateStructElement
64 )
65
66 set(MedReader_SRCS)
67 set(MedReader_HDRS)
68
69 foreach(class ${MedReader_CLASSES})
70     set(MedReader_SRCS ${MedReader_SRCS} ${class}.cxx)
71     set(MedReader_HDRS ${MedReader_HDRS} ${class}.h)
72 endforeach(class)
73
74 set_source_files_properties(
75   vtkMedGrid
76   vtkMedRegularGrid
77   vtkMedUtilities
78   PROPERTIES ABSTRACT 1
79 )
80
81 set_source_files_properties(
82   vtkMedIntArrayInternal
83   vtkMedUtilities
84   PROPERTIES WRAP_EXCLUDE 1
85 )
86
87 add_library(vtkMedReader ${MedReader_SRCS})
88
89 set(VTK_LIBS vtkIO)
90 if(${HDF5_IS_PARALLEL})
91   set(VTK_LIBS ${VTK_LIBS} vtkParallel)
92 endif(${HDF5_IS_PARALLEL})
93
94 # Introducing selection for parallel compilation
95 CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
96
97 add_definitions( -I${CMAKE_CURRENT_BINARY_DIR} )
98
99 target_link_libraries(vtkMedReader ${MED_LIBRARIES} ${VTK_LIBS} ${VTK_PARALLEL} ${vtkPVServerManager})
100
101 set(MedReader_BUILD_Testing ${VTK_BUILD_TESTING} CACHE BOOL "Build tests for the MedReader filter")
102
103 if(MedReader_BUILD_Testing)
104     add_subdirectory(Testing)
105 endif(MedReader_BUILD_Testing)
106
107 install(
108     TARGETS vtkMedReader
109     RUNTIME DESTINATION lib/salome
110     LIBRARY DESTINATION lib/salome
111     ARCHIVE DESTINATION lib/salome
112     )
113     
114 install(FILES ${MedReader_HDRS} DESTINATION include)
115         
116 # -----------------------------------------------------------------------------
117 # This make it easy for other projects to get the list of files etc. in this
118 # kit.
119 # -----------------------------------------------------------------------------
120 # needed by vtkExportKit.cmake
121 include(${VTK_CMAKE_DIR}/vtkExportKit.cmake)
122 IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
123   STRING(REGEX REPLACE "^/" "" VTK_INSTALL_PACKAGE_DIR_CM24 "${VTK_INSTALL_PACKAGE_DIR}")
124 ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
125
126 vtk_export_kit2(
127   "MedReader_IO" 
128   "MEDREADER_IO" 
129   ${CMAKE_CURRENT_BINARY_DIR} 
130   "${MedReader_SRCS}"
131 )