[2] | 1 | find_package(LibXml2 REQUIRED)
|
---|
| 2 | find_package(Xenomai QUIET)
|
---|
| 3 |
|
---|
| 4 | if(NOT XENOMAI_FOUND)
|
---|
| 5 | warn("Xenomai not found, you will not be able to link a real time program")
|
---|
| 6 | endif()
|
---|
| 7 |
|
---|
| 8 | execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
---|
| 9 | OUTPUT_VARIABLE GCC_VERSION)
|
---|
| 10 |
|
---|
| 11 | if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
|
---|
| 12 | if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
|
---|
| 13 | ADD_DEFINITIONS("-std=c++11")
|
---|
| 14 | else()
|
---|
| 15 | ADD_DEFINITIONS("-std=c++0x")
|
---|
| 16 | endif()
|
---|
| 17 | else()
|
---|
| 18 | message(STATUS "GCC version < 4.3, c+11 is not supported!")
|
---|
| 19 | endif()
|
---|
| 20 |
|
---|
| 21 | SET(FLAIR_INCLUDE_DIR
|
---|
| 22 | ${LIBXML2_INCLUDE_DIR}
|
---|
| 23 | ${CMAKE_SYSROOT}/usr/include/opencv
|
---|
| 24 | ${FLAIR_DEV}/include/FlairCore
|
---|
| 25 | )
|
---|
| 26 | SET(FLAIR_LIBRARY_DIR
|
---|
[10] | 27 | ${FLAIR_BIN}/lib/${ARCH_DIR}
|
---|
[2] | 28 | )
|
---|
| 29 |
|
---|
| 30 | SET(FLAIR_LIBRARIES
|
---|
| 31 | ${LIBXML2_LIBRARIES}
|
---|
| 32 | udt pthread cv cxcore highgui FileLib rt z
|
---|
| 33 | )
|
---|
| 34 |
|
---|
| 35 | #VRPN for motion capture
|
---|
| 36 | IF (FLAIR_USE_VRPN)
|
---|
| 37 | SET(FLAIR_LIBRARIES vrpn ${FLAIR_LIBRARIES})
|
---|
| 38 | ENDIF (FLAIR_USE_VRPN)
|
---|
| 39 |
|
---|
| 40 | #nmea for GPS
|
---|
| 41 | IF (FLAIR_USE_GPS)
|
---|
| 42 | SET(FLAIR_LIBRARIES nmea ${FLAIR_LIBRARIES})
|
---|
| 43 | ENDIF (FLAIR_USE_GPS)
|
---|
| 44 |
|
---|
| 45 | #core, will be replace by rt or nrt version at the end
|
---|
| 46 | SET(FLAIR_LIBRARIES FlairCore ${FLAIR_LIBRARIES})
|
---|
| 47 |
|
---|
| 48 | #sensor and actuator lib
|
---|
| 49 | IF (FLAIR_USE_SENSOR_ACTUATOR)
|
---|
| 50 | SET(FLAIR_INCLUDE_DIR ${FLAIR_INCLUDE_DIR} ${FLAIR_DEV}/include/FlairSensorActuator)
|
---|
| 51 | SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSensorActuator.a ${FLAIR_LIBRARIES})
|
---|
| 52 | ENDIF (FLAIR_USE_SENSOR_ACTUATOR)
|
---|
| 53 |
|
---|
| 54 | #filter lib
|
---|
| 55 | IF (FLAIR_USE_FILTER)
|
---|
| 56 | SET(FLAIR_INCLUDE_DIR ${FLAIR_INCLUDE_DIR} ${FLAIR_DEV}/include/FlairFilter)
|
---|
| 57 | SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairFilter.a iir ${FLAIR_LIBRARIES})
|
---|
| 58 | ENDIF (FLAIR_USE_FILTER)
|
---|
| 59 |
|
---|
| 60 | #meta lib
|
---|
| 61 | IF (FLAIR_USE_META)
|
---|
| 62 | SET(FLAIR_INCLUDE_DIR ${FLAIR_INCLUDE_DIR} ${FLAIR_DEV}/include/FlairMeta)
|
---|
| 63 | SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairMeta.a ${FLAIR_LIBRARIES})
|
---|
| 64 | ENDIF (FLAIR_USE_META)
|
---|
| 65 |
|
---|
| 66 | #simulator lib
|
---|
| 67 | IF (FLAIR_USE_SIMULATOR)
|
---|
| 68 | if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
|
---|
| 69 | SET(FLAIR_USE_SIMULATOR_GL FALSE)
|
---|
| 70 | endif()
|
---|
| 71 | SET(FLAIR_INCLUDE_DIR ${FLAIR_INCLUDE_DIR}
|
---|
| 72 | ${FLAIR_DEV}/include/FlairSimulator
|
---|
| 73 | ${CMAKE_SYSROOT}/usr/include/irrlicht
|
---|
| 74 | ${FLAIR_DEV}/include/FlairSensorActuator
|
---|
| 75 | ${CMAKE_SYSROOT}/usr/include/vrpn
|
---|
| 76 | )
|
---|
| 77 |
|
---|
| 78 | SET(SIMU_LIBRARY ${FLAIR_LIBRARY_DIR}/libFlairSensorActuator.a)
|
---|
| 79 | IF (FLAIR_USE_SIMULATOR_GL)
|
---|
| 80 | ADD_DEFINITIONS("-DGL")
|
---|
| 81 | SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_gl.a
|
---|
| 82 | ${SIMU_LIBRARY} GL vrpn ${FLAIR_LIBRARIES} Irrlicht Xxf86vm)
|
---|
| 83 | else()
|
---|
| 84 | SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_nogl.a ${SIMU_LIBRARY} vrpn ${FLAIR_LIBRARIES})
|
---|
| 85 | endif()
|
---|
| 86 | ENDIF (FLAIR_USE_SIMULATOR)
|
---|
| 87 |
|
---|
| 88 | #set RT or NRT specific libraries
|
---|
| 89 | set(FLAIR_LIBRARIES_RT ${FLAIR_LIBRARIES} ${XENOMAI_LIBRARIES})
|
---|
| 90 |
|
---|
| 91 | list(FIND FLAIR_LIBRARIES_RT "FlairCore" POS)
|
---|
| 92 | if(POS GREATER -1)
|
---|
| 93 | list(REMOVE_AT FLAIR_LIBRARIES_RT ${POS})
|
---|
| 94 | list(INSERT FLAIR_LIBRARIES_RT ${POS} "${FLAIR_LIBRARY_DIR}/libFlairCore_rt.a")
|
---|
| 95 | endif()
|
---|
| 96 |
|
---|
| 97 | set(FLAIR_LIBRARIES_NRT ${FLAIR_LIBRARIES})
|
---|
| 98 |
|
---|
| 99 | list(FIND FLAIR_LIBRARIES_NRT "FlairCore" POS)
|
---|
| 100 | if(POS GREATER -1)
|
---|
| 101 | list(REMOVE_AT FLAIR_LIBRARIES_NRT ${POS})
|
---|
| 102 | list(INSERT FLAIR_LIBRARIES_NRT ${POS} "${FLAIR_LIBRARY_DIR}/libFlairCore_nrt.a")
|
---|
| 103 | endif()
|
---|
| 104 |
|
---|