Salome HOME
Copyright update 2022
[modules/paravis.git] / src / Plugins / MEDReader / plugin / CMakeLists.txt
1 # Copyright (C) 2010-2022  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 # Common CMake macros
21 # ===================
22 set(TMP_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
23 unset(CMAKE_MODULE_PATH)
24 set(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
25 if(EXISTS ${CONFIGURATION_ROOT_DIR})
26   list(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
27   include(SalomeMacros)
28 else()
29   message(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
30 endif()
31
32 set(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "Path to the MEDCoupling tool")
33 if(EXISTS ${MEDCOUPLING_ROOT_DIR})
34   list(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")
35 endif()
36 list(APPEND CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules")
37 list(APPEND CMAKE_MODULE_PATH ${TMP_CMAKE_MODULE_PATH})
38
39 include(SalomeSetupPlatform)
40 set(BUILD_SHARED_LIBS TRUE)
41
42 find_package(SalomePythonInterp REQUIRED)
43 find_package(SalomePythonLibs REQUIRED)
44 find_package(SalomeHDF5 REQUIRED)
45 find_package(SalomeMEDCoupling REQUIRED)
46 find_package(SalomeMEDFile REQUIRED)
47
48 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
49                                                  ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
50 SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
51 SALOME_ACCUMULATE_ENVIRONMENT(PV_PLUGIN_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/lib/paraview)
52
53 add_subdirectory(MEDLoaderForPV)
54 add_subdirectory(ParaViewPlugin)
55
56 if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
57   # option to build tests in a standalone mode
58   option(BUILD_TESTING "Build Plugin Testing" OFF)
59 endif()
60 if (SALOME_BUILD_TESTS OR BUILD_TESTING)
61   add_subdirectory(Test)
62 endif()