-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2012-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.
+# 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
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
+INCLUDE(CMakeDependentOption)
PROJECT(SalomeMED C CXX)
# Ensure a proper linker behavior:
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
-SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
+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(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
#
# Kernel detection comes before user options to be
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
INCLUDE(SalomeMacros)
FIND_PACKAGE(SalomeKERNEL REQUIRED)
+ KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
SET(_default_MPI ${SALOME_USE_MPI})
OPTION(SALOME_MED_ENABLE_RENUMBER "Build Renumber." ON)
OPTION(SALOME_MED_WITH_FILE_EXAMPLES "Install examples of files containing meshes and fields of different formats." ON)
OPTION(SALOME_USE_MPI "(Use MPI containers) - For MED this triggers the build of ParaMEDMEM." ${_default_MPI})
-OPTION(SALOME_BUILD_GUI "Build GUI of MED." ON)
+CMAKE_DEPENDENT_OPTION(SALOME_BUILD_GUI "Build GUI of MED." ON
+ "NOT SALOME_MED_STANDALONE" OFF)
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 library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF)
+CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_METIS "Enable metis graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER" OFF)
CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_SCOTCH "Enable scotch graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF)
CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_PARMETIS "Enable parmetis graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;SALOME_USE_MPI" OFF)
IF(WIN32)
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
INCLUDE(SalomeMacros)
FIND_PACKAGE(SalomeKERNEL REQUIRED)
+ KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
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})
IF(SALOME_MED_PARTITIONER_METIS)
FIND_PACKAGE(SalomeMetis)
SALOME_LOG_OPTIONAL_PACKAGE(Metis SALOME_MED_PARTITIONER_METIS)
+ ADD_DEFINITIONS("-DMED_ENABLE_METIS")
ENDIF(SALOME_MED_PARTITIONER_METIS)
IF(SALOME_MED_PARTITIONER_SCOTCH)
FIND_PACKAGE(SalomeScotch)
SALOME_LOG_OPTIONAL_PACKAGE(Scotch SALOME_MED_PARTITIONER_SCOTCH)
+ ADD_DEFINITIONS("-DMED_ENABLE_SCOTCH")
ENDIF(SALOME_MED_PARTITIONER_SCOTCH)
ENDIF(SALOME_MED_ENABLE_PARTITIONER)
ENDIF(NOT SALOME_MED_MICROMED)
# Find GUI (optional)
# ===========
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)
+ FULL_GUI(TRUE) # check whether GUI builded in full mode and with CORBA
ADD_DEFINITIONS(${GUI_DEFINITIONS})
INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
ELSE(EXISTS ${GUI_ROOT_DIR})
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_USE_MPI)
FIND_PACKAGE(SalomeMPI REQUIRED)
+ ADD_DEFINITIONS("-DHAVE_MPI")
IF(SALOME_MED_PARTITIONER_PARMETIS)
FIND_PACKAGE(SalomeParMetis)
SALOME_LOG_OPTIONAL_PACKAGE(ParMetis SALOME_MED_PARTITIONER_PARMETIS)
+ ADD_DEFINITIONS("-DMED_ENABLE_PARMETIS")
ENDIF(SALOME_MED_PARTITIONER_PARMETIS)
ENDIF(SALOME_USE_MPI)
ENDIF(WIN32)
ADD_SUBDIRECTORY(src)
-IF(NOT SALOME_MED_STANDALONE)
- ADD_SUBDIRECTORY(adm_local)
-ENDIF(NOT SALOME_MED_STANDALONE)
+ADD_SUBDIRECTORY(adm_local)
IF(SALOME_BUILD_DOC)
ADD_SUBDIRECTORY(doc)
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)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets medloader)
+ IF(SALOME_MED_ENABLE_RENUMBER)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets renumbercpp)
+ ENDIF()
+ IF(SALOME_MED_ENABLE_PARTITIONER)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets medpartitionercpp)
+ IF(SALOME_BUILD_TESTS)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets MEDPARTITIONERTest)
+ ENDIF()
+ ENDIF()
+ IF(SALOME_BUILD_TESTS)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets InterpKernelTest)
+ ENDIF()
+ENDIF()
IF(SALOME_USE_MPI)
- LIST(APPEND _${PROJECT_NAME}_exposed_targets
- paramedmem)
-ENDIF(SALOME_USE_MPI)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets paramedmem)
+ IF(NOT SALOME_MED_MICROMED)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets paramedloader)
+ ENDIF()
+ IF(NOT SALOME_MED_STANDALONE)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets
+ paramedcouplingcorba paramedmemcompo)
+ ENDIF()
+ IF(SALOME_BUILD_TESTS)
+ IF(NOT SALOME_MED_MICROMED)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets ParaMEDMEMTest)
+ ENDIF()
+ ENDIF()
+ENDIF()
IF(NOT SALOME_MED_STANDALONE)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
- SalomeIDLMED medcouplingcorba )
-ENDIF(NOT SALOME_MED_STANDALONE)
+ SalomeIDLMED SalomeIDLMEDTests medcouplingcorba medcouplingclient)
+ IF(NOT SALOME_MED_MICROMED)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets medcalculator MEDOPFactoryEngine)
+ IF(SALOME_MED_ENABLE_PYTHON)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets medcalculatorspython)
+ ENDIF()
+ ENDIF()
+ENDIF()
+
+IF(SALOME_BUILD_GUI)
+ IF(NOT SALOME_MED_MICROMED)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets
+ MEDOPGUI_dialogs MEDOPGUI)
+ ENDIF()
+ENDIF()
# Add all targets to the build-tree export set