OPTION(SALOME_PARAVIS_BUILD_CORBA_PLUGINS "Build PARAVIS CORBA plugins (ParaMEDCorba -- this requires the SALOME FIELDS module)" ON)
OPTION(SALOME_PARAVIS_USE_GEOM_SOURCE "Import a GEOMETRY object to PARAVIS via its Corba IOR" OFF)
OPTION(SALOME_PARAVIS_USE_SMESH_SOURCE "Import a MESH object to PARAVIS via its Corba IOR" OFF)
+option(SALOME_USE_MPI "Activate parallel reading for MEDREADER" OFF)
CMAKE_DEPENDENT_OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF
"NOT SALOME_KERNEL_LIGHT_ONLY" ON)
##
FIND_PACKAGE(SalomeParaView REQUIRED)
-
##
## From MEDCoupling / MEDFile / or MEDModule (if CORBA plugin required):
##
# If CORBA plugins required, take in MED module
IF(SALOME_PARAVIS_BUILD_CORBA_PLUGINS)
SET(FIELDS_ROOT_DIR $ENV{FIELDS_ROOT_DIR} CACHE PATH "Path to the SALOME FIELDS module")
- IF(EXISTS ${FIELDS_ROOT_DIR})
- FIND_PACKAGE(SalomeFIELDS)
+ IF(EXISTS ${FIELDS_ROOT_DIR})
+ set(SALOME_USE_MPI_BEFORE ${SALOME_USE_MPI})
+ #SalomeFIELDS may break SALOME_USE_MPI var !
+ FIND_PACKAGE(SalomeFIELDS)
+ set(SALOME_USE_MPI ${SALOME_USE_MPI_BEFORE})
+ unset(SALOME_USE_MPI_BEFORE)
SALOME_LOG_OPTIONAL_PACKAGE(SalomeFIELDS SALOME_PARAVIS_BUILD_CORBA_PLUGINS)
IF(SALOME_USE_MPI)
SET(SALOME_PARAVIS_BUILD_INSITU ON)
LIST(APPEND _subdirs ParaSMESHCorba)
ENDIF()
+if(SALOME_USE_MPI)
+ # see https://stackoverflow.com/questions/20239334/cmake-set-subdirectory-options
+ # force to ON MEDREADER option instead of a simple set(MEDREADER_USE_MPI ON)
+ set(MEDREADER_USE_MPI ON CACHE BOOL "Activate parallel reading for MEDREADER" FORCE)
+endif(SALOME_USE_MPI)
+
FOREACH(_dir ${_subdirs})
ADD_SUBDIRECTORY(${_dir})
ENDFOREACH()
cmake_minimum_required(VERSION 3.8)
project(MEDReader)
-find_package(ParaView REQUIRED)
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+option(MEDREADER_USE_MPI "Activate parallel reading for MEDREADER" OFF)
-IF(SALOME_USE_MPI)
- ADD_DEFINITIONS(-DMEDREADER_USE_MPI)
-ENDIF(SALOME_USE_MPI)
+find_package(ParaView REQUIRED)
+if(MEDREADER_USE_MPI)
+ add_definitions(-DMEDREADER_USE_MPI)
+endif(MEDREADER_USE_MPI)
-option(BUILD_SHARED_LIBS "Build shared libraries" ON)
enable_testing()
include(GNUInstallDirs)