forked from unitreerobotics/UnitreecameraSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
34 lines (27 loc) · 1.06 KB
/
CMakeLists.txt
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
cmake_minimum_required( VERSION 2.8 )
project( UnitreeCameraSDK )
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bins/)
find_package(OpenCV 4 REQUIRED)
if(OpenCV_FOUND)
include_directories(${OpenCV_INCLUDE_DIR})
message(STATUS "OpenCV ${OpenCV_VERSION} FOUND")
message(STATUS ${OpenCV_LIBS})
if(${OpenCV_VERSION_MAJOR} EQUAL 4)
add_definitions(-DOPENCV_VERSION_4)
elseif(${OpenCV_VERSION_MAJOR} LESS 4)
add_definitions(-DOPENCV_VERSION_3)
endif()
else()
message(FATAL_ERROR "OpenCV Library Not Found")
endif()
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/amd64/)
link_directories(${PROJECT_SOURCE_DIR}/lib/amd64/)
else()
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/arm64/)
link_directories(${PROJECT_SOURCE_DIR}/lib/arm64/)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
include_directories(${PROJECT_SOURCE_DIR}/include)
set(SDKLIBS unitree_camera tstc_V4L2_xu_camera udev systemlog ${OpenCV_LIBS})
add_subdirectory(${PROJECT_SOURCE_DIR}/examples)