# Project name, upper case
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
-SET(${PROJECT_NAME_UC}_MAJOR_VERSION 1)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 0)
+SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
# Our own set of macros:
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_files")
-INCLUDE(MEDCouplingMacros)
+INCLUDE(SalomeMacros)
+
+# Platform setup
+# ==============
+INCLUDE(SalomeSetupPlatform)
#
# User options
# =========================
IF(NOT MEDCOUPLING_MED_MICROMED)
- FIND_PACKAGE(HDF5 REQUIRED)
- FIND_PACKAGE(MEDFile REQUIRED)
+ FIND_PACKAGE(SalomeHDF5 REQUIRED)
+ FIND_PACKAGE(SalomeMEDFile REQUIRED)
# XDR stuff
IF(NOT WIN32)
- FIND_PACKAGE(XDR REQUIRED)
+ FIND_PACKAGE(SalomeXDR REQUIRED)
ELSE(NOT WIN32)
IF(MEDCOUPLING_MED_MEDLOADER_USE_XDR)
- FIND_PACKAGE(XDR REQUIRED)
+ FIND_PACKAGE(SalomeXDR REQUIRED)
ENDIF(MEDCOUPLING_MED_MEDLOADER_USE_XDR)
ENDIF(NOT WIN32)
# End of XDR Stuff
IF(MEDCOUPLING_MED_ENABLE_PARTITIONER)
- IF(DEFINED ENV{LIBXML2_ROOT_DIR})
- SET(LIBXML2_ROOT_DIR $ENV{LIBXML2_ROOT_DIR} CACHE PATH "Path to the LibXml2.")
- LIST(APPEND CMAKE_PREFIX_PATH "${LIBXML2_ROOT_DIR}")
- ENDIF()
- FIND_PACKAGE(LibXml2)
+ FIND_PACKAGE(SalomeLibXml2)
+ SALOME_LOG_OPTIONAL_PACKAGE(LibXml2 MEDCOUPLING_MED_ENABLE_PARTITIONER)
IF(MEDCOUPLING_MED_PARTITIONER_METIS)
- FIND_PACKAGE(Metis)
+ FIND_PACKAGE(SalomeMetis)
+ SALOME_LOG_OPTIONAL_PACKAGE(Metis MEDCOUPLING_MED_PARTITIONER_METIS)
ADD_DEFINITIONS("-DMED_ENABLE_METIS")
ENDIF(MEDCOUPLING_MED_PARTITIONER_METIS)
IF(MEDCOUPLING_MED_PARTITIONER_SCOTCH)
- FIND_PACKAGE(Scotch)
+ FIND_PACKAGE(SalomeScotch)
+ SALOME_LOG_OPTIONAL_PACKAGE(Scotch MEDCOUPLING_MED_PARTITIONER_SCOTCH)
ADD_DEFINITIONS("-DMED_ENABLE_SCOTCH")
ENDIF(MEDCOUPLING_MED_PARTITIONER_SCOTCH)
ENDIF(MEDCOUPLING_MED_ENABLE_PARTITIONER)
ENABLE_TESTING() # let it outsite because even if MEDCOUPLING_BUILD_TESTS is OFF, python tests that not need additional compilation can be run.
IF(MEDCOUPLING_BUILD_TESTS)
- FIND_PACKAGE(CppUnit)
+ FIND_PACKAGE(SalomeCppUnit)
+ SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
ENDIF(MEDCOUPLING_BUILD_TESTS)
IF(MEDCOUPLING_USE_MPI)
- FIND_PACKAGE(MPI REQUIRED)
+ FIND_PACKAGE(SalomeMPI REQUIRED)
ADD_DEFINITIONS("-DHAVE_MPI")
- SET(MPI_INCLUDE_DIRS ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH})
- SET(MPI_LIBRARIES ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES})
- SET(MPI_DEFINITIONS "${MPI_CXX_COMPILE_FLAGS}")
-
IF(MEDCOUPLING_MED_PARTITIONER_PARMETIS)
- FIND_PACKAGE(ParMetis)
+ FIND_PACKAGE(SalomeParMetis)
+ SALOME_LOG_OPTIONAL_PACKAGE(ParMetis MEDCOUPLING_MED_PARTITIONER_PARMETIS)
ADD_DEFINITIONS("-DMED_ENABLE_PARMETIS")
ENDIF(MEDCOUPLING_MED_PARTITIONER_PARMETIS)
ENDIF(MEDCOUPLING_USE_MPI)
IF(MEDCOUPLING_MED_ENABLE_RENUMBER)
- IF(DEFINED ENV{BOOST_ROOT_DIR})
- SET(BOOST_ROOT_DIR $ENV{BOOST_ROOT_DIR} CACHE PATH "Path to the Boost.")
- LIST(APPEND CMAKE_PREFIX_PATH "${BOOST_ROOT_DIR}")
- ENDIF()
- SET(Boost_USE_STATIC_LIBS OFF)
- SET(Boost_USE_MULTITHREADED ON)
- SET(Boost_USE_STATIC_RUNTIME OFF)
- SET(Boost_NO_BOOST_CMAKE ON)
- FIND_PACKAGE(Boost)
+ FIND_PACKAGE(SalomeBoost)
+ SALOME_LOG_OPTIONAL_PACKAGE(Boost MEDCOUPLING_MED_ENABLE_RENUMBER)
ENDIF(MEDCOUPLING_MED_ENABLE_RENUMBER)
-IF(MEDCOUPLING_BUILD_DOC)
- FIND_PACKAGE(Doxygen)
- FIND_PACKAGE(Graphviz)
- FIND_PACKAGE(Sphinx)
-ENDIF(MEDCOUPLING_BUILD_DOC)
-
IF(MEDCOUPLING_MED_ENABLE_PYTHON)
- FIND_PACKAGE(PythonInterp)
- GET_FILENAME_COMPONENT(_python_dir "${PYTHON_EXECUTABLE}" PATH)
- GET_FILENAME_COMPONENT(CMAKE_INCLUDE_PATH "${_python_dir}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
- GET_FILENAME_COMPONENT(CMAKE_LIBRARY_PATH "${_python_dir}/../lib" ABSOLUTE)
- SET(PythonLibs_FIND_VERSION "${PYTHON_VERSION}")
- FIND_PACKAGE(PythonLibs)
-
- FIND_PACKAGE(SWIG)
+ FIND_PACKAGE(SalomePython)
+ FIND_PACKAGE(SalomeSWIG)
+ SALOME_LOG_OPTIONAL_PACKAGE(Python MEDCOUPLING_MED_ENABLE_PYTHON)
+ SALOME_LOG_OPTIONAL_PACKAGE(SWIG MEDCOUPLING_MED_ENABLE_PYTHON)
# Set the extra flags for SWIG for numpy and scipy
SET(SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY)
IF(NUMPY_FOUND)
ENDIF(SCIPY_FOUND)
ENDIF(MEDCOUPLING_MED_ENABLE_PYTHON)
+IF(MEDCOUPLING_BUILD_DOC)
+ FIND_PACKAGE(SalomeDoxygen)
+ FIND_PACKAGE(SalomeGraphviz)
+ FIND_PACKAGE(SalomeSphinx)
+ SALOME_LOG_OPTIONAL_PACKAGE(Doxygen MEDCOUPLING_BUILD_DOC)
+ SALOME_LOG_OPTIONAL_PACKAGE(Graphviz MEDCOUPLING_BUILD_DOC)
+ SALOME_LOG_OPTIONAL_PACKAGE(Sphinx MEDCOUPLING_BUILD_DOC)
+ENDIF(MEDCOUPLING_BUILD_DOC)
+
+# Detection report
+SALOME_PACKAGE_REPORT_AND_CHECK()
+
# Directories
#
# Directories have to be given after prerequisites (to be able to use
MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_BINS MEDCOUPLING_INSTALL_LIBS MEDCOUPLING_INSTALL_IDLS MEDCOUPLING_INSTALL_HEADERS)
MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS MEDCOUPLING_INSTALL_SCRIPT_DATA MEDCOUPLING_INSTALL_SCRIPT_PYTHON)
MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_APPLISKEL_SCRIPTS MEDCOUPLING_INSTALL_APPLISKEL_PYTHON MEDCOUPLING_INSTALL_CMAKE MEDCOUPLING_INSTALL_CMAKE_LOCAL MEDCOUPLING_INSTALL_RES)
-MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_PYTHON MEDCOUPLING_INSTALL_PYTHON_SHARED MEDCOUPLING_MED_INSTALL_RES_DATA MEDCOUPLING_MED_INSTALL_RES_SCRIPTS MEDCOUPLING_INSTALL_DOC)
+MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_PYTHON MEDCOUPLING_INSTALL_PYTHON_SHARED MEDCOUPLING_MED_INSTALL_RES_DATA MEDCOUPLING_INSTALL_DOC)
# Header configuration
# ====================
-MEDCOUPLING_XVERSION(${PROJECT_NAME})
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/MEDCoupling_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling_version.h)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling_version.h DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
+SALOME_XVERSION(${PROJECT_NAME})
+SALOME_CONFIGURE_FILE(MEDCoupling_version.h.in MEDCoupling_version.h INSTALL ${SALOME_INSTALL_HEADERS})
+#SALOME_CONFIGURE_FILE(VERSION.in VERSION INSTALL ${SALOME_INSTALL_BINS})
# Accumulate environment variables for MED module
#SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_BINS}
# Configuration export
# ====================
+INCLUDE(CMakePackageConfigHelpers)
# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
# Create the configuration files:
-# - in the build tree:
# Ensure the variables are always defined for the configure (even if empty):
-# SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
-# SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
-# SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}")
-# SET(MPI_ROOT_DIR "${MPI_ROOT_DIR}")
-# SET(HDF5_ROOT_DIR "${HDF5_ROOT_DIR}")
-# SET(OMNIORB_ROOT_DIR "${OMNIORB_ROOT_DIR}")
-# SET(PTHREAD_ROOT_DIR "${PTHREAD_ROOT_DIR}")
-# SET(BOOST_ROOT_DIR "${BOOST_ROOT_DIR}")
-# SET(SWIG_ROOT_DIR "${SWIG_ROOT_DIR}")
-# SET(PYTHON_ROOT_DIR "${PYTHON_ROOT_DIR}")
-# SET(CPPUNIT_ROOT_DIR "${CPPUNIT_ROOT_DIR}")
-# SET(GRAPHVIZ_ROOT_DIR "${GRAPHVIZ_ROOT_DIR}")
-# SET(DOXYGEN_ROOT_DIR "${DOXYGEN_ROOT_DIR}")
-# SET(SPHINX_ROOT_DIR "${SPHINX_ROOT_DIR}")
-
-# SET(METIS_ROOT_DIR "${METIS_ROOT_DIR}")
-# SET(PARMETIS_ROOT_DIR "${PARMETIS_ROOT_DIR}")
-# SET(SCOTCH_ROOT_DIR "${SCOTCH_ROOT_DIR}")
-# SET(XDR_ROOT_DIR "${XDR_ROOT_DIR}")
-
-# - in the install tree:
-# Get the relative path of the include directory so
-# we can register it in the generated configuration files:
+SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}")
+SET(MPI_ROOT_DIR "${MPI_ROOT_DIR}")
+SET(HDF5_ROOT_DIR "${HDF5_ROOT_DIR}")
+SET(BOOST_ROOT_DIR "${BOOST_ROOT_DIR}")
+SET(SWIG_ROOT_DIR "${SWIG_ROOT_DIR}")
+SET(PYTHON_ROOT_DIR "${PYTHON_ROOT_DIR}")
+SET(CPPUNIT_ROOT_DIR "${CPPUNIT_ROOT_DIR}")
+SET(GRAPHVIZ_ROOT_DIR "${GRAPHVIZ_ROOT_DIR}")
+SET(DOXYGEN_ROOT_DIR "${DOXYGEN_ROOT_DIR}")
+SET(SPHINX_ROOT_DIR "${SPHINX_ROOT_DIR}")
+
+SET(METIS_ROOT_DIR "${METIS_ROOT_DIR}")
+SET(PARMETIS_ROOT_DIR "${PARMETIS_ROOT_DIR}")
+SET(SCOTCH_ROOT_DIR "${SCOTCH_ROOT_DIR}")
+SET(XDR_ROOT_DIR "${XDR_ROOT_DIR}")
+
SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
# Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
-# SALOME_CONFIGURE_PREPARE(Metis ParMetis Scotch XDR CAS Qt4 CppUnit Graphviz Doxygen Sphinx MPI omniORB
-# PThread Boost libXml2 Python HDF5 MEDFile)
-
-# INCLUDE(CMakePackageConfigHelpers)
-# CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
-# ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
-# INSTALL_DESTINATION "${MEDCOUPLING_INSTALL_CMAKE}_LOCAL"
-# PATH_VARS CONF_INCLUDE_DIRS MEDCOUPLING_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
-# KERNEL_ROOT_DIR GUI_ROOT_DIR MEDFILE_ROOT_DIR MPI_ROOT_DIR
-# HDF5_ROOT_DIR OMNIORB_ROOT_DIR PTHREAD_ROOT_DIR BOOST_ROOT_DIR
-# SWIG_ROOT_DIR PYTHON_ROOT_DIR CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR
-# SPHINX_ROOT_DIR METIS_ROOT_DIR PARMETIS_ROOT_DIR SCOTCH_ROOT_DIR XDR_ROOT_DIR)
-
-#WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
-# VERSION ${${PROJECT_NAME_UC}_VERSION}
-# COMPATIBILITY AnyNewerVersion)
-
+SALOME_CONFIGURE_PREPARE(Metis ParMetis Scotch XDR CppUnit Graphviz Doxygen Sphinx MPI
+ Boost libXml2 Python HDF5 MEDFile)
+
+CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
+ ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
+ INSTALL_DESTINATION "${MEDCOUPLING_INSTALL_CMAKE_LOCAL}"
+ PATH_VARS CONF_INCLUDE_DIRS MEDCOUPLING_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
+ MEDFILE_ROOT_DIR MPI_ROOT_DIR
+ HDF5_ROOT_DIR BOOST_ROOT_DIR
+ SWIG_ROOT_DIR PYTHON_ROOT_DIR CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR
+ SPHINX_ROOT_DIR METIS_ROOT_DIR PARMETIS_ROOT_DIR SCOTCH_ROOT_DIR XDR_ROOT_DIR)
+
+WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+ VERSION ${${PROJECT_NAME_UC}_VERSION}
+ COMPATIBILITY AnyNewerVersion)
+
# Install the CMake configuration files:
-# INSTALL(FILES
-# "${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake"
-# "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
-# DESTINATION "${MEDCOUPLING_INSTALL_CMAKE_LOCAL}")
+INSTALL(FILES
+ "${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake"
+ "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
+ DESTINATION "${MEDCOUPLING_INSTALL_CMAKE_LOCAL}")
# Install the export set for use with the install-tree
-#INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${MEDCOUPLING_INSTALL_CMAKE_LOCAL}"
-# FILE ${PROJECT_NAME}Targets.cmake)
+INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${MEDCOUPLING_INSTALL_CMAKE_LOCAL}"
+ FILE ${PROJECT_NAME}Targets.cmake)
+
--- /dev/null
+# - Config file for the @PROJECT_NAME@ package
+# It defines the following variables.
+# Specific to the pacakge @PROJECT_NAME@ itself:
+# @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
+#
+
+###############################################################
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
+@PACKAGE_INIT@
+
+# Load the dependencies for the libraries of @PROJECT_NAME@
+# (contains definitions for IMPORTED targets). This is only
+# imported if we are not built as a subproject (in this case targets are already there)
+IF(NOT TARGET medcoupling AND NOT @PROJECT_NAME@_BINARY_DIR)
+ INCLUDE("@PACKAGE_MEDCOUPLING_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake")
+ENDIF()
+
+# Package root dir:
+SET_AND_CHECK(MEDCOUPLING_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
+
+# Include directories and definitions
+SET_AND_CHECK(MEDCOUPLING_INCLUDE_DIRS "${MEDCOUPLING_ROOT_DIR_EXP}/@MEDCOUPLING_INSTALL_HEADERS@")
+SET(MEDCOUPLING_INCLUDE_DIRS "${MEDCOUPLING_INCLUDE_DIRS};@_MEDCoupling_EXTRA_HEADERS@")
+SET(MEDCOUPLING_DEFINITIONS)
+
+# Package specific environment variables
+@_MEDCoupling_EXTRA_ENV_FULL@
+
+#### Now the specificities
+
+# Options exported by the package:
+SET(MEDCOUPLING_MED_MICROMED @MEDCOUPLING_MED_MICROMED@)
+SET(MEDCOUPLING_MED_ENABLE_PYTHON @MEDCOUPLING_MED_ENABLE_PYTHON@)
+SET(MEDCOUPLING_USE_MPI @MEDCOUPLING_USE_MPI@)
+SET(MEDCOUPLING_MED_BUILD_DOC @MEDCOUPLING_MED_BUILD_DOC@)
+SET(MEDCOUPLING_MED_BUILD_TESTS @MEDCOUPLING_MED_BUILD_TESTS@)
+SET(MEDCOUPLING_MED_BUILD_GUI @MEDCOUPLING_MED_BUILD_GUI@)
+
+# Advanced options
+
+# Level 1 prerequisites:
+
+# Optional level 1 prerequisites:
+
+IF(NOT MEDCOUPLING_MED_MICROMED)
+ SET_AND_CHECK(MEDFILE_ROOT_DIR_EXP "@PACKAGE_MEDFILE_ROOT_DIR@")
+ENDIF()
+
+# For all prerequisites, load the corresponding targets if the package was used
+# in CONFIG mode. This ensures dependent projects link correctly
+# without having to set LD_LIBRARY_PATH:
+SET(_PREREQ @_PREREQ_LIST@)
+SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@)
+SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@")
+LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
+IF(NOT _list_len EQUAL 0)
+ # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
+ MATH(EXPR _range "${_list_len}-1")
+ FOREACH(_p RANGE ${_range})
+ LIST(GET _PREREQ ${_p} _pkg )
+ LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
+ LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo)
+ MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
+ IF(NOT _pkg_compo)
+ FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
+ PATHS "${_pkg_dir}"
+ NO_DEFAULT_PATH)
+ ELSE()
+ STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}")
+ MESSAGE(STATUS "===> (components: ${_pkg_compo})")
+ FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
+ COMPONENTS ${_compo_lst}
+ PATHS "${_pkg_dir}"
+ NO_DEFAULT_PATH)
+ ENDIF()
+ ENDFOREACH()
+ENDIF()
+
+# Installation directories
+SET(MEDCOUPLING_INSTALL_BINS "@MEDCOUPLING_INSTALL_BINS@")
+SET(MEDCOUPLING_INSTALL_LIBS "@MEDCOUPLING_INSTALL_BINS@")
+SET(MEDCOUPLING_INSTALL_HEADERS "@MEDCOUPLING_INSTALL_BINS@")
+SET(MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS "@MEDCOUPLING_INSTALL_BINS@")
+SET(MEDCOUPLING_INSTALL_TESTS "@MEDCOUPLING_INSTALL_BINS@")
+SET(MEDCOUPLING_INSTALL_SCRIPT_PYTHON "@MEDCOUPLING_INSTALL_BINS@")
+SET(MEDCOUPLING_INSTALL_CMAKE_LOCAL "@MEDCOUPLING_INSTALL_BINS@")
+IF(MEDCOUPLING_MED_ENABLE_PYTHON)
+ SET(MEDCOUPLING_INSTALL_PYTHON "@MEDCOUPLING_INSTALL_BINS@")
+ SET(MEDCOUPLING_INSTALL_PYTHON_SHARED "@MEDCOUPLING_INSTALL_BINS@")
+ENDIF(MEDCOUPLING_MED_ENABLE_PYTHON)
+SET(MEDCOUPLING_INSTALL_RES "@MEDCOUPLING_INSTALL_BINS@")
+SET(MEDCOUPLING_INSTALL_DOC "@MEDCOUPLING_INSTALL_BINS@")
+
+# Exposed MEDCoupling targets:
+SET(MEDCoupling_interpkernel interpkernel)
+SET(MEDCoupling_medcoupling medcoupling)
+SET(MEDCoupling_medcouplingremapper medcouplingremapper)
+SET(MEDCoupling_medloader medloader)
+SET(MEDCoupling_renumbercpp renumbercpp)
+SET(MEDCoupling_medpartitionercpp medpartitionercpp)
+SET(MEDCoupling_MEDPARTITIONERTest MEDPARTITIONERTest)
+SET(MEDCoupling_InterpKernelTest InterpKernelTest)
+SET(MEDCoupling_paramedmem paramedmem)
+SET(MEDCoupling_paramedloader paramedloader)
+SET(MEDCoupling_paramedmemcompo paramedmemcompo)
+SET(MEDCoupling_ParaMEDMEMTest ParaMEDMEMTest)
+SET(MEDCoupling_medcouplingclient medcouplingclient)
#
SET(admlocal_cmake_DATA
- FindCppUnit.cmake
- FindMEDFile.cmake
- FindParMetis.cmake
- FindSphinx.cmake
- MEDCouplingMacros.cmake
- FindGraphviz.cmake
- FindMetis.cmake
- FindScotch.cmake
- FindXDR.cmake
+ FindMetis.cmake
+ FindParMetis.cmake
+ FindSalomeMED.cmake
+ FindSalomeMetis.cmake
+ FindSalomeParMetis.cmake
+ FindSalomeScotch.cmake
+ FindSalomeXDR.cmake
+ FindScotch.cmake
+ FindXDR.cmake
)
INSTALL(FILES ${admlocal_cmake_DATA} DESTINATION ${MEDCOUPLING_INSTALL_CMAKE_LOCAL})
# CPPUNIT_DEFINITIONS - specific CppUnit definitions to be added
#
# The header cppunit/extensions/HelperMacros.h is looked for.
-# The following libraries are searched
-# cppunit_dll, or cppunitd_dll (Windows)
+# The following libraries are searched
+# cppunit_dll, or cppunitd_dll (Windows)
# cppunit (Linux)
#
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CppUnit REQUIRED_VARS CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES)
+
+
# - Graphviz detection
#
# Output variables: GRAPHVIZ_EXECUTABLE - where is executable 'dot' takes place.
-# GRAPHVIZ_INCLUDE_DIRS - where to find headers.
-# GRAPHVIZ_LIBRARIES - where to get libraries.
-# GRAPHVIZ_VERSION - Graphviz version
-# GRAPHVIZ_DEFINITIONS - Graphviz definitions
-# GRAPHVIZ_FOUND - True if Graphviz was found.
+# GRAPHVIZ_INCLUDE_DIRS - where to find headers.
+# GRAPHVIZ_LIBRARIES - where to get libraries.
+# GRAPHVIZ_VERSION - Graphviz version
+# GRAPHVIZ_DEFINITIONS - Graphviz definitions
+# GRAPHVIZ_FOUND - True if Graphviz was found.
#
###########################################################################
# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-SET(GRAPHVIZ_ROOT_DIR $ENV{GRAPHVIZ_ROOT_DIR} CACHE PATH "Path to the Graphviz.")
-IF(GRAPHVIZ_ROOT_DIR)
- LIST(APPEND CMAKE_PREFIX_PATH "${GRAPHVIZ_ROOT_DIR}")
-ENDIF(GRAPHVIZ_ROOT_DIR)
-
FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot)
FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/cgraph.h)
FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY NAMES gvc PATH_SUFFIXES bin)
FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin)
-SET(GRAPHVIZ_LIBRARIES
+SET(GRAPHVIZ_LIBRARIES
${GRAPHVIZ_cdt_LIBRARY}
- ${GRAPHVIZ_graph_LIBRARY}
+ ${GRAPHVIZ_graph_LIBRARY}
${GRAPHVIZ_gvc_LIBRARY}
${GRAPHVIZ_pathplan_LIBRARY}
)
# Handle the standard arguments of the find_package() command:
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS
- GRAPHVIZ_EXECUTABLE
- GRAPHVIZ_LIBRARIES
- GRAPHVIZ_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS
+ GRAPHVIZ_EXECUTABLE
+ GRAPHVIZ_LIBRARIES
+ GRAPHVIZ_INCLUDE_DIRS)
SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES})
ENDIF(MEDFILE_F_LIBRARIES)
-IF(NOT MEDFILE_INCLUDE_DIRS
- OR (NOT MEDFILE_C_LIBRARIES AND NOT MEDFILE_F_LIBRARIES))
- MESSAGE(FATAL_ERROR "MEDFile not found; please set MEDFILE_ROOT_DIR and check target directory.")
-ENDIF()
-
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MEDFile REQUIRED_VARS MEDFILE_INCLUDE_DIRS MEDFILE_LIBRARIES)
FIND_LIBRARY(METIS_LIBRARIES metis)
FIND_PATH(METIS_INCLUDE_DIRS metis.h)
-IF(NOT METIS_LIBRARIES OR NOT METIS_INCLUDE_DIRS)
- MESSAGE(FATAL_ERROR "Metis not found; please set METIS_ROOT_DIR and check target directory.")
-ENDIF()
-
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Metis REQUIRED_VARS METIS_INCLUDE_DIRS METIS_LIBRARIES)
FILE(READ ${METIS_INCLUDE_DIRS}/metis.h metis_h_content)
ENDIF("${ln}" MATCHES "^#define METIS_VER_MAJOR")
ENDFOREACH(ln ${list_metis_h_content})
IF(metis_major_version STREQUAL 5)
- SET(MEDCOUPLING_METIS_V5 1)
+ SET(SALOME_MED_METIS_V5 1)
MESSAGE(STATUS "Metis maj version 5 detected.")
ELSE(metis_major_version STREQUAL 5)
MESSAGE(STATUS "Metis maj version 4 detected.")
SET(PARMETIS_ROOT_DIR $ENV{PARMETIS_ROOT_DIR} CACHE PATH "Path to the PARMETIS.")
IF(PARMETIS_ROOT_DIR)
- LIST(APPEND CMAKE_PREFIX_PATH "${PARMETIS_ROOT_DIR}")
+ LIST(APPEND CMAKE_LIBRARY_PATH "${PARMETIS_ROOT_DIR}")
+ LIST(APPEND CMAKE_INCLUDE_PATH "${PARMETIS_ROOT_DIR}/Lib")
ENDIF(PARMETIS_ROOT_DIR)
FIND_LIBRARY(PARMETIS_LIBRARIES parmetis)
SET(PARMETIS_LIBRARIES ${PARMETIS_LIBRARIES} ${PARMETIS_SEQ_LIBRARIES})
FIND_PATH(PARMETIS_INCLUDE_DIRS parmetis.h)
-IF(NOT PARMETIS_LIBRARIES OR NOT PARMETIS_INCLUDE_DIRS)
- MESSAGE(FATAL_ERROR "Parallel Metis not found; please set PARMETIS_ROOT_DIR and check target directory.")
-ENDIF()
-
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ParMetis REQUIRED_VARS PARMETIS_INCLUDE_DIRS PARMETIS_LIBRARIES)
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Boost detection dor Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+SET(Boost_USE_STATIC_LIBS OFF)
+SET(Boost_USE_MULTITHREADED ON)
+SET(Boost_USE_STATIC_RUNTIME OFF)
+SET(Boost_NO_BOOST_CMAKE ON)
+SET(SalomeBoost_FIND_COMPONENTS filesystem regex signals system thread date_time chrono)
+
+IF(WIN32)
+ # Under windows, one extra sub-directory in the boost installation hierarchy:
+ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Boost Boost_INCLUDE_DIRS 2)
+ELSE()
+ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Boost Boost_INCLUDE_DIRS 1)
+ENDIF()
+IF(Boost_FOUND OR BOOST_FOUND)
+ MESSAGE(STATUS "Boost include dirs is: ${Boost_INCLUDE_DIRS}")
+ENDIF()
+#MARK_AS_ADVANCED()
+
+## Specific definitions:
+IF(WIN32)
+ SET(BOOST_DEFINITIONS -DBOOST_DISABLE_ASSERTS -DBOOST_ALL_DYN_LINK)
+ENDIF()
+
+IF(Boost_FOUND OR BOOST_FOUND)
+ SALOME_ACCUMULATE_HEADERS(Boost_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Boost_LIBRARIES})
+ENDIF()
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# CppUnit detection for Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(CppUnit CPPUNIT_INCLUDE_DIRS 1)
+MARK_AS_ADVANCED(CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES CPPUNIT_CONFIG_BIN CPPUNIT_SUBLIB_cppunit CPPUNIT_SUBLIB_dl)
+
+IF(CPPUNIT_FOUND)
+ SALOME_ACCUMULATE_HEADERS(CPPUNIT_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CPPUNIT_LIBRARIES})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Doxygen detection for salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+# Additional variables:
+#
+# DOXYGEN_SUPPORT_STL (string) [advanced] : set to YES if doxygen properly manages STL files
+# or to NO otherwise (version 1.4.4 or older); see description of
+# BUILTIN_STL_SUPPORT configuration variable in the doxygen documentation
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Doxygen DOXYGEN_EXECUTABLE 2)
+IF(DOXYGEN_FOUND)
+ IF(DOXYGEN_VERSION VERSION_LESS "1.4.5")
+ SET(DOXYGEN_SUPPORT_STL NO)
+ ELSE()
+ SET(DOXYGEN_SUPPORT_STL YES)
+ ENDIF()
+ENDIF()
+MARK_AS_ADVANCED(DOXYGEN_SUPPORT_STL)
+
+IF(DOXYGEN_FOUND)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${DOXYGEN_EXECUTABLE})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Graphviz detection for salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Graphviz GRAPHVIZ_EXECUTABLE 2)
+MARK_AS_ADVANCED(GRAPHVIZ_EXECUTABLE GRAPHVIZ_LIBRARIES GRAPHVIZ_INCLUDE_DIRS)
+
+IF(GRAPHVIZ_FOUND)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${GRAPHVIZ_EXECUTABLE})
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${GRAPHVIZ_LIBRARIES})
+ENDIF()
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# HDF5 detection for Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+# --- HDF5 specificities ----
+# MPI root directory used for HDF5 compilation is exposed into MPI_ROOT_DIR_EXP
+#
+
+SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to the HDF5.")
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(HDF5 HDF5_INCLUDE_DIR 1)
+MARK_AS_ADVANCED(FORCE HDF5_INCLUDE_DIR HDF5_LIB HDF5_DIR)
+
+# Stupidly enough, CONFIG mode and MODULE mode for HDF5 do not return the same thing ...!
+SET(HDF5_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS};${HDF5_INCLUDE_DIR}")
+# Same story with libraries - if in CONFIG mode, HDF5_LIBRARIES is not defined:
+IF(NOT DEFINED HDF5_LIBRARIES)
+ SET(HDF5_LIBRARIES hdf5)
+ENDIF()
+
+##
+## 7. Specific to HDF5 only:
+## Expose MPI configuration to the rest of the world
+##
+IF(HDF5_ENABLE_PARALLEL OR HDF5_IS_PARALLEL)
+ # Set only one reference boolean variable:
+ # (unfortunately what is found in /usr/share/cmake/Modules/FindHDF5.cmake
+ # and in the native HDF5-config.cmake differ!)
+ SET(HDF5_IS_PARALLEL TRUE)
+
+ # HDF5 was compiled with MPI support
+ # Unfortunately HDF5 doesn't expose its MPI configuration easily ...
+ # We sniff the properties of the HDF5 target which should also be there:
+ GET_PROPERTY(_lib_lst TARGET hdf5 PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG)
+ FOREACH(s ${_lib_lst})
+ STRING(FIND "${s}" "mpi." _res) # should cover WIN(?) and LINUX
+ IF(_res GREATER -1)
+ GET_FILENAME_COMPONENT(_tmp "${s}" PATH) # go up to levels
+ GET_FILENAME_COMPONENT(MPI_ROOT_DIR_EXP "${_tmp}" PATH)
+ BREAK()
+ ENDIF()
+ ENDFOREACH()
+ IF(NOT SalomeHDF5_FIND_QUIETLY)
+ MESSAGE(STATUS "HDF5 was compiled with MPI: ${MPI_ROOT_DIR_EXP}")
+ ENDIF()
+ENDIF()
+
+## Add definitions
+ADD_DEFINITIONS(-DH5_USE_16_API)
+IF(WIN32)
+ ADD_DEFINITIONS(-D_HDF5USEDLL_)
+ENDIF()
+
+## Ensure SALOME uses MPI if HDF5 was parallel:
+IF(HDF5_IS_PARALLEL AND NOT SALOME_USE_MPI)
+ MESSAGE(FATAL_ERROR "HDF5 is compiled with MPI, you have to set SALOME_USE_MPI to ON")
+ENDIF()
+
+IF(HDF5_FOUND)
+ SALOME_ACCUMULATE_HEADERS(HDF5_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${HDF5_LIBRARIES})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# LibXml2 detection for SALOME
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+IF(WIN32)
+ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibXml2 LIBXML2_INCLUDE_DIR 1)
+ELSE()
+ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibXml2 LIBXML2_INCLUDE_DIR 2)
+ENDIF()
+#MARK_AS_ADVANCED()
+
+IF(LIBXML2_FOUND)
+ SALOME_ACCUMULATE_HEADERS(LIBXML2_INCLUDE_DIR)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${LIBXML2_LIBRARIES})
+ENDIF()
--- /dev/null
+# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# MED detection for Salome - this is typically called by dependent modules
+# (PARAVIS, etc ...)
+#
+# The detection is simpler than for other prerequisites.
+# See explanation in FindSalomeKERNEL.cmake.
+#
+
+IF(NOT SalomeMED_FIND_QUIETLY)
+ MESSAGE(STATUS "Looking for Salome MED ...")
+ENDIF()
+
+SET(CMAKE_PREFIX_PATH "${MED_ROOT_DIR}")
+SALOME_FIND_PACKAGE(SalomeMED SalomeMED CONFIG)
+
+IF(NOT SalomeMED_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Salome MED: ${MED_ROOT_DIR}")
+ENDIF()
+
+FOREACH(_res ${SalomeMED_EXTRA_ENV})
+ SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeMED_EXTRA_ENV_${_res}}")
+ENDFOREACH()
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Medfile detection for Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(MEDFile MEDFILE_INCLUDE_DIRS 1)
+#MARK_AS_ADVANCED()
+
+IF(MEDFILE_FOUND)
+ SALOME_ACCUMULATE_HEADERS(MEDFILE_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MEDFILE_LIBRARIES})
+ENDIF()
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# MPI detection for Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(MPI MPIEXEC 2)
+MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY)
+
+SET(MPI_INCLUDE_DIRS ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH})
+SET(MPI_LIBRARIES ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES})
+
+IF(MPI_FOUND)
+ # Detect if function MPI_Publish_name is provided by the external MPI library
+ # otherwise take ours.
+ include(CheckSymbolExists)
+ SET(CMAKE_REQUIRED_LIBRARIES ${MPI_LIBRARIES})
+ CHECK_SYMBOL_EXISTS(MPI_Publish_name ${MPI_C_INCLUDE_PATH}/mpi.h MPI2_IS_OK)
+ SET(MPI_DEFINITIONS "${MPI_CXX_COMPILE_FLAGS}")
+ IF(MPI2_IS_OK)
+ MESSAGE(STATUS "Your mpi implementation is compatible with mpi2 ... adding -DHAVE_MPI2")
+ SET(MPI_DEFINITIONS "${MPI_CXX_COMPILE_FLAGS} -DHAVE_MPI2")
+ ENDIF(MPI2_IS_OK)
+
+ SALOME_ACCUMULATE_HEADERS(MPI_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MPI_LIBRARIES})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Medfile detection dor Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Metis METIS_INCLUDE_DIRS 1)
+#MARK_AS_ADVANCED()
+
+IF(METIS_FOUND)
+ SALOME_ACCUMULATE_HEADERS(METIS_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${METIS_LIBRARIES})
+ENDIF()
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Medfile detection dor Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParMetis PARMETIS_INCLUDE_DIRS 1)
+#MARK_AS_ADVANCED()
+
+IF(PARMETIS_FOUND)
+ SALOME_ACCUMULATE_HEADERS(PARMETIS_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PARMETIS_LIBRARIES})
+ENDIF()
\ No newline at end of file
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Python libraries and interpreter detection for SALOME
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+# The interpreter is found first, and if OK, the corresponding libraries are searched.
+# We ensure the version of the libraries matches the one of the interpreter.
+#
+# We also look for an installation of NumPy, and if found the following variables are set
+# NUMPY_INCLUDE_DIR - NumPy header location
+# NUMPY_DEFINITIONS - compiler flag
+# and are automatically appended to PYTHON_INCLUDE_DIRS (and PYTHON_DEFINITIONS resp.)
+#
+
+# 1. Load environment or any previously detected Python
+IF(DEFINED ENV{PYTHON_ROOT_DIR})
+ FILE(TO_CMAKE_PATH "$ENV{PYTHON_ROOT_DIR}" _PYTHON_ROOT_DIR_ENV)
+ SET(_dflt_value "${_PYTHON_ROOT_DIR_ENV}")
+ELSE()
+ # will be blank if no Python was previously loaded
+ SET(_dflt_value "${PYTHON_ROOT_DIR_EXP}")
+ENDIF()
+
+# Make cache entry
+SET(PYTHON_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to Python directory (interpreter and libs)")
+
+# 2. Find package - config mode first (i.e. looking for XYZ-config.cmake)
+IF(WIN32)
+ IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(PythonInterp_FIND_VERSION _d)
+ SET(PYTHON_DEFINITIONS "-DHAVE_DEBUG_PYTHON")
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
+ENDIF(WIN32)
+IF(EXISTS "${PYTHON_ROOT_DIR}")
+ # Hope to find direclty a CMake config file there
+ SET(_CONF_DIR "${PYTHON_ROOT_DIR}/share/cmake")
+
+ # Try find_package in config mode with a hard-coded guess. This
+ # has the priority.
+ FIND_PACKAGE(Python CONFIG QUIET PATHS "${_CONF_DIR}")
+ MARK_AS_ADVANCED(Python_DIR)
+
+ IF (NOT PYTHON_FOUND)
+ LIST(APPEND CMAKE_PREFIX_PATH "${PYTHON_ROOT_DIR}")
+ ELSE()
+ MESSAGE(STATUS "Found Python in CONFIG mode!")
+ ENDIF()
+ENDIF()
+
+# Otherwise try the standard way (module mode, with the standard CMake Find*** macro):
+SALOME_FIND_PACKAGE(SalomePython PythonInterp MODULE)
+SET(_found1 ${PYTHONINTERP_FOUND})
+
+IF (PYTHONINTERP_FOUND)
+ # Now ensure we find the Python libraries matching the interpreter:
+ # This uses the variable PYTHON_EXECUTABLE
+
+ GET_FILENAME_COMPONENT(_python_bin "${PYTHON_EXECUTABLE}" NAME )
+ SET(PYTHONBIN "${_python_bin}" CACHE STRING "Name of Python interpreter")
+
+ GET_FILENAME_COMPONENT(_python_dir "${PYTHON_EXECUTABLE}" PATH)
+ GET_FILENAME_COMPONENT(CMAKE_INCLUDE_PATH "${_python_dir}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
+ GET_FILENAME_COMPONENT(CMAKE_LIBRARY_PATH "${_python_dir}/../lib" ABSOLUTE)
+ # For a Windows install, this might look more like this:
+ IF(WIN32)
+ LIST(APPEND CMAKE_LIBRARY_PATH "${_python_dir}/libs" ABSOLUTE)
+ LIST(APPEND CMAKE_INCLUDE_PATH "${_python_dir}/include" ABSOLUTE)
+ ENDIF()
+ # Override the EXACT and VERSION settings of the SalomePython module
+ # to force the next call to SALOME_FIND_PACKAGE() to find the exact matching
+ # version:
+ SET(_old_EXACT ${SalomePython_FIND_VERSION_EXACT})
+ SET(_old_VERSION "${SalomePython_FIND_VERSION}")
+ SET(SalomePython_FIND_VERSION_EXACT TRUE)
+ SET(SalomePython_FIND_VERSION "${PYTHON_VERSION_STRING}")
+ # Prepare call to FIND_PACKAGE(PythonLibs) and ensure priority is given to
+ # the location found for the interpreter:
+ GET_FILENAME_COMPONENT(_tmp "${_python_dir}" PATH)
+# SET(PYTHON_LIBRARY ${_tmp}/lib)
+# SET(PYTHON_INCLUDE_DIR ${_tmp}/include)
+ SALOME_FIND_PACKAGE(SalomePython PythonLibs MODULE)
+ # Restore variables:
+ SET(SalomePython_FIND_VERSION_EXACT ${_old_EXACT})
+ SET(SalomePython_FIND_VERSION "${_old_VERSION}")
+ENDIF()
+
+# Set the FOUND flag for SalomePython and Python:
+SET(SALOMEPYTHON_FOUND FALSE)
+IF (_found1 AND PYTHONLIBS_FOUND)
+
+ # 24.03.2015 ANA: Fix problem on Windows in Debug mode
+ # If you have Python, installed by Windows MSI Installer,
+ # PYTHON_LIBRARIES variable contains redundant release libraries...
+ IF(WIN32 AND CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET (PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES})
+ ENDIF()
+
+ SET(SALOMEPYTHON_FOUND TRUE)
+ SET(Python_FOUND TRUE)
+ELSE()
+SET(SALOMEPYTHON_FOUND FALSE)
+ SET(Python_FOUND FALSE)
+ENDIF()
+
+IF (SALOMEPYTHON_FOUND)
+ MESSAGE(STATUS "Python interpreter and Python libraries found:")
+ MESSAGE(STATUS "Python libraries: ${PYTHON_LIBRARIES}")
+ MESSAGE(STATUS "Python include dir: ${PYTHON_INCLUDE_DIR}")
+
+ # 3. Set the root dir which was finally retained
+ # For Python this is the grand-parent of the
+ # include directory:
+ GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${PYTHON_INCLUDE_DIR}" PATH)
+ IF(NOT WIN32)
+ GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
+ ENDIF()
+
+ # 4. Warn if CMake found something not located under ENV(XYZ_ROOT_DIR)
+ IF(DEFINED ENV{PYTHON_ROOT_DIR})
+ SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${_PYTHON_ROOT_DIR_ENV}")
+ IF(NOT _res)
+ MESSAGE(WARNING "Python was found, but not a the path given by the "
+"environment PYTHON_ROOT_DIR! Is the variable correctly set?")
+ ELSE()
+ MESSAGE(STATUS "Python found directory matches what was specified in the PYTHON_ROOT_DIR, all good!")
+ ENDIF()
+ ENDIF()
+
+ # 5. Conflict detection
+ # 5.1 From another prerequisite using Python
+ IF(PYTHON_ROOT_DIR_EXP)
+ SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${PYTHON_ROOT_DIR_EXP}")
+ IF(NOT _res)
+ MESSAGE(WARNING "Warning: Python: detected version conflicts with a previously found Python!"
+ "The two paths are " ${_tmp_ROOT_DIR} " vs " ${PYTHON_ROOT_DIR_EXP})
+ ELSE()
+ MESSAGE(STATUS "Python directory matches what was previously exposed by another prereq, all good!")
+ ENDIF()
+ ENDIF()
+
+ ##
+ ## 6. Save the final detected installation
+ ##
+ SET(PYTHON_ROOT_DIR "${_tmp_ROOT_DIR}")
+ SET(PYTHON_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
+
+ ## 7. Specifics
+ ##
+
+ # NumPy detection
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy ; import sys ; sys.stdout.write(numpy.get_include())" OUTPUT_VARIABLE NUMPY_INCLUDE_DIR ERROR_QUIET )
+ IF(NUMPY_INCLUDE_DIR)
+ SET(NUMPY_FOUND TRUE)
+ ENDIF(NUMPY_INCLUDE_DIR)
+ IF(NUMPY_FOUND)
+ SET(PYTHON_INCLUDE_DIRS ${NUMPY_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS})
+ SET(PYTHON_DEFINITIONS "${PYTHON_DEFINITIONS} -DWITH_NUMPY")
+ MESSAGE(STATUS "NumPy found : ${NUMPY_INCLUDE_DIR}")
+ ELSE(NUMPY_FOUND)
+ MESSAGE(STATUS "NumPy not found.")
+ ENDIF(NUMPY_FOUND)
+ # SciPy detection
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import scipy ; import sys ; sys.stdout.write(scipy.version.version)" OUTPUT_VARIABLE SCIPY_VERSION ERROR_QUIET )
+ IF(SCIPY_VERSION)
+ SET(SCIPY_FOUND TRUE)
+ ENDIF(SCIPY_VERSION)
+ IF(SCIPY_FOUND)
+ MESSAGE(STATUS "Scipy found : Version ${SCIPY_VERSION}")
+ ENDIF(SCIPY_FOUND)
+ ## None here
+ELSE()
+ MESSAGE(STATUS "Python was only partially (or not at all) found .")
+ENDIF()
+
+IF(SALOMEPYTHON_FOUND)
+ SALOME_ACCUMULATE_HEADERS(PYTHON_INCLUDE_DIR)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYTHON_EXECUTABLE})
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYTHON_LIBRARIES})
+ SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYTHON_PYTHONPATH})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# SWIG detection for SALOME
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2)
+MARK_AS_ADVANCED(SWIG_EXECUTABLE SWIG_VERSION)
+
+IF(SWIG_FOUND)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SWIG_EXECUTABLE})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Medfile detection dor Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Scotch SCOTCH_INCLUDE_DIRS 1)
+#MARK_AS_ADVANCED()
+
+IF(SCOTCH_FOUND)
+ SALOME_ACCUMULATE_HEADERS(SCOTCH_INCLUDE_DIRS)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SCOTCH_LIBRARIES})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# Sphinx detection for Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Sphinx SPHINX_EXECUTABLE 2)
+
+# Also retrieve paths to DOCUTILS and SETUPTOOLS:
+SET(SETUPTOOLS_ROOT_DIR "$ENV{SETUPTOOLS_ROOT_DIR}" CACHE PATH "Path to the Setuptools installation")
+SET(DOCUTILS_ROOT_DIR "$ENV{DOCUTILS_ROOT_DIR}" CACHE PATH "Path to the Docutils installation")
+
+# Ensure the command is run with the given PYTHONPATH
+IF(WIN32 AND NOT CYGWIN)
+ SET(SPHINX_EXECUTABLE ${SPHINX_EXECUTABLE})
+ SET(SPHINX_APIDOC_EXECUTABLE ${SPHINX_APIDOC_EXECUTABLE})
+ELSE()
+ SET(SPHINX_EXECUTABLE /usr/bin/env PYTHONPATH="${SPHINX_PYTHONPATH}:$$PYTHONPATH" ${SPHINX_EXECUTABLE})
+ SET(SPHINX_APIDOC_EXECUTABLE /usr/bin/env PYTHONPATH="${SPHINX_PYTHONPATH}:$$PYTHONPATH" ${SPHINX_APIDOC_EXECUTABLE})
+ENDIF()
+
+MARK_AS_ADVANCED(SPHINX_EXECUTABLE)
+
+IF(SPHINX_FOUND)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_EXECUTABLE})
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_APIDOC_EXECUTABLE})
+ SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SPHINX_PYTHONPATH})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Anthony Geay
+#
+
+# XDR detection dor Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(XDR XDR_INCLUDE_DIRS 1)
+#MARK_AS_ADVANCED()
+
+#IF(XDR_FOUND) # useless here because XDR is used only in CXX of MEDLoader
+# SALOME_ACCUMULATE_HEADERS(XDR_INCLUDE_DIRS)
+# SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${XDR_LIBRARIES})
+#ENDIF()
\ No newline at end of file
SET(SCOTCH_LIBRARIES ${SCOTCH_LIBRARIES} ${SCOTCH_ERR_LIBRARIES})
FIND_PATH(SCOTCH_INCLUDE_DIRS scotch.h PATH_SUFFIXES "/scotch")
-IF(NOT SCOTCH_LIBRARIES OR NOT SCOTCH_ERR_LIBRARIES OR NOT SCOTCH_INCLUDE_DIRS)
- MESSAGE(FATAL_ERROR "Scotch not found; please set SCOTCH_ROOT_DIR and check target directory.")
-ENDIF()
-
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Scotch REQUIRED_VARS SCOTCH_INCLUDE_DIRS SCOTCH_LIBRARIES)
#
# Output variables:
# SPHINX_EXECUTABLE - path to the Sphinx executable
-# SPHINX_PYTHONPATH - path to the Sphinx Python modules
-#
+# SPHINX_PYTHONPATH - path to the Sphinx Python modules
+#
###########################################################################
# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Handle the standard arguments of the find_package() command:
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE)
+
+++ /dev/null
-# Copyright (C) 2015 CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-####################################################################
-# _TOHEXA()
-# Convert a number (smaller than 16) into hexadecimal representation
-# with a leading 0.
-MACRO(_TOHEXA num result)
- SET(_hexa_map a b c d e f)
- IF(${num} LESS 10)
- SET(${result} "0${num}")
- ELSE()
- MATH(EXPR _res "${num}-10" )
- LIST(GET _hexa_map ${_res} _out)
- SET(${result} "0${_out}")
- ENDIF()
-ENDMACRO(_TOHEXA)
-
-####################################################################
-# MEDCOUPLING_XVERSION()
-#
-# Computes hexadecimal version of MEDCOUPLING package
-#
-# USAGE: MEDCOUPLING_XVERSION(package)
-#
-# ARGUMENTS:
-#
-# package: IN: MEDCOUPLING package name
-#
-# The macro reads MEDCOUPLING package version from PACKAGE_VERSION variable
-# (note package name are uppercase);
-# hexadecimal version value in form 0xAABBCC (where AA, BB and CC are
-# major, minor and maintenance components of package version in
-# hexadecimal form) is put to the PACKAGE_XVERSION variable
-MACRO(MEDCOUPLING_XVERSION pkg)
- STRING(TOUPPER ${pkg} _pkg_UC)
- IF(${_pkg_UC}_VERSION)
- SET(_major)
- SET(_minor)
- SET(_patch)
- _TOHEXA(${${_pkg_UC}_MAJOR_VERSION} _major)
- _TOHEXA(${${_pkg_UC}_MINOR_VERSION} _minor)
- _TOHEXA(${${_pkg_UC}_PATCH_VERSION} _patch)
- SET(${_pkg_UC}_XVERSION "0x${_major}${_minor}${_patch}")
- ENDIF()
-ENDMACRO(MEDCOUPLING_XVERSION)
--- /dev/null
+# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: A.Geay, V. Sandler, A. Bruneton
+#
+
+#----------------------------------------------------------------------------
+# LIST_CONTAINS is a macro useful for determining whether a list has a
+# particular entry
+#----------------------------------------------------------------------------
+MACRO(LIST_CONTAINS var value)
+ SET(${var})
+ FOREACH(value2 ${ARGN})
+ IF(${value} STREQUAL "${value2}")
+ SET(${var} TRUE)
+ ENDIF (${value} STREQUAL "${value2}")
+ ENDFOREACH (value2)
+ENDMACRO(LIST_CONTAINS)
+
+#----------------------------------------------------------------------------
+# The PARSE_ARGUMENTS macro will take the arguments of another macro and
+# define several variables.
+#
+# USAGE: PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)
+#
+# ARGUMENTS:
+#
+# prefix: IN: a prefix to put on all variables it creates.
+#
+# arg_names: IN: a list of names.
+# For each item in arg_names, PARSE_ARGUMENTS will create a
+# variable with that name, prefixed with prefix_. Each variable will be filled
+# with the arguments that occur after the given arg_name is encountered
+# up to the next arg_name or the end of the arguments. All options are
+# removed from these lists. PARSE_ARGUMENTS also creates a
+# prefix_DEFAULT_ARGS variable containing the list of all arguments up
+# to the first arg_name encountered.
+#
+# options: IN: a list of options.
+# For each item in options, PARSE_ARGUMENTS will create a
+# variable with that name, prefixed with prefix_. So, for example, if prefix is
+# MY_MACRO and options is OPTION1;OPTION2, then PARSE_ARGUMENTS will
+# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These
+# variables will be set to true if the option exists in the command line
+# or false otherwise.
+# arg_names and options lists should be quoted.
+#
+# The rest of PARSE_ARGUMENTS are arguments from another macro to be parsed.
+#----------------------------------------------------------------------------
+MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
+ SET(DEFAULT_ARGS)
+ FOREACH(arg_name ${arg_names})
+ SET(${prefix}_${arg_name})
+ ENDFOREACH(arg_name)
+ FOREACH(option ${option_names})
+ SET(${prefix}_${option} FALSE)
+ ENDFOREACH(option)
+ SET(current_arg_name DEFAULT_ARGS)
+ SET(current_arg_list)
+ FOREACH(arg ${ARGN})
+ LIST_CONTAINS(is_arg_name ${arg} ${arg_names})
+ IF (is_arg_name)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ SET(current_arg_name ${arg})
+ SET(current_arg_list)
+ ELSE (is_arg_name)
+ LIST_CONTAINS(is_option ${arg} ${option_names})
+ IF (is_option)
+ SET(${prefix}_${arg} TRUE)
+ ELSE (is_option)
+ SET(current_arg_list ${current_arg_list} ${arg})
+ ENDIF (is_option)
+ ENDIF (is_arg_name)
+ ENDFOREACH(arg)
+ SET(${prefix}_${current_arg_name} ${current_arg_list})
+ENDMACRO(PARSE_ARGUMENTS)
+
+#----------------------------------------------------------------------------
+# SALOME_INSTALL_SCRIPTS is a macro useful for installing scripts.
+#
+# USAGE: SALOME_INSTALL_SCRIPTS(file_list path [WORKING_DIRECTORY dir] [DEF_PERMS])
+#
+# ARGUMENTS:
+# file_list: IN : list of files to be installed. This list should be quoted.
+# path: IN : full pathname for installing.
+#
+# By default files to be installed as executable scripts.
+# If DEF_PERMS option is provided, than permissions for installed files are
+# only OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ.
+#----------------------------------------------------------------------------
+MACRO(SALOME_INSTALL_SCRIPTS file_list path)
+ PARSE_ARGUMENTS(SALOME_INSTALL_SCRIPTS "WORKING_DIRECTORY" "DEF_PERMS" ${ARGN})
+ SET(PERMS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+ IF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS)
+ SET(PERMS ${PERMS} OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+ ENDIF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS)
+ SET(_all_pyc)
+ SET(_all_pyo)
+ SET(_all_subdirs)
+ FOREACH(file ${file_list})
+ SET(PREFIX "")
+ SET(_source_prefix "")
+ GET_FILENAME_COMPONENT(file_name ${file} NAME)
+ IF(NOT IS_ABSOLUTE ${file})
+ IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY)
+ SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/")
+ ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY)
+ SET(_source_prefix "${CMAKE_CURRENT_SOURCE_DIR}/")
+ ENDIF(NOT IS_ABSOLUTE ${file})
+ INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS})
+ GET_FILENAME_COMPONENT(ext ${file} EXT)
+ GET_FILENAME_COMPONENT(we_ext ${file} NAME_WE)
+
+ IF(ext STREQUAL .py)
+ # Generate and install the pyc and pyo
+ # [ABN] Important: we avoid references or usage of CMAKE_INSTALL_PREFIX which is not correctly set
+ # when using CPack.
+ SET(_pyc_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.pyc")
+ SET(_pyo_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.pyo")
+ LIST(APPEND _all_pyc ${_pyc_file})
+ LIST(APPEND _all_pyo ${_pyo_file})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_pyc_file}
+ COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile ; py_compile.compile('${_source_prefix}${file}', '${_pyc_file}' )"
+ DEPENDS ${PREFIX}${file}
+ VERBATIM
+ )
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_pyo_file}
+ COMMAND ${PYTHON_EXECUTABLE} -O -c "import py_compile ; py_compile.compile('${_source_prefix}${file}', '${_pyo_file}' )"
+ DEPENDS ${PREFIX}${file}
+ VERBATIM
+ )
+ # Install the .pyo and the .pyc
+ INSTALL(FILES ${_pyc_file} DESTINATION ${path} PERMISSIONS ${PERMS})
+ INSTALL(FILES ${_pyo_file} DESTINATION ${path} PERMISSIONS ${PERMS})
+ ENDIF(ext STREQUAL .py)
+
+ # get relativa path (from CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR)
+ STRING(REGEX REPLACE ${CMAKE_SOURCE_DIR} "" rel_dir ${CMAKE_CURRENT_SOURCE_DIR})
+ # convert "/" to "_"
+ IF(rel_dir)
+ STRING(REGEX REPLACE "/" "_" unique_name ${rel_dir})
+ ELSE(rel_dir)
+ SET(unique_name _)
+ ENDIF(rel_dir)
+
+ ENDFOREACH(file ${file_list})
+ # Generate only one target for all requested Python script compilation.
+ # Make sure that the target name is unique too.
+ IF(_all_pyc)
+ SET(_cnt 0)
+ WHILE(TARGET "PYCOMPILE${unique_name}_${_cnt}")
+ MATH(EXPR _cnt ${_cnt}+1)
+ ENDWHILE()
+ ADD_CUSTOM_TARGET("PYCOMPILE${unique_name}_${_cnt}" ALL DEPENDS ${_all_pyc} ${_all_pyo})
+ ENDIF()
+ENDMACRO(SALOME_INSTALL_SCRIPTS)
+
+#----------------------------------------------------------------------------
+# SALOME_CONFIGURE_FILE is a macro useful for copying a file to another location
+# and modify its contents.
+#
+# USAGE: SALOME_CONFIGURE_FILE(in_file out_file [INSTALL dir])
+#
+# ARGUMENTS:
+# in_file: IN : input file (if relative path is given, full file path is computed from current source dir).
+# out_file: IN : output file (if relative path is given, full file path is computed from current build dir).
+# If INSTALL is specified, then 'out_file' will be installed to the 'dir' directory.
+#----------------------------------------------------------------------------
+MACRO(SALOME_CONFIGURE_FILE IN_FILE OUT_FILE)
+ IF(IS_ABSOLUTE ${IN_FILE})
+ SET(_in_file ${IN_FILE})
+ ELSE()
+ SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${IN_FILE})
+ ENDIF()
+ IF(IS_ABSOLUTE ${OUT_FILE})
+ SET(_out_file ${OUT_FILE})
+ ELSE()
+ SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${OUT_FILE})
+ ENDIF()
+ MESSAGE(STATUS "Creation of ${_out_file}")
+ CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)
+ PARSE_ARGUMENTS(SALOME_CONFIGURE_FILE "INSTALL" "" ${ARGN})
+ IF(SALOME_CONFIGURE_FILE_INSTALL)
+ INSTALL(FILES ${_out_file} DESTINATION ${SALOME_CONFIGURE_FILE_INSTALL})
+ ENDIF(SALOME_CONFIGURE_FILE_INSTALL)
+ENDMACRO(SALOME_CONFIGURE_FILE)
+
+
+#######################################################################################
+# Useful macros for SALOME own package detection system
+#
+
+###
+# SALOME_CHECK_EQUAL_PATHS(result path1 path2)
+# Check if two paths are identical, resolving links. If the paths do not exist a simple
+# text comparison is performed.
+# result is a boolean.
+###
+MACRO(SALOME_CHECK_EQUAL_PATHS varRes path1 path2)
+ SET("${varRes}" OFF)
+ IF(EXISTS "${path1}")
+ GET_FILENAME_COMPONENT(_tmp1 "${path1}" REALPATH)
+ ELSE()
+ SET(_tmp1 "${path1}")
+ ENDIF()
+
+ IF(EXISTS "${path2}")
+ GET_FILENAME_COMPONENT(_tmp2 "${path2}" REALPATH)
+ ELSE()
+ SET(_tmp2 "${path2}")
+ ENDIF()
+
+ IF("${_tmp1}" STREQUAL "${_tmp2}")
+ SET("${varRes}" ON)
+ ENDIF()
+# MESSAGE(${${varRes}})
+ENDMACRO()
+
+####
+# SALOME_LOG_OPTIONAL_PACKAGE(pkg flag)
+#
+# Register in global variables the detection status (found or not) of the optional package 'pkg'
+# and the configuration flag that should be turned off to avoid detection of the package.
+# The global variables are read again by SALOME_PACKAGE_REPORT_AND_CHECK to produce
+# a summary report of the detection status and stops the process if necessary.
+MACRO(SALOME_LOG_OPTIONAL_PACKAGE pkg flag)
+ # Was the package found
+ STRING(TOUPPER ${pkg} _pkg_UC)
+ IF(${pkg}_FOUND OR ${_pkg_UC}_FOUND)
+ SET(_isFound TRUE)
+ ELSE()
+ SET(_isFound FALSE)
+ ENDIF()
+
+ # Is the package already in the list? Then update its status:
+ LIST(FIND _SALOME_OPTIONAL_PACKAGES_names ${pkg} _result)
+ IF(NOT ${_result} EQUAL -1)
+ LIST(REMOVE_AT _SALOME_OPTIONAL_PACKAGES_found ${_result})
+ LIST(REMOVE_AT _SALOME_OPTIONAL_PACKAGES_flags ${_result})
+ LIST(INSERT _SALOME_OPTIONAL_PACKAGES_found ${_result} ${_isFound})
+ LIST(INSERT _SALOME_OPTIONAL_PACKAGES_flags ${_result} ${flag})
+ ELSE()
+ # Otherwise insert it
+ LIST(APPEND _SALOME_OPTIONAL_PACKAGES_names ${pkg})
+ LIST(APPEND _SALOME_OPTIONAL_PACKAGES_found ${_isFound})
+ LIST(APPEND _SALOME_OPTIONAL_PACKAGES_flags ${flag})
+ ENDIF()
+
+ENDMACRO(SALOME_LOG_OPTIONAL_PACKAGE)
+
+####
+# SALOME_JUSTIFY_STRING()
+#
+# Justifies the string specified as an argument to the given length
+# adding required number of spaces to the end. Does noting if input
+# string is longer as required length.
+# Puts the result to the output variable.
+#
+# USAGE: SALOME_JUSTIFY_STRING(input length result)
+#
+# ARGUMENTS:
+# input [in] input string
+# length [in] required length of resulting string
+# result [out] name of variable where the result string is put to
+#
+MACRO(SALOME_JUSTIFY_STRING input length result)
+ SET(${result} ${input})
+ STRING(LENGTH ${input} _input_length)
+ MATH(EXPR _nb_spaces "${length}-${_input_length}-1")
+ IF (_nb_spaces GREATER 0)
+ FOREACH(_idx RANGE ${_nb_spaces})
+ SET(${result} "${${result}} ")
+ ENDFOREACH()
+ ENDIF()
+ENDMACRO(SALOME_JUSTIFY_STRING)
+
+####
+# SALOME_PACKAGE_REPORT_AND_CHECK()
+#
+# Print a quick summary of the detection of optional prerequisites.
+# If a package was not found, the configuration is stopped. The summary also indicates
+# which flag should be turned off to skip the detection of the package.
+#
+# If optional JUSTIFY argument is specified, names of packages
+# are left-justified to the given length; default value is 10.
+#
+# USAGE: SALOME_PACKAGE_REPORT_AND_CHECK([JUSTIFY length])
+#
+MACRO(SALOME_PACKAGE_REPORT_AND_CHECK)
+ SET(_will_fail OFF)
+ PARSE_ARGUMENTS(SALOME_PACKAGE_REPORT "JUSTIFY" "" ${ARGN})
+ IF(SALOME_PACKAGE_REPORT_JUSTIFY)
+ SET(_length ${SALOME_PACKAGE_REPORT_JUSTIFY})
+ ELSE()
+ SET(_length 23)
+ ENDIF()
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS " Optional packages - Detection report ")
+ MESSAGE(STATUS " ==================================== ")
+ MESSAGE(STATUS "")
+ IF(DEFINED _SALOME_OPTIONAL_PACKAGES_names)
+ LIST(LENGTH _SALOME_OPTIONAL_PACKAGES_names _list_len)
+ # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
+ MATH(EXPR _range "${_list_len}-1")
+ FOREACH(_idx RANGE ${_range})
+ LIST(GET _SALOME_OPTIONAL_PACKAGES_names ${_idx} _pkg_name)
+ LIST(GET _SALOME_OPTIONAL_PACKAGES_found ${_idx} _pkg_found)
+ LIST(GET _SALOME_OPTIONAL_PACKAGES_flags ${_idx} _pkg_flag)
+ SALOME_JUSTIFY_STRING(${_pkg_name} ${_length} _pkg_name)
+ IF(_pkg_found)
+ SET(_found_msg "Found")
+ SET(_flag_msg "")
+ ELSE()
+ SET(_will_fail ON)
+ SET(_found_msg "NOT Found")
+ SET(_flag_msg " - ${_pkg_flag} can be switched OFF to skip this prerequisite.")
+ ENDIF()
+
+ MESSAGE(STATUS " * ${_pkg_name} -> ${_found_msg}${_flag_msg}")
+ ENDFOREACH()
+ ENDIF(DEFINED _SALOME_OPTIONAL_PACKAGES_names)
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS "")
+
+ # Failure if some packages were missing:
+ IF(_will_fail)
+ MESSAGE(FATAL_ERROR "Some required prerequisites have NOT been found. Take a look at the report above to fix this.")
+ ENDIF()
+ENDMACRO(SALOME_PACKAGE_REPORT_AND_CHECK)
+
+####
+# SALOME_FIND_PACKAGE(englobingPackageName standardPackageName modus [onlyTryQuietly])
+#
+# example: SALOME_FIND_PACKAGE(SalomeVTK VTK CONFIG)
+#
+# Encapsulate the call to the standard FIND_PACKAGE(standardPackageName) passing all the options
+# given when calling the command FIND_PACKAGE(SalomeXYZ). Those options are stored implicitly in
+# CMake variables: xyz__FIND_QUIETLY, xyz_FIND_REQUIRED, etc ...
+#
+# If a list of components was specified when invoking the initial FIND_PACKAGE(SalomeXyz ...) this is
+# also handled properly.
+#
+# Modus is either MODULE or CONFIG (cf standard FIND_PACKAGE() documentation).
+# The last argument is optional and if set to TRUE will force the search to be OPTIONAL and QUIET.
+# If the package is looked for in CONFIG mode, the standard system paths are skipped. If you still want a
+# system installation to be found in this mode, you have to set the ROOT_DIR variable explicitly to /usr (for
+# example).
+#
+# This macro is to be called from within the FindSalomeXXXX.cmake file.
+#
+####
+MACRO(SALOME_FIND_PACKAGE englobPkg stdPkg mode)
+ SET(_OPT_ARG ${ARGV3})
+ # Only bother if the package was not already found:
+ # Some old packages use the lower case version - standard should be to always use
+ # upper case:
+ STRING(TOUPPER ${stdPkg} stdPkgUC)
+ IF(NOT (${stdPkg}_FOUND OR ${stdPkgUC}_FOUND))
+ IF(${englobPkg}_FIND_QUIETLY OR _OPT_ARG)
+ SET(_tmp_quiet "QUIET")
+ ELSE()
+ SET(_tmp_quiet)
+ ENDIF()
+ IF(${englobPkg}_FIND_REQUIRED AND NOT _OPT_ARG)
+ SET(_tmp_req "REQUIRED")
+ ELSE()
+ SET(_tmp_req)
+ ENDIF()
+ IF(${englobPkg}_FIND_VERSION_EXACT)
+ SET(_tmp_exact "EXACT")
+ ELSE()
+ SET(_tmp_exact)
+ ENDIF()
+
+ # Call the CMake FIND_PACKAGE() command:
+ STRING(TOLOWER ${stdPkg} _pkg_lc)
+ IF(("${mode}" STREQUAL "NO_MODULE") OR ("${mode}" STREQUAL "CONFIG"))
+ # Hope to find direclty a CMake config file, indicating the SALOME CMake file
+ # paths (the command already looks in places like "share/cmake", etc ... by default)
+ # Note the options NO_CMAKE_BUILDS_PATH, NO_CMAKE_PACKAGE_REGISTRY to avoid (under Windows)
+ # looking into a previous CMake build done via a GUI, or into the Win registry.
+ # NO_CMAKE_SYSTEM_PATH and NO_SYSTEM_ENVIRONMENT_PATH ensure any _system_ files like 'xyz-config.cmake'
+ # don't get loaded (typically Boost). To force their loading, set the XYZ_ROOT_DIR variable to '/usr'.
+ # See documentation of FIND_PACKAGE() for full details.
+
+ # Do we need to call the signature using components?
+ IF(${englobPkg}_FIND_COMPONENTS)
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
+ NO_MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS}
+ PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files" "adm/cmake"
+ NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH)
+ ELSE()
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
+ NO_MODULE ${_tmp_quiet} ${_tmp_req}
+ PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files" "adm/cmake"
+ NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH)
+ ENDIF()
+ MARK_AS_ADVANCED(${stdPkg}_DIR)
+
+ ELSEIF("${mode}" STREQUAL "MODULE")
+
+ # Do we need to call the signature using components?
+ IF(${englobPkg}_FIND_COMPONENTS)
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
+ MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS})
+ ELSE()
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
+ MODULE ${_tmp_quiet} ${_tmp_req})
+ ENDIF()
+
+ ELSE()
+
+ MESSAGE(FATAL_ERROR "Invalid mode argument in the call to the macro SALOME_FIND_PACKAGE. Should be CONFIG or MODULE.")
+
+ ENDIF()
+
+ ENDIF()
+ENDMACRO()
+
+
+####################################################################
+# SALOME_FIND_PACKAGE_DETECT_CONFLICTS(pkg referenceVariable upCount)
+# pkg : name of the system package to be detected
+# referenceVariable: variable containing a path that can be browsed up to
+# retrieve the package root directory (xxx_ROOT_DIR)
+# upCount : number of times we have to go up from the path <referenceVariable>
+# to obtain the package root directory.
+# If this is a path to a file, going up one time gives the directory containing the file
+# going up 2 times gives the parent directory.
+#
+# For example: SALOME_FIND_PACKAGE_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2)
+# with SWIG_EXECUTABLE set to '/usr/bin/swig'
+# will produce '/usr'
+#
+# Generic detection (and conflict check) procedure for package XYZ:
+# 1. Load a potential env variable XYZ_ROOT_DIR as a default choice for the cache entry XYZ_ROOT_DIR
+# If empty, load a potential XYZ_ROOT_DIR_EXP as default value (path exposed by another package depending
+# directly on XYZ)
+# 2. Invoke FIND_PACKAGE() in this order:
+# * in CONFIG mode first (if possible): priority is given to a potential
+# "XYZ-config.cmake" file
+# * then switch to the standard MODULE mode, appending on CMAKE_PREFIX_PATH
+# the above XYZ_ROOT_DIR variable
+# 3. Extract the path actually found into a temp variable _XYZ_TMP_DIR
+# 4. Warn if XYZ_ROOT_DIR is set and doesn't match what was found (e.g. when CMake found the system installation
+# instead of what is pointed to by XYZ_ROOT_DIR - happens when a typo in the content of XYZ_ROOT_DIR).
+# 5. Conflict detection:
+# * check the temp variable against a potentially existing XYZ_ROOT_DIR_EXP
+# 6. Finally expose what was *actually* found in XYZ_ROOT_DIR.
+# 7. Specific stuff: for example exposing a prerequisite of XYZ to the rest of the world for future
+# conflict detection. This is added after the call to the macro by the callee.
+#
+MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount)
+ ##
+ ## 0. Initialization
+ ##
+
+ # Package name, upper case
+ STRING(TOUPPER ${pkg} pkg_UC)
+
+ ##
+ ## 1. Load environment or any previously detected root dir for the package
+ ##
+ IF(DEFINED ENV{${pkg_UC}_ROOT_DIR})
+ FILE(TO_CMAKE_PATH "$ENV{${pkg_UC}_ROOT_DIR}" _${pkg_UC}_ROOT_DIR_ENV)
+ SET(_dflt_value "${_${pkg_UC}_ROOT_DIR_ENV}")
+ ELSE()
+ # will be blank if no package was previously loaded:
+ SET(_dflt_value "${${pkg_UC}_ROOT_DIR_EXP}")
+ ENDIF()
+
+ # Detect if the variable has been set on the command line or elsewhere:
+ IF(DEFINED ${pkg_UC}_ROOT_DIR)
+ SET(_var_already_there TRUE)
+ ELSE()
+ SET(_var_already_there FALSE)
+ ENDIF()
+ # Make cache entry
+ SET(${pkg_UC}_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory")
+
+ ##
+ ## 2. Find package - try CONFIG mode first (i.e. looking for XYZ-config.cmake)
+ ##
+
+ # Override the variable - don't append to it, as it would give precedence
+ # to what was stored there before!
+ SET(CMAKE_PREFIX_PATH "${${pkg_UC}_ROOT_DIR}")
+
+ # Try find_package in config mode. This has the priority, but is
+ # performed QUIET and not REQUIRED:
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} NO_MODULE TRUE)
+
+ IF (${pkg_UC}_FOUND OR ${pkg}_FOUND)
+ MESSAGE(STATUS "Found ${pkg} in CONFIG mode!")
+ ENDIF()
+
+ # Otherwise try the standard way (module mode, with the standard CMake Find*** macro):
+ # We do it quietly to produce our own error message, except if we are in debug mode:
+ IF(SALOME_CMAKE_DEBUG)
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE FALSE)
+ ELSE()
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE TRUE)
+ ENDIF()
+
+ # Set the "FOUND" variable for the SALOME wrapper:
+ IF(${pkg_UC}_FOUND OR ${pkg}_FOUND)
+ SET(SALOME${pkg_UC}_FOUND TRUE)
+ ELSE()
+ SET(SALOME${pkg_UC}_FOUND FALSE)
+ IF(NOT Salome${pkg}_FIND_QUIETLY)
+ IF(Salome${pkg}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
+ "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR} "
+ "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
+ ELSE()
+ MESSAGE(WARNING "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
+ "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR} "
+ "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
+ ENDIF()
+ ENDIF()
+ ENDIF()
+
+ IF (${pkg_UC}_FOUND OR ${pkg}_FOUND)
+ ## 3. Set the root dir which was finally retained by going up "upDir" times
+ ## from the given reference path. The variable "referenceVariable" may be a list.
+ ## In this case we take its first element.
+
+ # First test if the variable exists, warn otherwise:
+ IF(NOT DEFINED ${referenceVariable})
+ MESSAGE(WARNING "${pkg}: the reference variable '${referenceVariable}' used when calling the macro "
+ "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() is not defined.")
+ ENDIF()
+
+ LIST(LENGTH ${referenceVariable} _tmp_len)
+ IF(_tmp_len)
+ LIST(GET ${referenceVariable} 0 _tmp_ROOT_DIR)
+ ELSE()
+ # Note the double de-reference of "referenceVariable":
+ SET(_tmp_ROOT_DIR "${${referenceVariable}}")
+ ENDIF()
+ IF(${upCount})
+ FOREACH(_unused RANGE 1 ${upCount})
+ GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
+ ENDFOREACH()
+ ENDIF()
+
+ ##
+ ## 4. Warn if CMake found something not located under ENV(XYZ_ROOT_DIR)
+ ##
+ IF(DEFINED ENV{${pkg_UC}_ROOT_DIR})
+ SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${_${pkg_UC}_ROOT_DIR_ENV}")
+ IF(NOT _res)
+ MESSAGE(WARNING "${pkg} was found, but not at the path given by the "
+ "environment ${pkg_UC}_ROOT_DIR! Is the variable correctly set? "
+ "The two paths are: ${_tmp_ROOT_DIR} and: ${_${pkg_UC}_ROOT_DIR_ENV}")
+
+ ELSE()
+ MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${pkg_UC}_ROOT_DIR variable, all good!")
+ ENDIF()
+ ELSE()
+ IF(NOT _var_already_there)
+ MESSAGE(STATUS "Variable ${pkg_UC}_ROOT_DIR was not explicitly defined. "
+ "An installation was found anyway: ${_tmp_ROOT_DIR}")
+ ENDIF()
+ ENDIF()
+
+ ##
+ ## 5. Conflict detection
+ ## From another prerequisite using the package:
+ ##
+ IF(${pkg_UC}_ROOT_DIR_EXP)
+ SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${${pkg_UC}_ROOT_DIR_EXP}")
+ IF(NOT _res)
+ MESSAGE(WARNING "Warning: ${pkg}: detected version conflicts with a previously found ${pkg}!"
+ " The two paths are " ${_tmp_ROOT_DIR} " vs " ${${pkg_UC}_ROOT_DIR_EXP})
+ ELSE()
+ MESSAGE(STATUS "${pkg} directory matches what was previously exposed by another prereq, all good!")
+ ENDIF()
+ ENDIF()
+
+ ##
+ ## 6. Save the detected installation
+ ##
+ SET(${pkg_UC}_ROOT_DIR "${_tmp_ROOT_DIR}")
+
+ ELSE()
+ MESSAGE(STATUS "${pkg} was not found.")
+ ENDIF()
+
+ SET(Salome${pkg}_FOUND "${pkg}_FOUND")
+ENDMACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS)
+
+
+####################################################################
+# SALOME_ADD_MPI_TO_HDF5()
+#
+# Overload the HDF5 flags so that they also contain MPI references.
+# This is to be used when HDF5 was compiled with MPI support;
+MACRO(SALOME_ADD_MPI_TO_HDF5)
+ SET(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS} ${MPI_INCLUDE_DIRS})
+ SET(HDF5_DEFINITIONS "${HDF5_DEFINITIONS} ${MPI_DEFINITIONS}")
+ SET(HDF5_LIBRARIES ${HDF5_LIBRARIES} ${MPI_LIBRARIES})
+ENDMACRO(SALOME_ADD_MPI_TO_HDF5)
+
+####################################################################
+# SALOME_TOHEXA()
+# Convert a number (smaller than 16) into hexadecimal representation
+# with a leading 0.
+MACRO(SALOME_TOHEXA num result)
+ SET(_hexa_map a b c d e f)
+ IF(${num} LESS 10)
+ SET(${result} "0${num}")
+ ELSE()
+ MATH(EXPR _res "${num}-10" )
+ LIST(GET _hexa_map ${_res} _out)
+ SET(${result} "0${_out}")
+ ENDIF()
+ENDMACRO(SALOME_TOHEXA)
+
+####################################################################
+# SALOME_XVERSION()
+#
+# Computes hexadecimal version of SALOME package
+#
+# USAGE: SALOME_XVERSION(package)
+#
+# ARGUMENTS:
+#
+# package: IN: SALOME package name
+#
+# The macro reads SALOME package version from PACKAGE_VERSION variable
+# (note package name in uppercase as assumed for SALOME modules);
+# hexadecimal version value in form 0xAABBCC (where AA, BB and CC are
+# major, minor and maintenance components of package version in
+# hexadecimal form) is put to the PACKAGE_XVERSION variable
+MACRO(SALOME_XVERSION pkg)
+ STRING(TOUPPER ${pkg} _pkg_UC)
+ IF(${_pkg_UC}_VERSION)
+ SET(_major)
+ SET(_minor)
+ SET(_patch)
+ SALOME_TOHEXA(${${_pkg_UC}_MAJOR_VERSION} _major)
+ SALOME_TOHEXA(${${_pkg_UC}_MINOR_VERSION} _minor)
+ SALOME_TOHEXA(${${_pkg_UC}_PATCH_VERSION} _patch)
+ SET(${_pkg_UC}_XVERSION "0x${_major}${_minor}${_patch}")
+ ENDIF()
+ENDMACRO(SALOME_XVERSION)
+
+
+#########################################################################
+# SALOME_ACCUMULATE_HEADERS()
+#
+# This macro is called in the various FindSalomeXYZ.cmake modules to accumulate
+# internally the list of include headers to be saved for future export.
+# The full set of include is saved in a variable called
+# _${PROJECT_NAME}_EXTRA_HEADERS
+#
+MACRO(SALOME_ACCUMULATE_HEADERS lst)
+ FOREACH(l IN LISTS ${lst})
+ LIST(FIND _${PROJECT_NAME}_EXTRA_HEADERS "${l}" _res)
+ IF(_res EQUAL "-1")
+ IF(NOT "${l}" STREQUAL "/usr/include")
+ LIST(APPEND _${PROJECT_NAME}_EXTRA_HEADERS "${l}")
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
+ENDMACRO(SALOME_ACCUMULATE_HEADERS)
+
+#########################################################################
+# SALOME_ACCUMULATE_ENVIRONMENT()
+#
+# USAGE: SALOME_ACCUMULATE_ENVIRONMENT(envvar value [value ...])
+#
+# ARGUMENTS:
+# envvar [in] environment variable name, e.g. PATH
+# value [in] value(s) to be added to environment variable
+#
+# This macro is called in the various FindSalomeXYZ.cmake modules to
+# accumulate environment variables, to be used later to run some command
+# in proper environment.
+#
+# 1. Each envrironment variable is stored in specific CMake variable
+# _${PROJECT_NAME}_EXTRA_ENV_<var>, where <var> is name of variable.
+# 2. Full list of environment variable names is stored in CMake variable
+# _${PROJECT_NAME}_EXTRA_ENV.
+#
+# Notes:
+# - The arguments list can include optional CHECK or NOCHECK keywords:
+# * For all arguments following CHECK keyword the macro perform an
+# additional check (see below); this is the default mode, it is suitable
+# for path variables (PATH, LD_LIBRARY_PATH, etc).
+# * For all arguments following NOCHECK keyword, no additional check is
+# performed.
+# Checking an argument means that we check:
+# - That the path actually exists
+# - That this is not a standard system path (starting with "/usr"); this avoids
+# polluting LD_LIBRARY_PATH or PATH with things like "/usr/lib64" ...
+#
+MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar)
+ SET(_is_check ON)
+ FOREACH(_item ${ARGN})
+ IF(${_item} STREQUAL "NOCHECK")
+ SET(_is_check OFF)
+ ELSEIF(${_item} STREQUAL "CHECK")
+ SET(_is_check ON)
+ ELSE()
+ IF(_is_check)
+ IF(NOT IS_DIRECTORY ${_item})
+ IF(TARGET ${_item})
+ GET_TARGET_PROPERTY(_item ${_item} LOCATION)
+ ENDIF()
+ GET_FILENAME_COMPONENT(_item ${_item} PATH)
+ ENDIF()
+ IF(EXISTS ${_item})
+ STRING(REGEX MATCH "^(/usr|/lib|/bin)" _usr_find ${_item})
+ LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)
+ IF(NOT _usr_find AND _res EQUAL -1)
+ LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item})
+ ENDIF()
+ ENDIF()
+ ELSE(_is_check)
+ LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)
+ IF( _res EQUAL -1)
+ LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item})
+ ENDIF()
+ ENDIF(_is_check)
+ ENDIF()
+ ENDFOREACH()
+
+ LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res)
+ IF(_res EQUAL -1)
+ LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV ${envvar})
+ ENDIF()
+ SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "SET\(${PROJECT_NAME}_EXTRA_ENV ${_${PROJECT_NAME}_EXTRA_ENV}\)")
+ FOREACH(_res ${_${PROJECT_NAME}_EXTRA_ENV})
+ STRING(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}" _res_path "${_${PROJECT_NAME}_EXTRA_ENV_${_res}}")
+ SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "${_${PROJECT_NAME}_EXTRA_ENV_FULL}\nSET\(${PROJECT_NAME}_EXTRA_ENV_${_res} ${_res_path}\)")
+ ENDFOREACH()
+ENDMACRO(SALOME_ACCUMULATE_ENVIRONMENT)
+
+#########################################################################
+# SALOME_GENERATE_ENVIRONMENT_SCRIPT()
+#
+# USAGE: SALOME_GENERATE_ENVIRONMENT_SCRIPT(output script cmd opts)
+#
+# ARGUMENTS:
+# output [out] output command, e.g. for creation of target.
+# script [in] output environement script name
+# cmd [in] input command, e.g. sphinx or python command.
+# opts [in] options for input command (cmd).
+#
+# This macro is called when it's necessary to use given environment to run some command.
+# Macro generates environement script using previously created variables
+# _${PROJECT_NAME}_EXTRA_ENV_<var>, where <var> is name of variable and
+# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT);
+# and puts generated command in proper environment into <output> argument.
+#
+# Notes:
+# - If <script> is specified as relative path, it is computed from the current build
+# directory.
+#
+MACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT output script cmd opts)
+ IF(IS_ABSOLUTE ${script})
+ SET(_script ${script})
+ ELSE()
+ SET(_script ${CMAKE_CURRENT_BINARY_DIR}/${script})
+ ENDIF()
+
+ IF(WIN32)
+ SET(_ext "bat")
+ SET(_call_cmd "call")
+ ELSE()
+ SET(_ext "sh")
+ SET(_call_cmd ".")
+ ENDIF()
+
+ SET(_env)
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+ FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})
+ IF(WIN32)
+ IF(${_item} STREQUAL "LD_LIBRARY_PATH")
+ SET(_item PATH)
+ ENDIF()
+ STRING(REPLACE "/" "\\" _env "${_env} @SET ${_item}=${_val};%${_item}%\n")
+ ELSE(WIN32)
+ SET(_env "${_env} export ${_item}=${_val}:\${${_item}}\n")
+ ENDIF(WIN32)
+ ENDFOREACH()
+ ENDFOREACH()
+
+ SET(_script ${_script}.${_ext})
+ FILE(WRITE ${_script} "${_env}")
+
+ SET(${output} ${_call_cmd} ${_script} && ${cmd} ${opts})
+
+ENDMACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT)
+
+#########################################################################
+# SALOME_GENERATE_TESTS_ENVIRONMENT()
+#
+# USAGE: SALOME_GENERATE_TESTS_ENVIRONMENT(output)
+#
+# ARGUMENTS:
+# output [out] output environement variable.
+#
+# This macro generates <output> variable to use given environment to run some tests.
+# Macro generates environement variable using previously created variables
+# _${PROJECT_NAME}_EXTRA_ENV_<var>, where <var> is name of variable and
+# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT);
+# and puts this variable into <output> argument.
+#
+MACRO(SALOME_GENERATE_TESTS_ENVIRONMENT output)
+ SET(_env)
+ SET(_WIN_LD_LIBRARY OFF)
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+ IF(${_item} STREQUAL "LD_LIBRARY_PATH")
+ SET(_WIN_LD_LIBRARY ON)
+ ENDIF()
+ SET(_env_${_item})
+ FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})
+ IF(WIN32)
+ STRING(REPLACE "/" "\\" _val "${_val}")
+ SET(_env_${_item} "${_val};${_env_${_item}}")
+ ELSE()
+ SET(_env_${_item} "${_val}:${_env_${_item}}")
+ ENDIF()
+ ENDFOREACH()
+ ENDFOREACH()
+
+ IF(_WIN_LD_LIBRARY AND WIN32)
+ SET(_env_PATH "${_env_PATH}$ENV{LD_LIBRARY_PATH};${_env_LD_LIBRARY_PATH}")
+ ENDIF()
+
+ IF(WIN32)
+ SET(sep ",")
+ ELSE()
+ SET(sep ";")
+ ENDIF()
+
+ FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+ IF(WIN32)
+ IF(NOT ${_item} STREQUAL "LD_LIBRARY_PATH")
+ SET(_env "${_item}=$ENV{${_item}};${_env_${_item}}${sep}${_env}")
+ ENDIF()
+ ELSE()
+ STRING(REPLACE ";" ":" _iii "$ENV{${_item}}")
+ SET(_env "${_item}=${_iii}:${_env_${_item}}${sep}${_env}")
+ ENDIF()
+ ENDFOREACH()
+
+ # Get module name as substring of "Salome<ModuleName>"
+ STRING(REGEX MATCH "^Salome" _is_salome_project ${PROJECT_NAME})
+ IF(_is_salome_project)
+ STRING(SUBSTRING "${PROJECT_NAME}" 6 -1 PRNAME)
+ ELSE()
+ SET(PRNAME ${PROJECT_NAME})
+ ENDIF()
+ SET(_env "${PRNAME}_ROOT_DIR=${CMAKE_INSTALL_PREFIX}${sep}${_env}")
+
+ # Creating follow string for Windows environement:
+ # "VAR1_ENV=1\;2\;3\;...\;...\;...;VAR2_ENV=1\;2\;3\;...\;...\;...;VAR3_ENV=1\;2\;3\;...\;...\;...;..."
+ IF(WIN32)
+ STRING(REGEX REPLACE "\\\\*;" "\\\\;" _env "${_env}")
+ STRING(REGEX REPLACE "\\\\*;*," ";" _env "${_env}")
+ ENDIF()
+
+ SET(${output} "${_env}")
+
+ENDMACRO(SALOME_GENERATE_TESTS_ENVIRONMENT)
+
+#########################################################################
+# SALOME_APPEND_LIST_OF_LIST()
+#
+# USAGE: SALOME_APPEND_LIST_OF_LIST(result element_list)
+#
+# Build a list of lists. The element_list is first parsed to convert it
+# from
+# a;b;c;d;e
+# to
+# a,b,c,d,e
+#
+# It is then added to the big list 'result'. Hence 'result' looks like:
+# a,b,c,d,e;f,g,h; ...
+#
+MACRO(SALOME_APPEND_LIST_OF_LIST result element_list)
+ SET(_tmp_res)
+ STRING(REPLACE ";" "," _tmp_res "${${element_list}}")
+
+ # Yet another CMake stupidity - LIST(LENGTH ";" var) returns 0
+ STRING(LENGTH result _list_len)
+ IF(NOT _list_len EQUAL 0)
+ SET(${result} "${${result}}${_tmp_res};") # LIST(APPEND ...) doesn't handle well empty elements!?
+ ELSE()
+ SET(${result} "${_tmp_res};") # to avoid redundant ';' at the beginning of the list
+ ENDIF()
+
+ENDMACRO(SALOME_APPEND_LIST_OF_LIST)
+
+#########################################################################
+# SALOME_CONFIGURE_PREPARE()
+#
+# USAGE: SALOME_CONFIGURE_PREPARE(pkg1 pkg2 ...)
+#
+# Prepare the variable that will be used to configure the file Salome<MODULE>Config.cmake,
+# namely:
+# - _PREREQ_LIST : the list of level 1 external prerequisites
+# - _PREREQ_DIR_LIST : their corresponding CMake directories (i.e. where the CMake configuration
+# file for this package can be found, if there is any!)
+# - _PREREQ_COMPO_LIST: the list of components requested when this package was invoked
+#
+# All this information is built from the package_list, the list of level 1 packages for this module.
+# Only the packages found in CONFIG mode are retained.
+#
+MACRO(SALOME_CONFIGURE_PREPARE)
+ SET(_tmp_prereq "${ARGV}")
+ SET(_PREREQ_LIST)
+ SET(_PREREQ_DIR_LIST)
+ SET(_PREREQ_COMPO_LIST)
+ FOREACH(_prereq IN LISTS _tmp_prereq)
+ IF(${_prereq}_DIR)
+ SET(_PREREQ_LIST "${_PREREQ_LIST} ${_prereq}")
+ SET(_PREREQ_DIR_LIST "${_PREREQ_DIR_LIST} \"${${_prereq}_DIR}\"")
+ SALOME_APPEND_LIST_OF_LIST(_PREREQ_COMPO_LIST Salome${_prereq}_COMPONENTS)
+ ENDIF()
+ ENDFOREACH()
+ENDMACRO(SALOME_CONFIGURE_PREPARE)
--- /dev/null
+# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+## Detect architecture
+IF(WIN32)
+ SET(MACHINE WINDOWS)
+ELSE()
+ SET(MACHINE PCLINUX)
+ENDIF()
+
+## Test for 64 bits
+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(MACHINE_IS_64 TRUE)
+ELSE()
+ SET(MACHINE_IS_64 FALSE)
+ENDIF()
+
+## Force CMAKE_BUILD_TYPE to Release if not set
+IF(NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE})
+ENDIF(NOT CMAKE_BUILD_TYPE)
+IF(NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_BUILD_TYPE Release)
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
+## Define the log level according to the build type
+IF(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "Debug")
+ SET(PYLOGLEVEL DEBUG)
+ELSE()
+ SET(PYLOGLEVEL WARNING)
+ENDIF()
+
+## Make all warnings errors on non-windows platforms
+# CURRENTLY DISABLED
+IF(NOT (WIN32 OR APPLE))
+ SET(ADD_WERROR ON)
+ SET(NAMES ACCEPT_SALOME_WARNINGS ACCEPT_${MODULE}_WARNINGS I_AM_A_TROLL_I_DO_NOT_FIX_${MODULE}_WARNINGS)
+ FOREACH(name ${NAMES})
+ SET(VAL $ENV{${name}})
+ IF("${VAL}" STREQUAL "0")
+ SET(ADD_WERROR ON)
+ ENDIF()
+ IF("${VAL}" STREQUAL "1")
+ SET(ADD_WERROR OFF)
+ ENDIF()
+ ENDFOREACH()
+
+ IF(ADD_WERROR)
+# SET(CMAKE_C_FLAGS "-Werror")
+# SET(CMAKE_CXX_FLAGS "-Werror")
+ ENDIF()
+ENDIF()
+
+## TODO: remove this ?
+#IF(WIN32)
+# MARK_AS_ADVANCED(CLEAR CMAKE_CONFIGURATION_TYPES)
+# SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE)
+#ELSE()
+# IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+# SET(CMAKE_C_FLAGS_DEBUG "-g")
+# SET(CMAKE_CXX_FLAGS_DEBUG "-g")
+# ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug)
+# IF(CMAKE_BUILD_TYPE STREQUAL Release)
+# SET(CMAKE_C_FLAGS_RELEASE "-O1 -DNDEBUG")
+# SET(CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG")
+# ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
+#ENDIF()
+
+IF(WIN32)
+ ## Windows specific:
+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) # To disable windows warnings for strcpy, fopen, ...
+ ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) # To disable windows warnings generated by checked iterators(e.g. std::copy, std::transform, ...)
+ ADD_DEFINITIONS(-DWNT -DWIN32)
+ ADD_DEFINITIONS(-D_WIN32_WINNT=0x0500) # Windows 2000 or later API is required
+ ADD_DEFINITIONS(-DPPRO_NT) # For medfile
+ #ADD_DEFINITIONS(-D_USE_MATH_DEFINES) # for MEDMEM
+
+ SET(PLATFORM_LIBS Ws2_32.lib)
+ LIST(APPEND PLATFORM_LIBS Userenv.lib) # At least for GEOM suit
+
+################################################################################################
+#
+# RNV: In the SALOME sometimes operating with STL collections is done in not fully valid way.
+# To avoid run-time exception in Debug mode default values of the _SECURE_SCL,
+# _SECURE_SCL_THROWS and _HAS_ITERATOR_DEBUGGING macros were redefined. It solved a problem
+# then we used tne Microsoft Visual Studio 2008 to build SALOME on Windows platform.
+# But in the Microsoft Visual Studio 2010 these macros affect on the size of STL collection
+# classes(in difference from the Microsoft Visual Studio 2008: in this version of MSVS size
+# of the STL collection classes does not depend on these macros).
+# All pre-requisite products are built by MSVS 2010 in Debug mode with the default
+# values of the metioned above macros (namely _SECURE_SCL=1, _HAS_ITERATOR_DEBUGGING=1 and
+# _SECURE_SCL_THROWS=1). So SALOME modules should be build in the same configuration.
+#
+################################################################################################
+#
+# # Disable iterator debugging on WINDOWS to avoid runtime error during checking iterators
+# # _SECURE_SCL
+# # If defined as 1, unsafe iterator use causes a runtime error.
+# # If defined as 0, checked iterators are disabled.
+# # The default value for _SECURE_SCL is 1
+# # _SECURE_SCL_THROWS
+# # If defined as 1, an out of range iterator use causes an exception at runtime.
+# # If defined as 0, the program is terminated by calling invalid_parameter.
+# # The default value for _SECURE_SCL_THROWS is 0
+#
+# ADD_DEFINITIONS(-D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0)
+#
+# # The symbol _HAS_ITERATOR_DEBUGGING can be used to turn off the iterator debugging feature in a debug build
+# # If defined as 1, iterator debugging is enabled.
+# # If defined as 0, iterator debugging is disabled.
+# # The default value for _HAS_ITERATOR_DEBUGGING is 1
+#
+# IF(NOT CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
+# ADD_DEFINITIONS(-D_HAS_ITERATOR_DEBUGGING=0)
+# ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
+################################################################################################
+
+ IF(MACHINE_IS_64)
+ SET(SIZE_OF_LONG 4) # set sizeof(long) to 4 byte
+ ELSE()
+ SET(SIZE_OF_LONG ${CMAKE_SIZEOF_VOID_P}) # set sizeof(long) the same as size of pointers
+ ENDIF()
+ELSE()
+ ## Linux specific:
+ SET(PLATFORM_LIBS dl) # Dynamic loading (dlopen, dlsym)
+ IF(MACHINE_IS_64)
+ ADD_DEFINITIONS(-DPCLINUX64)
+ ENDIF(MACHINE_IS_64)
+ENDIF()
+
+## define _DEBUG_ macro
+IF(NOT CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
+ ADD_DEFINITIONS(-D_DEBUG_)
+ENDIF()
+
+## Apple specific:
+IF(APPLE)
+ SET(CMAKE_C_COMPILER gcc)
+ SET(CMAKE_CXX_COMPILER g++)
+ # because default is clang(llvm) with mountain lion at least
+ENDIF()
+
+# Compiler flags for coverage testing
+IF(NOT WIN32)
+ OPTION(SALOME_BUILD_FOR_GCOV "Add the compilation flags for GCov/LCov" OFF)
+ MARK_AS_ADVANCED(SALOME_BUILD_FOR_GCOV)
+ IF(SALOME_BUILD_FOR_GCOV)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
+ ENDIF()
+ENDIF()
+
+IF(NOT NO_CXX11_SUPPORT)
+ # C++11 support
+ INCLUDE(CheckCXXCompilerFlag)
+ CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+ CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+ IF(COMPILER_SUPPORTS_CXX11)
+ MESSAGE(STATUS "Enable C++11 support")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ ELSEIF(COMPILER_SUPPORTS_CXX0X)
+ MESSAGE(STATUS "Enable C++0x support")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ ELSE()
+ MESSAGE(WARNING "Compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
+ ENDIF()
+ENDIF()
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py)
-
-MACRO(MEDCOUPLING_EXTEND_ENVIRONMENT_VARIABLE output envvar values)
- SET(_env)
- FOREACH(_val ${values})
- IF(${envvar} STREQUAL "PATH" OR ${envvar} STREQUAL "LD_LIBRARY_PATH")
- IF(NOT IS_DIRECTORY ${_val})
- GET_FILENAME_COMPONENT(_val "${_val}" PATH)
- ENDIF()
- ENDIF()
- IF(WIN32)
- IF(${envvar} STREQUAL "LD_LIBRARY_PATH")
- SET(envvar PATH)
- ENDIF()
- STRING(REPLACE "/" "\\" _env "${_env} @SET ${envvar}=${_val};%${envvar}%\n")
- ELSE(WIN32)
- SET(_env "${_env} export ${envvar}=${_val}:\${${envvar}}\n")
- ENDIF(WIN32)
- ENDFOREACH(_val)
- SET(${output} "${${output}} ${_env}")
-ENDMACRO(MEDCOUPLING_EXTEND_ENVIRONMENT_VARIABLE envvar values)
-
-
-SET(SETUPTOOLS_PATH $ENV{SETUPTOOLS_ROOT_DIR}/bin)
-SET(SETUPTOOLS_PYTHONPATH $ENV{SETUPTOOLS_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
-
-SET(DOCUTILS_PATH $ENV{DOCUTILS_ROOT_DIR}/bin)
-SET(DOCUTILS_PYTHONPATH $ENV{DOCUTILS_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
-
-SET(PKGCONFIG_PYTHONPATH $ENV{PKGCONFIG_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
-
-
-SET(build_env)
-
-#SET(_variables ${SPHINX_EXECUTABLE} ${SPHINX_APIDOC_EXECUTABLE} ${PYTHON_EXECUTABLE} ${GRAPHVIZ_EXECUTABLE} ${SETUPTOOLS_PATH} ${DOCUTILS_PATH})
-#MEDCOUPLING_EXTEND_ENVIRONMENT_VARIABLE(build_env "PATH" "${_variables}")
-
-#SET(_variables ${SPHINX_PYTHONPATH} ${PYTHON_PYTHONPATH} ${SETUPTOOLS_PYTHONPATH} ${DOCUTILS_PYTHONPATH} ${PKGCONFIG_PYTHONPATH})
-SET(_variables ${SPHINX_PYTHONPATH} ${SETUPTOOLS_PYTHONPATH} ${PKGCONFIG_PYTHONPATH} ${DOCUTILS_PYTHONPATH})
-MEDCOUPLING_EXTEND_ENVIRONMENT_VARIABLE(build_env "PYTHONPATH" "${_variables}")
-
-#SET(_variables ${PYTHON_LIBRARIES} ${GRAPHVIZ_LIBRARIES})
-SET(_variables ${PYTHON_LIBRARIES})
-MEDCOUPLING_EXTEND_ENVIRONMENT_VARIABLE(build_env "LD_LIBRARY_PATH" "${_variables}")
-
-IF(WIN32)
- SET(_ext "bat")
- SET(_call_cmd "call")
-ELSE()
- SET(_ext "sh")
- SET(_call_cmd ".")
-ENDIF()
-
+SALOME_CONFIGURE_FILE(conf.py.in conf.py)
SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} html)
-SET(_cmd ${SPHINX_EXECUTABLE} ${_cmd_options})
-
-SET(_script ${CMAKE_CURRENT_BINARY_DIR}/env_script.${_ext})
-
-FILE(WRITE ${_script} "${build_env}")
-SET(make_doc ${_call_cmd} ${_script} && ${_cmd})
-
+SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}")
-ADD_CUSTOM_TARGET(tutorial_doc COMMAND ${make_doc})
+ADD_CUSTOM_TARGET(tutorial_doc COMMAND ${_cmd})
ADD_DEPENDENCIES(usr_docs tutorial_doc)
#INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target tutorial_doc)")
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile_med_user.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_med_user)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
+SALOME_CONFIGURE_FILE(Doxyfile_med_user.in Doxyfile_med_user)
+SALOME_CONFIGURE_FILE(static/header.html.in static/header.html)
+
IF(MEDCOUPLING_MED_ENABLE_PYTHON)
INCLUDE(doxy2swig/doxy2swig.cmake)
# MEDCoupling classes to include
#
SET(_classes_MEDCoupling
-# ParaMEDMEM_1_1MEDCouplingPointSet
-# ParaMEDMEM_1_1MEDCouplingUMesh
-# ParaMEDMEM_1_1MEDCouplingCMesh
-# ParaMEDMEM_1_1MEDCouplingRemapper
-# ParaMEDMEM_1_1DataArray
-# ParaMEDMEM_1_1DataArrayInt
- ParaMEDMEM_1_1DataArrayDouble
+ ParaMEDMEM_1_1MEDCouplingPointSet
+ ParaMEDMEM_1_1MEDCouplingUMesh
+ ParaMEDMEM_1_1MEDCouplingCMesh
+ ParaMEDMEM_1_1MEDCouplingRemapper
+ ParaMEDMEM_1_1DataArray
+ ParaMEDMEM_1_1DataArrayInt
+ ParaMEDMEM_1_1DataArrayDouble
)
#
# MEDLoader classes to include
#
SET(_classes_MEDLoader
-# MEDLoader
-# ParaMEDMEM_1_1MEDFileMeshes
-# ParaMEDMEM_1_1MEDFileMesh
-# ParaMEDMEM_1_1MEDFileUMesh
+ MEDLoader
+ ParaMEDMEM_1_1MEDFileMeshes
+ ParaMEDMEM_1_1MEDFileMesh
+ ParaMEDMEM_1_1MEDFileUMesh
ParaMEDMEM_1_1MEDFileCMesh
)
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-SET(MED_ENABLE_MICROMED ${MEDCOUPLING_MED_MICROMED})
-
+# InterpKERNEL
ADD_SUBDIRECTORY(INTERP_KERNEL)
IF(MEDCOUPLING_BUILD_TESTS)
- ADD_SUBDIRECTORY(INTERP_KERNELTest)
+ IF(NOT MEDCOUPLING_MED_MICROMED) # to be fixed later: the tests depends on some MEDLoader includes!!
+ ADD_SUBDIRECTORY(INTERP_KERNELTest)
+ ENDIF()
ENDIF(MEDCOUPLING_BUILD_TESTS)
-ADD_SUBDIRECTORY(MEDCoupling)
+# MEDCoupling
+ADD_SUBDIRECTORY(MEDCoupling)
IF(MEDCOUPLING_MED_ENABLE_PYTHON)
ADD_SUBDIRECTORY(MEDCoupling_Swig)
ENDIF(MEDCOUPLING_MED_ENABLE_PYTHON)
+
IF(NOT MEDCOUPLING_MED_MICROMED)
+ # MEDLoader
ADD_SUBDIRECTORY(MEDLoader)
+
+ # RENUMBER
IF(MEDCOUPLING_MED_ENABLE_RENUMBER)
ADD_SUBDIRECTORY(RENUMBER)
IF(MEDCOUPLING_MED_ENABLE_PYTHON)
ADD_SUBDIRECTORY(RENUMBER_Swig)
ENDIF(MEDCOUPLING_MED_ENABLE_PYTHON)
ENDIF(MEDCOUPLING_MED_ENABLE_RENUMBER)
+
+ # MEDPartitioner
IF(MEDCOUPLING_MED_ENABLE_PARTITIONER)
ADD_SUBDIRECTORY(MEDPartitioner)
IF(MEDCOUPLING_MED_ENABLE_PYTHON)
ENDIF(NOT MEDCOUPLING_MED_MICROMED)
IF(MEDCOUPLING_USE_MPI)
+ # ParaMEDMEM
ADD_SUBDIRECTORY(ParaMEDMEM)
+
+ # ParaMEDLoader
IF(NOT MEDCOUPLING_MED_MICROMED)
ADD_SUBDIRECTORY(ParaMEDLoader)
ENDIF(NOT MEDCOUPLING_MED_MICROMED)
int pos=(int)_value;
int lgth=(int)valuesInExpr.size();
if(pos>=lgth || pos<0)
- throw INTERP_KERNEL::Exception("LeafExprVal::replaceValues : Big Problem detected !");
+ throw INTERP_KERNEL::Exception("LeafExprVal::replaceValues : Big Problem detected! Send a mail to Salome support with expression.");
_value=valuesInExpr[pos];
}
PerfTest.cxx
)
-IF(NOT MED_ENABLE_MICROMED)
+IF(NOT MEDCOUPLING_MED_MICROMED)
SET(InterpKernelTest_SOURCES
${InterpKernelTest_SOURCES}
InterpolationOptionsTest.cxx
ADD_EXECUTABLE(PerfTest ${PerfTest_SOURCES})
TARGET_LINK_LIBRARIES(PerfTest InterpKernelTest ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
INSTALL(TARGETS PerfTest DESTINATION ${MEDCOUPLING_INSTALL_BINS})
-ENDIF(NOT MED_ENABLE_MICROMED)
+ENDIF(NOT MEDCOUPLING_MED_MICROMED)
ADD_LIBRARY(InterpKernelTest SHARED ${InterpKernelTest_SOURCES})
SET(InterpKernelTest_LIBS medcoupling interpkernel ${CPPUNIT_LIBRARIES})
-IF(NOT MED_ENABLE_MICROMED)
+IF(NOT MEDCOUPLING_MED_MICROMED)
SET(InterpKernelTest_LIBS medloader ${InterpKernelTest_LIBS})
-ENDIF(NOT MED_ENABLE_MICROMED)
+ENDIF(NOT MEDCOUPLING_MED_MICROMED)
TARGET_LINK_LIBRARIES(InterpKernelTest ${InterpKernelTest_LIBS})
ADD_EXECUTABLE(TestINTERP_KERNEL ${TestINTERP_KERNEL_SOURCES})
TARGET_LINK_LIBRARIES(TestINTERP_KERNEL InterpKernelTest ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
-ADD_TEST(TestINTERP_KERNEL TestINTERP_KERNEL)
+#ADD_TEST(TestINTERP_KERNEL TestINTERP_KERNEL)
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+#SET_TESTS_PROPERTIES(TestINTERP_KERNEL PROPERTIES ENVIRONMENT "${tests_env}")
INSTALL(TARGETS TestINTERP_KERNEL DESTINATION ${MEDCOUPLING_INSTALL_BINS})
INSTALL(TARGETS InterpKernelTest DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
MEDCouplingBasicsTest0.cxx
)
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
ADD_EXECUTABLE(TestMEDCoupling ${TestMEDCoupling_SOURCES})
TARGET_LINK_LIBRARIES(TestMEDCoupling medcoupling ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
ADD_TEST(TestMEDCoupling TestMEDCoupling)
+SET_TESTS_PROPERTIES(TestMEDCoupling PROPERTIES ENVIRONMENT "${tests_env}")
ADD_EXECUTABLE(TestMEDCouplingRemapper ${TestMEDCouplingRemapper_SOURCES})
TARGET_LINK_LIBRARIES(TestMEDCouplingRemapper medcouplingremapper ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
ADD_TEST(TestMEDCouplingRemapper TestMEDCouplingRemapper)
+SET_TESTS_PROPERTIES(TestMEDCouplingRemapper PROPERTIES ENVIRONMENT "${tests_env}")
ADD_EXECUTABLE(TestMEDCouplingExamples ${TestMEDCouplingExamples_SOURCES})
TARGET_LINK_LIBRARIES(TestMEDCouplingExamples medcoupling ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
ADD_TEST(TestMEDCouplingExamples TestMEDCouplingExamples)
+SET_TESTS_PROPERTIES(TestMEDCouplingExamples PROPERTIES ENVIRONMENT "${tests_env}")
INSTALL(TARGETS TestMEDCoupling TestMEDCouplingRemapper TestMEDCouplingExamples DESTINATION ${MEDCOUPLING_INSTALL_BINS})
ENDIF(WIN32)
INSTALL(TARGETS ${SWIG_MODULE_MEDCoupling_REAL_NAME} ${SWIG_MODULE_MEDCouplingRemapper_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling.py ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingRemapper.py DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
+SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling.py ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingRemapper.py)
+SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${MEDCOUPLING_INSTALL_PYTHON})
INSTALL(FILES MEDCoupling.i MEDCouplingCommon.i MEDCouplingRefCountObject.i MEDCouplingMemArray.i MEDCouplingFieldDiscretization.i MEDCouplingTimeDiscretization.i MEDCouplingFinalize.i MEDCouplingRemapper.i MEDCouplingTypemaps.i MEDCouplingDataArrayTypemaps.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
INSTALL(FILES MEDCouplingBasicsTest.py MEDCouplingRemapperTest.py MEDCouplingDataForTest.py MEDCouplingNumPyTest.py MEDCouplingPickleTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
INSTALL(FILES MEDCouplingExamplesTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
ADD_TEST(MEDCouplingBasicsTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest.py)
+SET_TESTS_PROPERTIES(MEDCouplingBasicsTest PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(MEDCouplingExamplesTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingExamplesTest.py)
+SET_TESTS_PROPERTIES(MEDCouplingExamplesTest PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(MEDCouplingRemapperTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingRemapperTest.py)
+SET_TESTS_PROPERTIES(MEDCouplingRemapperTest PROPERTIES ENVIRONMENT "${tests_env}")
IF(NUMPY_FOUND)
ADD_TEST(MEDCouplingNumPyTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingNumPyTest.py)
+ SET_TESTS_PROPERTIES(MEDCouplingNumPyTest PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(MEDCouplingPickleTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingPickleTest.py)
+ SET_TESTS_PROPERTIES(MEDCouplingPickleTest PROPERTIES ENVIRONMENT "${tests_env}")
ENDIF(NUMPY_FOUND)
# Application tests
mExp0=csr_matrix((data,(row,col)),shape=(4,11))
# compute diff and check
diff=abs(m-mExp0)
- self.assertAlmostEqual(diff.max(),0.,14)
+ self.assertAlmostEqual(diff.sum(),0.,14)
## full specific case 1D where target=source
rem=MEDCouplingRemapper()
rem.setIntersectionType(PointLocator)
# expected matrix
mExp1=identity(11)
diff=abs(m-mExp1)
- self.assertAlmostEqual(diff.max(),0.,14)
+ self.assertAlmostEqual(diff.sum(),0.,14)
## case where some points in target are not in source
arrT=DataArrayDouble([-0.2,0.1,1.7,5.5,10.3])
mT=MEDCouplingCMesh() ; mT.setCoords(arrT)
data=array([0.9,0.1,0.3,0.7,0.5,0.5])
mExp2=csr_matrix((data,(row,col)),shape=(5,11))
diff=abs(m-mExp2)
- self.assertAlmostEqual(diff.max(),0.,14)
+ self.assertAlmostEqual(diff.sum(),0.,14)
## basic case 2D Curve
arrS=DataArrayInt.Range(0,11,1).convertToDblArr()
arrT=DataArrayDouble([0.1,1.7,5.5,9.6])
rowSum=m.sum(axis=1)
m=diags(array(1/rowSum.transpose()),[0])*m
diff=abs(m-mExp0)
- self.assertAlmostEqual(diff.max(),0.,14)
+ self.assertAlmostEqual(diff.sum(),0.,14)
pass
def build2DSourceMesh_1(self):
INSTALL(TARGETS _MEDLoader DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
INSTALL(FILES MEDLoader.i MEDLoaderTypemaps.i MEDLoaderCommon.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDLoader.py DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
+SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDLoader.py ${MEDCOUPLING_INSTALL_PYTHON})
INSTALL(FILES MEDLoaderDataForTest.py MEDLoaderTest.py MEDLoaderTest2.py MEDLoaderTest3.py MEDLoaderTest4.py SauvLoaderTest.py MEDLoaderExamplesTest.py MEDLoaderCouplingTrainingSession.py CaseIO.py CaseReader.py CaseWriter.py VTKReader.py MEDLoaderSplitter.py medutilities.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS})
INSTALL(FILES med2sauv PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MEDCOUPLING_INSTALL_BINS} )
INSTALL(FILES case2med PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MEDCOUPLING_INSTALL_BINS} )
INSTALL(FILES med2case PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${MEDCOUPLING_INSTALL_BINS} )
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
ADD_TEST(MEDLoaderTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest.py)
+SET_TESTS_PROPERTIES(MEDLoaderTest PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(MEDLoaderTest2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest2.py)
+SET_TESTS_PROPERTIES(MEDLoaderTest2 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(MEDLoaderTest3 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest3.py)
+SET_TESTS_PROPERTIES(MEDLoaderTest3 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(MEDLoaderTest4 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest4.py)
+SET_TESTS_PROPERTIES(MEDLoaderTest4 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(MEDLoaderExamplesTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderExamplesTest.py)
+SET_TESTS_PROPERTIES(MEDLoaderExamplesTest PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(SauvLoaderTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/SauvLoaderTest.py)
+SET_TESTS_PROPERTIES(SauvLoaderTest PROPERTIES ENVIRONMENT "${tests_env}")
IF(NUMPY_FOUND)
ADD_TEST(MEDLoaderCouplingTrainingSession ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderCouplingTrainingSession.py)
+ SET_TESTS_PROPERTIES(MEDLoaderCouplingTrainingSession PROPERTIES ENVIRONMENT "${tests_env}")
ENDIF(NUMPY_FOUND)
# Application tests
SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS}/test/MEDCoupling/MEDLoader/Swig)
-SET(MEDLOADER_TEST_FILES MEDLoaderDataForTest.py MEDLoaderTest.py MEDLoaderTest2.py MEDLoaderTest3.py MEDLoaderTest4.py SauvLoaderTest.py MEDLoaderExamplesTest.py MEDLoaderCouplingTrainingSession.py CaseIO.py CaseReader.py CaseWriter.py VTKReader.py MEDLoaderSplitter.py medutilities.py)
+SET(MEDLOADER_TEST_FILES
+ MEDLoaderDataForTest.py
+ MEDLoaderTest.py
+ MEDLoaderTest2.py
+ MEDLoaderTest3.py
+ MEDLoaderTest4.py
+ SauvLoaderTest.py
+ MEDLoaderExamplesTest.py
+ MEDLoaderCouplingTrainingSession.py
+ CaseIO.py
+ CaseReader.py
+ CaseWriter.py
+ VTKReader.py
+ MEDLoaderSplitter.py
+ medutilities.py
+)
FOREACH(testfile ${MEDLOADER_TEST_FILES})
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${testfile}" "${CMAKE_CURRENT_BINARY_DIR}/${testfile}" COPYONLY)
SauvLoaderTest.cxx
)
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
ADD_EXECUTABLE(TestMEDLoader ${TestMEDLoader_SOURCES})
TARGET_LINK_LIBRARIES(TestMEDLoader medloader ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
ADD_TEST(TestMEDLoader TestMEDLoader)
+SET_TESTS_PROPERTIES(TestMEDLoader PROPERTIES ENVIRONMENT "${tests_env}")
ADD_EXECUTABLE(TestSauvLoader ${TestSauvLoader_SOURCES})
TARGET_LINK_LIBRARIES(TestSauvLoader medloader ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
ADD_TEST(TestSauvLoader TestSauvLoader)
+SET_TESTS_PROPERTIES(TestSauvLoader PROPERTIES ENVIRONMENT "${tests_env}")
INSTALL(TARGETS TestMEDLoader TestSauvLoader DESTINATION ${MEDCOUPLING_INSTALL_BINS})
#include <cmath>
#include <numeric>
+#include <unistd.h> // get_current_dir_name()
using namespace ParaMEDMEM;
INSTALL(FILES ${MEDPARTITIONERTest_HEADERS_HXX} DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
ADD_TEST(TestMEDPARTITIONER TestMEDPARTITIONER)
+SET_TESTS_PROPERTIES(TestMEDPARTITIONER PROPERTIES ENVIRONMENT "${tests_env}")
# Application tests
INSTALL(TARGETS ${SWIG_MODULE_MEDPartitioner_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDPartitioner.py)
-INSTALL(FILES "${PYFILES_TO_INSTALL}" DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
INSTALL(FILES MEDPartitioner.i MEDPartitionerCommon.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
INSTALL(FILES MEDPartitionerTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
-ADD_TEST(MEDPartitionerTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDPartitionerTest.py)
-SET(MEDPartitionerTest_PYTHONPATH "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/../MEDLoader/Swig")
-SET_TESTS_PROPERTIES(MEDPartitionerTest PROPERTIES ENVIRONMENT "${MEDPartitionerTest_PYTHONPATH}")
+IF(MEDCOUPLING_MED_PARTITIONER_METIS)
+ # Python test of partitionner require METIS or PARMETIS?
+ SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+ ADD_TEST(MEDPartitionerTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDPartitionerTest.py)
+ SET_TESTS_PROPERTIES(MEDPartitionerTest PROPERTIES ENVIRONMENT "${tests_env}")
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader/Swig/MEDLoaderDataForTest.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+ENDIF()
# Application tests
# Now add CMake tests - test_perf, ParaMEDMEMTestMPI2_1 and ParaMEDMEMTestMPI2_2
# are left aside, as they are too specific
#
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
# -- some tests require 2, 3, 4 or 5 procs --
ADD_TEST(NAME TestParaMEDMEM_Proc2 COMMAND ${MPIEXEC} -np 2 $<TARGET_FILE:TestParaMEDMEM>)
+SET_TESTS_PROPERTIES(TestParaMEDMEM_Proc2 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(NAME TestParaMEDMEM_Proc3 COMMAND ${MPIEXEC} -np 3 $<TARGET_FILE:TestParaMEDMEM>)
+SET_TESTS_PROPERTIES(TestParaMEDMEM_Proc3 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(NAME TestParaMEDMEM_Proc4 COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:TestParaMEDMEM>)
+SET_TESTS_PROPERTIES(TestParaMEDMEM_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(NAME TestParaMEDMEM_Proc5 COMMAND ${MPIEXEC} -np 5 $<TARGET_FILE:TestParaMEDMEM>)
+SET_TESTS_PROPERTIES(TestParaMEDMEM_Proc5 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(NAME TestMPIAccess_Proc2 COMMAND ${MPIEXEC} -np 2 $<TARGET_FILE:TestMPIAccess>)
+SET_TESTS_PROPERTIES(TestMPIAccess_Proc2 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(NAME TestMPIAccess_Proc3 COMMAND ${MPIEXEC} -np 3 $<TARGET_FILE:TestMPIAccess>)
+SET_TESTS_PROPERTIES(TestMPIAccess_Proc3 PROPERTIES ENVIRONMENT "${tests_env}")
ADD_TEST(NAME TestMPIAccessDEC_Proc4 COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:TestMPIAccessDEC>)
+SET_TESTS_PROPERTIES(TestMPIAccessDEC_Proc4 PROPERTIES ENVIRONMENT "${tests_env}")
# Installation rules
INSTALL(TARGETS ${TESTSParaMEDMEM} DESTINATION ${MEDCOUPLING_INSTALL_BINS})
INSTALL(TARGETS _ParaMEDMEM DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
INSTALL(FILES ParaMEDMEM.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ParaMEDMEM.py test_InterpKernelDEC.py test_NonCoincidentDEC.py test_StructuredCoincidentDEC.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+
+SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/ParaMEDMEM.py ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+INSTALL(FILES test_InterpKernelDEC.py test_NonCoincidentDEC.py test_StructuredCoincidentDEC.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
ENDIF(WIN32)
INSTALL(TARGETS ${SWIG_MODULE_MEDRenumber_REAL_NAME} DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDRenumber.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDRenumber.py ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
INSTALL(FILES MEDRenumber.i MEDRenumberCommon.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
INSTALL(FILES MEDRenumberTest.py DESTINATION ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON})
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
ADD_TEST(MEDRenumberTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDRenumberTest.py)
-SET(MEDRenumberTest_PYTHONPATH "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/../MEDCoupling_Swig")
-SET_TESTS_PROPERTIES(MEDRenumberTest PROPERTIES ENVIRONMENT "${MEDRenumberTest_PYTHONPATH}")
+SET_TESTS_PROPERTIES(MEDRenumberTest PROPERTIES ENVIRONMENT "${tests_env}")
# Application tests