-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (34 loc) · 1.17 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
cmake_minimum_required(VERSION 3.14)
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO "RelWithDebInfo;Release;")
option(ROS_BUILD "Build in a ros workspace" OFF)
option(BUILD_DEPTHAI "Build all relevant dependencies" ${ROS_BUILD})
include(FetchContent)
if(BUILD_DEPTHAI)
MESSAGE("Building depthai locally...")
#SET(DEPTHAI_OPENCV_SUPPORT ON)
set(BUILD_SHARED_LIBS ON CACHE INTERNAL "Build SHARED libraries" FORCE)
FetchContent_Declare(
depthai-core
GIT_REPOSITORY https://github.com/constructiverealities/depthai.git
GIT_TAG e48fd69b5ff5e9923de4330cd9c6b42d85fd8374
)
FetchContent_MakeAvailable(depthai-core)
project(cr-dai-tools)
else()
project(cr-dai-tools)
find_package(depthai REQUIRED)
endif()
set(CMAKE_CXX_STANDARD 17)
if(NOT ROS_BUILD)
add_subdirectory(dai-tools)
else()
add_subdirectory(ros)
endif()
if(NOT ROS_BUILD)
add_executable(cr-dai-example ./apps/example.cc)
target_link_libraries(cr-dai-example cr-dai-tools)
install(TARGETS cr-dai-example DESTINATION bin)
if(WIN32)
install(FILES $<TARGET_PDB_FILE:cr-dai-example> DESTINATION bin OPTIONAL)
endif()
endif()