-#include(../../CMake/Common.cmake)
+ADD_SUBDIRECTORY(reference_data)
+
+include(../../CMake/Common.cmake)
+include(ExternalFiles.cmake)
+
+set (CMAKE_POSITION_INDEPENDENT_CODE ON)
set(PROJECT_HEADERS
test_HYDROData_Bathymetry.h
+ test_HYDROData_Channel.h
test_HYDROData_Document.h
test_HYDROData_Entity.h
test_HYDROData_Image.h
test_HYDROData_Iterator.h
+ test_HYDROData_LandCoverMap.h
test_HYDROData_OperationsFactory.h
test_HYDROData_PolylineXY.h
test_HYDROData_Profile.h
+ test_HYDROData_ShapeFile.h
test_HYDROData_StricklerTable.h
test_HYDROGUI_ListModel.h
+ test_HYDROGUI_Shape.h
+ test_HYDROGUI_LandCoverMapDlg.h
+ test_HYDROData_CalcCase.h
+ test_HYDROData_Stream.h
+ test_HYDROData_Tool.h
+ test_HYDROGUI_BathymetryPrs.h
+
+ test_Dependencies.h
+ test_HYDROData_DTM.h
+ test_HYDROData_BoundaryPolygons.h
+ test_GraphicsView.h
+ test_Overview.h
+
+ TestShape.h
+ TestViewer.h
+ TestLib_Listener.h
+ TestLib_Runner.h
)
-set(PROJECT_SOURCES
+set(PROJECT_SOURCES
test_HYDROData_Bathymetry.cxx
+ test_HYDROData_Channel.cxx
test_HYDROData_Document.cxx
test_HYDROData_Entity.cxx
test_HYDROData_Image.cxx
test_HYDROData_Iterator.cxx
+ test_HYDROData_LandCoverMap.cxx
test_HYDROData_Main.cxx
test_HYDROData_OperationsFactory.cxx
test_HYDROData_PolylineXY.cxx
test_HYDROData_Profile.cxx
+ test_HYDROData_ShapeFile.cxx
test_HYDROData_StricklerTable.cxx
+ test_HYDROData_DTM.cxx
+ test_HYDROData_BoundaryPolygons.cxx
test_HYDROGUI_ListModel.cxx
-
- ../HYDROData/HYDROData_AltitudeObject.cxx
- ../HYDROData/HYDROData_Application.cxx
- ../HYDROData/HYDROData_ArtificialObject.cxx
- ../HYDROData/HYDROData_Bathymetry.cxx
- ../HYDROData/HYDROData_BSplineOperation.cxx
- ../HYDROData/HYDROData_CalculationCase.cxx
- ../HYDROData/HYDROData_Channel.cxx
- ../HYDROData/HYDROData_Confluence.cxx
- ../HYDROData/HYDROData_Digue.cxx
- ../HYDROData/HYDROData_Document.cxx
- ../HYDROData/HYDROData_DummyObject3D.cxx
- ../HYDROData/HYDROData_Entity.cxx
- ../HYDROData/HYDROData_IAltitudeObject.cxx
- ../HYDROData/HYDROData_IInterpolator.cxx
- ../HYDROData/HYDROData_Image.cxx
- ../HYDROData/HYDROData_ImmersibleZone.cxx
- ../HYDROData/HYDROData_IPolyline.cxx
- ../HYDROData/HYDROData_Iterator.cxx
- ../HYDROData/HYDROData_Lambert93.cxx
- ../HYDROData/HYDROData_NaturalObject.cxx
- ../HYDROData/HYDROData_Object.cxx
- ../HYDROData/HYDROData_Obstacle.cxx
- ../HYDROData/HYDROData_ObstacleAltitude.cxx
- ../HYDROData/HYDROData_OperationsFactory.cxx
- ../HYDROData/HYDROData_Pipes.cxx
- ../HYDROData/HYDROData_PolylineOperator.cxx
- ../HYDROData/HYDROData_PolylineXY.cxx
- ../HYDROData/HYDROData_Polyline3D.cxx
- ../HYDROData/HYDROData_PriorityQueue.cxx
- ../HYDROData/HYDROData_Profile.cxx
- ../HYDROData/HYDROData_ProfileUZ.cxx
- ../HYDROData/HYDROData_Projection.cxx
- ../HYDROData/HYDROData_Region.cxx
- ../HYDROData/HYDROData_River.cxx
- ../HYDROData/HYDROData_ShapesGroup.cxx
- ../HYDROData/HYDROData_ShapesTool.cxx
- ../HYDROData/HYDROData_SplittedShapesGroup.cxx
- ../HYDROData/HYDROData_SplitToZonesTool.cxx
- ../HYDROData/HYDROData_Stream.cxx
- ../HYDROData/HYDROData_StreamAltitude.cxx
- ../HYDROData/HYDROData_StricklerTable.cxx
- ../HYDROData/HYDROData_LandCover.cxx
- ../HYDROData/HYDROData_Tool.cxx
- ../HYDROData/HYDROData_TopoCurve.cxx
- ../HYDROData/HYDROData_Transform.cxx
- ../HYDROData/HYDROData_VisualState.cxx
- ../HYDROData/HYDROData_Zone.cxx
- ../HYDROData/HYDROData_GeomTool.cxx
- ../HYDROData/HYDROData_IProfilesInterpolator.cxx
- ../HYDROData/HYDROData_LinearInterpolator.cxx
- ../HYDROData/HYDROData_InterpolatorsFactory.cxx
- ../HYDROData/HYDROData_SinusX.cxx
- ../HYDROData/HYDROData_ShapeFile.cxx
- ../HYDROData/HYDROData_LandCoverMap.cxx
-
- ../HYDROGUI/HYDROGUI_ListModel.cxx
- ../HYDROGUI/HYDROGUI_DataObject.cxx
+ test_HYDROGUI_Shape.cxx
+ test_HYDROGUI_LandCoverMapDlg.cxx
+ test_HYDROData_CalcCase.cxx
+ test_HYDROData_Stream.cxx
+ test_Dependencies.cxx
+ test_HYDROData_Tool.cxx
+ test_GraphicsView.cxx
+ test_Overview.cxx
+ test_HYDROGUI_ProfilesDlg.cxx
+ test_HYDROGUI_BathymetryPrs.cxx
+
+ TestShape.cxx
+ TestViewer.cxx
+ TestLib_Listener.cxx
+ TestLib_Runner.cxx
)
-add_definitions(
- -DLIGHT_MODE -DHYDRODATA_STATIC -DHYDROGUI_STATIC
-)
+add_definitions( -DLIGHT_MODE -DHYDRODATA_STATIC -DHYDROGUI_STATIC -DTEST_MODE -DQT_GUI_LIB -DQT_WIDGETS_LIB )
IF( ${WIN32} )
- add_definitions( -DWNT )
+ add_definitions( -DWNT -D__WIN32__ -D__x86__ -D_WIN64 -D_WIN32_WINNT=0x0400 -D__NT__ -D__OSVERSION__=4 )
ENDIF()
-SET( BOOST_INCLUDES $ENV{BOOST_ROOT_DIR}/include/boost-1_52 )
-SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT_DIR}/include )
-SET( QT_INCLUDES $ENV{QT_ROOT_DIR}/include $ENV{QT_ROOT_DIR}/include/QtCore $ENV{QT_ROOT_DIR}/include/QtGui )
+SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT}/include )
+SET( CAS_INCLUDES $ENV{CASROOT}/inc )
+SET( QT_INCLUDES $ENV{QTDIR}/include $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 )
+SET( ECW_INCLUDES $ENV{ECWLIB_ROOT_DIR}/include )
-link_directories( $ENV{CAS_ROOT_DIR}/win32/libd ) #TODO: more correct for release, linux etc
-SET( CAS_LIBRARIES TKernel TKLCAF TKCAF TKCDF TKMath TKG2d TKG3d TKBRep TKGeomBase TKTopAlgo TKGeomAlgo TKBool TKShHealing TKXSBase TKOffset TKHLR TKBO )
+IF( ${WIN32} )
+ link_directories( $ENV{CASROOT}/win64/lib/vc10 $ENV{GL2PS_DIR}/lib )
+ELSE()
+ link_directories( $ENV{CASROOT}/lib $ENV{TBB_ROOT_DIR}/lib/intel64/gcc4.4 )
+ENDIF()
+SET( CAS_LIBRARIES TKernel TKLCAF TKCAF TKCDF TKMath TKG2d TKG3d TKBRep TKGeomBase TKTopAlgo TKGeomAlgo TKBool TKShHealing TKXSBase TKOffset TKHLR TKBO TKV3d TKService TKMesh gl2ps )
-link_directories( $ENV{QT_ROOT_DIR}/lib )
-SET( QT_LIBRARIES QtCored4 QtGuid4 )
+link_directories( $ENV{QT_ROOT_DIR}/lib $ENV{QTDIR}/lib )
+IF( ${WIN32} )
+ SET( QT_LIBRARIES Qt5Cored Qt5Guid Qt5Testd )
+ELSE()
+ SET( QT_LIBRARIES Qt5Core Qt5Gui Qt5Test )
+ENDIF()
-link_directories( $ENV{CPPUNIT_ROOT_DIR}/lib )
-SET( CPPUNIT_LIBRARIES cppunitd )
-link_directories( $ENV{GUI_ROOT_DIR}/lib/salome )
-SET( GUI_LIBRARIES ImageComposer Qtx SUIT LightApp CAM )
+link_directories( $ENV{CPPUNIT_ROOT}/lib )
+IF( ${WIN32} )
+ IF( CMAKE_BUILD_TYPE MATCHES Debug )
+ SET( CPPUNIT_LIBRARIES cppunitd )
+ ELSE()
+ SET( CPPUNIT_LIBRARIES cppunit )
+ ENDIF()
+ELSE()
+ SET( CPPUNIT_LIBRARIES cppunit )
+ENDIF()
+
+link_directories( $ENV{KERNEL_ROOT_DIR}/lib/salome $ENV{GUI_ROOT_DIR}/lib/salome $ENV{GEOM_ROOT_DIR}/lib/salome )
+
+SET( GUI_LIBRARIES ImageComposer qtx suit CAM OCCViewer GraphicsView )
+# Please do not link with LightApp since in the full SALOME it is linked with CORBA (omniORB)
+
+SET( GEOM_LIBRARIES CurveCreator GEOMUtils )
+
+link_directories( $ENV{ECWLIB_ROOT_DIR}/lib )
+IF( ${WIN32} )
+ SET( ECW_LIBRARIES libecwj2 )
+ELSE()
+ SET( ECW_LIBRARIES ecwj2 )
+ENDIF()
include_directories(
- ${BOOST_INCLUDES}
- ${CAS_INCLUDE_DIRS}
+ ${CAS_INCLUDES}
${QT_INCLUDES}
${CPPUNIT_INCLUDES}
+ ${KERNEL_INCLUDES}
${GUI_INCLUDES}
- ${CMAKE_CURRENT_SOURCE_DIR}
+ ${GEOM_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/../HYDROData
${CMAKE_CURRENT_SOURCE_DIR}/../HYDROGUI
${CMAKE_CURRENT_SOURCE_DIR}/../shapelib
+ ${ECW_INCLUDES}
)
-add_executable( HYDROData_tests ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib )
+source_group( "External files" FILES ${EXTERNAL_FILES} )
+
+add_executable( HYDROData_tests ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${EXTERNAL_FILES} ${PROJECT_MOC_HEADERS} )
+set_target_properties( HYDROData_tests PROPERTIES LINK_INTERFACE_LIBRARIES "" )
+target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib ${ECW_LIBRARIES} )
+
+INSTALL(TARGETS HYDROData_tests EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})