-# Copyright (C) 2015-2016 CEA/DEN, EDF R&D
+# Copyright (C) 2015-2020 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
#INCLUDE(CMakeDependentOption)
PROJECT(MEDCoupling C CXX)
-# Ensure a proper linker behavior:
-CMAKE_POLICY(SET CMP0003 NEW)
# Versioning
# ===========
# Project name, upper case
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
-SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 2)
+SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 6)
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(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)
+ INCLUDE(SalomeMacros NO_POLICY_SCOPE)
ELSE()
MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
ENDIF()
# ==============
INCLUDE(SalomeSetupPlatform)
+# [ABN]: use the below for aggressive code quality check:
+#if( EXISTS "aaaa")
+# add_definitions(-Weverything)
+# add_definitions(-Wno-inconsistent-missing-override)
+# add_definitions(-Wno-c++98-compat -Wno-c++98-compat-pedantic)
+# add_definitions(-Wno-sign-conversion)
+# add_definitions(-Wno-switch-enum)
+#
+# add_definitions(-Wno-documentation-unknown-command) # \image in Doxygen
+# add_definitions(-Wno-gnu-statement-expression) # assert(...)
+#
+# add_definitions(-Wno-reserved-id-macro -Wno-padded -Wno-weak-vtables -Wdouble-promotion -Wno-comma -Wno-unused-parameter)
+# add_definitions(-Wno-unreachable-code-break -Wno-old-style-cast -Wno-deprecated -Wno-double-promotion)
+# add_definitions(-Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes)
+# add_definitions(-Wno-covered-switch-default -Wno-weak-template-vtables -Wno-undefined-func-template -Wno-used-but-marked-unused)
+# add_definitions(-Wno-unreachable-code-return -Wno-missing-noreturn -Wno-unused-member-function -Wno-header-hygiene)
+# add_definitions(-Wno-ignored-qualifiers) # because of MED-file
+# add_definitions(-Wno-unused-function -Wno-unused-macros)
+# add_definitions(-Wno-missing-field-initializers)
+# add_definitions(-Wno-shadow) # SWIG generates a lot of those ...
+#
+# add_definitions(-Wno-float-equal) # OUCH
+#endif()
+
#
# User options
# ============
INCLUDE(CMakeDependentOption)
-OPTION(MEDCOUPLING_MICROMED "Build MED without MED file dependancy." 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_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)
+OPTION(MEDCOUPLING_USE_64BIT_IDS "Size of IDs to refer cells and nodes. 32 bits when OFF (default), 64 bits when ON." ON)
+
IF(${MEDCOUPLING_USE_MPI})
SET(USE_METIS_NOT_PARMETIS OFF)
ELSE()
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)
+ "MEDCOUPLING_ENABLE_PARTITIONER" 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)
+CMAKE_DEPENDENT_OPTION(MEDCOUPLING_BUILD_FRENCH_DOC "Generate MEDCOUPLING French documentation" OFF
+ "MEDCOUPLING_BUILD_DOC" OFF)
IF(MEDCOUPLING_BUILD_STATIC)
SET(BUILD_SHARED_LIBS 0)
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(MEDCOUPLING_USE_MPI)
FIND_PACKAGE(SalomeMPI REQUIRED)
ADD_DEFINITIONS("-DHAVE_MPI")
+ SALOME_ADD_MPI_TO_HDF5()
IF(MEDCOUPLING_PARTITIONER_PARMETIS)
FIND_PACKAGE(SalomeParMetis)
SALOME_LOG_OPTIONAL_PACKAGE(ParMetis MEDCOUPLING_PARTITIONER_PARMETIS)
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)
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)
ADD_DEFINITIONS("-D_USE_MATH_DEFINES")
ENDIF(WIN32)
+INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
+
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(adm_local)
# 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)
+ interpkernel medcouplingcpp medcouplingremapper)
IF(NOT MEDCOUPLING_MICROMED)
LIST(APPEND _${PROJECT_NAME}_exposed_targets medloader)