Skip to content

Commit ea35dbe

Browse files
committed
cmake: Add option to enable Hunter to fetch data
Co-authored-by: Petr Hodina
1 parent 79657eb commit ea35dbe

File tree

7 files changed

+266
-225
lines changed

7 files changed

+266
-225
lines changed

cmake/depthaiOptions.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ option(DEPTHAI_ENABLE_PROTOBUF "Enable Protobuf support" ON)
1818
option(DEPTHAI_ENABLE_CURL "Enable CURL support" ${DEPTHAI_DEFAULT_CURL_SUPPORT})
1919
option(DEPTHAI_ENABLE_KOMPUTE "Enable Kompute support" OFF)
2020
option(DEPTHAI_ENABLE_MP4V2 "Enable video recording using the MP4V2 library" ON)
21+
option(DEPTHAI_FETCH_ARTIFACTS "Enable fetching artifacts from remote repository" OFF)
2122

2223
# ---------- Optional Features (public) -------------
2324
option(DEPTHAI_OPENCV_SUPPORT "Enable optional OpenCV support" ON)

examples/cpp/AprilTags/CMakeLists.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@ cmake_minimum_required(VERSION 3.10)
55
## function: dai_set_example_test_labels(example_name ...)
66

77
# Download lenna :0
8-
private_data(
9-
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/images/april_tags.jpg"
10-
FILE "april_tags.jpg"
11-
SHA1 "6818a531e71948bd28e1f0ab3e76b18aff6150fb"
12-
LOCATION april_tags
13-
)
8+
if(DEPTHAI_FETCH_ARTIFACTS)
9+
private_data(
10+
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/images/april_tags.jpg"
11+
FILE "april_tags.jpg"
12+
SHA1 "6818a531e71948bd28e1f0ab3e76b18aff6150fb"
13+
LOCATION april_tags
14+
)
15+
endif
1416

1517
dai_add_example(april_tags april_tags.cpp ON OFF)
1618
dai_set_example_test_labels(april_tags ondevice rvc2_all rvc4 rvc4rgb ci)
1719

1820
dai_add_example(april_tags_12mp april_tags_12mp.cpp ON OFF)
1921
dai_set_example_test_labels(april_tags_12mp ondevice rvc2_all rvc4 rvc4rgb ci)
2022

21-
dai_add_example(april_tags_replay april_tags_replay.cpp ON OFF)
22-
target_compile_definitions(april_tags_replay PRIVATE APRIL_TAGS_PATH="${april_tags}")
23-
dai_set_example_test_labels(april_tags_replay ondevice rvc2_all rvc4 rvc4rgb ci)
23+
if(DEPTHAI_FETCH_ARTIFACTS)
24+
dai_add_example(april_tags_replay april_tags_replay.cpp ON OFF)
25+
target_compile_definitions(april_tags_replay PRIVATE APRIL_TAGS_PATH="${april_tags}")
26+
dai_set_example_test_labels(april_tags_replay ondevice rvc2_all rvc4 rvc4rgb ci)
27+
endif()

examples/cpp/DetectionNetwork/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ cmake_minimum_required(VERSION 3.10)
44
## function: dai_add_example(example_name example_src enable_test use_pcl)
55
## function: dai_set_example_test_labels(example_name ...)
66

7-
# Video file with objects to detect
8-
private_data(
9-
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/construction_vest.mp4"
10-
SHA1 "271d8d0b702e683ce02957db7c100843de5ceaec"
11-
FILE "construction_vest.mp4"
12-
LOCATION construction_vest
13-
)
7+
if(DEPTHAI_FETCH_ARTIFACTS)
8+
# Video file with objects to detect
9+
private_data(
10+
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/construction_vest.mp4"
11+
SHA1 "271d8d0b702e683ce02957db7c100843de5ceaec"
12+
FILE "construction_vest.mp4"
13+
LOCATION construction_vest
14+
)
15+
endif()
1416

15-
if(DEPTHAI_ENABLE_REMOTE_CONNECTION)
17+
if(DEPTHAI_ENABLE_REMOTE_CONNECTION AND DEPTHAI_FETCH_ARTIFACTS)
1618
dai_add_example(detection_network_replay detection_network_replay.cpp OFF OFF)
1719
target_compile_definitions(detection_network_replay PRIVATE VIDEO_PATH="${construction_vest}")
1820
endif()
@@ -21,4 +23,4 @@ dai_add_example(detection_network detection_network.cpp ON OFF)
2123
dai_set_example_test_labels(detection_network ondevice rvc2_all rvc4 rvc4rgb ci)
2224

2325
dai_add_example(detection_network_remap detection_network_remap.cpp ON OFF)
24-
dai_set_example_test_labels(detection_network_remap ondevice rvc2_all rvc4 ci)
26+
dai_set_example_test_labels(detection_network_remap ondevice rvc2_all rvc4 ci)

examples/cpp/ImageManip/CMakeLists.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@ cmake_minimum_required(VERSION 3.10)
66

77

88
# Download lenna :0
9-
private_data(
10-
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/images/lenna.png"
11-
FILE "lenna.png"
12-
SHA1 "3ee0d360dc12003c0d43e3579295b52b64906e85"
13-
LOCATION lenna
14-
)
9+
if(DEPTHAI_FETCH_ARTIFACTS)
10+
private_data(
11+
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/images/lenna.png"
12+
FILE "lenna.png"
13+
SHA1 "3ee0d360dc12003c0d43e3579295b52b64906e85"
14+
LOCATION lenna
15+
)
16+
endif()
1517

1618
dai_add_example(image_manip_resize image_manip_resize.cpp ON OFF)
1719
dai_set_example_test_labels(image_manip_resize ondevice rvc2_all rvc4 rvc4rgb ci)
1820

1921
dai_add_example(image_manip_multi_ops image_manip_multi_ops.cpp ON OFF)
2022
dai_set_example_test_labels(image_manip_multi_ops ondevice rvc2_all rvc4 rvc4rgb ci)
2123

22-
dai_add_example(image_manip_all_ops image_manip_all_ops.cpp ON OFF)
23-
target_compile_definitions(image_manip_all_ops PRIVATE LENNA_PATH="${lenna}")
24-
dai_set_example_test_labels(image_manip_all_ops ondevice rvc2_all rvc4 rvc4rgb ci)
24+
if(DEPTHAI_FETCH_ARTIFACTS)
25+
dai_add_example(image_manip_all_ops image_manip_all_ops.cpp ON OFF)
26+
target_compile_definitions(image_manip_all_ops PRIVATE LENNA_PATH="${lenna}")
27+
dai_set_example_test_labels(image_manip_all_ops ondevice rvc2_all rvc4 rvc4rgb ci)
28+
endif()
2529

2630
dai_add_example(image_manip_remap image_manip_remap.cpp ON OFF)
27-
dai_set_example_test_labels(image_manip_remap ondevice rvc2_all rvc4 rvc4rgb ci)
31+
dai_set_example_test_labels(image_manip_remap ondevice rvc2_all rvc4 rvc4rgb ci)

examples/cpp/NeuralNetwork/CMakeLists.txt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@ cmake_minimum_required(VERSION 3.10)
55
## function: dai_set_example_test_labels(example_name ...)
66

77
# Download lenna :0
8-
private_data(
9-
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/images/lenna.png"
10-
FILE "lenna.png"
11-
SHA1 "3ee0d360dc12003c0d43e3579295b52b64906e85"
12-
LOCATION lenna
13-
)
8+
if(DEPTHAI_FETCH_ARTIFACTS)
9+
private_data(
10+
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/images/lenna.png"
11+
FILE "lenna.png"
12+
SHA1 "3ee0d360dc12003c0d43e3579295b52b64906e85"
13+
LOCATION lenna
14+
)
15+
endif()
1416

1517
dai_add_example(neural_network neural_network.cpp ON OFF)
1618
dai_set_example_test_labels(neural_network ondevice rvc2_all rvc4 rvc4rgb ci)
1719

18-
dai_add_example(neural_network_multi_input neural_network_multi_input.cpp ON OFF)
19-
target_compile_definitions(neural_network_multi_input PRIVATE LENNA_PATH="${lenna}")
20-
dai_set_example_test_labels(neural_network_multi_input ondevice rvc2_all rvc4 rvc4rgb ci)
20+
if(DEPTHAI_FETCH_ARTIFACTS)
21+
dai_add_example(neural_network_multi_input neural_network_multi_input.cpp ON OFF)
22+
target_compile_definitions(neural_network_multi_input PRIVATE LENNA_PATH="${lenna}")
23+
dai_set_example_test_labels(neural_network_multi_input ondevice rvc2_all rvc4 rvc4rgb ci)
2124

22-
dai_add_example(neural_network_multi_input_combined neural_network_multi_input_combined.cpp ON OFF)
23-
target_compile_definitions(neural_network_multi_input_combined PRIVATE LENNA_PATH="${lenna}")
25+
dai_add_example(neural_network_multi_input_combined neural_network_multi_input_combined.cpp ON OFF)
26+
target_compile_definitions(neural_network_multi_input_combined PRIVATE LENNA_PATH="${lenna}")
27+
endif()

examples/cpp/RecordReplay/CMakeLists.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,25 @@ cmake_minimum_required(VERSION 3.10)
44
## function: dai_add_example(example_name example_src enable_test use_pcl)
55
## function: dai_set_example_test_labels(example_name ...)
66

7-
private_data(
8-
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/misc/recording.tar"
9-
SHA1 "b1e31a26c83dc1e315132c9226097da4b1a5cbb7"
10-
FILE "recording.tar"
11-
LOCATION recording_path
12-
)
7+
if(DEPTHAI_FETCH_ARTIFACTS)
8+
private_data(
9+
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/misc/recording.tar"
10+
SHA1 "b1e31a26c83dc1e315132c9226097da4b1a5cbb7"
11+
FILE "recording.tar"
12+
LOCATION recording_path
13+
)
14+
endif()
1315

1416
dai_add_example(replay_video_meta replay_video_meta.cpp OFF OFF)
1517

1618
dai_add_example(replay_video replay_video.cpp OFF OFF)
1719

1820
dai_add_example(replay_imu replay_imu.cpp OFF OFF)
1921

20-
dai_add_example(holistic_replay holistic_replay.cpp ON OFF)
21-
target_compile_definitions(holistic_replay PRIVATE RECORDING_PATH="${recording_path}")
22+
if(DEPTHAI_FETCH_ARTIFACTS)
23+
dai_add_example(holistic_replay holistic_replay.cpp ON OFF)
24+
target_compile_definitions(holistic_replay PRIVATE RECORDING_PATH="${recording_path}")
25+
endif()
2226

2327
dai_add_example(record_video record_video.cpp OFF OFF)
2428

@@ -28,4 +32,4 @@ dai_add_example(record_encoded record_encoded.cpp OFF OFF)
2832

2933
dai_add_example(record_raw record_raw.cpp OFF OFF)
3034

31-
dai_add_example(record_imu record_imu.cpp OFF OFF)
35+
dai_add_example(record_imu record_imu.cpp OFF OFF)

0 commit comments

Comments
 (0)