source: flair-src/trunk/tools/FlairGCS/CMakeLists.txt @ 204

Last change on this file since 204 was 204, checked in by Sanahuja Guillaume, 4 years ago

maj gl for new toolchain

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