1 | # - Try to find the Xenomai Real-Time
|
---|
2 | # Will define:
|
---|
3 | #
|
---|
4 | # XENOMAI_INCLUDE_DIR - Include directories needed to use the C++ driver
|
---|
5 | # XENOMAI_INCLUDE_POSIX_DIR - Include directories for POSIX systems
|
---|
6 | # XENOMAI_POSIX_WRAPPERS - Directories containing the libraries (win)
|
---|
7 | # XENOMAI_LIBRARY_XENOMAI - Xenomai library
|
---|
8 | # XENOMAI_LIBRARY_NATIVE - Native library
|
---|
9 | # XENOMAI_LIBRARY_PTHREAD_RT -
|
---|
10 | # XENOMAI_LIBRARY_RTDM -
|
---|
11 | # XENOMAI_DEFINITIONS - Xenomai definitions / compiler flags
|
---|
12 | #
|
---|
13 | # Possible hints:
|
---|
14 | # XENOMAI_ROOT - root directory of the TBB installation
|
---|
15 | #
|
---|
16 | # Copyright (C) 2010 by Arne Nordmann <anordman at cor-lab dot de>
|
---|
17 | #
|
---|
18 | # This file may be licensed under the terms of the
|
---|
19 | # GNU Lesser General Public License Version 3 (the ``LGPL''),
|
---|
20 | # or (at your option) any later version.
|
---|
21 | #
|
---|
22 | # Software distributed under the License is distributed
|
---|
23 | # on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
|
---|
24 | # express or implied. See the LGPL for the specific language
|
---|
25 | # governing rights and limitations.
|
---|
26 | #
|
---|
27 | # You should have received a copy of the LGPL along with this
|
---|
28 | # program. If not, go to http://www.gnu.org/licenses/lgpl.html
|
---|
29 | # or write to the Free Software Foundation, Inc.,
|
---|
30 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
---|
31 | #
|
---|
32 | # The development of this software was supported by:
|
---|
33 | # CoR-Lab, Research Institute for Cognition and Robotics
|
---|
34 | # Bielefeld University
|
---|
35 |
|
---|
36 | IF(UNIX)
|
---|
37 |
|
---|
38 | # Search Path
|
---|
39 | SET(XENOMAI_SEARCH_PATH ${ADDITIONAL_XENOMAI_SEARCH_PATH} /usr/include/xenomai /usr/local/xenomai /usr/xenomai/include /usr/xenomai /usr /include/xenomai)
|
---|
40 |
|
---|
41 | # Try to find xeno-config.h
|
---|
42 | FIND_PATH(XENOMAI_DIR xeno_config.h ${XENOMAI_SEARCH_PATH})
|
---|
43 |
|
---|
44 | IF(XENOMAI_DIR)
|
---|
45 | SET(XENOMAI_FOUND TRUE)
|
---|
46 |
|
---|
47 | SET(XENOMAI_INCLUDE_DIR ${XENOMAI_DIR})
|
---|
48 | SET(XENOMAI_INCLUDE_POSIX_DIR ${XENOMAI_DIR}/posix)
|
---|
49 |
|
---|
50 | # Find xenomai pthread
|
---|
51 |
|
---|
52 | FIND_LIBRARY(XENOMAI_LIBRARY_NATIVE native ${XENOMAI_DIR}/../../lib)
|
---|
53 | FIND_LIBRARY(XENOMAI_LIBRARY_XENOMAI xenomai ${XENOMAI_DIR}/../../lib)
|
---|
54 | FIND_LIBRARY(XENOMAI_LIBRARY_PTHREAD_RT pthread_rt rtdm ${XENOMAI_DIR}/../../lib)
|
---|
55 | FIND_LIBRARY(XENOMAI_LIBRARY_RTDM rtdm ${XENOMAI_DIR}/../../lib)
|
---|
56 | FIND_LIBRARY(XENOMAI_LIBRARY_RTDK rtdk ${XENOMAI_DIR}/../../lib)
|
---|
57 |
|
---|
58 | SET(XENOMAI_LIBRARIES ${XENOMAI_LIBRARY_RTDM} ${XENOMAI_LIBRARY_NATIVE})
|
---|
59 | IF(XENOMAI_LIBRARY_XENOMAI)
|
---|
60 | SET(XENOMAI_LIBRARIES ${XENOMAI_LIBRARIES} ${XENOMAI_LIBRARY_XENOMAI} )
|
---|
61 | ENDIF()
|
---|
62 | IF(XENOMAI_LIBRARY_RTDK)#old xenomai (2.4.7 cube)
|
---|
63 | SET(XENOMAI_LIBRARIES ${XENOMAI_LIBRARIES} ${XENOMAI_LIBRARY_RTDK} )
|
---|
64 | ENDIF()
|
---|
65 | # Find posix wrappers
|
---|
66 | FIND_FILE(XENOMAI_POSIX_WRAPPERS lib/posix.wrappers ${XENOMAI_SEARCH_PATH})
|
---|
67 |
|
---|
68 | # Add compile/preprocess options
|
---|
69 | SET(XENOMAI_DEFINITIONS "-D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__")
|
---|
70 |
|
---|
71 | ENDIF(XENOMAI_DIR)
|
---|
72 |
|
---|
73 | ENDIF(UNIX)
|
---|
74 |
|
---|
75 | INCLUDE(FindPackageHandleStandardArgs)
|
---|
76 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xenomai DEFAULT_MSG XENOMAI_DIR)
|
---|