From 5274ccf8e361fe33d5917cd3bbc1bd0b4fe151ac Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 30 Aug 2016 15:12:26 +0300 Subject: [PATCH] patch for correct compilation (Windows) --- CMakeLists.txt | 5 +- src/HYDROData/HYDROData_Bathymetry.cxx | 2 +- src/HYDROData/HYDROData_PolylineXY.cxx | 18 ++-- src/HYDROData/HYDROData_QuadtreeNode.hxx | 2 +- src/HYDROData/HYDROData_StreamAltitude.cxx | 8 +- src/HYDROPy/CMakeLists.txt | 99 +++++++++++----------- src/HYDRO_tests/CMakeLists.txt | 16 ++-- 7 files changed, 75 insertions(+), 75 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75b6f19d..54f22731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,8 +92,9 @@ OPTION(SALOME_BUILD_TESTS "Build HYDRO tests" ON) # Mandatory products: -FIND_PACKAGE(SalomePythonInterp REQUIRED) -FIND_PACKAGE(SalomePythonLibs REQUIRED) +FIND_PACKAGE(SalomePython REQUIRED) +#FIND_PACKAGE(SalomePythonInterp REQUIRED) +#FIND_PACKAGE(SalomePythonLibs REQUIRED) FIND_PACKAGE(SalomeCAS REQUIRED) FIND_PACKAGE(SalomeVTK REQUIRED) FIND_PACKAGE(SalomeOmniORB REQUIRED) diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index 34bd4a21..c62352ef 100644 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -342,7 +342,7 @@ bool interpolZtriangle(const gp_XY& point, vtkPolyData* delaunay2D, vtkIdList* t double l2 = 1 -l0 -l1; //DEBTRACE("l0, l1, l2: " << l0 << " " << l1 << " " << l2); - if ((l0>=0) and (l0<=1) and (l1>=0) and (l1<=1) and (l2>=0) and (l2<=1)) + if ((l0>=0) && (l0<=1) && (l1>=0) && (l1<=1) && (l2>=0) && (l2<=1)) { z = l0*v[0][2] + l1*v[1][2] + l2*v[2][2]; return true; diff --git a/src/HYDROData/HYDROData_PolylineXY.cxx b/src/HYDROData/HYDROData_PolylineXY.cxx index 3eaa0ad9..6013e653 100644 --- a/src/HYDROData/HYDROData_PolylineXY.cxx +++ b/src/HYDROData/HYDROData_PolylineXY.cxx @@ -500,7 +500,7 @@ bool convertEdgesToSections( const TopoDS_Edge& double d1= ProjectPointToCurve(aEndPs[1].XYZ(), adaptorOldCurve,p[1]); double d2= ProjectPointToCurve(midPnt.XYZ(), adaptorOldCurve, p[2]); DEBTRACE("d0: "< 1.e-3) and (abs(pmax - plast) >1.e-3))) // internal points forward + if((pmin < pmax) && ((abs(pmin - pfirst)> 1.e-3) && (abs(pmax - plast) >1.e-3))) // internal points forward forward = true; - else if ((pmin > pmax) and((abs(pmin - plast)> 1.e-3) and (abs(pmax - pfirst) >1.e-3))) // internal points reverse + else if ((pmin > pmax) && ((abs(pmin - plast)> 1.e-3) && (abs(pmax - pfirst) >1.e-3))) // internal points reverse { pmin = p[1]; pmax = p[0]; forward = false; } - else if ((abs(pmin - plast) <1.e-3) and (p[2] < pmax)) // forward, replace pmin par pfirst + else if ((abs(pmin - plast) <1.e-3) && (p[2] < pmax)) // forward, replace pmin par pfirst pmin = pfirst; - else if ((abs(pmin - plast) <1.e-3) and (p[2] > pmax)) // reverse + else if ((abs(pmin - plast) <1.e-3) && (p[2] > pmax)) // reverse { pmin = p[1]; pmax = p[0]; forward = false; } - else if ((abs(pmax - pfirst) <1.e-3) and (p[2] < pmin)) // reverse + else if ((abs(pmax - pfirst) <1.e-3) && (p[2] < pmin)) // reverse { pmin = p[1]; pmax = p[0]; forward = false; } - else if ((abs(pmax - pfirst) <1.e-3) and (p[2] > pmin)) // forward, replace pmax par plast + else if ((abs(pmax - pfirst) <1.e-3) && (p[2] > pmin)) // forward, replace pmax par plast pmax = plast; } DEBTRACE("forward: "<< forward << " pmin " << pmin << " pmax " << pmax); @@ -566,7 +566,7 @@ bool convertEdgesToSections( const TopoDS_Edge& gp_XYZ p(aPoint.X(), aPoint.Y(), 0); double param =-1; double d = ProjectPointToCurve(p, adaptorOldCurve, param); - if ((param > pmin) and (param < pmax)) + if ((param > pmin) && (param < pmax)) { DEBTRACE("param: " << param); aPointsList.Append(aPoint); @@ -579,7 +579,7 @@ bool convertEdgesToSections( const TopoDS_Edge& gp_XYZ p(aPoint.X(), aPoint.Y(), 0); double param =-1; double d = ProjectPointToCurve(p, adaptorOldCurve, param); - if ((param > pmin) and (param < pmax)) + if ((param > pmin) && (param < pmax)) { DEBTRACE("param: " << param); aPointsList.Append(aPoint); diff --git a/src/HYDROData/HYDROData_QuadtreeNode.hxx b/src/HYDROData/HYDROData_QuadtreeNode.hxx index 6ec99f76..6ea6f186 100644 --- a/src/HYDROData/HYDROData_QuadtreeNode.hxx +++ b/src/HYDROData/HYDROData_QuadtreeNode.hxx @@ -106,7 +106,7 @@ public: bool isEmpty() const { return myChildren == 0; } inline double getPrecision() {return myPrecision; } - inline double setPrecision(double precision) {myPrecision = precision; } + inline void setPrecision(double precision) {myPrecision = precision; } protected: diff --git a/src/HYDROData/HYDROData_StreamAltitude.cxx b/src/HYDROData/HYDROData_StreamAltitude.cxx index d00d47c8..7ab98d3f 100644 --- a/src/HYDROData/HYDROData_StreamAltitude.cxx +++ b/src/HYDROData/HYDROData_StreamAltitude.cxx @@ -126,7 +126,7 @@ bool IsPointBetweenEdges2( const gp_Pnt& aFirstPnt1, const gp_Pnt& aLastPnt1, double z1 = x1*ya -xa*y1; // v1^va: z component double z2 = x2*yb -xb*y2; // v2^vb: z component bool isBetween = true; - if (((z1<0) and (z2<0)) or ((z1>=0) and (z2>=0))) + if (((z1<0) && (z2<0)) || ((z1>=0) && (z2>=0))) { isBetween = false; } @@ -138,9 +138,9 @@ bool IsPointBetweenEdges2( const gp_Pnt& aFirstPnt1, const gp_Pnt& aLastPnt1, double dl1 = (aLastPnt1.X()-xg)*(aLastPnt1.X()-xg) + (aLastPnt1.Y()-yg)*(aLastPnt1.Y()-yg); double df2 = (aFirstPnt2.X()-xg)*(aFirstPnt2.X()-xg) + (aFirstPnt2.Y()-yg)*(aFirstPnt2.Y()-yg); double dl2 = (aLastPnt2.X()-xg)*(aLastPnt2.X()-xg) + (aLastPnt2.Y()-yg)*(aLastPnt2.Y()-yg); - double r2 = fmax(df1,dl1); - r2 = fmax(r2,df2); - r2 = fmax(r2,dl2); + double r2 = std::max(df1,dl1); + r2 = std::max(r2,df2); + r2 = std::max(r2,dl2); double d2 = (thePoint.X()-xg)*(thePoint.X()-xg) + (thePoint.Y()-yg)*(thePoint.Y()-yg); if (d2 > r2) isBetween = false; diff --git a/src/HYDROPy/CMakeLists.txt b/src/HYDROPy/CMakeLists.txt index c15ed61c..326a4acb 100644 --- a/src/HYDROPy/CMakeLists.txt +++ b/src/HYDROPy/CMakeLists.txt @@ -1,5 +1,6 @@ include(../../CMake/Common.cmake) -include(UsePyQt4) +include(../../CMake/UsePyQt4EXT.cmake) +#include(UsePyQt4) # --- options --- @@ -32,65 +33,63 @@ SET(_link_LIBRARIES # sip files / to be processed by sip SET(_sip_files HYDROData.sip - HYDROData_AltitudeObject.sip - HYDROData_Application.sip - HYDROData_ArtificialObject.sip - HYDROData_Bathymetry.sip - HYDROData_CalculationCase.sip - HYDROData_Channel.sip - HYDROData_Confluence.sip - HYDROData_Digue.sip - HYDROData_Document.sip - HYDROData_Entity.sip - HYDROData_IAltitudeObject.sip - HYDROData_IInterpolator.sip - HYDROData_Image.sip - HYDROData_ImmersibleZone.sip - HYDROData_IPolyline.sip - HYDROData_IProfilesInterpolator.sip - HYDROData_LandCoverMap.sip - HYDROData_NaturalObject.sip - HYDROData_Object.sip - HYDROData_ObstacleAltitude.sip - HYDROData_Obstacle.sip - HYDROData_Polyline3D.sip - HYDROData_PolylineXY.sip - HYDROData_Profile.sip - HYDROData_ProfileUZ.sip - HYDROData_Region.sip - HYDROData_River.sip - HYDROData_SequenceOfObjects.sip - HYDROData_ShapesGroup.sip - HYDROData_SplitShapesGroup.sip - HYDROData_StreamAltitude.sip - HYDROData_Stream.sip - HYDROData_StricklerTable.sip - HYDROData_Zone.sip - CAS/gp_XY.sip - CAS/gp_XYZ.sip - CAS/NCollection_Sequence.sip - CAS/TCollection_AsciiString.sip ) SET(_add_SOURCES - sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc - sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc - sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc - sipHYDROPyNCollection_Sequence0100gp_XY.cc - sipHYDROPyNCollection_Sequence0100gp_XYZ.cc - sipHYDROPyNCollection_Sequence1800.cc - sipHYDROPyNCollection_Sequence2400.cc - sipHYDROPyNCollection_Sequence2600.cc - sipHYDROPyTCollection_AsciiString.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPycmodule.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XY.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XYZ.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_AltitudeObject.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Application.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ArtificialObject.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Bathymetry.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_CalculationCase.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Channel.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Confluence.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Digue.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Document.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Entity.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IAltitudeObject.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IInterpolator.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Image.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ImmersibleZone.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IPolyline.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IProfilesInterpolator.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_LandCoverMap.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_NaturalObject.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Object.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ObstacleAltitude.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Polyline3D.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Profile.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ProfileUZ.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Region.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ShapesGroup.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_SplitShapesGroup.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Stream.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_StreamAltitude.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_StricklerTable.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XYZ.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence1800.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence2400.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence2600.cc + ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyTCollection_AsciiString.cc ) # --- sources --- # sources / sip wrappings -PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files} SOURCES ${_add_SOURCES}) +PYQT4_WRAP_SIP_EXT( _sip_SOURCES ${_sip_files} ) # SOURCES ${_add_SOURCES}) # sources / to compile -SET(HYDROPy_SOURCES ${_sip_SOURCES}) +SET(HYDROPy_SOURCES ${_sip_SOURCES} ${_add_SOURCES}) # --- rules --- diff --git a/src/HYDRO_tests/CMakeLists.txt b/src/HYDRO_tests/CMakeLists.txt index 1e95d072..8a33dba0 100644 --- a/src/HYDRO_tests/CMakeLists.txt +++ b/src/HYDRO_tests/CMakeLists.txt @@ -53,16 +53,16 @@ set(PROJECT_SOURCES ) add_definitions( - -DLIGHT_MODE -DHYDRODATA_STATIC -DHYDROGUI_STATIC + -DLIGHT_MODE -DHYDRODATA_STATIC -DHYDROGUI_STATIC -D__WIN32__ -D__x86__ -D_WIN64 -D_WIN32_WINNT=0x0400 -D__NT__ -D__OSVERSION__=4 ) IF( ${WIN32} ) add_definitions( -DWNT ) ENDIF() -SET( CPPUNIT_INCLUDES $ENV{cppUNIT_ROOT}/include ) +SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT_DIR}/include ) SET( CAS_INCLUDES $ENV{CASROOT}/inc ) -SET( QT_INCLUDES $ENV{QTDIR}/include $ENV{QTDIR}/include/QtCore $ENV{QTDIR}/include/QtGui $ENV{QTDIR}/include/QtTest ) +SET( QT_INCLUDES $ENV{QT_ROOT_DIR}/include $ENV{QT_ROOT_DIR}/include/QtCore $ENV{QT_ROOT_DIR}/include/QtGui $ENV{QT_ROOT_DIR}/include/QtTest ) SET( KERNEL_INCLUDES $ENV{KERNEL_ROOT_DIR}/include/salome ) SET( GUI_INCLUDES $ENV{GUI_ROOT_DIR}/include/salome ) SET( GEOM_INCLUDES $ENV{GEOM_ROOT_DIR}/include/salome ) @@ -74,14 +74,14 @@ ELSE() ENDIF() SET( CAS_LIBRARIES TKernel TKLCAF TKCAF TKCDF TKMath TKG2d TKG3d TKBRep TKGeomBase TKTopAlgo TKGeomAlgo TKBool TKShHealing TKXSBase TKOffset TKHLR TKBO TKV3d TKService TKMesh ) -link_directories( $ENV{QTDIR}/lib ) +link_directories( $ENV{QT_ROOT_DIR}/lib ) IF( ${WIN32} ) SET( QT_LIBRARIES QtCored4 QtGuid4 QtTestd4 ) ELSE() SET( QT_LIBRARIES QtCore QtGui QtTest ) ENDIF() -link_directories( $ENV{cppUNIT_ROOT}/lib ) +link_directories( $ENV{CPPUNIT_ROOT_DIR}/lib ) IF( ${WIN32} ) SET( CPPUNIT_LIBRARIES cppunitd ) ELSE() @@ -109,8 +109,8 @@ source_group( "External files" FILES ${EXTERNAL_FILES} ) add_executable( HYDROData_tests ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${EXTERNAL_FILES} ${PROJECT_MOC_HEADERS} ) target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib HYDROData) -IF( ${WIN32} ) - add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" ) -ENDIF() +#IF( ${WIN32} ) +# add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" ) +#ENDIF() INSTALL(TARGETS HYDROData_tests EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -- 2.39.2