Salome HOME
CMake: replacing CMAKE_* variables by PROJECT_* variabls
[modules/paravis.git] / src / Plugins / MedReader / IO / 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 set(MedReader_CLASSES
21     vtkMedReader
22     vtkMedDriver
23     vtkMedDriver30
24     vtkMedFactory
25     vtkMedFile
26     vtkMedMesh
27     vtkMedGrid
28     vtkMedRegularGrid
29     vtkMedPolarGrid
30     vtkMedCartesianGrid
31     vtkMedCurvilinearGrid
32     vtkMedUnstructuredGrid
33     vtkMedFamily
34     vtkMedGroup
35     vtkMedField
36     vtkMedEntityArray
37     vtkMedProfile
38     vtkMedLocalization
39     vtkMedFieldOverEntity
40     vtkMedFieldStep
41     vtkMedUtilities
42     #vtkMedString
43     vtkMedIntArrayInternal
44     vtkMedIntArray
45     vtkMedFamilyOnEntity
46     vtkMedInterpolation
47     vtkMedFraction
48     vtkMedFilter
49     vtkMedFieldOnProfile
50     vtkExtractGroup
51     vtkMedSelection
52     vtkMedLink
53     vtkMedFamilyOnEntityOnProfile
54     vtkMedConstantAttribute
55     vtkMedVariableAttribute
56     vtkMedStructElement
57     vtkGenerateStructElement
58 )
59
60 set(MedReader_SRCS)
61 set(MedReader_HDRS)
62
63 foreach(class ${MedReader_CLASSES})
64     set(MedReader_SRCS ${MedReader_SRCS} ${class}.cxx)
65     set(MedReader_HDRS ${MedReader_HDRS} ${class}.h)
66 endforeach(class)
67
68 set_source_files_properties(
69   vtkMedGrid
70   vtkMedRegularGrid
71   vtkMedUtilities
72   PROPERTIES ABSTRACT 1
73 )
74
75 set_source_files_properties(
76   vtkMedIntArrayInternal
77   vtkMedUtilities
78   PROPERTIES WRAP_EXCLUDE 1
79 )
80
81 # this adds target_link_libraries dependencies on all modules listed under
82 # DEPENDS in module.cmake
83 vtk_module_library(vtkMedReader ${MedReader_SRCS})
84
85 # Introducing selection for parallel compilation
86 # CONFIGURE_FILE( ${PROJECT_SOURCE_DIR}/IO/config.h.cmake ${PROJECT_SOURCE_DIR}/IO/config.h )
87 CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
88
89 target_link_libraries(vtkMedReader ${MED_LIBRARIES})
90
91 #set(MedReader_BUILD_Testing ${VTK_BUILD_TESTING} CACHE BOOL "Build tests for the MedReader filter")
92
93 #if(MedReader_BUILD_Testing)
94 #    add_subdirectory(Testing)
95 #endif(MedReader_BUILD_Testing)
96
97 install(
98     TARGETS vtkMedReader
99     RUNTIME DESTINATION lib/salome
100     LIBRARY DESTINATION lib/salome
101     ARCHIVE DESTINATION lib/salome
102     )
103
104 install(FILES ${MedReader_HDRS} DESTINATION include)
105         
106 # -----------------------------------------------------------------------------
107 # This make it easy for other projects to get the list of files etc. in this
108 # kit.
109 # -----------------------------------------------------------------------------
110 # needed by vtkExportKit.cmake
111
112 #include(${ParaView_CMAKE_DIR}/VTKMono/vtkExportKit.cmake)
113
114 #  #include(${VTK_CMAKE_DIR}/vtkExportKit.cmake)
115 #IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
116 #  STRING(REGEX REPLACE "^/" "" VTK_INSTALL_PACKAGE_DIR_CM24 "${VTK_INSTALL_PACKAGE_DIR}")
117 #ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
118
119 #set(VTK_INSTALL_PACKAGE_DIR_CM24 ${VTK_MODULES_DIR})
120 #vtk_export_kit2(
121 #  "MedReader_IO" 
122 #  "MEDREADER_IO" 
123 #  ${CMAKE_CURRENT_BINARY_DIR} 
124 #  "${MedReader_SRCS}"
125 #)