forked from ZickZakk/HTWK_SmartDriving_2015
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AADCConfig.cmake
101 lines (87 loc) · 3.6 KB
/
AADCConfig.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# execute just once
if(AADC_FOUND)
message(STATUS "AADC config file already found.")
return()
endif(AADC_FOUND)
set(AADC_OPENCV_FOUND FALSE)
set(AADC_OPENNI2_FOUND FALSE)
set(AADC_ZBAR_FOUND FALSE)
#-------OpenCV------------------------------------------
find_package(OpenCV
REQUIRED
COMPONENTS
opencv_core
opencv_video
opencv_imgproc
opencv_highgui
opencv_features2d
opencv_nonfree
PATHS
"/opt/arm-linux-gnueabihf/SDK/gcc-4.8/opencv/3.0.0"
"C:/SDK/opencv/3.0.0/build"
"C:/SDK/opencv/3.0.0"
)
if(NOT OpenCV_LIBS)
message(FATAL_ERROR "Opencv lib not found. Please specify the OPENCV_DIR")
else(NOT OpenCV_LIBS)
set(AADC_OPENCV_FOUND TRUE)
if(NOT UNIX)
set(OpenCV_INCLUDE_DIR "C:/SDK/opencv/3.0.0/build/include" CACHE PATH "The include directory of Opencv")
endif(NOT UNIX)
endif(NOT OpenCV_LIBS)
#--------OpenNI2----------------------------------------
# OpenNI does not provide a CMake config file.
# So we have to set it from the outside.
if(UNIX)
set(OPENNI2_DIR "/opt/arm-linux-gnueabihf/SDK/gcc-4.8/OpenNi/2.2.0" CACHE PATH "The root directory of OpenNI2")
else(UNIX)
set(OPENNI2_DIR "C:/SDK/OpenNI2" CACHE PATH "The root directory of OpenNI2")
endif(UNIX)
FIND_LIBRARY(OPENNI2_LIBS
NAMES
OpenNI2
PATHS
"${OPENNI2_DIR}/Bin/Arm-Release/"
"${OPENNI2_DIR}/Lib"
PATH_SUFFIXES so
)
#set(OPENNI2_DIR "/home/parallels/Desktop/OpenNI-master/Platform/Linux/Redist/OpenNI-Bin-Dev-Linux-x64-v1.5.7.10" CACHE PATH "The root directory of OpenNI2")
#message(FATAL_ERROR "${OPENNI2_DIR}")
if(NOT OPENNI2_LIBS)
message(FATAL_ERROR "OpenNI2 lib not found. Please specify the OPENNI2_DIR")
else(NOT OPENNI2_LIBS)
set(AADC_OPENNI2_FOUND TRUE)
endif(NOT OPENNI2_LIBS)
set(OPENNI2_INCLUDE_DIR "${OPENNI2_DIR}/Include/" CACHE PATH "The include directory of OpenNI2")
#--------zbar------------------------------------------
# zbar does not provide a CMake config file.
# So we have to set it from the outside.
# currently there is no x64 version for windows available.
if(NOT CMAKE_CL_64)
if(UNIX)
set(ZBAR_DIR "/opt/arm-linux-gnueabihf/SDK/gcc-4.6/zbar/0.10/install" CACHE PATH "The root directory of ZBar")
else(UNIX)
set(ZBAR_DIR "C:/SDK/ZBar" CACHE PATH "The root directory of ZBar")
endif(UNIX)
set(ZBAR_LIB_DIR "${ZBAR_DIR}/lib/" CACHE PATH "The lib directory of ZBar" )
set(ZBAR_BIN_DIR "${ZBAR_DIR}/bin/" CACHE PATH "The bin directory of ZBar" )
FIND_LIBRARY(ZBAR_LIBS
NAMES
zbar
libzbar-0
PATHS
"${ZBAR_LIB_DIR}"
)
if(NOT ZBAR_LIBS)
message(FATAL_ERROR "ZBar lib not found. Please specify the ZBAR_DIR.")
else(NOT ZBAR_LIBS)
set(AADC_ZBAR_FOUND TRUE)
endif(NOT ZBAR_LIBS)
set(ZBAR_INCLUDE_DIR "${ZBAR_DIR}/include/" CACHE PATH "The include directory of ZBar" )
else(NOT CMAKE_CL_64)
# hack to avoid running this config file again.
set(AADC_ZBAR_FOUND TRUE)
endif(NOT CMAKE_CL_64)
if(NOT AADC_OPENCV_FOUND OR NOT AADC_OPENNI2_FOUND OR NOT AADC_ZBAR_FOUND)
message(FATAL "At least one of the required libraries is not found")
endif(NOT AADC_OPENCV_FOUND OR NOT AADC_OPENNI2_FOUND OR NOT AADC_ZBAR_FOUND)