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