-
Notifications
You must be signed in to change notification settings - Fork 5
/
FindOnion.cmake
58 lines (51 loc) · 1.19 KB
/
FindOnion.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Search libfreenect header and libary
find_path(Onion_INCLUDE_DIR
NAMES
onion/onion.h
onion/log.h
onion/extras/png.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
./lib/onion/include
# PATH_SUFFIXES
#libonion
)
find_path(Onion_LIBRARY_PATH
NAMES
libonion.so
PATHS
/usr/lib
/usr/local/lib64
/usr/local/lib
/opt/local/lib
./lib/onion/lib
)
find_path(Onion_BIN_DIR
NAMES
otemplate
PATHS
/usr/bin
/usr/local/bin
/opt/local/bin
./lib/onion/bin
)
if(Onion_BIN_DIR)
set(OTEMPLATE ${Onion_BIN_DIR}/otemplate)
endif(Onion_BIN_DIR)
if(Onion_INCLUDE_DIR AND Onion_LIBRARY_PATH AND Onion_BIN_DIR)
set(Onion_FOUND TRUE)
set(Onion_LIBS onion onion_extras onioncpp)
else(Onion_INCLUDE_DIR AND Onion_LIBRARY_PATH AND Onion_BIN_DIR)
set(Onion_FOUND FALSE)
endif(Onion_INCLUDE_DIR AND Onion_LIBRARY_PATH AND Onion_BIN_DIR)
if(Onion_FOUND)
message(STATUS " Lib: onion")
message(STATUS " - Includes: ${Onion_INCLUDE_DIR}")
message(STATUS " - Link: ${Onion_LIBS}")
message(STATUS " - Library path: ${Onion_LIBRARY_PATH}")
message(STATUS " - Binaries: ${Onion_BIN_DIR}")
else(Onion_FOUND)
message(FATAL_ERROR "Could not find onion installation.")
endif(Onion_FOUND)