CMakeLists.txt 28.1 KB
Newer Older
1 2 3 4 5
cmake_minimum_required (VERSION 2.6)

project (qgroundcontrol)

# marcos
6
macro(find_or_build_from_source PACKAGE PACKAGE_PATH)
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
    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)
    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
38 39
set(qgroundcontrol_VERSION_MINOR 8)
set(qgroundcontrol_VERSION_PATCH 3)
40 41 42 43 44 45 46 47 48 49 50 51 52 53
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)
54
    message(WARNING "static linking is not yet tested and may have linking errors")
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
    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)

# installer
include(InstallRequiredSystemLibraries)
75 76
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-${qgroundcontrol_VERSION}-cpack")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${qgroundcontrol_VERSION}-cpack")
James Goppert's avatar
James Goppert committed
77
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${qgroundcontrol_VERSION}")
78
set(CPACK_GENERATOR "DEB")
James Goppert's avatar
James Goppert committed
79
set(CPACK_SOURCE_GENERATOR "TGZ")
80 81 82 83 84 85 86 87 88
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}
James Goppert's avatar
James Goppert committed
89 90
    "/.git/";"/build/";"~$";".*\\\\.bin$";".*\\\\.swp$"
    )
91 92 93 94 95 96 97 98 99 100 101 102 103
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)

# find libraries with cmake modules
find_package(Qt4 COMPONENTS QtGui QtCore QtNetwork QtOpenGL QtSVG QtXML QtPhonon QtWebKit REQUIRED)
set(PHONON_FIND_QUIETLY FALSE)
104
find_package(Phonon)
105
find_package(SDL REQUIRED)
James Goppert's avatar
James Goppert committed
106
if (UNIX)
107
    find_package(Flite)
James Goppert's avatar
James Goppert committed
108
endif(UNIX)
109
find_package(OpenGL REQUIRED)
James Goppert's avatar
James Goppert committed
110
find_package(OpenSceneGraph 2.9.9 COMPONENTS osgGA osgDB osgUtil osgViewer)
111
if ("OSG_LIBRARY-NOTFOUND" STREQUAL "${OSG_LIBRARY}")
James Goppert's avatar
James Goppert committed
112 113 114 115 116
    set(OPENSCENEGRAPH_FOUND FALSE)
else()
    set(OPENSCENEGRAPH_FOUND TRUE)
endif()

117
find_or_build_from_source(MAVLINK thirdParty/mavlink)
James Goppert's avatar
James Goppert committed
118
find_or_build_from_source(QSERIALPORT thirdParty/qserialport)
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

# 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()

James Goppert's avatar
James Goppert committed
135 136 137 138 139 140 141
if(QSERIALPORT_BUILD_FROM_SOURCE)
    # qserialport headers without Q_OBJECT
    # r !grep -RL Q_OBJECT thirdParty/qserialport/include
    set (qserialportHdrs
        thirdParty/qserialport/include/QtSerialPort/qserialport_export.h
        thirdParty/qserialport/include/QtSerialPort/qserialport
        thirdParty/qserialport/include/QtSerialPort/qportsettings.h
142
        )
James Goppert's avatar
James Goppert committed
143 144 145 146 147
    # qserialport headers with Q_OBJECT
    # r !grep -Rl Q_OBJECT thirdParty/qserialport
    set (qserialportMocSrc
        thirdParty/qserialport/include/QtSerialPort/qserialport.h
        thirdParty/qserialport/include/QtSerialPort/qserialportnative.h
148
        )
James Goppert's avatar
James Goppert committed
149 150 151 152
    # qserialport src
    set (qserialportSrc
        thirdParty/qserialport/src/common/qserialport.cpp
        thirdParty/qserialport/src/common/qportsettings.cpp
153 154
    )

James Goppert's avatar
James Goppert committed
155
    # qserialport native code
156
    if (WIN32)
James Goppert's avatar
James Goppert committed
157 158
        list(APPEND qserialportHdrs
            thirdParty/qserialport/src/win32/commdcbhelper.h
159
            )
James Goppert's avatar
James Goppert committed
160 161 162
        list(APPEND qserialportMocSrc
            thirdParty/qserialport/src/win32/qwincommevtnotifier.h
            thirdParty/qserialport/src/win32/wincommevtbreaker.h
163
        )
James Goppert's avatar
James Goppert committed
164 165 166 167 168 169
        list(APPEND qserialportSrc
            thirdParty/qserialport/src/win32/qserialportnative_win32.cpp
            thirdParty/qserialport/src/win32/commdcbhelper.cpp
            thirdParty/qserialport/src/win32/qwincommevtnotifier.cpp
            #thirdParty/qserialport/src/win32/qserialportnative_wince.cpp
            #thirdParty/qserialport/src/win32/wincommevtbreaker.cpp
170 171
            )
    elseif(UNIX OR APPLE)
James Goppert's avatar
James Goppert committed
172 173
        list(APPEND qserialportHdrs
            thirdParty/qserialport/src/posix/termioshelper.h
174
            )
James Goppert's avatar
James Goppert committed
175 176 177
        list(APPEND qserialportSrc    
            thirdParty/qserialport/src/posix/termioshelper.cpp
            thirdParty/qserialport/src/posix/qserialportnative_posix.cpp
178 179 180 181 182
            )
    else()
        message(FATAL_ERROR "unknown OS")
    endif()

James Goppert's avatar
James Goppert committed
183 184 185 186
    # qserialport linking
    qt4_wrap_cpp(qserialportMoc ${qserialportMocSrc})
    add_library(qserialport ${qserialportMoc} ${qserialportSrc})
    target_link_libraries(qserialport ${QT_LIBRARIES})
187

James Goppert's avatar
James Goppert committed
188 189 190 191
    set(QSERIALPORT_INCLUDE_DIRS
        ${PROJECT_SOURCE_DIR}/thirdParty/qserialport/include
        ${PROJECT_SOURCE_DIR}/thirdParty/qserialport/include/QtSerialPort
        ${PROJECT_SOURCE_DIR}/thirdParty/qserialport/src
James Goppert's avatar
James Goppert committed
192
        )
James Goppert's avatar
James Goppert committed
193 194 195
    set(QSERIALPORT_LIBRARIES qserialport)
    add_custom_command(OUTPUT qserialport_BUILD.stamp 
        COMMAND touch qserialport_BUILD.stamp)
James Goppert's avatar
James Goppert committed
196 197
endif()

198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
# 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)

216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
# 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}
    )
James Goppert's avatar
James Goppert committed
239
set (qgroundcontrolLibs)
240

241
# dependency summary
242
message(STATUS "=======================================")
243
message(STATUS "\tDEPENDENCY\t\tFOUND")
244
message(STATUS "=======================================")
245 246

# common dependencies
James Goppert's avatar
James Goppert committed
247
message(STATUS "\t\tMAVLINK\t\t${MAVLINK_FOUND}")
248 249
if (MAVLINK_FOUND)
    list(APPEND qgroundcontrolIncludes ${MAVLINK_INCLUDE_DIRS})
James Goppert's avatar
James Goppert committed
250
endif()
251

James Goppert's avatar
James Goppert committed
252 253 254 255
message(STATUS "\t\tqserialport\t${QSERIALPORT_FOUND}")
if (QSERIALPORT_FOUND)
    list(APPEND qgroundcontrolIncludes ${QSERIALPORT_INCLUDE_DIRS})
    list(APPEND qgroundcontrolLibs ${QSERIALPORT_LIBRARIES})
James Goppert's avatar
James Goppert committed
256 257
endif()

James Goppert's avatar
James Goppert committed
258
message(STATUS "\t\tOpenSceneGraph\t${OPENSCENEGRAPH_FOUND}")
James Goppert's avatar
James Goppert committed
259
if (OPENSCENEGRAPH_FOUND)
260
    list(APPEND qgroundcontrolIncludes ${OPENSCENEGRAPH_INCLUDE_DIRS})
261
    list(APPEND qgroundcontrolLibs ${OPENSCENEGRAPH_LIBRARIES})
James Goppert's avatar
James Goppert committed
262
endif()
263

James Goppert's avatar
James Goppert committed
264
message(STATUS "\t\tQT4\t\t${QT4_FOUND}")
265
if (QT4_FOUND)
266
    list(APPEND qgroundcontrolIncludes ${QT_INCLUDE_DIRS})
James Goppert's avatar
James Goppert committed
267
    list(APPEND qgroundcontrolLibs ${QT_LIBRARIES})
James Goppert's avatar
James Goppert committed
268
endif()
269

James Goppert's avatar
James Goppert committed
270
message(STATUS "\t\tPHONON\t\t${PHONON_FOUND}")
271
if (PHONON_FOUND)
272
    list(APPEND qgroundcontrolIncludes ${PHONON_INCLUDES})
James Goppert's avatar
James Goppert committed
273
    list(APPEND qgroundcontrolLibs ${PHONON_LIBS})
James Goppert's avatar
James Goppert committed
274
endif()
275

James Goppert's avatar
James Goppert committed
276
message(STATUS "\t\tSDL\t\t${SDL_FOUND}")
277 278
if (SDL_FOUND)
    list(APPEND qgroundcontrolIncludes ${SDL_INCLUDE_DIR})
James Goppert's avatar
James Goppert committed
279
    list(APPEND qgroundcontrolLibs ${SDL_LIBRARY})
James Goppert's avatar
James Goppert committed
280
endif()
281

James Goppert's avatar
James Goppert committed
282
message(STATUS "\t\tOPENGL\t\t${OPENGL_FOUND}")
283 284
if (OPENGL_FOUND)
    list(APPEND qgroundcontrolIncludes ${OPENGL_INCLUDE_DIR})
James Goppert's avatar
James Goppert committed
285
    list(APPEND qgroundcontrolLibs ${OPENGL_LIBRARIES})
286
endif()
287

James Goppert's avatar
James Goppert committed
288 289
# unix only dependencies
if (UNIX)
James Goppert's avatar
James Goppert committed
290
    message(STATUS "\t\tFLITE\t\t${FLITE_FOUND}")
291 292
    if (FLITE_FOUND)
        list(APPEND qgroundcontrolIncludes ${FLITE_INCLUDE_DIR})
James Goppert's avatar
James Goppert committed
293
        list(APPEND qgroundcontrolLibs ${FLITE_LIBRARIES})
294
    endif ()
James Goppert's avatar
James Goppert committed
295
endif()
296 297 298 299

# set include directories
include_directories(${qgroundcontrolIncludes})

300 301
message(STATUS "=======================================")

302
# project flags
303
include (${QT_USE_FILE})
304
set (commonLibs
305
        )
306 307
add_definitions(-D_TTY_POSIX_)

308
# qgrouncontrol forms
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
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
James Goppert's avatar
James Goppert committed
329
    src/ui/designer/QGCCommandButton.ui
330 331 332 333 334 335 336 337 338 339
    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
340
    #src/ui/map3D/QGCGoogleEarthView.ui
341 342
    src/ui/SlugsDataSensorView.ui
    src/ui/SlugsHilSim.ui
James Goppert's avatar
James Goppert committed
343 344
    #src/ui/SlugsPIDControl.ui
    #src/ui/SlugsVideoCamControl.ui
345 346 347 348 349 350 351 352 353
    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
James Goppert's avatar
James Goppert committed
354
    src/ui/UASControlParameters.ui
355 356 357
    src/ui/QGCSettingsWidget.ui
    )

358
# qgroundcontrol headers without Q_OBJECT
359 360
# r !grep -RL Q_OBJECT src | grep "^.*\.[h|hpp]$" | sed -e "s/^/\t/g"
set (qgroundcontrolHdrs 
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408
	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/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
)
409

410
# qgroundcontrol headers with Q_OBJECT
411 412
# r !grep -Rl Q_OBJECT src | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
set(qgroundcontrolMocSrc 
413
	src/Core.h
James Goppert's avatar
James Goppert committed
414 415 416 417 418 419 420 421 422
    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
423 424
	src/Waypoint.h
	src/LogCompressor.h
425
    src/GAudioOutput.h
426 427 428 429 430 431
	src/comm/AS4Protocol.h
	src/comm/MAVLinkSwarmSimulationLink.h
	src/comm/ProtocolInterface.h
	#src/comm/OpalLink.h
	src/comm/MAVLinkProtocol.h
	src/comm/SerialLinkInterface.h
432
	src/comm/SerialInterface.h
433 434 435 436 437 438 439 440 441
	src/comm/UDPLink.h
	src/comm/LinkManager.h
	src/comm/LinkInterface.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
James Goppert's avatar
James Goppert committed
442
    src/ui/uas/UASControlParameters.h
443
	src/ui/QGCSettingsWidget.h
444 445
	#src/ui/map3D/WebImageCache.h
	#src/ui/map3D/QGCGoogleEarthView.h
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
James Goppert's avatar
James Goppert committed
452
    src/ui/designer/QGCCommandButton.h
453 454 455 456 457 458 459 460 461 462 463 464
	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
James Goppert's avatar
James Goppert committed
465
	#src/ui/SlugsVideoCamControl.h
466 467 468 469 470 471 472
	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
James Goppert's avatar
James Goppert committed
473
	#src/ui/SlugsPIDControl.h
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508
	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/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
509
	#src/standalone/mavlinkgen/MAVLinkGen.h
510
	src/input/JoystickInput.h
511 512
    )

513
# qgroundcontrol source
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
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/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
535
    src/uas/QGCUASParamManager.cc
536 537 538 539
    src/uas/SlugsMAV.cc
    src/uas/UAS.cc
    src/uas/UASManager.cc
    src/uas/UASWaypointManager.cc
540 541 542 543 544 545 546 547 548 549 550 551 552 553
    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
James Goppert's avatar
James Goppert committed
554
    src/ui/designer/QGCCommandButton.cc
555 556 557 558 559 560 561
    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
James Goppert's avatar
James Goppert committed
562
    src/ui/uas/UASControlParameters.cpp
563 564 565 566 567 568 569 570 571 572 573 574 575
    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
James Goppert's avatar
James Goppert committed
576
    #src/ui/SlugsPIDControl.cpp
577
    src/ui/SlugsPadCameraControl.cpp
James Goppert's avatar
James Goppert committed
578
    #src/ui/SlugsVideoCamControl.cpp
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603
    src/ui/WaypointList.cc
    src/ui/WaypointView.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/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
    )

604 605 606
# qgroundcontrol resource files
set(qgroundcontrolRscSrc mavground.qrc)

607 608 609 610 611 612 613 614 615
# qgroundcontrol linking
qt4_wrap_cpp(qgroundcontrolMoc ${qgroundcontrolMocSrc})
qt4_wrap_ui(qgroundcontrolUi ${qgroundcontrolUiSrc})
qt4_add_resources(qgroundcontrolRsc ${qgroundcontrolRscSrc})
add_executable(qgroundcontrol
    ${qgroundcontrolSrc}
    ${qgroundcontrolMoc}
    ${qgroundcontrolUi}
    ${qgroundcontrolRsc}
616
    )
617
add_dependencies(qgroundcontrol MAVLINK)
618
target_link_libraries(qgroundcontrol
James Goppert's avatar
James Goppert committed
619
    ${qgroundcontrolLibs}
620
    qextserialport qmapcontrol qwt)
621

622 623
# qgroundcontrol install
install(TARGETS qgroundcontrol DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
624

625 626 627 628
# qwt library
#----------------------------------------------------------------------------

# qwt headers without Q_OBJECT
629 630
# r !grep -L Q_OBJECT src/lib/qwt | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
set (qwtHdrs 
631
    src/lib/qwt/qwt_abstract_scale_draw.h
632 633 634
    src/lib/qwt/qwt_abstract_scale.h
    src/lib/qwt/qwt_array.h
    src/lib/qwt/qwt_arrow_button.h
635
    src/lib/qwt/qwt_clipper.h
636
    src/lib/qwt/qwt_color_map.h
637 638
    src/lib/qwt/qwt_compass_rose.h
    src/lib/qwt/qwt_curve_fitter.h
639 640
    src/lib/qwt/qwt_data.h
    src/lib/qwt/qwt_dial_needle.h
641
    src/lib/qwt/qwt_double_interval.h
642 643 644 645 646
    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
647
    src/lib/qwt/qwt_interval_data.h
648 649 650 651 652 653 654 655
    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
656
    src/lib/qwt/qwt_plot_grid.h
657
    src/lib/qwt/qwt_plot_item.h
658
    src/lib/qwt/qwt_plot_layout.h
659 660 661 662 663 664 665 666
    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
667
    src/lib/qwt/qwt_rect.h
668 669
    src/lib/qwt/qwt_round_scale_draw.h
    src/lib/qwt/qwt_scale_div.h
670 671
    src/lib/qwt/qwt_scale_draw.h
    src/lib/qwt/qwt_scale_engine.h
672 673 674 675 676 677 678 679 680
    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
681 682
# r !grep -l Q_OBJECT src/lib/qwt | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
set (qwtMocSrc 
683
    src/lib/qwt/qwt_abstract_slider.h
684
    src/lib/qwt/qwt_analog_clock.h
685
    src/lib/qwt/qwt_compass.h
686 687 688 689 690 691 692
    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
693
    src/lib/qwt/qwt_panner.h
694 695 696 697 698 699 700 701 702 703
    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
704
    src/lib/qwt/qwt_thermo.h
705
    src/lib/qwt/qwt_wheel.h
706 707
    )

708
# qwt source
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778
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
    )

779 780 781
# qwt linking
qt4_wrap_cpp(qwtMoc ${qwtMocSrc})
add_library(qwt ${qwtMoc} ${qwtSrc})
782
target_link_libraries(qwt ${QT_LIBRARIES})
783

784
# qextserialport library
785 786
#----------------------------------------------------------------------------

787 788
# qextserialport headers without Q_OBJECT
# r !grep -RL Q_OBJECT src/lib/qextserialport | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
789 790 791
set (qextserialportHdrs
    src/lib/qextserialport/posix_qextserialport.h
    src/lib/qextserialport/qextserialenumerator.h
792 793 794 795 796 797 798
    )
# 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
799
)
800
# qextserialport src
801 802 803 804 805 806
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
807
    )
808

809
# qextserial linking
810 811 812
qt4_wrap_cpp(qextserialportMoc ${qextserialportMocSrc})
add_library(qextserialport ${qextserialportMoc} ${qextserialportSrc})
target_link_libraries(qextserialport ${QT_LIBRARIES})
813

814 815
# qmapcontrol library
#----------------------------------------------------------------------------
816

817
# qmapcontrol headers without Q_OBJECT
818
# r !grep -RL Q_OBJECT lib/QMapControl | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
819
set (qmapcontrolHdrs
820 821 822 823 824 825
	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
826
    )
827 828

# qmapcontorl headers with Q_OBJECT
829
# r !grep -Rl Q_OBJECT lib/QMapControl | grep "^.*\.[h|hpp]$" | sed "s/^/\t/g"
830
set (qmapcontrolMocSrc
831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849
	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
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880
    )

# 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
881 882 883
qt4_wrap_cpp(qmapcontrolMoc ${qmapcontrolMocSrc})
add_library(qmapcontrol ${qmapcontrolMoc} ${qmapcontrolSrc})
target_link_libraries(qmapcontrol ${QT_LIBRARIES})
884 885

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