source: flair-dev/tags/0.0.1/cmake-modules/FlairUseFile.cmake@ 55

Last change on this file since 55 was 10, checked in by Sanahuja Guillaume, 6 years ago

correct bugs

File size: 3.1 KB
Line 
1find_package(LibXml2 REQUIRED)
2find_package(Xenomai QUIET)
3
4if(NOT XENOMAI_FOUND)
5 warn("Xenomai not found, you will not be able to link a real time program")
6endif()
7
8execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
9 OUTPUT_VARIABLE GCC_VERSION)
10
11if (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()
17else()
18 message(STATUS "GCC version < 4.3, c+11 is not supported!")
19endif()
20
21SET(FLAIR_INCLUDE_DIR
22 ${LIBXML2_INCLUDE_DIR}
23 ${CMAKE_SYSROOT}/usr/include/opencv
24 ${FLAIR_DEV}/include/FlairCore
25)
26SET(FLAIR_LIBRARY_DIR
27 ${FLAIR_BIN}/lib/${ARCH_DIR}
28)
29
30SET(FLAIR_LIBRARIES
31 ${LIBXML2_LIBRARIES}
32 udt pthread cv cxcore highgui FileLib rt z
33)
34
35#VRPN for motion capture
36IF (FLAIR_USE_VRPN)
37 SET(FLAIR_LIBRARIES vrpn ${FLAIR_LIBRARIES})
38ENDIF (FLAIR_USE_VRPN)
39
40#nmea for GPS
41IF (FLAIR_USE_GPS)
42 SET(FLAIR_LIBRARIES nmea ${FLAIR_LIBRARIES})
43ENDIF (FLAIR_USE_GPS)
44
45#core, will be replace by rt or nrt version at the end
46SET(FLAIR_LIBRARIES FlairCore ${FLAIR_LIBRARIES})
47
48#sensor and actuator lib
49IF (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})
52ENDIF (FLAIR_USE_SENSOR_ACTUATOR)
53
54#filter lib
55IF (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})
58ENDIF (FLAIR_USE_FILTER)
59
60#meta lib
61IF (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})
64ENDIF (FLAIR_USE_META)
65
66#simulator lib
67IF (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()
86ENDIF (FLAIR_USE_SIMULATOR)
87
88#set RT or NRT specific libraries
89set(FLAIR_LIBRARIES_RT ${FLAIR_LIBRARIES} ${XENOMAI_LIBRARIES})
90
91list(FIND FLAIR_LIBRARIES_RT "FlairCore" POS)
92if(POS GREATER -1)
93 list(REMOVE_AT FLAIR_LIBRARIES_RT ${POS})
94 list(INSERT FLAIR_LIBRARIES_RT ${POS} "${FLAIR_LIBRARY_DIR}/libFlairCore_rt.a")
95endif()
96
97set(FLAIR_LIBRARIES_NRT ${FLAIR_LIBRARIES})
98
99list(FIND FLAIR_LIBRARIES_NRT "FlairCore" POS)
100if(POS GREATER -1)
101 list(REMOVE_AT FLAIR_LIBRARIES_NRT ${POS})
102 list(INSERT FLAIR_LIBRARIES_NRT ${POS} "${FLAIR_LIBRARY_DIR}/libFlairCore_nrt.a")
103endif()
104
Note: See TracBrowser for help on using the repository browser.