-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (40 loc) · 1.64 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_policy(SET CMP0048 NEW)
project(TELICAM_DRIVER VERSION 1.0.0)
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 17)
##################################################
# Options
##################################################
option(BUILD_VIEWER "Build viewer" ON)
##################################################
# Dependencies
##################################################
# OpenCV
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
# Telicam SDK
set(TELICAM_INCLUDE_DIR "/opt/TeliCamSDK/include")
set(TELICAM_LIB_DIR "/opt/TeliCamSDK/lib")
# JSON (for viewer)
if(BUILD_VIEWER)
include(FetchContent)
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz)
FetchContent_Declare(cli11 URL https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.3.1.tar.gz)
FetchContent_MakeAvailable(json cli11)
endif()
include_directories(${TELICAM_INCLUDE_DIR})
link_directories(${TELICAM_LIB_DIR})
include_directories(include)
################################################
# Targets
################################################
# Executable
if(BUILD_VIEWER)
add_executable(telicam_viewer src/telicam.cpp src/telicam_viewer.cpp)
target_link_libraries(telicam_viewer ${OpenCV_LIBS} TeliCamApi_64 TeliCamUtl_64 nlohmann_json::nlohmann_json CLI11::CLI11)
endif()
# Library
add_library(telicam SHARED src/telicam.cpp)
set_target_properties(telicam PROPERTIES PUBLIC_HEADER include/telicam.hpp)
target_link_libraries(telicam ${OpenCV_LIBS} TeliCamApi_64 TeliCamUtl_64)
install(TARGETS telicam LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include/telicam)