1 | PROJECT(flairgcs)
|
---|
2 | cmake_minimum_required(VERSION 2.8)
|
---|
3 | include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
|
---|
4 |
|
---|
5 | execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
---|
6 | OUTPUT_VARIABLE GCC_VERSION)
|
---|
7 |
|
---|
8 | if (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()
|
---|
14 | else()
|
---|
15 | message(STATUS "GCC version < 4.3, c+11 is not supported!")
|
---|
16 | endif()
|
---|
17 |
|
---|
18 | FILE(GLOB PROJECT_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
---|
19 |
|
---|
20 | SET(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 |
|
---|
40 | FIND_PACKAGE(Qt4 REQUIRED)
|
---|
41 | SET(QT_USE_QTGUI TRUE)
|
---|
42 | SET(QT_USE_QTMAIN TRUE)
|
---|
43 | SET(QT_USE_QTXML TRUE)
|
---|
44 | SET(QT_USE_QTNETWORK TRUE)
|
---|
45 | INCLUDE(${QT_USE_FILE})
|
---|
46 |
|
---|
47 | QT4_WRAP_CPP(MOC_SOURCES ${FILES_TO_MOC})
|
---|
48 |
|
---|
49 | # generate rules for building source files from the resources
|
---|
50 | QT4_ADD_RESOURCES(RCC_SOURCES "src/ressources.qrc")
|
---|
51 |
|
---|
52 | ADD_DEFINITIONS(${QT_DEFINITIONS})
|
---|
53 | ADD_DEFINITIONS(-DQT_THREAD_SUPPORT -DQT_NO_DEBUG)
|
---|
54 |
|
---|
55 | include_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 |
|
---|
66 | LINK_DIRECTORIES (
|
---|
67 | ${QT_LIBRARY_DIR}
|
---|
68 | )
|
---|
69 |
|
---|
70 | ADD_EXECUTABLE(${PROJECT_NAME} ${PROJECT_SOURCE_FILES} ${MOC_SOURCES} ${RCC_SOURCES})
|
---|
71 | TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} qwt QwtDataViewer udt QtLocation FileLib z)
|
---|
72 |
|
---|
73 | INSTALL(
|
---|
74 | TARGETS ${PROJECT_NAME}
|
---|
75 | RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-bin/tools/${ARCH_DIR}
|
---|
76 | )
|
---|
77 |
|
---|
78 | add_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 |
|
---|
83 | add_dependencies(${PROJECT_NAME} svn_rev)
|
---|
84 |
|
---|
85 |
|
---|
86 | SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
---|