-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
38 lines (30 loc) · 1.15 KB
/
Copy pathCMakeLists.txt
File metadata and controls
38 lines (30 loc) · 1.15 KB
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
#Project
project(cork)
cmake_minimum_required(VERSION 2.8)
#Macro to get the current username
macro(whoami out)
execute_process(
COMMAND whoami
OUTPUT_VARIABLE ${out}
OUTPUT_STRIP_TRAILING_WHITESPACE)
endmacro(whoami)
find_package(OpenCV REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
whoami(WHOAMI)
set(CMAKE_CXX_STANDARD 11)
set(TISCAMERA_DIR /home/${WHOAMI}/tiscamera)
#Check if tiscamera directory exists
if(NOT IS_DIRECTORY "${TISCAMERA_DIR}/examples/cpp/common")
message("Error : TISCAMERA_DIR not set to tiscamera directory. Please correct CMakeLists.txt.")
return()
endif()
#Check modules
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0)
pkg_check_modules(TCAMLIB tcam)
#Includes
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${TISCAMERA_DIR}/examples/cpp/common ${GSTREAMER_INCLUDE_DIRS} ${TCAM_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
add_definitions(${GSTREAMER_CFLAGS_OTHER})
#Build main
add_executable(cork ./source/main.cpp ${TISCAMERA_DIR}/examples/cpp/common/tcamcamera.cpp)
target_link_libraries(cork ${OpenCV_LIBS} ${TCAMLIB_LIBRARIES} ${GSTREAMER_LIBRARIES} Threads::Threads)