diff --git a/.gitignore b/.gitignore index 6d8b9fdf08dab16fe0599a83836aac10be09b326..03e3788fe9716cf58b6b9bc0846c18524b10e33c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +*.swp +*.nfs +CMakeFiles *Makefile* tags build diff --git a/.gitmodules b/.gitmodules index aab53d9259254c68027a3f0e6b43c3d752e9594a..f915dfb1d90d2b6ee7f743325098cbaf1300decb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "MAVLink"] - path = MAVLink - url = git://github.com/pixhawk/mavlink.git +[submodule "thirdParty/mavlink"] + path = thirdParty/mavlink + url = https://github.com/pixhawk/mavlink.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..313a9e718547471522f6715945102095f96bcc01 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,802 @@ +cmake_minimum_required (VERSION 2.6) + +project (qgroundcontrol) + +# marcos +macro(find_or_build_from_source PACKAGE PACKAGE_PATH IS_GIT_SUBMODULE) + add_custom_target(${PACKAGE}) + if (NOT ${PACKAGE}_BUILD_FROM_SOURCE) + find_package(${PACKAGE}) + endif() + if (NOT ${PACKAGE}_FOUND) + set(${PACKAGE}_BUILD_FROM_SOURCE TRUE) + message(STATUS "could not find package ${PACKAGE}, building from source") + add_custom_target(${PACKAGE}_BUILD DEPENDS ${PACKAGE}_BUILD.stamp) + add_dependencies(${PACKAGE} ${PACKAGE}_BUILD) + set(${PACKAGE}_FOUND TRUE) + if (${IS_GIT_SUBMODULE}) + message(STATUS "${PACKAGE} detected as git submodule, will attempt to initialize it") + list(APPEND GIT_SUBMODULES ${PACKAGE_PATH}) + add_dependencies(${PACKAGE}_BUILD GIT) + endif() + endif() +endmacro(find_or_build_from_source) + +macro(set_default VAR DEFAULT) + if (NOT DEFINED ${VAR}) + set(${VAR} ${DEFAULT}) + endif() +endmacro(set_default) + +# check for out of source build +if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") + message(FATAL_ERROR "In-source builds are not allowed. For example run: + rm CMakeCache.txt + mkdir build + cd build + cmake .. + make") +endif() + +# settings +set(qgroundcontrol_VERSION_MAJOR 0) +set(qgroundcontrol_VERSION_MINOR 8) +set(qgroundcontrol_VERSION_PATCH 3) +set(qgroundcontrol_SOVERSION 0) + +set_default(MAVLINK_BUILD_FROM_SOURCE FALSE) +set_default(STATIC_LINKING FALSE) +set_default(IN_SRC_BUILD FALSE) + +# built variables +set(qgroundcontrol_VERSION ${qgroundcontrol_VERSION_MAJOR}.${qgroundcontrol_VERSION_MINOR}.${qgroundcontrol_VERSION_PATCH}) +set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) +set(CMAKE_LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) + +# only find static libraries +if(STATIC_LINKING) + message(WARNING "static linking is not yet tested and may have linking errors") + if(WIN32) + set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + else(WIN32) + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + endif(WIN32) +endif() + +# set build type +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) +endif(NOT CMAKE_BUILD_TYPE) + +# enable languages +enable_language(C) +enable_language(CXX) + +# initialize variables +set(qgroundcontrol_LIBRARIES qgroundcontrolNavigation qgroundcontrolCommunication) +set(SCICOSLAB_BLOCKS stdBlocks;jsbsimBlocks;mavlinkBlocks) + +# installer +include(InstallRequiredSystemLibraries) +set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${qgroundcontrol_VERSION}") +set(CPACK_GENERATOR "DEB") +set(CPACK_SOURCE_GENERATOR "TGZ;ZIP") +set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") +set(CPACK_SET_DESTDIR TRUE) +set(CPACK_PACKAGE_CONTACT "James Goppert james.goppert@gmail.com") +set(CPACK_PACKAGE_DESCRITION_SUMMARY " + QGroundControl + + A qt based ground-control program for unmanned systems. + ") +set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES} + /.git/;/build/;~$;.*\\\\.bin$;.*\\\\.swp$) +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/license.txt") +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README") +set(CPACK_PACKAGE_VERSION_MAJOR ${qgroundcontrol_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${qgroundcontrol_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${qgroundcontrol_VERSION_PATCH}) +include(CPack) + +# add make dist target +add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) + +# git submodules +if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/.git) + message(STATUS "git repository detected, will attempt to load submodules") + set(FOUND_GIT_REPO TRUE) + add_custom_command(OUTPUT GIT.stamp + COMMAND cd ${PROJECT_SOURCE_DIR} && git submodule init ${GIT_SUBMODULES} + COMMAND cd ${PROJECT_SOURCE_DIR} && git submodule update ${GIT_SUBMODULES}) + add_custom_target(GIT DEPENDS GIT.stamp) +else() + set(FOUND_GIT_REPO FALSE) +endif() + +# find libraries with cmake modules +find_package(Qt4 COMPONENTS QtGui QtCore QtNetwork QtOpenGL QtSVG QtXML QtPhonon QtWebKit REQUIRED) +set(PHONON_FIND_QUIETLY FALSE) +find_package(Phonon) +find_package(SDL) +find_package(Flite) +find_package(OpenGL) +find_package(OpenSceneGraph 2.8.3 COMPONENTS osgGA osgDB osgUtil osgViewer) +find_or_build_from_source(MAVLINK thirdParty/mavlink FOUND_GIT_REPO) + +# build libraries from source if not found on system +if(MAVLINK_BUILD_FROM_SOURCE) + set(MAVLINK_INCLUDE_DIRS + ${PROJECT_SOURCE_DIR}/thirdParty/mavlink/include + ${PROJECT_SOURCE_DIR}/thirdParty/mavlink/include/common + ${PROJECT_SOURCE_DIR}/thirdParty/mavlink/include/pixhawk + ${PROJECT_SOURCE_DIR}/thirdParty/mavlink/include/slugs + ${PROJECT_SOURCE_DIR}/thirdParty/mavlink/include/ualberta + ${PROJECT_SOURCE_DIR}/thirdParty/mavlink/include/ardupilotmega + ) + + add_custom_command(OUTPUT MAVLINK_BUILD.stamp + COMMAND touch MAVLINK_BUILD.stamp) +endif() + +# data directory +if(IN_SRC_BUILD) + message(STATUS "configuring for in source build") + set(DATADIR ${PROJECT_SOURCE_DIR}/data) + set(LIBDIR ${CMAKE_SOURCE_DIR}/data) + set(BINDIR ${CMAKE_BINARY_DIR}/bin) +else() + message(STATUS "configuring for install build") + set(DATADIR ${CMAKE_INSTALL_PREFIX}/share/qgroundcontrol/data) + set(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) + set(BINDIR ${CMAKE_INSTALL_PREFIX}/bin) +endif() + +# install data files +install(DIRECTORY "${PROJECT_SOURCE_DIR}/data" + DESTINATION share/qgroundcontrol + PATTERN "*.git*" EXCLUDE) + +# dependency summary +message(STATUS "=======================================") +message(STATUS "\tLIBRARY\t\t\tBUILDING") +message(STATUS "=======================================") +message(STATUS "\t\tMavlink\t\tYES") +if (OPENSCENEGRAPH_FOUND) + list(APPEND qgroundcontrol_LIBRARIES qgroundcontrolVisualization) + message(STATUS "\t\tOpenSceneGraph\tYES") +else() + message(STATUS "\t\tOpenSceneGraph\t\tNO") +endif (OPENSCENEGRAPH_FOUND) +if (QT4_FOUND) + message(STATUS "\t\tQT4\t\tYES") +else() + message(STATUS "\t\tQT4\t\tNO") +endif (QT4_FOUND) +if (PHONON_FOUND) + message(STATUS "\t\tPHONON\t\tYES") +else() + message(STATUS "\t\tPHONON\t\tNO") +endif (PHONON_FOUND) +message(STATUS "=======================================") + +# project flags +include (${QT_USE_FILE}) +include_directories( + src + src/ui + src/ui/linechart + src/ui/uas + src/ui/map + src/ui/map3D + src/uas + src/comm + include/ui + src/input + src/lib/qmapcontrol + src/ui/mavlink + src/ui/param + src/ui/watchdog + src/ui/map3D + src/ui/designer + src/lib/qextserialport + src/lib/qwt + lib/QMapControl + ${PROJECT_BINARY_DIR} + ${SDL_INCLUDE_DIR} + ${OPENGL_INCLUDE_DIR} + ${OPENSCENEGRAPH_INCLUDE_DIRS} + ${QT_INCLUDE_DIRS} + ${PHONON_INCLUDE_DIR}/phonon + ${FLITE_INCLUDE_DIR} + ${MAVLINK_INCLUDE_DIRS} + ) +set (commonLibs + ) +add_definitions(-D_TTY_POSIX_) + +# qgrouncontrol forms +set(qgroundcontrolUiSrc + src/ui/MainWindow.ui + src/ui/CommSettings.ui + src/ui/SerialSettings.ui + src/ui/UASControl.ui + src/ui/UASList.ui + src/ui/UASInfo.ui + src/ui/Linechart.ui + src/ui/UASView.ui + src/ui/ParameterInterface.ui + src/ui/WaypointList.ui + src/ui/WaypointView.ui + src/ui/ObjectDetectionView.ui + src/ui/JoystickWidget.ui + src/ui/DebugConsole.ui + src/ui/MapWidget.ui + src/ui/XMLCommProtocolWidget.ui + src/ui/HDDisplay.ui + src/ui/MAVLinkSettingsWidget.ui + src/ui/AudioOutputWidget.ui + src/ui/QGCSensorSettingsWidget.ui + src/ui/watchdog/WatchdogControl.ui + src/ui/watchdog/WatchdogProcessView.ui + src/ui/watchdog/WatchdogView.ui + src/ui/QGCFirmwareUpdate.ui + src/ui/QGCPxImuFirmwareUpdate.ui + src/ui/QGCDataPlot2D.ui + src/ui/QGCRemoteControlView.ui + src/ui/QMap3D.ui + src/ui/QGCWebView.ui + #src/ui/map3D/QGCGoogleEarthView.ui + src/ui/SlugsDataSensorView.ui + src/ui/SlugsHilSim.ui + src/ui/SlugsPIDControl.ui + src/ui/SlugsVideoCamControl.ui + src/ui/SlugsPadCameraControl.ui + src/ui/uas/QGCUnconnectedInfoWidget.ui + src/ui/designer/QGCToolWidget.ui + src/ui/designer/QGCParamSlider.ui + src/ui/designer/QGCActionButton.ui + src/ui/QGCMAVLinkLogPlayer.ui + src/ui/QGCWaypointListMulti.ui + src/ui/mission/QGCCustomWaypointAction.ui + src/ui/QGCUDPLinkConfiguration.ui + src/ui/QGCSettingsWidget.ui + ) + +# qgroundcontrol headers without Q_OBJECT +# r !grep -RL Q_OBJECT src | grep "^.*\.[h|hpp]$" | sed -e "s/^/\t/g" +set (qgroundcontrolHdrs + src/QGC.h + src/configuration.h + src/comm/OpalRT.h + src/comm/ParameterList.h + src/comm/Parameter.h + src/comm/QGCParamID.h + src/comm/QGCMAVLink.h + src/MG.h + src/ui/map3D/WebImage.h + src/ui/map3D/PixhawkCheetahGeode.h + src/ui/map3D/WaypointGroupNode.h + src/ui/map3D/ImageWindowGeode.h + src/ui/map3D/Imagery.h + src/ui/map3D/QGCGlut.h + src/ui/map3D/HUDScaleGeode.h + src/ui/map3D/Texture.h + src/ui/map3D/GCManipulator.h + src/ui/map3D/Q3DWidgetFactory.h + src/ui/map3D/TextureCache.h + src/ui/map3D/QOSGWidget.h + src/ui/map/Waypoint2DIcon.h + src/ui/map/MAV2DIcon.h + src/ui/OgreWidget.h + src/ui/mavlink/DomItem.h + src/ui/generated/ObjectDetectionView.h + src/ui/generated/MAVLinkSettingsWidget.h + src/ui/generated/SerialSettings.h + src/ui/generated/WaypointView.h + src/ui/generated/LineChart.h + src/ui/generated/UASList.h + src/ui/generated/UASInfo.h + src/ui/generated/MainWindow.h + src/ui/generated/DebugConsole.h + src/ui/generated/XMLCommProtocolWidget.h + src/ui/generated/WatchdogView.h + src/ui/generated/WatchdogControl.h + src/ui/generated/UASControl.h + src/ui/generated/WatchdogProcessView.h + src/ui/generated/ParameterInterface.h + src/ui/generated/HDDisplay.h + src/ui/generated/WaypointList.h + src/ui/generated/JoystickWidget.h + src/ui/generated/QGCSensorSettingsWidget.h + src/ui/generated/MapWidget.h + src/ui/generated/AudioOutputWidget.h + src/ui/generated/UASView.h + src/ui/generated/CommSettings.h + src/input/Freenect.h +) + +# qgroundcontrol headers with Q_OBJECT +# r !grep -Rl Q_OBJECT src | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g" +set(qgroundcontrolMocSrc + src/Core.h + src/uas/UASManager.h + src/uas/UASWaypointManager.h + src/uas/UASInterface.h + src/uas/PxQuadMAV.h + src/uas/QGCMAVLinkUASFactory.h + src/uas/SlugsMAV.h + src/uas/UAS.h + src/uas/ArduPilotMegaMAV.h + src/Waypoint.h + src/LogCompressor.h + src/GAudioOutput.h + src/comm/AS4Protocol.h + src/comm/MAVLinkSwarmSimulationLink.h + src/comm/ProtocolInterface.h + src/comm/MAVLinkSyntaxHighlighter.h + #src/comm/OpalLink.h + src/comm/MAVLinkProtocol.h + src/comm/SerialLinkInterface.h + src/comm/UDPLink.h + src/comm/LinkManager.h + src/comm/LinkInterface.h + src/comm/MAVLinkXMLParser.h + src/comm/MAVLinkSimulationLink.h + src/comm/SerialSimulationLink.h + src/comm/MAVLinkSimulationWaypointPlanner.h + src/comm/MAVLinkSimulationMAV.h + #src/comm/QGCNMEAProtocol.h + src/comm/SerialLink.h + src/ui/QGCSettingsWidget.h + #src/ui/map3D/WebImageCache.h + #src/ui/map3D/QGCGoogleEarthView.h + src/ui/map3D/QMap3D.h + #src/ui/map3D/Pixhawk3DWidget.h + #src/ui/map3D/Q3DWidget.h + src/ui/map3D/QGCWebPage.h + src/ui/ObjectDetectionView.h + src/ui/SerialConfigurationWindow.h + src/ui/QGCFirmwareUpdate.h + src/ui/CommConfigurationWindow.h + src/ui/MAVLinkSettingsWidget.h + src/ui/SlugsDataSensorView.h + src/ui/WaypointView.h + src/ui/QGCPxImuFirmwareUpdate.h + src/ui/QGCWebView.h + src/ui/QGCDataPlot2D.h + src/ui/HSIDisplay.h + src/ui/SlugsPadCameraControl.h + src/ui/QGCMainWindowAPConfigurator.h + src/ui/MainWindow.h + src/ui/SlugsVideoCamControl.h + src/ui/DebugConsole.h + src/ui/XMLCommProtocolWidget.h + src/ui/uas/UASListWidget.h + src/ui/uas/UASInfoWidget.h + src/ui/uas/QGCUnconnectedInfoWidget.h + src/ui/uas/UASControlWidget.h + src/ui/uas/UASView.h + src/ui/SlugsPIDControl.h + src/ui/HUD.h + src/ui/RadioCalibration/RadioCalibrationWindow.h + src/ui/RadioCalibration/RadioCalibrationData.h + src/ui/RadioCalibration/SwitchCalibrator.h + src/ui/RadioCalibration/AbstractCalibrator.h + src/ui/RadioCalibration/CurveCalibrator.h + src/ui/RadioCalibration/AirfoilServoCalibrator.h + src/ui/ParameterInterface.h + src/ui/linechart/LinechartWidget.h + src/ui/linechart/IncrementalPlot.h + src/ui/linechart/Scrollbar.h + src/ui/linechart/Linecharts.h + src/ui/linechart/ScrollZoomer.h + src/ui/linechart/LinechartPlot.h + src/ui/HDDisplay.h + src/ui/watchdog/WatchdogView.h + src/ui/watchdog/WatchdogControl.h + src/ui/watchdog/WatchdogProcessView.h + src/ui/QGCMAVLinkLogPlayer.h + src/ui/QGCUDPLinkConfiguration.h + #src/ui/OpalLinkConfigurationWindow.h + src/ui/mavlink/DomModel.h + src/ui/SlugsHilSim.h + src/ui/WaypointList.h + src/ui/JoystickWidget.h + src/ui/QGCWaypointListMulti.h + src/ui/CameraView.h + src/ui/QGCSensorSettingsWidget.h + src/ui/designer/QGCToolWidgetItem.h + src/ui/designer/QGCParamSlider.h + src/ui/designer/QGCActionButton.h + src/ui/designer/QGCToolWidget.h + src/ui/QGCParamWidget.h + src/ui/MapWidget.h + src/ui/QGCRemoteControlView.h + src/ui/AudioOutputWidget.h + #src/standalone/mavlinkgen/MAVLinkGen.h + src/input/JoystickInput.h + ) + +# qgroundcontrol source +set (qgroundcontrolSrc + src/main.cc + src/Core.cc + src/GAudioOutput.cc + src/LogCompressor.cc + src/QGC.cc + src/Waypoint.cc + src/comm/AS4Protocol.cc + src/comm/LinkManager.cc + src/comm/MAVLinkProtocol.cc + src/comm/MAVLinkSimulationLink.cc + src/comm/MAVLinkSimulationMAV.cc + src/comm/MAVLinkSimulationWaypointPlanner.cc + src/comm/MAVLinkSwarmSimulationLink.cc + src/comm/MAVLinkSyntaxHighlighter.cc + src/comm/MAVLinkXMLParser.cc + src/comm/SerialLink.cc + src/comm/SerialSimulationLink.cc + src/comm/UDPLink.cc + src/input/JoystickInput.cc + src/uas/ArduPilotMegaMAV.cc + src/uas/PxQuadMAV.cc + src/uas/QGCMAVLinkUASFactory.cc + src/uas/SlugsMAV.cc + src/uas/UAS.cc + src/uas/UASManager.cc + src/uas/UASWaypointManager.cc + src/ui/AudioOutputWidget.cc + src/ui/CameraView.cc + src/ui/CommConfigurationWindow.cc + src/ui/DebugConsole.cc + src/ui/HDDisplay.cc + src/ui/HSIDisplay.cc + src/ui/HUD.cc + src/ui/JoystickWidget.cc + src/ui/MAVLinkSettingsWidget.cc + src/ui/MainWindow.cc + src/ui/MapWidget.cc + src/ui/ObjectDetectionView.cc + src/ui/ParameterInterface.cc + src/ui/QGCDataPlot2D.cc + src/ui/QGCFirmwareUpdate.cc + src/ui/QGCMAVLinkLogPlayer.cc + src/ui/QGCMainWindowAPConfigurator.cc + src/ui/QGCParamWidget.cc + src/ui/QGCPxImuFirmwareUpdate.cc + src/ui/QGCRemoteControlView.cc + src/ui/QGCSensorSettingsWidget.cc + src/ui/QGCSettingsWidget.cc + src/ui/QGCUDPLinkConfiguration.cc + src/ui/QGCWaypointListMulti.cc + src/ui/QGCWebView.cc + src/ui/RadioCalibration/AbstractCalibrator.cc + src/ui/RadioCalibration/AirfoilServoCalibrator.cc + src/ui/RadioCalibration/CurveCalibrator.cc + src/ui/RadioCalibration/RadioCalibrationData.cc + src/ui/RadioCalibration/RadioCalibrationWindow.cc + src/ui/RadioCalibration/SwitchCalibrator.cc + src/ui/SerialConfigurationWindow.cc + src/ui/SlugsDataSensorView.cc + src/ui/SlugsHilSim.cc + src/ui/SlugsPIDControl.cpp + src/ui/SlugsPadCameraControl.cpp + src/ui/SlugsVideoCamControl.cpp + src/ui/WaypointList.cc + src/ui/WaypointView.cc + src/ui/XMLCommProtocolWidget.cc + src/ui/designer/QGCActionButton.cc + src/ui/designer/QGCParamSlider.cc + src/ui/designer/QGCToolWidget.cc + src/ui/designer/QGCToolWidgetItem.cc + src/ui/linechart/IncrementalPlot.cc + src/ui/linechart/LinechartPlot.cc + src/ui/linechart/LinechartWidget.cc + src/ui/linechart/Linecharts.cc + src/ui/linechart/ScrollZoomer.cc + src/ui/linechart/Scrollbar.cc + src/ui/map/MAV2DIcon.cc + src/ui/map/Waypoint2DIcon.cc + src/ui/map3D/QGCWebPage.cc + src/ui/mavlink/DomItem.cc + src/ui/mavlink/DomModel.cc + src/ui/uas/QGCUnconnectedInfoWidget.cc + src/ui/uas/UASControlWidget.cc + src/ui/uas/UASInfoWidget.cc + src/ui/uas/UASListWidget.cc + src/ui/uas/UASView.cc + src/ui/watchdog/WatchdogControl.cc + src/ui/watchdog/WatchdogProcessView.cc + src/ui/watchdog/WatchdogView.cc + ) + +# qgroundcontrol resource files +set(qgroundcontrolRscSrc mavground.qrc) + +# qgroundcontrol linking +qt4_wrap_cpp(qgroundcontrolMoc ${qgroundcontrolMocSrc}) +qt4_wrap_ui(qgroundcontrolUi ${qgroundcontrolUiSrc}) +qt4_add_resources(qgroundcontrolRsc ${qgroundcontrolRscSrc}) +add_executable(qgroundcontrol + ${qgroundcontrolSrc} + ${qgroundcontrolMoc} + ${qgroundcontrolUi} + ${qgroundcontrolRsc} + ) +add_dependencies(qgroundcontrol MAVLINK) +target_link_libraries(qgroundcontrol + ${SDL_LIBRARY} + ${OPENGL_LIBRARIES} + ${OSG_LIBRARIES} + ${QT_LIBRARIES} + ${FLITE_LIBRARIES} + ${PHONON_LIBS} + qextserialport qmapcontrol qwt) + +# qgroundcontrol install +install(TARGETS qgroundcontrol DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) + +# qwt library +#---------------------------------------------------------------------------- + +# qwt headers without Q_OBJECT +# r !grep -L Q_OBJECT src/lib/qwt | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g" +set (qwtHdrs + src/lib/qwt/qwt_abstract_scale_draw.h + src/lib/qwt/qwt_abstract_scale.h + src/lib/qwt/qwt_array.h + src/lib/qwt/qwt_arrow_button.h + src/lib/qwt/qwt_clipper.h + src/lib/qwt/qwt_color_map.h + src/lib/qwt/qwt_compass_rose.h + src/lib/qwt/qwt_curve_fitter.h + src/lib/qwt/qwt_data.h + src/lib/qwt/qwt_dial_needle.h + src/lib/qwt/qwt_double_interval.h + src/lib/qwt/qwt_double_range.h + src/lib/qwt/qwt_double_rect.h + src/lib/qwt/qwt_event_pattern.h + src/lib/qwt/qwt_global.h + src/lib/qwt/qwt.h + src/lib/qwt/qwt_interval_data.h + src/lib/qwt/qwt_layout_metrics.h + src/lib/qwt/qwt_legend_itemmanager.h + src/lib/qwt/qwt_math.h + src/lib/qwt/qwt_paint_buffer.h + src/lib/qwt/qwt_painter.h + src/lib/qwt/qwt_picker_machine.h + src/lib/qwt/qwt_plot_curve.h + src/lib/qwt/qwt_plot_dict.h + src/lib/qwt/qwt_plot_grid.h + src/lib/qwt/qwt_plot_item.h + src/lib/qwt/qwt_plot_layout.h + src/lib/qwt/qwt_plot_marker.h + src/lib/qwt/qwt_plot_printfilter.h + src/lib/qwt/qwt_plot_rasteritem.h + src/lib/qwt/qwt_plot_scaleitem.h + src/lib/qwt/qwt_plot_spectrogram.h + src/lib/qwt/qwt_plot_svgitem.h + src/lib/qwt/qwt_polygon.h + src/lib/qwt/qwt_raster_data.h + src/lib/qwt/qwt_rect.h + src/lib/qwt/qwt_round_scale_draw.h + src/lib/qwt/qwt_scale_div.h + src/lib/qwt/qwt_scale_draw.h + src/lib/qwt/qwt_scale_engine.h + src/lib/qwt/qwt_scale_map.h + src/lib/qwt/qwt_spline.h + src/lib/qwt/qwt_symbol.h + src/lib/qwt/qwt_text_engine.h + src/lib/qwt/qwt_text.h + src/lib/qwt/qwt_valuelist.h + ) + +# qwt headers with Q_OBJECT +# r !grep -l Q_OBJECT src/lib/qwt | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g" +set (qwtMocSrc + src/lib/qwt/qwt_abstract_slider.h + src/lib/qwt/qwt_analog_clock.h + src/lib/qwt/qwt_compass.h + src/lib/qwt/qwt_counter.h + src/lib/qwt/qwt_dial.h + src/lib/qwt/qwt_dyngrid_layout.h + src/lib/qwt/qwt_knob.h + src/lib/qwt/qwt_legend.h + src/lib/qwt/qwt_legend_item.h + src/lib/qwt/qwt_magnifier.h + src/lib/qwt/qwt_panner.h + src/lib/qwt/qwt_picker.h + src/lib/qwt/qwt_plot_canvas.h + src/lib/qwt/qwt_plot.h + src/lib/qwt/qwt_plot_magnifier.h + src/lib/qwt/qwt_plot_panner.h + src/lib/qwt/qwt_plot_picker.h + src/lib/qwt/qwt_plot_zoomer.h + src/lib/qwt/qwt_scale_widget.h + src/lib/qwt/qwt_slider.h + src/lib/qwt/qwt_text_label.h + src/lib/qwt/qwt_thermo.h + src/lib/qwt/qwt_wheel.h + ) + +# qwt source +set (qwtSrc + src/lib/qwt/qwt_plot_magnifier.cpp + src/lib/qwt/qwt_plot_curve.cpp + src/lib/qwt/qwt_panner.cpp + src/lib/qwt/qwt_round_scale_draw.cpp + src/lib/qwt/qwt_clipper.cpp + src/lib/qwt/qwt_plot_printfilter.cpp + src/lib/qwt/qwt_data.cpp + src/lib/qwt/qwt_text_engine.cpp + src/lib/qwt/qwt_dial.cpp + src/lib/qwt/qwt_plot_rasteritem.cpp + src/lib/qwt/qwt_spline.cpp + src/lib/qwt/qwt_rect.cpp + src/lib/qwt/qwt_plot_canvas.cpp + src/lib/qwt/qwt_magnifier.cpp + src/lib/qwt/qwt_analog_clock.cpp + src/lib/qwt/qwt_knob.cpp + src/lib/qwt/qwt_counter.cpp + src/lib/qwt/qwt_plot_axis.cpp + src/lib/qwt/qwt_interval_data.cpp + src/lib/qwt/qwt_scale_map.cpp + src/lib/qwt/qwt_slider.cpp + src/lib/qwt/qwt_compass_rose.cpp + src/lib/qwt/qwt_plot_print.cpp + src/lib/qwt/qwt_plot_layout.cpp + src/lib/qwt/qwt_abstract_scale_draw.cpp + src/lib/qwt/qwt_abstract_slider.cpp + src/lib/qwt/qwt_picker.cpp + src/lib/qwt/qwt_raster_data.cpp + src/lib/qwt/qwt_picker_machine.cpp + src/lib/qwt/qwt_plot_marker.cpp + src/lib/qwt/qwt_scale_draw.cpp + src/lib/qwt/qwt_thermo.cpp + src/lib/qwt/qwt_layout_metrics.cpp + src/lib/qwt/qwt_dial_needle.cpp + src/lib/qwt/qwt_plot_xml.cpp + src/lib/qwt/qwt_legend.cpp + src/lib/qwt/qwt_plot_picker.cpp + src/lib/qwt/qwt_event_pattern.cpp + src/lib/qwt/qwt_curve_fitter.cpp + src/lib/qwt/qwt_double_range.cpp + src/lib/qwt/qwt_painter.cpp + src/lib/qwt/qwt_double_interval.cpp + src/lib/qwt/qwt_math.cpp + src/lib/qwt/qwt_plot_item.cpp + src/lib/qwt/qwt_plot_zoomer.cpp + src/lib/qwt/qwt_symbol.cpp + src/lib/qwt/qwt_scale_div.cpp + src/lib/qwt/qwt_color_map.cpp + src/lib/qwt/qwt_plot.cpp + src/lib/qwt/qwt_plot_spectrogram.cpp + src/lib/qwt/qwt_paint_buffer.cpp + src/lib/qwt/qwt_plot_dict.cpp + src/lib/qwt/qwt_scale_widget.cpp + src/lib/qwt/qwt_text.cpp + src/lib/qwt/qwt_dyngrid_layout.cpp + src/lib/qwt/qwt_abstract_scale.cpp + src/lib/qwt/qwt_plot_svgitem.cpp + src/lib/qwt/qwt_arrow_button.cpp + src/lib/qwt/qwt_double_rect.cpp + src/lib/qwt/qwt_compass.cpp + src/lib/qwt/qwt_wheel.cpp + src/lib/qwt/qwt_legend_item.cpp + src/lib/qwt/qwt_plot_scaleitem.cpp + src/lib/qwt/qwt_text_label.cpp + src/lib/qwt/qwt_plot_panner.cpp + src/lib/qwt/qwt_scale_engine.cpp + src/lib/qwt/qwt_plot_grid.cpp + ) + +# qwt linking +qt4_wrap_cpp(qwtMoc ${qwtMocSrc}) +add_library(qwt ${qwtMoc} ${qwtSrc}) +target_link_libraries(qwt ${QT_LIBRARIES}) + +# qextserialport library +#---------------------------------------------------------------------------- + +# qextserialport headers without Q_OBJECT +# r !grep -RL Q_OBJECT src/lib/qextserialport | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g" +set (qextserialportHdrs + src/lib/qextserialport/posix_qextserialport.h + src/lib/qextserialport/qextserialenumerator.h + ) +# qextserialport headers with Q_OBJECT +# r !grep -Rl Q_OBJECT src/lib/qextserialport | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g" +set (qextserialportMocSrc + src/lib/qextserialport/qextserialbase.h + src/lib/qextserialport/qextserialport.h + #src/lib/qextserialport/win_qextserialport.h +) +# qextserialport src +set (qextserialportSrc + src/lib/qextserialport/posix_qextserialport.cpp + src/lib/qextserialport/qextserialport.cpp + src/lib/qextserialport/qextserialbase.cpp + #src/lib/qextserialport/win_qextserialport.cpp + src/lib/qextserialport/qextserialenumerator.cpp + ) + +# qextserial linking +qt4_wrap_cpp(qextserialportMoc ${qextserialportMocSrc}) +add_library(qextserialport ${qextserialportMoc} ${qextserialportSrc}) +target_link_libraries(qextserialport ${QT_LIBRARIES}) + +# qmapcontrol library +#---------------------------------------------------------------------------- + +# qmapcontrol headers without Q_OBJECT +# r !grep -RL Q_OBJECT lib/QMapControl | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g" +set (qmapcontrolHdrs + lib/QMapControl/src/circlepoint.h + lib/QMapControl/src/wmsmapadapter.h + lib/QMapControl/src/gps_position.h + lib/QMapControl/src/fixedimageoverlay.h + lib/QMapControl/src/imagepoint.h + lib/QMapControl/qmapcontrol.h + ) + +# qmapcontorl headers with Q_OBJECT +# r !grep -Rl Q_OBJECT lib/QMapControl | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g" +set (qmapcontrolMocSrc + lib/QMapControl/src/googlemapadapter.h + lib/QMapControl/src/mapnetwork.h + lib/QMapControl/src/mapadapter.h + lib/QMapControl/src/geometrylayer.h + lib/QMapControl/src/linestring.h + lib/QMapControl/src/mapcontrol.h + lib/QMapControl/src/tilemapadapter.h + lib/QMapControl/src/curve.h + lib/QMapControl/src/imagemanager.h + lib/QMapControl/src/layer.h + lib/QMapControl/src/maplayer.h + lib/QMapControl/src/geometry.h + lib/QMapControl/src/googlesatmapadapter.h + lib/QMapControl/src/point.h + lib/QMapControl/src/osmmapadapter.h + lib/QMapControl/src/layermanager.h + lib/QMapControl/src/openaerialmapadapter.h + lib/QMapControl/src/emptymapadapter.h + lib/QMapControl/src/yahoomapadapter.h + ) + +# qmapcontrol source +set (qmapcontrolSrc + lib/QMapControl/src/point.cpp + lib/QMapControl/src/imagepoint.cpp + lib/QMapControl/src/yahoomapadapter.cpp + lib/QMapControl/src/layermanager.cpp + lib/QMapControl/src/circlepoint.cpp + lib/QMapControl/src/imagemanager.cpp + lib/QMapControl/src/maplayer.cpp + lib/QMapControl/src/geometrylayer.cpp + lib/QMapControl/src/mapadapter.cpp + lib/QMapControl/src/mapnetwork.cpp + lib/QMapControl/src/linestring.cpp + lib/QMapControl/src/osmmapadapter.cpp + lib/QMapControl/src/fixedimageoverlay.cpp + lib/QMapControl/src/layer.cpp + lib/QMapControl/src/openaerialmapadapter.cpp + lib/QMapControl/src/geometry.cpp + lib/QMapControl/src/mapcontrol.cpp + lib/QMapControl/src/tilemapadapter.cpp + lib/QMapControl/src/googlemapadapter.cpp + lib/QMapControl/src/wmsmapadapter.cpp + lib/QMapControl/src/googlesatmapadapter.cpp + lib/QMapControl/src/curve.cpp + lib/QMapControl/src/emptymapadapter.cpp + lib/QMapControl/src/gps_position.cpp + ) + +# qmapcontrol linking +qt4_wrap_cpp(qmapcontrolMoc ${qmapcontrolMocSrc}) +add_library(qmapcontrol ${qmapcontrolMoc} ${qmapcontrolSrc}) +target_link_libraries(qmapcontrol ${QT_LIBRARIES}) + +# vim:ts=4:sw=4:expandtab diff --git a/CMakeModules/FindFlite.cmake b/CMakeModules/FindFlite.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a4d16bad18428f8cb828ee37ab443368065770b8 --- /dev/null +++ b/CMakeModules/FindFlite.cmake @@ -0,0 +1,17 @@ +FIND_PATH(FLITE_INCLUDE_DIR flite/flite.h) +FIND_LIBRARY(FLITE_LIBRARIES NAMES flite) + +IF(FLITE_INCLUDE_DIR AND FLITE_LIBRARIES) + SET(FLITE_FOUND TRUE) +ENDIF(FLITE_INCLUDE_DIR AND FLITE_LIBRARIES) + +IF(FLITE_FOUND) + IF (NOT Flite_FIND_QUIETLY) + MESSAGE(STATUS "Found flite includes: ${FLITE_INCLUDE_DIR}/flite/flite.h") + MESSAGE(STATUS "Found flite library: ${FLITE_LIBRARIES}") + ENDIF (NOT Flite_FIND_QUIETLY) +ELSE(FLITE_FOUND) + IF (Flite_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could NOT find flite development files") + ENDIF (Flite_FIND_REQUIRED) +ENDIF(FLITE_FOUND) diff --git a/CMakeModules/FindMAVLINK.cmake b/CMakeModules/FindMAVLINK.cmake new file mode 100644 index 0000000000000000000000000000000000000000..1b1c579255a9cbff8e295534d77e45a96cbba006 --- /dev/null +++ b/CMakeModules/FindMAVLINK.cmake @@ -0,0 +1,20 @@ +# - Try to find MAVLINK +# Once done, this will define +# +# MAVLINK_FOUND - system has scicoslab +# MAVLINK_INCLUDE_DIRS - the scicoslab include directories + +include(LibFindMacros) + +# Include dir +find_path(MAVLINK_INCLUDE_DIR + NAMES mavlink_types.h + PATHS + /usr/include/mavlink + /usr/local/include/mavlink +) + +# Set the include dir variables and the libraries and let libfind_process do the rest. +# NOTE: Singular variables for this library, plural for libraries this this lib depends on. +set(MAVLINK_PROCESS_INCLUDES MAVLINK_INCLUDE_DIR) +libfind_process(MAVLINK) diff --git a/CMakeModules/FindPhonon.cmake b/CMakeModules/FindPhonon.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a89940488a361f9100827560957b1f9c1f530d4c --- /dev/null +++ b/CMakeModules/FindPhonon.cmake @@ -0,0 +1,71 @@ +# Find libphonon +# Once done this will define +# +# PHONON_FOUND - system has Phonon Library +# PHONON_INCLUDES - the Phonon include directory +# PHONON_LIBS - link these to use Phonon +# PHONON_VERSION - the version of the Phonon Library + +# Copyright (c) 2008, Matthias Kretz +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +macro(_phonon_find_version) + set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h") + if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h") + set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h") + endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h") + file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000) + string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}") + set(PHONON_VERSION "${CMAKE_MATCH_1}") + message(STATUS "Phonon Version: ${PHONON_VERSION}") +endmacro(_phonon_find_version) + +if(PHONON_FOUND) + # Already found, nothing more to do except figuring out the version + _phonon_find_version() +else(PHONON_FOUND) + if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + set(PHONON_FIND_QUIETLY TRUE) + endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + + # As discussed on kde-buildsystem: first look at CMAKE_PREFIX_PATH, then at the suggested PATHS (kde4 install dir) + find_library(PHONON_LIBRARY NAMES phonon phonon4 PATHS /usr/lib ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR}) + # then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.) + find_library(PHONON_LIBRARY NAMES phonon phonon4) + + find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS /usr/include ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR}) + find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h) + + if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY}) + set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR}) + set(PHONON_FOUND TRUE) + _phonon_find_version() + else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + set(PHONON_FOUND FALSE) + endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) + + if(PHONON_FOUND) + if(NOT PHONON_FIND_QUIETLY) + message(STATUS "Found Phonon: ${PHONON_LIBRARY}") + message(STATUS "Found Phonon Includes: ${PHONON_INCLUDES}") + endif(NOT PHONON_FIND_QUIETLY) + else(PHONON_FOUND) + if(Phonon_FIND_REQUIRED) + if(NOT PHONON_INCLUDE_DIR) + message(STATUS "Phonon includes NOT found!") + endif(NOT PHONON_INCLUDE_DIR) + if(NOT PHONON_LIBRARY) + message(STATUS "Phonon library NOT found!") + endif(NOT PHONON_LIBRARY) + message(FATAL_ERROR "Phonon library or includes NOT found!") + else(Phonon_FIND_REQUIRED) + message(STATUS "Unable to find Phonon") + endif(Phonon_FIND_REQUIRED) + endif(PHONON_FOUND) + + + mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY PHONON_INCLUDES) +endif(PHONON_FOUND) diff --git a/CMakeModules/LibFindMacros.cmake b/CMakeModules/LibFindMacros.cmake new file mode 100644 index 0000000000000000000000000000000000000000..ff9233a6c821be3f8dedf63632d1284951df5d7c --- /dev/null +++ b/CMakeModules/LibFindMacros.cmake @@ -0,0 +1,98 @@ +# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments +# used for the current package. For this to work, the first parameter must be the +# prefix of the current package, then the prefix of the new package etc, which are +# passed to find_package. +macro (libfind_package PREFIX) + set (LIBFIND_PACKAGE_ARGS ${ARGN}) + if (${PREFIX}_FIND_QUIETLY) + set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET) + endif (${PREFIX}_FIND_QUIETLY) + if (${PREFIX}_FIND_REQUIRED) + set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED) + endif (${PREFIX}_FIND_REQUIRED) + find_package(${LIBFIND_PACKAGE_ARGS}) +endmacro (libfind_package) + +# CMake developers made the UsePkgConfig system deprecated in the same release (2.6) +# where they added pkg_check_modules. Consequently I need to support both in my scripts +# to avoid those deprecated warnings. Here's a helper that does just that. +# Works identically to pkg_check_modules, except that no checks are needed prior to use. +macro (libfind_pkg_check_modules PREFIX PKGNAME) + if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + include(UsePkgConfig) + pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS) + else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(${PREFIX} ${PKGNAME}) + endif (PKG_CONFIG_FOUND) + endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) +endmacro (libfind_pkg_check_modules) + +# Do the final processing once the paths have been detected. +# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain +# all the variables, each of which contain one include directory. +# Ditto for ${PREFIX}_PROCESS_LIBS and library files. +# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES. +# Also handles errors in case library detection was required, etc. +macro (libfind_process PREFIX) + # Skip processing if already processed during this run + if (NOT ${PREFIX}_FOUND) + # Start with the assumption that the library was found + set (${PREFIX}_FOUND TRUE) + + # Process all includes and set _FOUND to false if any are missing + foreach (i ${${PREFIX}_PROCESS_INCLUDES}) + if (${i}) + set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}}) + mark_as_advanced(${i}) + else (${i}) + set (${PREFIX}_FOUND FALSE) + endif (${i}) + endforeach (i) + + # Process all libraries and set _FOUND to false if any are missing + foreach (i ${${PREFIX}_PROCESS_LIBS}) + if (${i}) + set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}}) + mark_as_advanced(${i}) + else (${i}) + set (${PREFIX}_FOUND FALSE) + endif (${i}) + endforeach (i) + + # Print message and/or exit on fatal error + if (${PREFIX}_FOUND) + if (NOT ${PREFIX}_FIND_QUIETLY) + message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}") + endif (NOT ${PREFIX}_FIND_QUIETLY) + else (${PREFIX}_FOUND) + if (${PREFIX}_FIND_REQUIRED) + foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS}) + message("${i}=${${i}}") + endforeach (i) + message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.") + endif (${PREFIX}_FIND_REQUIRED) + endif (${PREFIX}_FOUND) + endif (NOT ${PREFIX}_FOUND) +endmacro (libfind_process) + +macro(libfind_library PREFIX basename) + set(TMP "") + if(MSVC80) + set(TMP -vc80) + endif(MSVC80) + if(MSVC90) + set(TMP -vc90) + endif(MSVC90) + set(${PREFIX}_LIBNAMES ${basename}${TMP}) + if(${ARGC} GREATER 2) + set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2}) + string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES}) + set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP}) + endif(${ARGC} GREATER 2) + find_library(${PREFIX}_LIBRARY + NAMES ${${PREFIX}_LIBNAMES} + PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS} + ) +endmacro(libfind_library) diff --git a/autobuild.sh b/autobuild.sh new file mode 100755 index 0000000000000000000000000000000000000000..9b7f7912a40a38e95fdebd6fe7da97216bda9fa6 --- /dev/null +++ b/autobuild.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +PS3='Please enter your choice: ' +LIST="in_source_build install_build grab_debian_dependencies package_source package remake clean END" +MAKEARGS="-j8" +echo +echo in_source_build: is used for development and you can start the scicoslab toolbox by typing scicoslab in the oooark source directory +echo install_build: is used for building before final installation to the system. +echo grab_debian_dependencies: installs all the required packages for debian based systems \(ubuntu maverick/ debian squeeze,lenny\) +echo remake: calls make again after project has been configured as install or in source build +echo package_source: creates a source package for distribution +echo package: creates binary packages for distribution +echo clean: removes the build directory + +echo +select OPT in $LIST +do + if [ $OPT = "in_source_build" ] &> /dev/null + then + echo you chose in source build + mkdir -p build && cd build && cmake -DIN_SRC_BUILD:bool=TRUE .. && make $MAKEARGS + exit 0 + elif [ $OPT = "install_build" ] &> /dev/null + then + echo you chose install build + mkdir -p build && cd build && cmake .. && make $MAKEARGS + exit 0 + elif [ $OPT = "grab_debian_dependencies" ] &> /dev/null + then + echo you chose to install debian dependencies + sudo apt-get install cmake libqt4-dev libboost-all-dev libopenscenegraph-dev + sudo apt-get install scicoslab-gtk + exit 0 + + elif [ $OPT = "remake" ] &> /dev/null + then + echo you chose to recall make on the previously configured build + cd build && make $MAKEARGS + exit 0 + + elif [ $OPT = "package_source" ] &> /dev/null + then + echo you chose to package the source + mkdir -p build && cd build && cmake .. && make package_source + exit 0 + + elif [ $OPT = "package" ] &> /dev/null + then + echo you chose to package the binary + mkdir -p build && cd build && cmake .. && make package + exit 0 + + elif [ $OPT = "clean" ] &> /dev/null + then + echo you chose to clean the build + rm -rf build + + elif [ $OPT = "END" ] &> /dev/null + then + exit 0 + fi +done diff --git a/createTags b/createTags new file mode 100755 index 0000000000000000000000000000000000000000..80145c3398826ee0685dfb522c2740faec4c4e46 --- /dev/null +++ b/createTags @@ -0,0 +1,5 @@ +#!/bin/bash +ctags -RV --c++-kinds=+p --fields=+iaS --extra=+q \ + . \ + /usr/include/qt4 \ + /usr/include/osg* diff --git a/qgroundcontrol.pri b/qgroundcontrol.pri index 008cf159938adb1d3a68f0850e9664b28469c4e8..a5bd6af35fcc58c415996bf62cddbdadece3b1b9 100644 --- a/qgroundcontrol.pri +++ b/qgroundcontrol.pri @@ -202,7 +202,12 @@ message("Compiling for linux 32") DEPENDENCIES_PRESENT += osg # Include OpenSceneGraph libraries LIBS += -losg \ - -losgViewer + -losgViewer \ + -losgGA \ + -losgDB \ + -losgText \ + -lOpenThreads + DEFINES += QGC_OSG_ENABLED } @@ -273,7 +278,12 @@ linux-g++-64 { DEPENDENCIES_PRESENT += osg # Include OpenSceneGraph libraries LIBS += -losg \ - -losgViewer + -losgViewer \ + -losgGA \ + -losgDB \ + -losgText \ + -lOpenThreads + DEFINES += QGC_OSG_ENABLED } @@ -342,10 +352,10 @@ INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \ LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \ -losg \ -losgViewer \ - -losgGA \ - -losgDB \ - -losgText \ - -lOpenThreads + -losgGA \ + -losgDB \ + -losgText \ + -lOpenThreads DEFINES += QGC_OSG_ENABLED exists($$BASEDIR/lib/osgEarth123) { DEPENDENCIES_PRESENT += osgearth @@ -400,7 +410,7 @@ win32-g++ { debug { #DESTDIR = $$BUILDDIR/debug - CONFIG += console + CONFIG += console } release { @@ -454,3 +464,4 @@ win32-g++ { # see http://osgearth.org/wiki/FAQ for details. QMAKE_CXXFLAGS += -Wl,-E } +# vim:ts=4:sw=4:expandtab diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index 50ef1ecbc630cd59e59f644ff39337d188aefa95..e10356f3777fe4ace139ae57df2869ebd10a1f04 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -189,7 +189,7 @@ bool GAudioOutput::say(QString text, int severity) file.setFileTemplate("XXXXXX.wav"); if (file.open()) { - cst_voice* v = register_cmu_us_kal(NULL); + cst_voice* v = new_voice(); cst_wave* wav = flite_text_to_wave(text.toStdString().c_str(), v); // file.fileName() returns the unique file name cst_wave_save(wav, file.fileName().toStdString().c_str(), "riff"); diff --git a/src/MissionLog.cc b/src/MissionLog.cc deleted file mode 100644 index a2149e9100ca357c9d366005cf2fd26968033d90..0000000000000000000000000000000000000000 --- a/src/MissionLog.cc +++ /dev/null @@ -1,86 +0,0 @@ -/*===================================================================== - -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit - -(c) 2009 PIXHAWK PROJECT - -This file is part of the PIXHAWK project - - PIXHAWK is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - PIXHAWK 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with PIXHAWK. If not, see . - -======================================================================*/ - -/** - * @file - * @brief Brief Description - * - * @author Lorenz Meier - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - - -/** - * @brief Constructor for the mission log - * - **/ - -MissionLog::MissionLog(QObject* parent) : QObject(parent) -{ - logLines = new QMap(); - logFiles = new QMap(); -} - -/** - * @brief Destructor for the mission log. It closes all files - * - **/ -MissionLog::~MissionLog() -{ - delete logFiles; - delete logLines; -} - -void MissionLog::startLog(UASInterface* uas, QString format) -{ - QString separator; - - if (format.contains(",")) separator = ","; - if (format.contains(";")) separator = ";"; - if (format.contains("\t")) separator = "\t"; - - QStringList fields = format.split(separator); -} - -void MissionLog::stopLog(UASInterface* uas, QString format) -{ - // TODO Check if file has to be closed explicitely - logFiles->remove(format); -} - - diff --git a/src/MissionLog.h b/src/MissionLog.h deleted file mode 100644 index 9ca62bd8ff2ba6446812725f3ee4557c44ab7a3d..0000000000000000000000000000000000000000 --- a/src/MissionLog.h +++ /dev/null @@ -1,106 +0,0 @@ -/*===================================================================== - -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit - -(c) 2009 PIXHAWK PROJECT - -This file is part of the PIXHAWK project - - PIXHAWK is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - PIXHAWK 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with PIXHAWK. If not, see . - -======================================================================*/ - -/** - * @file - * @brief Brief Description - * - * @author Lorenz Meier - * - */ - -#ifndef _MISSIONLOG_H_ -#define _MISSIONLOG_H_ - -#include -#include -#include -#include - -/** - * @brief Log the mission executed by this groundstation - * - * Displays all events in a console window and writes (if enabled) all events to a logfile - * - **/ -class MissionLog : public QObject { - Q_OBJECT - -public: - MissionLog(QObject* parent = NULL); - ~MissionLog(); - -public slots: - void startLog(UASInterface* uas, QString format); - void stopLog(UASInterface* uas, QString format); - -protected: - /** - * @brief This nested class is just a data container for a log line - */ - class LogFile - { - public: - void setField(QString id, double value) - { - //fields->value(id.trimmed()) = value; - fieldsDone++; - if (fieldsDone == fields->size()) writeLine(); - } - - protected: - QMap* fields; - int fieldsDone; - QFile* file; - - LogFile(QFile* file, QString format) - { - fields = new QMap(); - fieldsDone = 0; - file->open(QIODevice::WriteOnly | QIODevice::Text); - } - - void addField(QString id) - { - fields->insert(id, 0.0f); - } - - void writeLine() - { - QString line = ""; - // Iterate through the fields - - // Reset value to zero after write - line += "\n"; - file->write(line.toAscii()); - file->flush(); - } - - }; - QMap* logFiles; - -private: - -}; - -#endif // _MISSIONLOG_H_ diff --git a/src/plugins/PxMAV.cc b/src/plugins/PxMAV.cc deleted file mode 100644 index a761a4e004cd7ee02f0f49ccb3745d7c769e9183..0000000000000000000000000000000000000000 --- a/src/plugins/PxMAV.cc +++ /dev/null @@ -1,114 +0,0 @@ -#include "PxMAV.h" - -#include - -PxMAV::PxMAV() : - UAS(NULL, 0) -{ -} - -PxMAV::PxMAV(MAVLinkProtocol* mavlink, int id) : - UAS(mavlink, id) -{ -} - -/** - * This function is called by MAVLink once a complete, uncorrupted (CRC check valid) - * mavlink packet is received. - * - * @param link Hardware link the message came from (e.g. /dev/ttyUSB0 or UDP port). - * messages can be sent back to the system via this link - * @param message MAVLink message, as received from the MAVLink protocol stack - */ -void PxMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) -{ - // Let UAS handle the default message set - UAS::receiveMessage(link, message); - mavlink_message_t* msg = &message; - - //qDebug() << "PX RECEIVED" << msg->sysid << msg->compid << msg->msgid; - - - // Handle your special messages - switch (msg->msgid) - { - case MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT: - { - mavlink_watchdog_heartbeat_t payload; - mavlink_msg_watchdog_heartbeat_decode(msg, &payload); - - emit watchdogReceived(this->uasId, payload.watchdog_id, payload.process_count); - } - break; - - case MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO: - { - mavlink_watchdog_process_info_t payload; - mavlink_msg_watchdog_process_info_decode(msg, &payload); - - emit processReceived(this->uasId, payload.watchdog_id, payload.process_id, QString((const char*)payload.name), QString((const char*)payload.arguments), payload.timeout); - } - break; - - case MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS: - { - mavlink_watchdog_process_status_t payload; - mavlink_msg_watchdog_process_status_decode(msg, &payload); - emit processChanged(this->uasId, payload.watchdog_id, payload.process_id, payload.state, (payload.muted == 1) ? true : false, payload.crashes, payload.pid); - } - break; - case MAVLINK_MSG_ID_DEBUG_VECT: - { - mavlink_debug_vect_t vect; - mavlink_msg_debug_vect_decode(msg, &vect); - QString str((const char*)vect.name); - emit valueChanged(uasId, str+".x", vect.x, MG::TIME::getGroundTimeNow()); - emit valueChanged(uasId, str+".y", vect.y, MG::TIME::getGroundTimeNow()); - emit valueChanged(uasId, str+".z", vect.z, MG::TIME::getGroundTimeNow()); - } - break; - case MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE: - { - mavlink_vision_position_estimate_t pos; - mavlink_msg_vision_position_estimate_decode(&message, &pos); - quint64 time = getUnixTime(pos.usec); - emit valueChanged(uasId, "vis. time", pos.usec, time); - emit valueChanged(uasId, "vis. roll", pos.roll, time); - emit valueChanged(uasId, "vis. pitch", pos.pitch, time); - emit valueChanged(uasId, "vis. yaw", pos.yaw, time); - emit valueChanged(uasId, "vis. x", pos.x, time); - emit valueChanged(uasId, "vis. y", pos.y, time); - emit valueChanged(uasId, "vis. z", pos.z, time); - emit valueChanged(uasId, "vis. vx", pos.vx, time); - emit valueChanged(uasId, "vis. vy", pos.vy, time); - emit valueChanged(uasId, "vis. vz", pos.vz, time); - emit valueChanged(uasId, "vis. vyaw", pos.vyaw, time); - // Set internal state - if (!positionLock) - { - // If position was not locked before, notify positive - // GAudioOutput::instance()->notifyPositive(); - } - positionLock = true; - } - break; - default: - // Do nothing - break; - } -} - -void PxMAV::sendProcessCommand(int watchdogId, int processId, unsigned int command) -{ - mavlink_watchdog_command_t payload; - payload.target_system_id = uasId; - payload.watchdog_id = watchdogId; - payload.process_id = processId; - payload.command_id = (uint8_t)command; - - mavlink_message_t msg; - mavlink_msg_watchdog_command_encode(mavlink->getSystemId(), mavlink->getComponentId(), &msg, &payload); - sendMessage(msg); -} - - Q_EXPORT_PLUGIN2(pixhawk_plugins, PxMAV) diff --git a/src/plugins/PxMAV.h b/src/plugins/PxMAV.h deleted file mode 100644 index a3639ea9c25cb3b863a8ef8f677e6f6837703a36..0000000000000000000000000000000000000000 --- a/src/plugins/PxMAV.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef PXMAV_H -#define PXMAV_H - -#include "UAS.h" - -class PxMAV : public UAS -{ - Q_OBJECT - Q_INTERFACES(UASInterface) -public: - PxMAV(MAVLinkProtocol* mavlink, int id); - PxMAV(); -public slots: - /** @brief Receive a MAVLink message from this MAV */ - void receiveMessage(LinkInterface* link, mavlink_message_t message); - /** @brief Send a command to an onboard process */ - void sendProcessCommand(int watchdogId, int processId, unsigned int command); -signals: - void watchdogReceived(int systemId, int watchdogId, unsigned int processCount); - void processReceived(int systemId, int watchdogId, int processId, QString name, QString arguments, int timeout); - void processChanged(int systemId, int watchdogId, int processId, int state, bool muted, int crashed, int pid); -}; - -#endif // PXMAV_H diff --git a/src/uas/Logfile.cc b/src/uas/Logfile.cc deleted file mode 100644 index b217a218cc242856bd9649ee3253e0479701914b..0000000000000000000000000000000000000000 --- a/src/uas/Logfile.cc +++ /dev/null @@ -1,48 +0,0 @@ -#include "Logfile.h" -#include - -LogFile::LogFile(UASInterface* uas, QString filename, QString formatString) -{ - this->uas = uas; - connect(this->uas, SIGNAL(valueChanged(int, QString, double, quint64)), this, SLOT(addValue(int, QString, double, quint64))); - file = new QFile(filename); - separator = ","; - this->formatString = formatString; - if (file->open(QIODevice::WriteOnly | QIODevice::Text)) - { - out = new QTextStream(file); - } -} - -LogFile::~LogFile() -{ - out->flush(); - file->close(); - delete out; - delete file; -} - -void LogFile::addValue(int uas, QString id, double value, quint64 timestamp) -{ - //out.atEnd()->append() << separator << value; - - if (formatString == id) - { - - out->operator <<(timestamp); - out->operator <<(separator); - out->operator <<(value); - out->operator <<("\n"); - out->flush(); - } -} - -//std::ofstream markerlog("mavserial_markerlog.txt"); -//std::ofstream attitudelog("mavserial_attitudelog.txt"); - - -void LogFile::addValue(QString id, double value) -{ - //out.atEnd()->append() << separator << value; - //qDebug() << id << value; -} diff --git a/src/uas/Logfile.h b/src/uas/Logfile.h deleted file mode 100644 index 0fa088f33c9baa3601002f24d43caff172c83986..0000000000000000000000000000000000000000 --- a/src/uas/Logfile.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef LOGFILE_H -#define LOGFILE_H - -#include -#include -#include - -class LogFile : public QObject -{ - Q_OBJECT -public: - LogFile(UASInterface* uas, QString filename, QString formatString=""); - ~LogFile(); - -public slots: - void addValue(QString id, double value); - void addValue(int uas, QString id, double value, quint64 timestamp); - -protected: - QFile* file; - QTextStream* out; - QString separator; - QString formatString; - UASInterface* uas; -}; - -#endif // LOGFILE_H diff --git a/src/ui/designer/QGCParamSliderPlugin.h b/src/ui/designer/QGCParamSliderPlugin.h deleted file mode 100644 index 3b0a316f9e9029db39a18a51bb91e937f026151a..0000000000000000000000000000000000000000 --- a/src/ui/designer/QGCParamSliderPlugin.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef QGCPARAMSLIDERPLUGIN_H -#define QGCPARAMSLIDERPLUGIN_H - -#include - -class QGCParamSliderPlugin : public QObject, - public QDesignerCustomWidgetInterface -{ - Q_OBJECT - Q_INTERFACES(QDesignerCustomWidgetInterface) - -public: - explicit QGCParamSliderPlugin(QObject *parent = 0); - - bool isContainer() const; - bool isInitialized() const; - QIcon icon() const; - QString domXml() const; - QString group() const; - QString includeFile() const; - QString name() const; - QString toolTip() const; - QString whatsThis() const; - QWidget *createWidget(QWidget *parent); - void initialize(QDesignerFormEditorInterface *core); - -private: - bool initialized; -}; - -#endif // QGCPARAMSLIDERPLUGIN_H diff --git a/thirdParty/mavlink b/thirdParty/mavlink new file mode 160000 index 0000000000000000000000000000000000000000..50ad6bf278b87a105adb4887b5338daa2940f0c6 --- /dev/null +++ b/thirdParty/mavlink @@ -0,0 +1 @@ +Subproject commit 50ad6bf278b87a105adb4887b5338daa2940f0c6