]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Changes related to the split of MED module. New CMake agr/medcoupling_tool
authorabn <adrien.bruneton@cea.fr>
Fri, 11 Dec 2015 14:01:20 +0000 (15:01 +0100)
committerabn <adrien.bruneton@cea.fr>
Fri, 11 Dec 2015 14:01:20 +0000 (15:01 +0100)
option added: SALOME_PARAVIS_BUILD_CORBA_PLUGINS (dftl ON)

CMakeLists.txt
src/Plugins/CMakeLists.txt
src/Plugins/MEDReader/CMakeLists.txt
src/Plugins/MEDReader/IO/CMakeLists.txt

index 3f2573389451f236fd5514a24c331551a5ce32ef..08be4910e682b5e5b8da89ff682f8d0f83b023d9 100644 (file)
@@ -76,6 +76,7 @@ OPTION(SALOME_BUILD_DOC "Generate SALOME GUI documentation" ON)
 OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
 OPTION(SALOME_PARAVIS_ALL_TEST "Add all tests for Salome PARAVIS module" OFF)
 OPTION(SALOME_PARAVIS_BUILD_PLUGINS "Build PARAVIS plugins (MEDReader, etc ...)" ON)
+OPTION(SALOME_PARAVIS_BUILD_CORBA_PLUGINS "Build PARAVIS CORBA plugins (ParaMEDCorba -- this requires the SALOME MED 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)
 CMAKE_DEPENDENT_OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF
@@ -92,8 +93,6 @@ CMAKE_DEPENDENT_OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OF
 ##
 
 FIND_PACKAGE(SalomePython REQUIRED)
-FIND_PACKAGE(SalomeHDF5 REQUIRED)
-FIND_PACKAGE(SalomeSWIG REQUIRED)
 
 IF(NOT SALOME_LIGHT_ONLY)
   FIND_PACKAGE(SalomeOmniORB REQUIRED)
@@ -135,36 +134,30 @@ ADD_DEFINITIONS(${GUI_DEFINITIONS})
 INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
 
 ##
-## From GUI: part 2
-##
-FIND_PACKAGE(SalomeCAS REQUIRED)  # [ABN] I wish I could avoid that ...
-
-##
-## From MED
+## From MEDCoupling / MEDFile / or MEDModule (if CORBA plugin required):
 ##
 IF(SALOME_PARAVIS_BUILD_PLUGINS)
-  SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR} CACHE PATH "Path to the Salome MED module")
-  IF(EXISTS ${MED_ROOT_DIR})
-    LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local/cmake_files")
-    FIND_PACKAGE(SalomeMED REQUIRED)
-  ELSE()
-    MESSAGE(FATAL_ERROR "We absolutely need the Salome MED module to build plugins, please define MED_ROOT_DIR")
-  ENDIF()
-  IF(SALOME_MED_STANDALONE OR SALOME_MED_MICROMED)
-    MESSAGE(FATAL_ERROR "We absolutely need a Salome MED with KERNEL and with MED file dependancy,
-                         please set SALOME_MED_STANDALONE=OFF and SALOME_MED_MICROMED=OFF in MED module
-                         or SALOME_PARAVIS_BUILD_PLUGINS=OFF in PARAVIS module")
-  ENDIF()
-  FIND_PACKAGE(SalomeMEDFile)
-  FIND_PACKAGE(MEDCoupling)
-  SALOME_LOG_OPTIONAL_PACKAGE(MEDFile SALOME_PARAVIS_BUILD_PLUGINS)
-  SALOME_LOG_OPTIONAL_PACKAGE(MEDCoupling SALOME_PARAVIS_BUILD_PLUGINS)
-ENDIF()
+   # If CORBA plugins required, take in MED module 
+   IF(SALOME_PARAVIS_BUILD_CORBA_PLUGINS)
+      SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR} CACHE PATH "Path to the SALOME MED module")
+      IF(EXISTS ${MED_ROOT_DIR})
+         LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local/cmake_files")
+         FIND_PACKAGE(SalomeMED)
+         SALOME_LOG_OPTIONAL_PACKAGE(SalomeMED SALOME_PARAVIS_BUILD_CORBA_PLUGINS)
+      ENDIF()
+    ELSE(SALOME_PARAVIS_BUILD_CORBA_PLUGINS)
+       SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "Path to the MEDCoupling tool")
+       IF(EXISTS ${MEDCOUPLING_ROOT_DIR})
+          LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")   
+       ENDIF()
+       FIND_PACKAGE(SalomeMEDCoupling)            # will load MEDFile
+       SALOME_LOG_OPTIONAL_PACKAGE(MEDCoupling SALOME_PARAVIS_BUILD_PLUGINS)
+    ENDIF()        
+ENDIF(SALOME_PARAVIS_BUILD_PLUGINS)
 
 ##
 ## From GEOM
 ##
-
 IF(SALOME_PARAVIS_BUILD_PLUGINS AND SALOME_PARAVIS_USE_GEOM_SOURCE)
   SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR} CACHE PATH "Path to the Salome GEOM")
   IF(EXISTS ${GEOM_ROOT_DIR})
index 325f79834ce295309010ff6f210094f9e875887a..ff1b52b3cda603031de308ddad5c125cd2e818fe 100755 (executable)
@@ -31,9 +31,11 @@ SET(_subdirs
   )
 
 IF(NOT SALOME_LIGHT_ONLY)
-  LIST(APPEND _subdirs
-    ParaMEDCorba
-  )
+  IF(SALOME_PARAVIS_BUILD_CORBA_PLUGINS)
+    LIST(APPEND _subdirs
+      ParaMEDCorba
+    )
+  ENDIF()
 ENDIF()
 
 IF(SALOME_PARAVIS_USE_GEOM_SOURCE)
index 6b918c163b88770f041a56fb36b272c83ba9d519..dc157a4a6f1b41bb314bf3deca24852d341dab6c 100644 (file)
@@ -25,7 +25,9 @@
 #setenv LD_LIBRARY_PATH ...MEDReader_INSTALL/lib/salome:${LD_LIBRARY_PATH}
 
 # Typical cmake command
-# env MED_ROOT_DIR=... cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=PATH_TO/MEDReader_INSTALL ../MEDReader_SRC -DMEDFILE_ROOT_DIR=/where/is/med-3.0.7_install -DMEDCOUPLING_ROOT_DIR=/where/is/medcoupling_install
+# cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=PATH_TO/MEDReader_INSTALL ../MEDReader_SRC  \ 
+#       -DMEDFILE_ROOT_DIR=/where/is/med-3.0.7_install -DMEDCOUPLING_ROOT_DIR=/where/is/medcoupling_install \ 
+#       -DParaView_DIR=<PARAVIEW_INSTALL>/lib/cmake/paraview-4.3 
 
 PROJECT(MEDReader)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
@@ -66,16 +68,15 @@ OPTION(BUILD_SHARED_LIBS "Build with shared libraries." ${VTK_BUILD_SHARED_LIBS}
 # Find dependant Library
 #
 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "KERNEL_ROOT_DIR")
-SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR} CACHE PATH "MED_ROOT_DIR")
+SET(MEDCOUPLING_ROOT_DIR $ENV{MEDCOUPLING_ROOT_DIR} CACHE PATH "MEDCOUPLING_ROOT_DIR")
 #LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local_without_kernel/cmake_files")
 LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
-LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local/cmake_files")
+LIST(APPEND CMAKE_MODULE_PATH "${MEDCOUPLING_ROOT_DIR}/cmake_files")
 INCLUDE(SalomeMacros)
 INCLUDE(SalomeSetupPlatform)
-INCLUDE(SalomeMEDConfig)
 FIND_PACKAGE(SalomePython REQUIRED)
 FIND_PACKAGE(SalomeHDF5 REQUIRED)
-FIND_PACKAGE(SalomeMED REQUIRED)
+FIND_PACKAGE(SalomeMEDCoupling REQUIRED)
 FIND_PACKAGE(SalomeMEDFile REQUIRED)
 
 # Accumulate environment variables for PARAVIS module
index 331e4cc02497640af73e37f48241d538a36ed930..1f763b884056f951c70e4e6673a9a84826913cdb 100644 (file)
@@ -28,7 +28,8 @@ IF(HDF5_IS_PARALLEL)
   ADD_DEFINITIONS("-DMEDREADER_USE_MPI")
 ENDIF(HDF5_IS_PARALLEL)
 
-SET(MEDReader_CLASSES vtkMEDReader vtkExtractGroup vtkELNOMeshFilter vtkELNOSurfaceFilter vtkELNOFilter vtkExtractCellType vtkMEDQuadraturePointsGenerator)
+SET(MEDReader_CLASSES vtkMEDReader vtkExtractGroup vtkELNOMeshFilter vtkELNOSurfaceFilter vtkELNOFilter 
+                                   vtkExtractCellType vtkMEDQuadraturePointsGenerator)
 
 SET(MEDReader_SRCS)
 SET(MEDReader_HDRS)
@@ -41,13 +42,15 @@ ENDFOREACH(class)
 ADD_LIBRARY(MEDLoaderForPV SHARED MEDFileFieldRepresentationTree.cxx MEDTimeReq.cxx MEDUtilities.cxx vtkGenerateVectors.cxx)
 
 IF(HDF5_IS_PARALLEL)
-  TARGET_LINK_LIBRARIES(MEDLoaderForPV vtkCommonCore vtkCommonDataModel ${PARAMEDLOADER_LIBRARY} ${MEDFILE_C_LIBRARIES})
+  TARGET_LINK_LIBRARIES(MEDLoaderForPV vtkCommonCore vtkCommonDataModel ${MEDCoupling_paramedloader} ${MEDFILE_C_LIBRARIES})
 ELSE(HDF5_IS_PARALLEL)
-  TARGET_LINK_LIBRARIES(MEDLoaderForPV vtkCommonCore vtkCommonDataModel ${MEDLOADER_LIBRARY} ${MEDFILE_C_LIBRARIES})
+  TARGET_LINK_LIBRARIES(MEDLoaderForPV vtkCommonCore vtkCommonDataModel ${MEDCoupling_medloader} ${MEDFILE_C_LIBRARIES})
 ENDIF(HDF5_IS_PARALLEL)
 
 VTK_MODULE_LIBRARY(vtkMEDReader ${MEDReader_SRCS})
-TARGET_LINK_LIBRARIES(vtkMEDReader vtkPVVTKExtensionsRendering vtkRenderingFreeType vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL vtkInteractionStyle vtkFiltersCore vtkFiltersGeneral MEDLoaderForPV ${MEDFILE_C_LIBRARIES})
+TARGET_LINK_LIBRARIES(vtkMEDReader vtkPVVTKExtensionsRendering vtkRenderingFreeType vtkRenderingOpenGL 
+                                   vtkRenderingFreeTypeOpenGL vtkInteractionStyle vtkFiltersCore vtkFiltersGeneral 
+                                   MEDLoaderForPV ${MEDFILE_C_LIBRARIES})
 
 INSTALL(
   TARGETS vtkMEDReader MEDLoaderForPV