-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2016 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.
+# 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
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-#IF(WIN32)
-# INCLUDE(${PROJECT_SOURCE_DIR}/adm_local/cmake_files/FindXDR.cmake)
-#ENDIF(WIN32)
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
-PROJECT(SalomeMED C CXX)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
+#INCLUDE(CMakeDependentOption)
+PROJECT(MEDCoupling C CXX)
# Ensure a proper linker behavior:
CMAKE_POLICY(SET CMP0003 NEW)
# Project name, upper case
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
-SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 2)
+SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
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})
-# Temporary backward compatibility:
-SET(VERSION ${${PROJECT_NAME_UC}_VERSION})
-SET(XVERSION 0x0${${PROJECT_NAME_UC}_MAJOR_VERSION}0${${PROJECT_NAME_UC}_MINOR_VERSION}0${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(VERSION_DEV "0")
-#
-# Kernel detection comes before user options to be
-# able to take previous values of SALOME_USE_MPI, SALOME_BUILD_DOC, etc ...
-#
-IF(NOT SALOME_MED_STANDALONE)
- SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
- IF(EXISTS ${KERNEL_ROOT_DIR})
- LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
- INCLUDE(SalomeMacros)
- FIND_PACKAGE(SalomeKERNEL REQUIRED)
- ELSE(EXISTS ${KERNEL_ROOT_DIR})
- MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR or turn option SALOME_MED_STANDALONE to ON !")
- ENDIF(EXISTS ${KERNEL_ROOT_DIR})
- LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
- FIND_PACKAGE(SalomeOmniORB REQUIRED)
-ELSE(NOT SALOME_MED_STANDALONE)
- LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local_without_kernel/cmake_files")
+# Common CMake macros
+SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake files")
+IF(EXISTS ${CONFIGURATION_ROOT_DIR})
+ LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
INCLUDE(SalomeMacros)
-ENDIF(NOT SALOME_MED_STANDALONE)
+ELSE()
+ MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
+ENDIF()
+
+# Platform setup
+# ==============
+INCLUDE(SalomeSetupPlatform)
#
# User options
# ============
INCLUDE(CMakeDependentOption)
-OPTION(SALOME_MED_STANDALONE "Build MED without CORBA bindings. When OFF, exchange to PARAVIS is disabled." OFF)
-OPTION(SALOME_MED_MICROMED "Build MED without MED file dependancy." OFF)
-OPTION(SALOME_MED_ENABLE_PYTHON "Build PYTHON bindings." ON)
-OPTION(SALOME_MED_ENABLE_PARTITIONER "Build MEDPartitioner." ON)
-OPTION(SALOME_MED_ENABLE_RENUMBER "Build Renumber." ON)
-OPTION(SALOME_USE_MPI "To build ParaMEDMEM." OFF)
-OPTION(SALOME_BUILD_GUI "Build GUI of MED." ON)
-OPTION(SALOME_BUILD_TESTS "Build MED tests." ON)
-OPTION(SALOME_BUILD_DOC "Build MED doc." ON)
-CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_METIS "Enable metis graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF)
-CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_SCOTCH "Enable scotch graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF)
-CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_PARMETIS "Enable parmetis graph librarie in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;SALOME_USE_MPI" OFF)
+OPTION(MEDCOUPLING_MICROMED "Build MED without MED file dependency." OFF)
+OPTION(MEDCOUPLING_ENABLE_PYTHON "Build PYTHON bindings." ON)
+OPTION(MEDCOUPLING_ENABLE_PARTITIONER "Build MEDPartitioner." ON)
+OPTION(MEDCOUPLING_ENABLE_RENUMBER "Build Renumber." ON)
+OPTION(MEDCOUPLING_WITH_FILE_EXAMPLES "Install examples of files containing meshes and fields of different formats." ON)
+OPTION(MEDCOUPLING_USE_MPI "(Use MPI containers) - For MED this triggers the build of ParaMEDMEM." OFF)
+OPTION(MEDCOUPLING_BUILD_TESTS "Build MED tests." ON)
+OPTION(MEDCOUPLING_BUILD_DOC "Build MED doc." ON)
+OPTION(MEDCOUPLING_BUILD_STATIC "Build MEDCoupling library in static mode." OFF)
+IF(${MEDCOUPLING_USE_MPI})
+ SET(USE_METIS_NOT_PARMETIS OFF)
+ELSE()
+ SET(USE_METIS_NOT_PARMETIS ON)
+ENDIF()
+CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_METIS "Enable metis graph library in MEDPartitioner." ${USE_METIS_NOT_PARMETIS}
+ "MEDCOUPLING_ENABLE_PARTITIONER" OFF)
+CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_SCOTCH "Enable scotch graph library in MEDPartitioner." ON
+ "MEDCOUPLING_ENABLE_PARTITIONER;NOT MEDCOUPLING_USE_MPI" OFF)
+CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_PARMETIS "Enable parmetis graph library in MEDPartitioner." ${MEDCOUPLING_USE_MPI}
+ "MEDCOUPLING_ENABLE_PARTITIONER;MEDCOUPLING_USE_MPI" OFF)
+CMAKE_DEPENDENT_OPTION(MEDCOUPLING_PARTITIONER_PTSCOTCH "Enable ptscotch graph library in MEDPartitioner." ${MEDCOUPLING_USE_MPI}
+ "MEDCOUPLING_ENABLE_PARTITIONER;MEDCOUPLING_USE_MPI" OFF)
+SET(XDR_DEFAULT_OPTION ON)
+IF(WIN32)
+ SET(XDR_DEFAULT_OPTION OFF)
+ENDIF()
+CMAKE_DEPENDENT_OPTION(MEDCOUPLING_MEDLOADER_USE_XDR "Enable use of XDR for SauvReader." ${XDR_DEFAULT_OPTION} "NOT MEDCOUPLING_MICROMED" OFF)
+
+IF(MEDCOUPLING_BUILD_STATIC)
+ SET(BUILD_SHARED_LIBS 0)
+ SET(CMAKE_POSITION_INDEPENDENT_CODE 1) # -fPIC option
+ELSE()
+ SET(BUILD_SHARED_LIBS 1)
+ENDIF()
+IF(${MEDCOUPLING_PARTITIONER_PARMETIS} AND ${MEDCOUPLING_PARTITIONER_METIS})
+ MESSAGE(FATAL_ERROR "ParMetis and Metis are mutually exclusive! Make a choice (options MEDCOUPLING_PARTITIONER_METIS and MEDCOUPLING_PARTITIONER_PARMETIS).")
+ENDIF()
+
+IF(${MEDCOUPLING_PARTITIONER_PTSCOTCH} AND ${MEDCOUPLING_PARTITIONER_SCOTCH})
+ MESSAGE(FATAL_ERROR "PTScotch and Scotch are mutually exclusive! Make a choice (options MEDCOUPLING_PARTITIONER_SCOTCH and MEDCOUPLING_PARTITIONER_PTSCOTCH).")
+ENDIF()
#
# Set list of prerequisites
# =========================
-IF(NOT SALOME_MED_STANDALONE)
- SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
- IF(EXISTS ${KERNEL_ROOT_DIR})
- LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
- INCLUDE(SalomeMacros)
- FIND_PACKAGE(SalomeKERNEL REQUIRED)
- ELSE(EXISTS ${KERNEL_ROOT_DIR})
- MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR or turn option SALOME_MED_STANDALONE to ON !")
- ENDIF(EXISTS ${KERNEL_ROOT_DIR})
- LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
- FIND_PACKAGE(SalomeOmniORB REQUIRED)
-ELSE(NOT SALOME_MED_STANDALONE)
- LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local_without_kernel/cmake_files")
- INCLUDE(SalomeMacros)
-ENDIF(NOT SALOME_MED_STANDALONE)
-
-LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
-
-IF(NOT SALOME_MED_MICROMED)
+IF(NOT MEDCOUPLING_MICROMED)
FIND_PACKAGE(SalomeHDF5 REQUIRED)
FIND_PACKAGE(SalomeMEDFile REQUIRED)
- IF(SALOME_MED_ENABLE_PARTITIONER)
- FIND_PACKAGE(SalomeLibXml2 REQUIRED)
- IF(SALOME_MED_PARTITIONER_METIS)
- FIND_PACKAGE(SalomeMetis REQUIRED)
- ENDIF(SALOME_MED_PARTITIONER_METIS)
- IF(SALOME_MED_PARTITIONER_SCOTCH)
- FIND_PACKAGE(SalomeScotch REQUIRED)
- ENDIF(SALOME_MED_PARTITIONER_SCOTCH)
- ENDIF(SALOME_MED_ENABLE_PARTITIONER)
-ENDIF(NOT SALOME_MED_MICROMED)
-
-IF(SALOME_BUILD_GUI)
- IF(NOT SALOME_MED_STANDALONE)
- SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
- IF(EXISTS ${GUI_ROOT_DIR})
- LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
- FIND_PACKAGE(SalomeGUI REQUIRED)
- ELSE(EXISTS ${GUI_ROOT_DIR})
- MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR or turn option SALOME_BUILD_GUI to OFF !")
- ENDIF(EXISTS ${GUI_ROOT_DIR})
- FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
- FIND_PACKAGE(SalomeCAS REQUIRED) # maybe one day it will disappear ...
- ENDIF(NOT SALOME_MED_STANDALONE)
-ENDIF(SALOME_BUILD_GUI)
-
-LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
-
-IF(SALOME_BUILD_TESTS)
- ENABLE_TESTING()
- FIND_PACKAGE(SalomeCppUnit REQUIRED)
-ENDIF(SALOME_BUILD_TESTS)
-
-IF(SALOME_USE_MPI)
+ # XDR stuff
+ IF(MEDCOUPLING_MEDLOADER_USE_XDR)
+ FIND_PACKAGE(SalomeXDR REQUIRED)
+ ENDIF(MEDCOUPLING_MEDLOADER_USE_XDR)
+ # End of XDR Stuff
+ IF(MEDCOUPLING_ENABLE_PARTITIONER)
+ FIND_PACKAGE(SalomeLibXml2)
+ SALOME_LOG_OPTIONAL_PACKAGE(LibXml2 MEDCOUPLING_ENABLE_PARTITIONER)
+ IF(MEDCOUPLING_PARTITIONER_METIS)
+ FIND_PACKAGE(SalomeMetis)
+ SALOME_LOG_OPTIONAL_PACKAGE(Metis MEDCOUPLING_PARTITIONER_METIS)
+ IF(SalomeMetis_FOUND)
+ ADD_DEFINITIONS("-DMED_ENABLE_METIS")
+ ENDIF()
+ ENDIF(MEDCOUPLING_PARTITIONER_METIS)
+ IF(MEDCOUPLING_PARTITIONER_SCOTCH)
+ FIND_PACKAGE(SalomeScotch)
+ SALOME_LOG_OPTIONAL_PACKAGE(Scotch MEDCOUPLING_PARTITIONER_SCOTCH)
+ IF(SalomeScotch_FOUND)
+ ADD_DEFINITIONS("-DMED_ENABLE_SCOTCH")
+ ENDIF()
+ ENDIF(MEDCOUPLING_PARTITIONER_SCOTCH)
+ ENDIF(MEDCOUPLING_ENABLE_PARTITIONER)
+ENDIF(NOT MEDCOUPLING_MICROMED)
+
+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(SalomeCppUnit)
+ SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
+ENDIF(MEDCOUPLING_BUILD_TESTS)
+
+IF(MEDCOUPLING_USE_MPI)
FIND_PACKAGE(SalomeMPI REQUIRED)
- IF(SALOME_MED_PARTITIONER_PARMETIS)
- FIND_PACKAGE(SalomeParMetis REQUIRED)
- ENDIF(SALOME_MED_PARTITIONER_PARMETIS)
-ENDIF(SALOME_USE_MPI)
-
-IF(SALOME_MED_ENABLE_RENUMBER)
+ ADD_DEFINITIONS("-DHAVE_MPI")
+ IF(MEDCOUPLING_PARTITIONER_PARMETIS)
+ FIND_PACKAGE(SalomeParMetis)
+ SALOME_LOG_OPTIONAL_PACKAGE(ParMetis MEDCOUPLING_PARTITIONER_PARMETIS)
+ IF (SalomeParMetis_FOUND)
+ ADD_DEFINITIONS("-DMED_ENABLE_PARMETIS")
+ ENDIF()
+ ENDIF(MEDCOUPLING_PARTITIONER_PARMETIS)
+ IF(MEDCOUPLING_PARTITIONER_PTSCOTCH)
+ FIND_PACKAGE(SalomePTScotch)
+ SALOME_LOG_OPTIONAL_PACKAGE(PTScotch MEDCOUPLING_PARTITIONER_PTSCOTCH)
+ IF(SalomePTScotch_FOUND)
+ ADD_DEFINITIONS("-DMED_ENABLE_PTSCOTCH")
+ ENDIF(SalomePTScotch_FOUND)
+ ENDIF(MEDCOUPLING_PARTITIONER_PTSCOTCH)
+ENDIF(MEDCOUPLING_USE_MPI)
+
+IF(MEDCOUPLING_ENABLE_RENUMBER)
FIND_PACKAGE(SalomeBoost)
-ENDIF(SALOME_MED_ENABLE_RENUMBER)
-
-IF(SALOME_BUILD_DOC)
- FIND_PACKAGE(SalomeDoxygen REQUIRED)
- FIND_PACKAGE(SalomeGraphviz) # Remains optional even here.
- FIND_PACKAGE(SalomeSphinx REQUIRED)
-ENDIF(SALOME_BUILD_DOC)
-
-IF(SALOME_MED_ENABLE_PYTHON)
- FIND_PACKAGE(SalomePython REQUIRED)
- FIND_PACKAGE(SalomeSWIG REQUIRED)
-ENDIF(SALOME_MED_ENABLE_PYTHON)
+ SALOME_LOG_OPTIONAL_PACKAGE(Boost MEDCOUPLING_ENABLE_RENUMBER)
+ENDIF(MEDCOUPLING_ENABLE_RENUMBER)
+
+IF(MEDCOUPLING_ENABLE_PYTHON)
+ FIND_PACKAGE(SalomePythonInterp)
+ FIND_PACKAGE(SalomePythonLibs)
+ FIND_PACKAGE(SalomeNumPySciPy)
+ FIND_PACKAGE(SalomeSWIG)
+ SALOME_LOG_OPTIONAL_PACKAGE(PythonInterp MEDCOUPLING_ENABLE_PYTHON)
+ SALOME_LOG_OPTIONAL_PACKAGE(PythonLibs MEDCOUPLING_ENABLE_PYTHON)
+ SALOME_LOG_OPTIONAL_PACKAGE(SWIG MEDCOUPLING_ENABLE_PYTHON)
+ IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "2")
+ IF("${PYTHON_VERSION_MINOR}" LESS "7")
+ MESSAGE(FATAL_ERROR "MEDCoupling's Python requires at least Python 2.7 (you seem to have ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}). Upgrade your Python, or turn off MEDCOUPLING_ENABLE_PYTHON")
+ ENDIF()
+ ENDIF()
+ IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
+ MESSAGE(STATUS "Using Python 3")
+ ENDIF()
+ENDIF(MEDCOUPLING_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
# Python version string for example).
# ===========
-SET(SALOME_INSTALL_BINS bin/salome CACHE PATH "Install path: SALOME binaries")
-SET(SALOME_INSTALL_LIBS lib/salome CACHE PATH "Install path: SALOME libs")
-SET(SALOME_INSTALL_IDLS idl/salome CACHE PATH "Install path: SALOME IDL files")
-SET(SALOME_INSTALL_HEADERS include/salome CACHE PATH "Install path: SALOME headers")
-SET(SALOME_INSTALL_SCRIPT_SCRIPTS ${SALOME_INSTALL_BINS} CACHE PATH
- "Install path: SALOME scripts")
-SET(SALOME_INSTALL_SCRIPT_DATA ${SALOME_INSTALL_BINS} CACHE PATH
- "Install path: SALOME script data")
-SET(SALOME_INSTALL_SCRIPT_PYTHON ${SALOME_INSTALL_BINS} CACHE PATH
- "Install path: SALOME Python scripts")
-SET(SALOME_INSTALL_APPLISKEL_SCRIPTS ${SALOME_INSTALL_BINS}/appliskel CACHE PATH
- "Install path: SALOME application skeleton - scripts")
-SET(SALOME_INSTALL_APPLISKEL_PYTHON ${SALOME_INSTALL_BINS}/appliskel CACHE PATH
- "Install path: SALOME application skeleton - Python")
-SET(SALOME_INSTALL_CMAKE adm_local/cmake_files CACHE PATH "Install path: SALOME CMake files")
-SET(SALOME_INSTALL_CMAKE_LOCAL adm_local/cmake_files CACHE PATH
- "Install path: local SALOME CMake files")
-
-IF(SALOME_MED_ENABLE_PYTHON)
+SET(MEDCOUPLING_INSTALL_BINS bin CACHE PATH "Install path: MEDCoupling binaries")
+SET(MEDCOUPLING_INSTALL_LIBS lib CACHE PATH "Install path: MEDCoupling libs")
+SET(MEDCOUPLING_INSTALL_HEADERS include CACHE PATH "Install path: MEDCoupling headers")
+SET(MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS ${MEDCOUPLING_INSTALL_BINS} CACHE PATH "Install path: MEDCoupling scripts")
+SET(MEDCOUPLING_INSTALL_TESTS tests CACHE PATH "Install path: MEDCoupling tests")
+# SET(MEDCOUPLING_INSTALL_SCRIPT_DATA ${MEDCOUPLING_INSTALL_BINS} CACHE PATH "Install path: MEDCoupling script data")
+SET(MEDCOUPLING_INSTALL_SCRIPT_PYTHON ${MEDCOUPLING_INSTALL_BINS} CACHE PATH "Install path: MEDCoupling Python scripts")
+SET(MEDCOUPLING_INSTALL_CMAKE_LOCAL cmake_files CACHE PATH "Install path: local MEDCoupling CMake files")
+
+IF(MEDCOUPLING_ENABLE_PYTHON)
SET(_pydir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
- SET(SALOME_INSTALL_PYTHON ${_pydir}/salome CACHE PATH "Install path: SALOME Python stuff")
- SET(SALOME_INSTALL_PYTHON_SHARED ${SALOME_INSTALL_PYTHON}/shared_modules CACHE PATH
- "Install path: SALOME Python shared modules")
-ENDIF(SALOME_MED_ENABLE_PYTHON)
+ SET(MEDCOUPLING_INSTALL_PYTHON ${_pydir} CACHE PATH "Install path: MEDCoupling Python stuff")
+ SET(MEDCOUPLING_INSTALL_PYTHON_SHARED ${MEDCOUPLING_INSTALL_PYTHON}/shared_modules CACHE PATH
+ "Install path: MEDCoupling Python shared modules")
+ENDIF(MEDCOUPLING_ENABLE_PYTHON)
-SET(SALOME_INSTALL_RES share/salome/resources CACHE PATH "Install path: SALOME resources")
+SET(MEDCOUPLING_INSTALL_RES share/resources CACHE PATH "Install path: MEDCoupling resources")
+SET(MEDCOUPLING_INSTALL_DOC share/doc CACHE PATH "Install path: MEDCoupling documentation")
# Med specific:
-SET(SALOME_MED_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/med" CACHE PATH "Install path: SALOME MED specific data")
-SET(SALOME_MED_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/med" CACHE PATH "Install path: SALOME MED specific scripts")
+SET(MEDCOUPLING_INSTALL_RES_DATA "${MEDCOUPLING_INSTALL_RES}/med" CACHE PATH "Install path: MEDCoupling specific data")
+#SET(MEDCOUPLING_INSTALL_RES_SCRIPTS "${MEDCOUPLING_INSTALL_RES}/med" CACHE PATH "Install path: MEDCouplng specific scripts")
-MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
-MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
-MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
-MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED SALOME_MED_INSTALL_RES_DATA SALOME_MED_INSTALL_RES_SCRIPTS)
+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_INSTALL_RES_DATA MEDCOUPLING_INSTALL_DOC)
-# Configuration of MED_version.h.in
+# Header configuration
+# ====================
+SALOME_XVERSION(${PROJECT_NAME})
+SALOME_CONFIGURE_FILE(MEDCoupling_version.h.in MEDCoupling_version.h INSTALL ${MEDCOUPLING_INSTALL_HEADERS})
-SET(input ${PROJECT_SOURCE_DIR}/MED_version.h.in)
-SET(output ${PROJECT_BINARY_DIR}/MED_version.h)
-MESSAGE(STATUS "Creation of ${output}")
-CONFIGURE_FILE(${input} ${output} @ONLY)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MED_version.h DESTINATION ${SALOME_INSTALL_HEADERS})
+# Accumulate environment variables for MED module
+#SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_BINS}
+# ${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON})
+#SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_LIBS})
-# Sources
+
+# Sources
# ========
IF(WIN32)
ADD_DEFINITIONS("-D_USE_MATH_DEFINES")
ENDIF(WIN32)
ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(bin)
ADD_SUBDIRECTORY(adm_local)
-IF(SALOME_BUILD_DOC)
+IF(MEDCOUPLING_BUILD_DOC)
ADD_SUBDIRECTORY(doc)
-ENDIF(SALOME_BUILD_DOC)
-
-IF(NOT SALOME_MED_STANDALONE)
- ADD_SUBDIRECTORY(idl)
-ELSE(NOT SALOME_MED_STANDALONE)
- ADD_SUBDIRECTORY(adm_local_without_kernel)
-ENDIF(NOT SALOME_MED_STANDALONE)
+ENDIF(MEDCOUPLING_BUILD_DOC)
-IF(NOT SALOME_MED_MICROMED)
- ADD_SUBDIRECTORY(resources)
-ENDIF(NOT SALOME_MED_MICROMED)
+ADD_SUBDIRECTORY(resources)
+IF(MEDCOUPLING_ENABLE_PYTHON)
+ ADD_SUBDIRECTORY(v8_work)
+ENDIF()
# Configuration export
# ====================
# 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"
SET(_${PROJECT_NAME}_exposed_targets
- interpkernel medcoupling medcouplingremapper)
-
-IF(NOT SALOME_MED_MICROMED)
- LIST(APPEND _${PROJECT_NAME}_exposed_targets
- medloader)
- IF(SALOME_USE_MPI)
- LIST(APPEND _${PROJECT_NAME}_exposed_targets
- paramedloader)
- ENDIF(SALOME_USE_MPI)
-ENDIF(NOT SALOME_MED_MICROMED)
-
-IF(SALOME_USE_MPI)
- LIST(APPEND _${PROJECT_NAME}_exposed_targets
- paramedmem)
-ENDIF(SALOME_USE_MPI)
-
-IF(NOT SALOME_MED_STANDALONE)
- LIST(APPEND _${PROJECT_NAME}_exposed_targets
- SalomeIDLMED medcouplingcorba )
-ENDIF(NOT SALOME_MED_STANDALONE)
+ interpkernel medcouplingcpp medcouplingremapper)
+
+IF(NOT MEDCOUPLING_MICROMED)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets medloader)
+ IF(MEDCOUPLING_ENABLE_RENUMBER)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets renumbercpp)
+ ENDIF()
+ IF(MEDCOUPLING_ENABLE_PARTITIONER)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets medpartitionercpp)
+ IF(MEDCOUPLING_BUILD_TESTS)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets MEDPARTITIONERTest)
+ ENDIF()
+ ENDIF()
+ IF(MEDCOUPLING_BUILD_TESTS)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets InterpKernelTest InterpKernelTestUtils)
+ ENDIF()
+ENDIF()
+
+IF(MEDCOUPLING_USE_MPI)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets paramedmem)
+ IF(NOT MEDCOUPLING_MICROMED)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets paramedloader)
+ ENDIF()
+ IF(MEDCOUPLING_BUILD_TESTS)
+ IF(NOT MEDCOUPLING_MICROMED)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets ParaMEDMEMTest)
+ ENDIF()
+ ENDIF()
+ENDIF()
# Add all targets to the build-tree export set
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:
+# Ensure the variables are always defined for the configure (even if empty):
SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}")
-SET(HDF5_ROOT_DIR "${HDF5_ROOT_DIR}")
SET(MPI_ROOT_DIR "${MPI_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(DOXYGEN_ROOT_DIR "${DOXYGEN_ROOT_DIR}")
SET(SPHINX_ROOT_DIR "${SPHINX_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(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}")
-CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in
+
+# Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
+SALOME_CONFIGURE_PREPARE(MEDFile MPI Boost Swig Python CppUnit Graphviz Doxygen Sphinx
+ Metis ParMetis Scotch XDR)
+
+CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
- INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}"
- PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX
- MEDFILE_ROOT_DIR HDF5_ROOT_DIR OMNIORB_ROOT_DIR PTHREAD_ROOT_DIR
- SWIG_ROOT_DIR PYTHON_ROOT_DIR CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR
- SPHINX_ROOT_DIR)
+ INSTALL_DESTINATION "${MEDCOUPLING_INSTALL_CMAKE_LOCAL}"
+ PATH_VARS CONF_INCLUDE_DIRS MEDCOUPLING_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
+ MEDFILE_ROOT_DIR MPI_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}
INSTALL(FILES
"${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
- DESTINATION "${SALOME_INSTALL_CMAKE}")
+ DESTINATION "${MEDCOUPLING_INSTALL_CMAKE_LOCAL}")
# Install the export set for use with the install-tree
-INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE}"
+INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${MEDCOUPLING_INSTALL_CMAKE_LOCAL}"
FILE ${PROJECT_NAME}Targets.cmake)
+