]> SALOME platform Git repositories - modules/paravis.git/blob - src/Plugins/MEDWriter/CMakeLists.txt
Salome HOME
653e5cac29300c9bf468ebf0a457fc55d527af9a
[modules/paravis.git] / src / Plugins / MEDWriter / CMakeLists.txt
1 # Copyright (C) 2016  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 # Author : Anthony Geay (EDF R&D)
20
21 PROJECT(MEDWriter)
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
23
24 IF(COMMAND cmake_policy)
25   CMAKE_POLICY(SET CMP0003 NEW)
26   #CMAKE_POLICY(SET CMP0022 OLD)
27   #CMAKE_POLICY(SET CMP0023 OLD)
28 ENDIF(COMMAND cmake_policy)
29
30 SET(MED_WRITER_VERSION "0.0.0")
31
32 FIND_PACKAGE(ParaView REQUIRED)
33 IF(NOT ParaView_FOUND)
34   MESSAGE(FATAL_ERROR "Please locate ParaView." )
35 ENDIF(NOT ParaView_FOUND)
36 INCLUDE(${PARAVIEW_USE_FILE})
37 PV_SETUP_MODULE_ENVIRONMENT("vtkMEDWriter")
38
39 OPTION(BUILD_SHARED_LIBS "Build with shared libraries." ${VTK_BUILD_SHARED_LIBS})
40
41 SET(VTK_INSTALL_RUNTIME_DIR lib/salome)
42 SET(VTK_INSTALL_LIBRARY_DIR lib/salome)
43 SET(VTK_INSTALL_ARCHIVE_DIR lib/salome)
44 SET(MEDWRITER_INSTALL_CMAKE_LOCAL adm_local/cmake_files CACHE PATH "Install path: local SALOME CMake files")
45 SET(MEDWRITER_INSTALL_HEADERS include/salome CACHE PATH "Install path: local include files")
46
47
48 SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "MEDCOUPLING_ROOT_DIR")
49 LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")
50 INCLUDE(SalomeMacros)
51 FIND_PACKAGE(SalomeHDF5 REQUIRED)
52 FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
53 FIND_PACKAGE(SalomeMEDFile REQUIRED)
54
55 PV_PROCESS_MODULES()
56
57 INCLUDE_DIRECTORIES(
58   ${MEDCOUPLING_INCLUDE_DIRS}
59   ${MEDFILE_INCLUDE_DIRS}
60   ${HDF5_INCLUDE_DIRS})
61
62 ADD_SUBDIRECTORY(IO)
63 ADD_SUBDIRECTORY(ParaViewPlugin)
64
65 INCLUDE(CMakePackageConfigHelpers)
66
67 SALOME_CONFIGURE_PREPARE(MEDCOUPLING MEDFILE HDF5)
68 CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in 
69   ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
70   INSTALL_DESTINATION "${MEDWRITER_INSTALL_CMAKE_LOCAL}"
71   PATH_VARS CMAKE_INSTALL_PREFIX MEDWRITER_INSTALL_HEADERS)
72
73 INSTALL(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" DESTINATION "${MEDWRITER_INSTALL_CMAKE_LOCAL}")
74 INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${MEDWRITER_INSTALL_CMAKE_LOCAL}" FILE ${PROJECT_NAME}Targets.cmake)