From: abn Date: Fri, 11 Dec 2015 14:01:20 +0000 (+0100) Subject: Changes related to the split of MED module. New CMake X-Git-Tag: V8_0_0a1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fagr%2Fmedcoupling_tool;p=modules%2Fparavis.git Changes related to the split of MED module. New CMake option added: SALOME_PARAVIS_BUILD_CORBA_PLUGINS (dftl ON) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f257338..08be4910 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/src/Plugins/CMakeLists.txt b/src/Plugins/CMakeLists.txt index 325f7983..ff1b52b3 100755 --- a/src/Plugins/CMakeLists.txt +++ b/src/Plugins/CMakeLists.txt @@ -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) diff --git a/src/Plugins/MEDReader/CMakeLists.txt b/src/Plugins/MEDReader/CMakeLists.txt index 6b918c16..dc157a4a 100644 --- a/src/Plugins/MEDReader/CMakeLists.txt +++ b/src/Plugins/MEDReader/CMakeLists.txt @@ -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=/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 diff --git a/src/Plugins/MEDReader/IO/CMakeLists.txt b/src/Plugins/MEDReader/IO/CMakeLists.txt index 331e4cc0..1f763b88 100644 --- a/src/Plugins/MEDReader/IO/CMakeLists.txt +++ b/src/Plugins/MEDReader/IO/CMakeLists.txt @@ -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