From dbc796091e4034d7d597577fa1330a61c7661e3d Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 5 May 2014 19:07:20 +0400 Subject: [PATCH] win32 compatibility --- .../vtkEllipseBuilderFilter.cxx | 2 +- src/Plugins/MEDReader/IO/CMakeLists.txt | 4 +-- .../IO/MEDFileFieldRepresentationTree.hxx | 9 ++--- src/Plugins/MEDReader/IO/MEDLoaderForPV.h | 33 +++++++++++++++++++ src/Plugins/MEDReader/IO/MEDTimeReq.hxx | 8 +++-- src/Plugins/MEDReader/IO/MEDUtilities.hxx | 4 ++- .../MEDReader/IO/vtkELNOMeshFilter.cxx | 2 +- src/Plugins/MEDReader/IO/vtkMEDReader.h | 2 ++ src/Plugins/ParaMEDCorba/CMakeLists.txt | 14 ++++++-- 9 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 src/Plugins/MEDReader/IO/MEDLoaderForPV.h diff --git a/src/Plugins/EllipseBuilder/vtkEllipseBuilderFilter.cxx b/src/Plugins/EllipseBuilder/vtkEllipseBuilderFilter.cxx index 30e1d977..1f3e2d00 100644 --- a/src/Plugins/EllipseBuilder/vtkEllipseBuilderFilter.cxx +++ b/src/Plugins/EllipseBuilder/vtkEllipseBuilderFilter.cxx @@ -189,7 +189,7 @@ int vtkEllipseBuilderFilter::RequestData(vtkInformation* vtkNotUsed(request), int aNumberOfRealComponents = aRealArray->GetNumberOfComponents(); int aNumberOfImagComponents = anImagArray->GetNumberOfComponents(); - if (aNumberOfRealComponents >= 3 and aNumberOfImagComponents >= 3) + if (aNumberOfRealComponents >= 3 && aNumberOfImagComponents >= 3) { anOutputMDSet->CopyStructure(anInputMDSet); vtkUnstructuredGrid* aCloneDS = aSourceDS->NewInstance(); diff --git a/src/Plugins/MEDReader/IO/CMakeLists.txt b/src/Plugins/MEDReader/IO/CMakeLists.txt index fb39e984..091b5335 100644 --- a/src/Plugins/MEDReader/IO/CMakeLists.txt +++ b/src/Plugins/MEDReader/IO/CMakeLists.txt @@ -34,10 +34,10 @@ FOREACH(class ${MEDReader_CLASSES}) ENDFOREACH(class) ADD_LIBRARY(MEDLoaderForPV SHARED MEDFileFieldRepresentationTree.cxx MEDTimeReq.cxx MEDUtilities.cxx vtkGenerateVectors.cxx) -TARGET_LINK_LIBRARIES(MEDLoaderForPV ${MED_medloader} ${MEDFILE_C_LIBRARIES}) +TARGET_LINK_LIBRARIES(MEDLoaderForPV vtkCommonCore vtkCommonDataModel ${MED_medloader} ${MEDFILE_C_LIBRARIES}) VTK_MODULE_LIBRARY(vtkMEDReader ${MEDReader_SRCS}) -TARGET_LINK_LIBRARIES(vtkMEDReader MEDLoaderForPV ${MEDFILE_C_LIBRARIES}) +TARGET_LINK_LIBRARIES(vtkMEDReader vtkPVVTKExtensionsRendering vtkRenderingFreeType vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL vtkInteractionStyle vtkFiltersCore vtkFiltersGeneral MEDLoaderForPV ${MEDFILE_C_LIBRARIES}) INSTALL( TARGETS vtkMEDReader MEDLoaderForPV diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx index 4df798d6..d70bfce6 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx @@ -23,6 +23,7 @@ #include "MEDFileMesh.hxx" #include "MEDFileField.hxx" +#include "MEDLoaderForPV.h" #include "vtkType.h" @@ -59,7 +60,7 @@ private: mutable std::vector< std::vector< std::pair< vtkQuadratureSchemeDefinition *, unsigned char > > > _defs; }; -class MEDFileFieldRepresentationLeavesArrays : public ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr +class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeavesArrays : public ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr { public: MEDFileFieldRepresentationLeavesArrays(); @@ -90,7 +91,7 @@ private: ELGACmp _elga_cmp; }; -class MEDFileFieldRepresentationLeaves +class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeaves { public: MEDFileFieldRepresentationLeaves(); @@ -125,7 +126,7 @@ private: mutable vtkDataSet *_cached_ds; }; -class MEDFileFieldRepresentationTree +class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationTree { public: MEDFileFieldRepresentationTree(); @@ -168,7 +169,7 @@ private: ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr _fields; }; -class TimeKeeper +class MEDLOADERFORPV_EXPORT TimeKeeper { public: TimeKeeper(int policy); diff --git a/src/Plugins/MEDReader/IO/MEDLoaderForPV.h b/src/Plugins/MEDReader/IO/MEDLoaderForPV.h new file mode 100644 index 00000000..616079b9 --- /dev/null +++ b/src/Plugins/MEDReader/IO/MEDLoaderForPV.h @@ -0,0 +1,33 @@ +// Copyright (C) 2010-2014 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef __MEDLOADERFORPV_HXX__ +#define __MEDLOADERFORPV_HXX__ + +#ifdef WIN32 +# if defined MEDLoaderForPV_EXPORTS || defined MEDLOADERFORPV_EXPORTS +# define MEDLOADERFORPV_EXPORT __declspec( dllexport ) +# else +# define MEDLOADERFORPV_EXPORT __declspec( dllimport ) +# endif +#else + #define MEDLOADERFORPV_EXPORT +#endif + +#endif diff --git a/src/Plugins/MEDReader/IO/MEDTimeReq.hxx b/src/Plugins/MEDReader/IO/MEDTimeReq.hxx index e1c061d4..40b9d6d2 100644 --- a/src/Plugins/MEDReader/IO/MEDTimeReq.hxx +++ b/src/Plugins/MEDReader/IO/MEDTimeReq.hxx @@ -24,7 +24,9 @@ #include #include -class MEDTimeReq +#include "MEDLoaderForPV.h" + +class MEDLOADERFORPV_EXPORT MEDTimeReq { public: virtual int size() const = 0; @@ -36,7 +38,7 @@ public: virtual ~MEDTimeReq(); }; -class MEDStdTimeReq : public MEDTimeReq +class MEDLOADERFORPV_EXPORT MEDStdTimeReq : public MEDTimeReq { public: MEDStdTimeReq(int timeReq); @@ -52,7 +54,7 @@ private: int _time_req; }; -class MEDModeTimeReq : public MEDTimeReq +class MEDLOADERFORPV_EXPORT MEDModeTimeReq : public MEDTimeReq { public: MEDModeTimeReq(const std::vector& v, const std::vector& ts); diff --git a/src/Plugins/MEDReader/IO/MEDUtilities.hxx b/src/Plugins/MEDReader/IO/MEDUtilities.hxx index 52ac5196..c6f28034 100644 --- a/src/Plugins/MEDReader/IO/MEDUtilities.hxx +++ b/src/Plugins/MEDReader/IO/MEDUtilities.hxx @@ -21,9 +21,11 @@ #ifndef __MEDUTILITIES_HXX__ #define __MEDUTILITIES_HXX__ +#include "MEDLoaderForPV.h" + class vtkInformationIntegerKey; -class MEDUtilities +class MEDLOADERFORPV_EXPORT MEDUtilities { public: static vtkInformationIntegerKey *ELGA(); diff --git a/src/Plugins/MEDReader/IO/vtkELNOMeshFilter.cxx b/src/Plugins/MEDReader/IO/vtkELNOMeshFilter.cxx index 1eb4c7ab..9d6894ff 100644 --- a/src/Plugins/MEDReader/IO/vtkELNOMeshFilter.cxx +++ b/src/Plugins/MEDReader/IO/vtkELNOMeshFilter.cxx @@ -108,7 +108,7 @@ int vtkELNOMeshFilter::RequestData(vtkInformation *request, for(int index = 0; index < fielddata->GetNumberOfArrays(); index++) { vtkDataArray *data(fielddata->GetArray(index)); - vtkQuadratureSchemeDefinition **dict(0); + vtkQuadratureSchemeDefinition **dict; vtkInformationQuadratureSchemeDefinitionVectorKey *key(vtkQuadratureSchemeDefinition::DICTIONARY()); if(key->Has(data->GetInformation())) { diff --git a/src/Plugins/MEDReader/IO/vtkMEDReader.h b/src/Plugins/MEDReader/IO/vtkMEDReader.h index a8972801..f8ba0598 100644 --- a/src/Plugins/MEDReader/IO/vtkMEDReader.h +++ b/src/Plugins/MEDReader/IO/vtkMEDReader.h @@ -21,6 +21,8 @@ #ifndef __vtkMEDReader_h_ #define __vtkMEDReader_h_ +#include + #include "vtkMultiBlockDataSetAlgorithm.h" class vtkMutableDirectedGraph; diff --git a/src/Plugins/ParaMEDCorba/CMakeLists.txt b/src/Plugins/ParaMEDCorba/CMakeLists.txt index 200b2b32..b58baba5 100644 --- a/src/Plugins/ParaMEDCorba/CMakeLists.txt +++ b/src/Plugins/ParaMEDCorba/CMakeLists.txt @@ -51,8 +51,7 @@ PROJECT( ParaMEDCorba ) SERVER_MANAGER_SOURCES ${PARACORBAPLUG_SRCS} ) INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} ${MED_ROOT_DIR}/include/salome ${KERNEL_ROOT_DIR}/include/salome) - SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS}") - SET_TARGET_PROPERTIES(ParaMEDCorbaPlugin PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS}") + ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) TARGET_LINK_LIBRARIES(ParaMEDMEM2VTK #vtkCommon @@ -69,6 +68,17 @@ PROJECT( ParaMEDCorba ) ParaMEDMEM2VTK ) + #Build library with a static runtime and ignore MSVCRT.lib on WINDOWS + IF(WIN32) + IF(CMAKE_BUILD_TYPE STREQUAL Debug) + SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRTD") + SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "/MTd") + ELSE() + SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "/MT") + ENDIF() + ENDIF(WIN32) + INSTALL(TARGETS ParaMEDCorbaPlugin DESTINATION lib/paraview) INSTALL(TARGETS ParaMEDMEM2VTK DESTINATION lib/salome) -- 2.39.2