CMakeLists.txt 26.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
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)
James Goppert's avatar
James Goppert committed
43 44
set(qgroundcontrol_VERSION_MINOR 8)
set(qgroundcontrol_VERSION_PATCH 3)
45 46 47 48 49 50 51 52 53 54 55 56 57 58
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)
59
    message(WARNING "static linking is not yet tested and may have linking errors")
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
    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)
122
find_package(Phonon)
123
find_package(SDL REQUIRED)
James Goppert's avatar
James Goppert committed
124
if (UNIX)
125
    find_package(Flite)
James Goppert's avatar
James Goppert committed
126
endif(UNIX)
127
find_package(OpenGL REQUIRED)
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
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)

164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
# include directories
set(qgroundcontrolIncludes
    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}
    )

188
# dependency summary
189
message(STATUS "=======================================")
190
message(STATUS "\tDEPENDENCY\t\tFOUND")
191
message(STATUS "=======================================")
192 193 194 195 196 197 198 199

# common dependencies
if (MAVLINK_FOUND)
    message(STATUS "\t\tMAVLINK\t\tYES")
    list(APPEND qgroundcontrolIncludes ${MAVLINK_INCLUDE_DIRS})
else()
    message(STATUS "\t\tOpenSceneGraph\t\tNO")
endif (MAVLINK_FOUND)
200 201
if (OPENSCENEGRAPH_FOUND)
    message(STATUS "\t\tOpenSceneGraph\tYES")
202
    list(APPEND qgroundcontrolIncludes ${OPENSCENEGRAPH_INCLUDE_DIRS})
203 204 205 206 207
else()
    message(STATUS "\t\tOpenSceneGraph\t\tNO")
endif (OPENSCENEGRAPH_FOUND)
if (QT4_FOUND)
    message(STATUS "\t\tQT4\t\tYES")
208
    list(APPEND qgroundcontrolIncludes ${QT_INCLUDE_DIRS})
209 210 211 212 213
else()
    message(STATUS "\t\tQT4\t\tNO")
endif (QT4_FOUND)
if (PHONON_FOUND)
    message(STATUS "\t\tPHONON\t\tYES")
214
    list(APPEND qgroundcontrolIncludes ${PHONON_INCLUDE_DIR}/phonon)
215 216 217
else()
    message(STATUS "\t\tPHONON\t\tNO")
endif (PHONON_FOUND)
218 219 220 221 222 223 224 225 226 227 228 229 230
if (SDL_FOUND)
    message(STATUS "\t\tSDL\t\tYES")
    list(APPEND qgroundcontrolIncludes ${SDL_INCLUDE_DIR})
else()
    message(STATUS "\t\tSDL\t\tNO")
endif (SDL_FOUND)
if (OPENGL_FOUND)
    message(STATUS "\t\tOPENGL\t\tYES")
    list(APPEND qgroundcontrolIncludes ${OPENGL_INCLUDE_DIR})
else()
    message(STATUS "\t\tOPENGL\t\tNO")
endif (OPENGL_FOUND)

James Goppert's avatar
James Goppert committed
231 232
# unix only dependencies
if (UNIX)
233 234 235 236 237 238
    if (FLITE_FOUND)
        message(STATUS "\t\tFLITE\t\tYES")
        list(APPEND qgroundcontrolIncludes ${FLITE_INCLUDE_DIR})
    else()
        message(STATUS "\t\tFLITE\t\tNO")
    endif (FLITE_FOUND)
James Goppert's avatar
James Goppert committed
239
endif(UNIX)
240 241 242 243

# set include directories
include_directories(${qgroundcontrolIncludes})

244 245
message(STATUS "=======================================")

246
# project flags
247
include (${QT_USE_FILE})
248
set (commonLibs
249
        )
250 251
add_definitions(-D_TTY_POSIX_)

252
# qgrouncontrol forms
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
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
283
    #src/ui/map3D/QGCGoogleEarthView.ui
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
    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
    )

300
# qgroundcontrol headers without Q_OBJECT
301 302
# r !grep -RL Q_OBJECT src | grep "^.*\.[h|hpp]$" | sed -e "s/^/\t/g"
set (qgroundcontrolHdrs 
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
	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
)
352

353
# qgroundcontrol headers with Q_OBJECT
354 355
# r !grep -Rl Q_OBJECT src | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
set(qgroundcontrolMocSrc 
356
	src/Core.h
James Goppert's avatar
James Goppert committed
357 358 359 360 361 362 363 364 365
    src/uas/ArduPilotMegaMAV.h
    src/uas/PxQuadMAV.h
    src/uas/QGCMAVLinkUASFactory.h
    src/uas/QGCUASParamManager.h
    src/uas/SlugsMAV.h
    src/uas/UAS.h
    src/uas/UASInterface.h
    src/uas/UASManager.h
    src/uas/UASWaypointManager.h
366 367
	src/Waypoint.h
	src/LogCompressor.h
368
    src/GAudioOutput.h
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
	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
387 388
	#src/ui/map3D/WebImageCache.h
	#src/ui/map3D/QGCGoogleEarthView.h
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451
	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
452
	#src/standalone/mavlinkgen/MAVLinkGen.h
453
	src/input/JoystickInput.h
454 455
    )

456
# qgroundcontrol source
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
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
James Goppert's avatar
James Goppert committed
480
    src/uas/QGCUASParamManager.cc
481 482 483 484
    src/uas/SlugsMAV.cc
    src/uas/UAS.cc
    src/uas/UASManager.cc
    src/uas/UASWaypointManager.cc
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
    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
    )

550 551 552
# qgroundcontrol resource files
set(qgroundcontrolRscSrc mavground.qrc)

553 554 555 556 557 558 559 560 561
# qgroundcontrol linking
qt4_wrap_cpp(qgroundcontrolMoc ${qgroundcontrolMocSrc})
qt4_wrap_ui(qgroundcontrolUi ${qgroundcontrolUiSrc})
qt4_add_resources(qgroundcontrolRsc ${qgroundcontrolRscSrc})
add_executable(qgroundcontrol
    ${qgroundcontrolSrc}
    ${qgroundcontrolMoc}
    ${qgroundcontrolUi}
    ${qgroundcontrolRsc}
562
    )
563
add_dependencies(qgroundcontrol MAVLINK)
564 565 566 567 568 569 570 571
target_link_libraries(qgroundcontrol
    ${SDL_LIBRARY}
    ${OPENGL_LIBRARIES}
    ${OSG_LIBRARIES}
    ${QT_LIBRARIES}
    ${FLITE_LIBRARIES}
    ${PHONON_LIBS}
    qextserialport qmapcontrol qwt)
572

573 574
# qgroundcontrol install
install(TARGETS qgroundcontrol DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
575

576 577 578 579
# qwt library
#----------------------------------------------------------------------------

# qwt headers without Q_OBJECT
580 581
# r !grep -L Q_OBJECT src/lib/qwt | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
set (qwtHdrs 
582
    src/lib/qwt/qwt_abstract_scale_draw.h
583 584 585
    src/lib/qwt/qwt_abstract_scale.h
    src/lib/qwt/qwt_array.h
    src/lib/qwt/qwt_arrow_button.h
586
    src/lib/qwt/qwt_clipper.h
587
    src/lib/qwt/qwt_color_map.h
588 589
    src/lib/qwt/qwt_compass_rose.h
    src/lib/qwt/qwt_curve_fitter.h
590 591
    src/lib/qwt/qwt_data.h
    src/lib/qwt/qwt_dial_needle.h
592
    src/lib/qwt/qwt_double_interval.h
593 594 595 596 597
    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
598
    src/lib/qwt/qwt_interval_data.h
599 600 601 602 603 604 605 606
    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
607
    src/lib/qwt/qwt_plot_grid.h
608
    src/lib/qwt/qwt_plot_item.h
609
    src/lib/qwt/qwt_plot_layout.h
610 611 612 613 614 615 616 617
    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
618
    src/lib/qwt/qwt_rect.h
619 620
    src/lib/qwt/qwt_round_scale_draw.h
    src/lib/qwt/qwt_scale_div.h
621 622
    src/lib/qwt/qwt_scale_draw.h
    src/lib/qwt/qwt_scale_engine.h
623 624 625 626 627 628 629 630 631
    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
632 633
# r !grep -l Q_OBJECT src/lib/qwt | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
set (qwtMocSrc 
634
    src/lib/qwt/qwt_abstract_slider.h
635
    src/lib/qwt/qwt_analog_clock.h
636
    src/lib/qwt/qwt_compass.h
637 638 639 640 641 642 643
    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
644
    src/lib/qwt/qwt_panner.h
645 646 647 648 649 650 651 652 653 654
    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
655
    src/lib/qwt/qwt_thermo.h
656
    src/lib/qwt/qwt_wheel.h
657 658
    )

659
# qwt source
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729
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
    )

730 731 732
# qwt linking
qt4_wrap_cpp(qwtMoc ${qwtMocSrc})
add_library(qwt ${qwtMoc} ${qwtSrc})
733
target_link_libraries(qwt ${QT_LIBRARIES})
734

735
# qextserialport library
736 737
#----------------------------------------------------------------------------

738 739
# qextserialport headers without Q_OBJECT
# r !grep -RL Q_OBJECT src/lib/qextserialport | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
740 741 742
set (qextserialportHdrs
    src/lib/qextserialport/posix_qextserialport.h
    src/lib/qextserialport/qextserialenumerator.h
743 744 745 746 747 748 749
    )
# 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
750
)
751
# qextserialport src
752 753 754 755 756 757
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
758
    )
759

760
# qextserial linking
761 762 763
qt4_wrap_cpp(qextserialportMoc ${qextserialportMocSrc})
add_library(qextserialport ${qextserialportMoc} ${qextserialportSrc})
target_link_libraries(qextserialport ${QT_LIBRARIES})
764

765 766
# qmapcontrol library
#----------------------------------------------------------------------------
767

768
# qmapcontrol headers without Q_OBJECT
769
# r !grep -RL Q_OBJECT lib/QMapControl | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
770
set (qmapcontrolHdrs
771 772 773 774 775 776
	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
777
    )
778 779

# qmapcontorl headers with Q_OBJECT
780
# r !grep -Rl Q_OBJECT lib/QMapControl | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
781
set (qmapcontrolMocSrc
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
	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
801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831
    )

# 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
832 833 834
qt4_wrap_cpp(qmapcontrolMoc ${qmapcontrolMocSrc})
add_library(qmapcontrol ${qmapcontrolMoc} ${qmapcontrolSrc})
target_link_libraries(qmapcontrol ${QT_LIBRARIES})
835 836

# vim:ts=4:sw=4:expandtab