source: libs/FindYARP.cmake @ 445

Revision 445, 2.4 KB checked in by lmalek, 10 years ago (diff)

Samgar edition by WRUT. Based on Qt. Initial import.

Line 
1# - Try to find YARP
2# Once done this will define
3#
4#  YARP_FOUND - system has YARP
5#  YARP_INCLUDE_DIRS - the YARP include directory
6#  YARP_LIBRARIES - Link these to use YARP
7#  YARP_DEFINITIONS - Compiler switches required for using YARP
8#
9#  Copyright (c) 2008 Stefán Freyr Stefánsson <[EMAIL PROTECTED]>
10#
11#  Redistribution and use is allowed according to the terms of the New
12#  BSD license.
13#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14#
15
16
17if (YARP_LIBRARIES AND YARP_INCLUDE_DIRS)
18  # in cache already
19  set(YARP_FOUND TRUE)
20else (YARP_LIBRARIES AND YARP_INCLUDE_DIRS)
21  find_path(YARP_INCLUDE_DIR
22    NAMES
23      yarp/os/all.h yarp/dev/all.h yarp/sig/all.h
24    PATHS
25      /usr/include
26      /usr/local/include
27      /opt/local/include
28      /sw/include
29  )
30
31  find_library(YARP_OS_LIBRARY
32    NAMES
33      YARP_OS
34    PATHS
35      /usr/lib
36      /usr/local/lib
37      /opt/local/lib
38      /sw/lib
39  )
40  find_library(YARP_DEV_LIBRARY
41    NAMES
42      YARP_dev
43    PATHS
44      /usr/lib
45      /usr/local/lib
46      /opt/local/lib
47      /sw/lib
48  )
49  find_library(YARP_SIG_LIBRARY
50    NAMES
51      YARP_sig
52    PATHS
53      /usr/lib
54      /usr/local/lib
55      /opt/local/lib
56      /sw/lib
57  )
58
59  if (YARP_OS_LIBRARY)
60    set(YARP_OS_FOUND TRUE)
61  endif (YARP_OS_LIBRARY)
62  if (YARP_DEV_LIBRARY)
63    set(YARP_DEV_FOUND TRUE)
64  endif (YARP_DEV_LIBRARY)
65  if (YARP_SIG_LIBRARY)
66    set(YARP_SIG_FOUND TRUE)
67  endif (YARP_SIG_LIBRARY)
68
69  set(YARP_INCLUDE_DIRS
70    ${YARP_INCLUDE_DIR}
71  )
72
73  if (YARP_OS_FOUND)
74    set(YARP_LIBRARIES
75      ${YARP_LIBRARIES}
76      ${YARP_OS_LIBRARY}
77    )
78  endif (YARP_OS_FOUND)
79  if (YARP_DEV_FOUND)
80    set(YARP_LIBRARIES
81      ${YARP_LIBRARIES}
82      ${YARP_DEV_LIBRARY}
83    )
84  endif (YARP_DEV_FOUND)
85  if (YARP_SIG_FOUND)
86    set(YARP_LIBRARIES
87      ${YARP_LIBRARIES}
88      ${YARP_SIG_LIBRARY}
89    )
90  endif (YARP_SIG_FOUND)
91
92  if (YARP_INCLUDE_DIRS AND YARP_LIBRARIES)
93     set(YARP_FOUND TRUE)
94  endif (YARP_INCLUDE_DIRS AND YARP_LIBRARIES)
95
96  if (YARP_FOUND)
97    if (NOT YARP_FIND_QUIETLY)
98      message(STATUS "Found YARP: ${YARP_LIBRARIES}")
99    endif (NOT YARP_FIND_QUIETLY)
100  else (YARP_FOUND)
101    if (YARP_FIND_REQUIRED)
102      message(FATAL_ERROR "Could not find YARP")
103    endif (YARP_FIND_REQUIRED)
104  endif (YARP_FOUND)
105
106  # show the YARP_INCLUDE_DIRS and YARP_LIBRARIES variables only in the advanced view
107  mark_as_advanced(YARP_INCLUDE_DIRS YARP_LIBRARIES)
108
109endif (YARP_LIBRARIES AND YARP_INCLUDE_DIRS)
Note: See TracBrowser for help on using the repository browser.