source: flair-src/branches/mavlink/tools/FlairGCS/CMakeLists.txt @ 74

Last change on this file since 74 was 74, checked in by Thomas Fuhrmann, 5 years ago

Update CMakeList

File size: 2.3 KB
Line 
1PROJECT(flairgcs)
2cmake_minimum_required(VERSION 2.8)
3include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
4
5execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
6                OUTPUT_VARIABLE GCC_VERSION)
7
8if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
9        if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
10                ADD_DEFINITIONS("-std=c++11")
11        else()
12                ADD_DEFINITIONS("-std=c++0x")
13        endif()
14else()
15        message(STATUS "GCC version < 4.3, c+11 is not supported!")
16endif()
17
18FILE(GLOB PROJECT_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
19
20SET(FILES_TO_MOC
21        src/UdtSocket.h
22        src/RangeFinderPlot.h
23        src/DataPlot2D.h
24        src/Picture.h
25        src/Manager.h
26        src/file_ui.h
27        src/Vector3DSpinBox.h
28        src/DoubleSpinBox.h
29        src/SpinBox.h
30        src/CheckBox.h
31        src/ComboBox.h
32        src/PushButton.h
33        src/mapwidget.h
34        src/Map.h
35        src/XmlWidget.h
36        src/ConnectionLayout.h
37        src/ListWidget.h
38)
39
40FIND_PACKAGE(Qt4 REQUIRED)
41SET(QT_USE_QTGUI TRUE)
42SET(QT_USE_QTMAIN TRUE)
43SET(QT_USE_QTXML TRUE)
44SET(QT_USE_QTNETWORK TRUE)
45INCLUDE(${QT_USE_FILE})
46
47QT4_WRAP_CPP(MOC_SOURCES ${FILES_TO_MOC})
48
49# generate rules for building source files from the resources
50QT4_ADD_RESOURCES(RCC_SOURCES "src/ressources.qrc")
51
52ADD_DEFINITIONS(${QT_DEFINITIONS})
53ADD_DEFINITIONS(-DQT_THREAD_SUPPORT -DQT_NO_DEBUG)
54
55include_directories(
56        ${CMAKE_SOURCE_DIR}/src
57        ${CMAKE_SOURCE_DIR}/../../lib/FlairCore/src/unexported
58        ${QT_INCLUDE_DIR}
59        ${CMAKE_SYSROOT}/usr/include/udt
60        ${CMAKE_SYSROOT}/usr/include/qwt
61        ${CMAKE_SYSROOT}/usr/include/QwtDataViewer
62        ${CMAKE_SYSROOT}/usr/include/qt4/QtMobility
63        ${CMAKE_SYSROOT}/usr/include/qt4/QtLocation
64)
65
66LINK_DIRECTORIES (
67        ${QT_LIBRARY_DIR}
68)
69
70ADD_EXECUTABLE(${PROJECT_NAME} ${PROJECT_SOURCE_FILES} ${MOC_SOURCES} ${RCC_SOURCES})
71TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} qwt QwtDataViewer udt QtLocation FileLib z)
72
73INSTALL(
74        TARGETS ${PROJECT_NAME}
75        RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-bin/tools/${ARCH_DIR}
76)
77
78add_custom_target(
79        svn_rev
80        COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/svn_revision.sh $ENV{FLAIR_ROOT}/flair-src ${CMAKE_CURRENT_SOURCE_DIR}/src/svnversion.h
81)
82
83add_dependencies(${PROJECT_NAME} svn_rev)
84
85
86SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
Note: See TracBrowser for help on using the repository browser.