From 12c295f71d9bd855030f9e548f7b7d8d97ae3f8f Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 17 Oct 2013 07:24:33 +0000 Subject: [PATCH] Win32 compatibility. --- doc/docutils/CMakeLists.txt | 6 ++-- doc/salome/gui/GEOM/CMakeLists.txt | 22 +++++++++---- idl/CMakeLists.txt | 4 +-- src/EntityGUI/EntityGUI_FieldDlg.cxx | 4 +++ src/GEOM/CMakeLists.txt | 1 + src/GEOM/GEOM_Engine.hxx | 4 +-- src/GEOM_SWIG_WITHIHM/CMakeLists.txt | 4 +-- .../ImportExportGUI_ExportXAODlg.h | 2 +- .../ImportExportGUI_ImportXAODlg.h | 2 +- src/XAO/CMakeLists.txt | 3 +- src/XAO/XAO.hxx | 33 +++++++++++++++++++ src/XAO/XAO_BooleanField.hxx | 8 ++++- src/XAO/XAO_BooleanStep.hxx | 9 ++++- src/XAO/XAO_BrepGeometry.hxx | 8 ++++- src/XAO/XAO_DoubleField.hxx | 8 ++++- src/XAO/XAO_DoubleStep.hxx | 8 ++++- src/XAO/XAO_Exception.hxx | 5 ++- src/XAO/XAO_Field.cxx | 4 +-- src/XAO/XAO_Field.hxx | 9 ++++- src/XAO/XAO_GeometricElement.hxx | 12 +++++-- src/XAO/XAO_Geometry.hxx | 8 ++++- src/XAO/XAO_Group.hxx | 7 ++-- src/XAO/XAO_IntegerField.hxx | 8 ++++- src/XAO/XAO_IntegerStep.hxx | 9 ++++- src/XAO/XAO_Step.hxx | 8 ++++- src/XAO/XAO_StringField.hxx | 7 +++- src/XAO/XAO_StringStep.hxx | 8 ++++- src/XAO/XAO_Xao.hxx | 9 ++++- src/XAO/XAO_XaoExporter.hxx | 7 +++- src/XAO/XAO_XaoUtils.cxx | 1 + src/XAO/XAO_XaoUtils.hxx | 6 +++- src/XAO/tests/BrepGeometryTest.cxx | 6 ++-- src/XAO/tests/TestUtils.hxx | 3 +- src/XAO_Swig/CMakeLists.txt | 4 +-- src/XAO_Swig/xao.i | 2 ++ 35 files changed, 203 insertions(+), 46 deletions(-) create mode 100755 src/XAO/XAO.hxx diff --git a/doc/docutils/CMakeLists.txt b/doc/docutils/CMakeLists.txt index 985c835de..681e33800 100755 --- a/doc/docutils/CMakeLists.txt +++ b/doc/docutils/CMakeLists.txt @@ -45,7 +45,7 @@ SALOME_CONFIGURE_FILE(conf.py.in conf.py) # Their root dir were found when looking for Sphinx (FindSalomeSphinx.cmake): SET(_pydir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) -IF(WINDOWS) +IF(WIN32) STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\${_pydir}\\site-packages\\salome\;%PYTHONPATH% @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\bin\\salome\;%PYTHONPATH% @SET PATH=${CMAKE_INSTALL_PREFIX}\\lib\\salome\;%PATH% @@ -65,7 +65,7 @@ IF(WINDOWS) ") SET(EXT "bat") SET(CALL_STR "call") -ELSE(WINDOWS) +ELSE(WIN32) SET(SCR " export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/${_pydir}/site-packages/salome:\${PYTHONPATH} export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome:\${PYTHONPATH} export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib/salome:\${LD_LIBRARY_PATH} @@ -93,7 +93,7 @@ ELSE(WINDOWS) ) SET(EXT "sh") SET(CALL_STR ".") -ENDIF(WINDOWS) +ENDIF(WIN32) FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}") diff --git a/doc/salome/gui/GEOM/CMakeLists.txt b/doc/salome/gui/GEOM/CMakeLists.txt index 9a8550ef7..93285c4c7 100644 --- a/doc/salome/gui/GEOM/CMakeLists.txt +++ b/doc/salome/gui/GEOM/CMakeLists.txt @@ -34,18 +34,17 @@ SALOME_CONFIGURE_FILE(static/header.html.in ${builddir}/static/header.html) SALOME_CONFIGURE_FILE(static/header_py.html.in ${builddir}/static/header_py.html) SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py") -IF(WINDOWS) +IF(WIN32) STRING(REPLACE "/" "\\" f ${f}) -ENDIF(WINDOWS) +ENDIF(WIN32) -ADD_CUSTOM_TARGET(usr_docs mkdir -p tmp +ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomBuilder.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/geomBuilder.py COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/gsketcher.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/gsketcher.py COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_tui COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py COMMAND ${DOXYGEN_EXECUTABLE} doxyfile - COMMAND ${PYTHON_EXECUTABLE} -c "import shutil; shutil.rmtree(r'''tmp''')" - COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''', ignore=shutil.ignore_patterns('*usr_docs*', '*CMakeFiles*', '*.cmake', 'doxyfile*', '*.vcproj', 'static', 'Makefile*')); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM/geompy_doc'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/static/SALOME_BOA_PA.pdf''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''')" + COMMAND ${CMAKE_COMMAND} -E remove_directory tmp VERBATIM WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) @@ -53,5 +52,16 @@ ADD_CUSTOM_TARGET(usr_docs mkdir -p tmp ADD_DEPENDENCIES(usr_docs html_docs) INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)") -INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${SALOME_INSTALL_DOC}/gui) +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${SALOME_INSTALL_DOC}/gui + PATTERN "*usr_docs*" EXCLUDE + PATTERN "*CMakeFiles*" EXCLUDE + PATTERN "static" EXCLUDE + PATTERN "Makefile*" EXCLUDE + PATTERN "*.cmake" EXCLUDE + PATTERN "doxyfile*" EXCLUDE + PATTERN "*.vcproj" EXCLUDE +) + INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/static/SALOME_BOA_PA.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM) + diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 3f93f4c2a..44a1b598e 100755 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -25,9 +25,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) -IF(WINDOWS) +IF(WIN32) ADD_DEFINITIONS(-DNOGDI) -ENDIF(WINDOWS) +ENDIF(WIN32) SET(SalomeIDLGEOM_IDLSOURCES diff --git a/src/EntityGUI/EntityGUI_FieldDlg.cxx b/src/EntityGUI/EntityGUI_FieldDlg.cxx index 7fd1adf9d..f819f96e8 100644 --- a/src/EntityGUI/EntityGUI_FieldDlg.cxx +++ b/src/EntityGUI/EntityGUI_FieldDlg.cxx @@ -76,6 +76,10 @@ #include #include +#ifdef max + #undef max +#endif + const int theIntLimit = std::numeric_limits::max() - 10; diff --git a/src/GEOM/CMakeLists.txt b/src/GEOM/CMakeLists.txt index a1ce3979a..607ac6e1d 100755 --- a/src/GEOM/CMakeLists.txt +++ b/src/GEOM/CMakeLists.txt @@ -40,6 +40,7 @@ SET(_link_LIBRARIES ${CAS_TKCDF} ${CAS_TKG3d} ${KERNEL_SALOMELocalTrace} + ${KERNEL_OpUtil} GEOMSketcher ) diff --git a/src/GEOM/GEOM_Engine.hxx b/src/GEOM/GEOM_Engine.hxx index 67e2dfe30..174ad0c90 100644 --- a/src/GEOM/GEOM_Engine.hxx +++ b/src/GEOM/GEOM_Engine.hxx @@ -180,9 +180,9 @@ class GEOM_Engine const TCollection_AsciiString& anEntry, Resource_DataMapOfAsciiStringAsciiString& aNameToEntry); - void DocumentModified(const int theDocId, const bool isModified); + Standard_EXPORT void DocumentModified(const int theDocId, const bool isModified); - bool DocumentModified(const int theDocId); + Standard_EXPORT bool DocumentModified(const int theDocId); protected: Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine); diff --git a/src/GEOM_SWIG_WITHIHM/CMakeLists.txt b/src/GEOM_SWIG_WITHIHM/CMakeLists.txt index a44292a7f..7a36ff10b 100755 --- a/src/GEOM_SWIG_WITHIHM/CMakeLists.txt +++ b/src/GEOM_SWIG_WITHIHM/CMakeLists.txt @@ -77,9 +77,9 @@ SET(_swig_SCRIPTS SWIG_ADD_MODULE(libGEOM_Swig python libGEOM_Swig.i libGEOM_Swig.cxx) SWIG_LINK_LIBRARIES(libGEOM_Swig "${_link_LIBRARIES}") -IF(WINDOWS) +IF(WIN32) SET_TARGET_PROPERTIES(_libGEOM_Swig PROPERTIES DEBUG_OUTPUT_NAME _libGEOM_Swig_d) -ENDIF(WINDOWS) +ENDIF(WIN32) INSTALL(TARGETS _libGEOM_Swig DESTINATION ${SALOME_INSTALL_PYTHON}) diff --git a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h index acc4737cd..1f009b8d6 100644 --- a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h +++ b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h @@ -67,7 +67,7 @@ private slots: void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); - void LineEditReturnPressed(); +// void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); void btnFileSelectClicked(); diff --git a/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.h b/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.h index 085c7bd90..baacc3311 100644 --- a/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.h +++ b/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.h @@ -59,7 +59,7 @@ private slots: void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); - void LineEditReturnPressed(); +// void LineEditReturnPressed(); void btnFileSelectClicked(); }; diff --git a/src/XAO/CMakeLists.txt b/src/XAO/CMakeLists.txt index b0ab3a4cd..433874f73 100644 --- a/src/XAO/CMakeLists.txt +++ b/src/XAO/CMakeLists.txt @@ -40,12 +40,13 @@ ADD_DEFINITIONS( SET(_link_LIBRARIES ${PTHREAD_LIBRARIES} ${LIBXML2_LIBRARIES} - ${CAS_TKBRep} ${CAS_TKTopAlgo} + ${CAS_TKBRep} ${CAS_TKTopAlgo} ${CAS_TKG2d} ) # --- headers --- SET(XAO_HEADERS + XAO.hxx XAO_BooleanField.hxx XAO_BooleanStep.hxx XAO_BrepGeometry.hxx diff --git a/src/XAO/XAO.hxx b/src/XAO/XAO.hxx new file mode 100755 index 000000000..128e5201a --- /dev/null +++ b/src/XAO/XAO.hxx @@ -0,0 +1,33 @@ +// Copyright (C) 2013 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. +// +// 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 +// +// Author : Roman NIKOLAEV (OpenCascade) + +#if defined XAO_EXPORTS || defined Xao_EXPORTS + #if defined WIN32 + #define XAO_EXPORT __declspec( dllexport ) + #else + #define XAO_EXPORT + #endif +#else + #if defined WIN32 + #define XAO_EXPORT __declspec( dllimport ) + #else + #define XAO_EXPORT + #endif +#endif \ No newline at end of file diff --git a/src/XAO/XAO_BooleanField.hxx b/src/XAO/XAO_BooleanField.hxx index 9860c4643..5fed9f254 100644 --- a/src/XAO/XAO_BooleanField.hxx +++ b/src/XAO/XAO_BooleanField.hxx @@ -23,17 +23,23 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Field.hxx" #include "XAO_BooleanStep.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + + namespace XAO { /** * @class BooleanField * Represents a field with boolean values. */ - class BooleanField : public Field + class XAO_EXPORT BooleanField : public Field { public: /** diff --git a/src/XAO/XAO_BooleanStep.hxx b/src/XAO/XAO_BooleanStep.hxx index 9986a069a..f1e596b74 100644 --- a/src/XAO/XAO_BooleanStep.hxx +++ b/src/XAO/XAO_BooleanStep.hxx @@ -23,16 +23,23 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Step.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#pragma warning(disable:4251) // Warning dll-interface ... +#endif + + namespace XAO { /** * @class BooleanStep * Step with boolean values. */ - class BooleanStep : public Step + class XAO_EXPORT BooleanStep : public Step { public: /** diff --git a/src/XAO/XAO_BrepGeometry.hxx b/src/XAO/XAO_BrepGeometry.hxx index a457b3a77..6be30f970 100644 --- a/src/XAO/XAO_BrepGeometry.hxx +++ b/src/XAO/XAO_BrepGeometry.hxx @@ -26,16 +26,22 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Geometry.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + + namespace XAO { /** * @class BrepGeometry * Representation of a BRep Geometry. */ - class BrepGeometry : public Geometry + class XAO_EXPORT BrepGeometry : public Geometry { public: /** diff --git a/src/XAO/XAO_DoubleField.hxx b/src/XAO/XAO_DoubleField.hxx index 040a503b7..4e58ea991 100644 --- a/src/XAO/XAO_DoubleField.hxx +++ b/src/XAO/XAO_DoubleField.hxx @@ -23,17 +23,23 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Field.hxx" #include "XAO_DoubleStep.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + + namespace XAO { /** * @class DoubleField * Represents a field with double values. */ - class DoubleField : public Field + class XAO_EXPORT DoubleField : public Field { public: /** diff --git a/src/XAO/XAO_DoubleStep.hxx b/src/XAO/XAO_DoubleStep.hxx index 5f4f3e34a..699286e37 100644 --- a/src/XAO/XAO_DoubleStep.hxx +++ b/src/XAO/XAO_DoubleStep.hxx @@ -23,16 +23,22 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Step.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + + namespace XAO { /** * @class DoubleStep * Step with double values. */ - class DoubleStep : public Step + class XAO_EXPORT DoubleStep : public Step { public: /** diff --git a/src/XAO/XAO_Exception.hxx b/src/XAO/XAO_Exception.hxx index dce64a967..78d4b3072 100644 --- a/src/XAO/XAO_Exception.hxx +++ b/src/XAO/XAO_Exception.hxx @@ -21,13 +21,16 @@ #ifndef __XAO_EXCEPTION_HXX__ #define __XAO_EXCEPTION_HXX__ +#include "XAO.hxx" +#include + namespace XAO { /** * \class XAO_Exception * Exception for XAO operations. */ - class XAO_Exception : public std::exception + class XAO_EXPORT XAO_Exception : public std::exception { public: /** diff --git a/src/XAO/XAO_Field.cxx b/src/XAO/XAO_Field.cxx index 51d73616c..1e5f27ace 100644 --- a/src/XAO/XAO_Field.cxx +++ b/src/XAO/XAO_Field.cxx @@ -44,7 +44,7 @@ Field::Field(const XAO::Dimension& dimension, Field::~Field() { - for (int i = 0; i < m_steps.size(); ++i) + for (unsigned int i = 0; i < m_steps.size(); ++i) delete m_steps[i]; } @@ -81,7 +81,7 @@ throw (XAO_Exception) void Field::setComponentsNames(const std::vector& names) throw (XAO_Exception) { - for (int i = 0; i < names.size(); ++i) + for (unsigned int i = 0; i < names.size(); ++i) { if (i < m_nbComponents) m_components[i] = names[i]; diff --git a/src/XAO/XAO_Field.hxx b/src/XAO/XAO_Field.hxx index e1931d587..3a940f490 100644 --- a/src/XAO/XAO_Field.hxx +++ b/src/XAO/XAO_Field.hxx @@ -24,9 +24,16 @@ #include #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Step.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#pragma warning(disable:4251) // Warning dll-interface ... +#endif + + namespace XAO { typedef std::vector::iterator stepIterator; @@ -35,7 +42,7 @@ namespace XAO * @class Field * A geometrical Field. */ - class Field + class XAO_EXPORT Field { protected: /** diff --git a/src/XAO/XAO_GeometricElement.hxx b/src/XAO/XAO_GeometricElement.hxx index f0496479e..cfb001852 100644 --- a/src/XAO/XAO_GeometricElement.hxx +++ b/src/XAO/XAO_GeometricElement.hxx @@ -23,15 +23,23 @@ #include #include + +#include "XAO.hxx" #include "XAO_Exception.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#pragma warning(disable:4251) // Warning dll-interface ... +#endif + + namespace XAO { /** * \class GeometricElement * Generic class to manipulate a topologic element (vertex, edge, face or solid). */ - class GeometricElement + class XAO_EXPORT GeometricElement { public: /** @@ -100,7 +108,7 @@ namespace XAO * \class GeometricElementList * Generic class to manipulate a list of topologic element. */ - class GeometricElementList + class XAO_EXPORT GeometricElementList { public: /** diff --git a/src/XAO/XAO_Geometry.hxx b/src/XAO/XAO_Geometry.hxx index 12ca3101a..da9ca5b7c 100644 --- a/src/XAO/XAO_Geometry.hxx +++ b/src/XAO/XAO_Geometry.hxx @@ -23,17 +23,23 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Exception.hxx" #include "XAO_GeometricElement.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + + namespace XAO { /** * @class Geometry * Base class for geometries. */ - class Geometry + class XAO_EXPORT Geometry { protected: /** diff --git a/src/XAO/XAO_Group.hxx b/src/XAO/XAO_Group.hxx index de46a7dc0..052ee3095 100644 --- a/src/XAO/XAO_Group.hxx +++ b/src/XAO/XAO_Group.hxx @@ -24,15 +24,18 @@ #include #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" - +#ifdef WIN32 +#pragma warning(disable:4251) // Warning dll-interface ... +#endif namespace XAO { /** * \class Group * Class to represent a Geometrical Group. */ - class Group + class XAO_EXPORT Group { public: /** diff --git a/src/XAO/XAO_IntegerField.hxx b/src/XAO/XAO_IntegerField.hxx index 9e33cb364..f619449f7 100644 --- a/src/XAO/XAO_IntegerField.hxx +++ b/src/XAO/XAO_IntegerField.hxx @@ -23,17 +23,23 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Field.hxx" #include "XAO_IntegerStep.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + + namespace XAO { /** * @class IntegerField * Represents a field with integer values. */ - class IntegerField : public Field + class XAO_EXPORT IntegerField : public Field { public: /** diff --git a/src/XAO/XAO_IntegerStep.hxx b/src/XAO/XAO_IntegerStep.hxx index 09673466a..322a44bcb 100644 --- a/src/XAO/XAO_IntegerStep.hxx +++ b/src/XAO/XAO_IntegerStep.hxx @@ -23,16 +23,23 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Step.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#pragma warning(disable:4251) // Warning dll-interface ... +#endif + + namespace XAO { /** * @class IntegerStep * Step with integer values. */ - class IntegerStep : public Step + class XAO_EXPORT IntegerStep : public Step { public: /** diff --git a/src/XAO/XAO_Step.hxx b/src/XAO/XAO_Step.hxx index 6c61020c9..903d57549 100644 --- a/src/XAO/XAO_Step.hxx +++ b/src/XAO/XAO_Step.hxx @@ -21,15 +21,21 @@ #ifndef __XAO_STEP_HXX__ #define __XAO_STEP_HXX__ +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + + namespace XAO { /** * @class Step * Base class for steps. */ - class Step + class XAO_EXPORT Step { protected: /** Default constructor. */ diff --git a/src/XAO/XAO_StringField.hxx b/src/XAO/XAO_StringField.hxx index b9adb690e..107efe80e 100644 --- a/src/XAO/XAO_StringField.hxx +++ b/src/XAO/XAO_StringField.hxx @@ -23,17 +23,22 @@ #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Field.hxx" #include "XAO_StringStep.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + namespace XAO { /** * @class StringField * Represents a field with string values. */ - class StringField : public Field + class XAO_EXPORT StringField : public Field { public: /** diff --git a/src/XAO/XAO_StringStep.hxx b/src/XAO/XAO_StringStep.hxx index b0eb2f615..ed6e1772d 100644 --- a/src/XAO/XAO_StringStep.hxx +++ b/src/XAO/XAO_StringStep.hxx @@ -24,16 +24,22 @@ #include #include +#include "XAO.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Step.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#pragma warning(disable:4251) // Warning dll-interface ... +#endif + namespace XAO { /** * @class StringStep * Step with strings values. */ - class StringStep : public Step + class XAO_EXPORT StringStep : public Step { public: /** diff --git a/src/XAO/XAO_Xao.hxx b/src/XAO/XAO_Xao.hxx index 451d327cb..bceb909bd 100644 --- a/src/XAO/XAO_Xao.hxx +++ b/src/XAO/XAO_Xao.hxx @@ -23,10 +23,17 @@ #include #include + +#include "XAO.hxx" #include "XAO_Exception.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Geometry.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#pragma warning(disable:4251) // Warning dll-interface ... +#endif + namespace XAO { class Group; @@ -40,7 +47,7 @@ namespace XAO * @class Xao * The Xao class describes the XAO format. */ - class Xao + class XAO_EXPORT Xao { public: /** diff --git a/src/XAO/XAO_XaoExporter.hxx b/src/XAO/XAO_XaoExporter.hxx index a63e921ca..2971ab63e 100644 --- a/src/XAO/XAO_XaoExporter.hxx +++ b/src/XAO/XAO_XaoExporter.hxx @@ -21,18 +21,23 @@ #ifndef __XAO_XAOEXPORTER_HXX__ #define __XAO_XAOEXPORTER_HXX__ +#include "XAO.hxx" #include "XAO_Xao.hxx" #include "XAO_Geometry.hxx" #include "XAO_Group.hxx" #include "XAO_Field.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif + namespace XAO { /** * @class XaoExporter * Util class for import/export XAO. */ - class XaoExporter + class XAO_EXPORT XaoExporter { public: /** diff --git a/src/XAO/XAO_XaoUtils.cxx b/src/XAO/XAO_XaoUtils.cxx index 206f5ed0c..2ef335286 100644 --- a/src/XAO/XAO_XaoUtils.cxx +++ b/src/XAO/XAO_XaoUtils.cxx @@ -20,6 +20,7 @@ #include +#include "XAO_Exception.hxx" #include "XAO_Xao.hxx" #include "XAO_XaoUtils.hxx" diff --git a/src/XAO/XAO_XaoUtils.hxx b/src/XAO/XAO_XaoUtils.hxx index cc82e0d2d..02b9a36ed 100644 --- a/src/XAO/XAO_XaoUtils.hxx +++ b/src/XAO/XAO_XaoUtils.hxx @@ -25,8 +25,12 @@ #include #include +#include "XAO.hxx" #include "XAO_Exception.hxx" +#ifdef WIN32 +#pragma warning(disable:4290) // Warning Exception ... +#endif namespace XAO { @@ -66,7 +70,7 @@ namespace XAO * \class XaoUtils * Utilities class to convert types. */ - class XaoUtils + class XAO_EXPORT XaoUtils { public: /** diff --git a/src/XAO/tests/BrepGeometryTest.cxx b/src/XAO/tests/BrepGeometryTest.cxx index 069b64d31..d4ed474f9 100644 --- a/src/XAO/tests/BrepGeometryTest.cxx +++ b/src/XAO/tests/BrepGeometryTest.cxx @@ -152,7 +152,7 @@ void BrepGeometryTest::testGetEdgeVertices() void printVector(std::vector& v) { std::cout << "# "; - for (int i = 0; i < v.size(); i++) + for (unsigned int i = 0; i < v.size(); i++) std::cout << v[i] << ", "; std::cout << std::endl; } @@ -266,7 +266,7 @@ void BrepGeometryTest::testParse() { std::cout << " Shell #" << shellIndex << std::endl; std::vector faces = geom->getSolidFaces(solidIndex, shellIndex); - for (int indf = 0; indf < faces.size(); ++indf) + for (unsigned int indf = 0; indf < faces.size(); ++indf) { int faceIndex = faces[indf]; std::cout << " Face #" << geom->getFaceReference(faceIndex) << std::endl; @@ -276,7 +276,7 @@ void BrepGeometryTest::testParse() { std::cout << " Wire #" << wireIndex << std::endl; std::vector edges = geom->getFaceEdges(faceIndex, wireIndex); - for (int inde = 0; inde < edges.size(); ++inde) + for (unsigned int inde = 0; inde < edges.size(); ++inde) { int edgeIndex = edges[inde]; std::cout << " Edge #" << geom->getEdgeReference(edgeIndex) << " : "; diff --git a/src/XAO/tests/TestUtils.hxx b/src/XAO/tests/TestUtils.hxx index f754db107..83e343680 100644 --- a/src/XAO/tests/TestUtils.hxx +++ b/src/XAO/tests/TestUtils.hxx @@ -12,7 +12,8 @@ namespace XAO static std::string getTestFilePath(const std::string& fileName) { std::string dataDir = getenv("GEOM_SRC_DIR"); - dataDir += "/src/XAO/tests/data/" + fileName; + dataDir += "/src/XAO/tests/data/"; + dataDir += fileName; return dataDir; } diff --git a/src/XAO_Swig/CMakeLists.txt b/src/XAO_Swig/CMakeLists.txt index 03091f925..929e7318f 100644 --- a/src/XAO_Swig/CMakeLists.txt +++ b/src/XAO_Swig/CMakeLists.txt @@ -59,9 +59,9 @@ SET_SOURCE_FILES_PROPERTIES(xao.i PROPERTIES SWIG_DEFINITIONS "-shadow") SWIG_ADD_MODULE(xao python xao.i) SWIG_LINK_LIBRARIES(xao "${_link_LIBRARIES}") -IF(WINDOWS) +IF(WIN32) SET_TARGET_PROPERTIES(_xao PROPERTIES DEBUG_OUTPUT_NAME _xao_d) -ENDIF(WINDOWS) +ENDIF(WIN32) INSTALL(TARGETS _xao DESTINATION ${SALOME_INSTALL_PYTHON}) INSTALL(FILES xao.i DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/XAO_Swig/xao.i b/src/XAO_Swig/xao.i index 2a0942b3a..85f47cf49 100644 --- a/src/XAO_Swig/xao.i +++ b/src/XAO_Swig/xao.i @@ -1,5 +1,6 @@ %module xao %{ +#include "XAO.hxx" #include "XAO_Exception.hxx" #include "XAO_XaoUtils.hxx" #include "XAO_Xao.hxx" @@ -48,6 +49,7 @@ namespace std %ignore XAO::MsgBuilder; %ignore XAO::XaoUtils; +%include "XAO.hxx" %include XAO_Exception.hxx %include XAO_XaoUtils.hxx -- 2.39.2