Salome HOME
bos #20031 MEDReader and MPI
[modules/paravis.git] / src / Plugins / MEDReader / CMakeLists.txt
1 # Copyright (C) 2010-2020  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, or (at your option) any later version.
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 cmake_minimum_required(VERSION 3.8)
21 project(MEDReader)
22
23 find_package(ParaView REQUIRED)
24
25 IF(SALOME_USE_MPI)
26   ADD_DEFINITIONS(-DMEDREADER_USE_MPI)
27 ENDIF(SALOME_USE_MPI)
28
29 option(BUILD_SHARED_LIBS "Build shared libraries" ON)
30 enable_testing()
31
32 include(GNUInstallDirs)
33 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
34 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
35 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
36
37 set("_paraview_plugin_default_${CMAKE_PROJECT_NAME}" ON)
38 paraview_plugin_scan(
39   ENABLE_BY_DEFAULT YES
40   PLUGIN_FILES      "${CMAKE_CURRENT_SOURCE_DIR}/plugin/paraview.plugin"
41   PROVIDES_PLUGINS  plugins
42   REQUIRES_MODULES  required_modules)
43
44 foreach (module IN LISTS required_modules)
45   if (NOT TARGET "${module}")
46     message("Missing required module: ${module}")
47     return ()
48   endif ()
49 endforeach ()
50
51 paraview_plugin_build(
52   RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}"
53   LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}"
54   LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}"
55   PLUGINS ${plugins})