Skip to content

Commit dc5bf79

Browse files
authored
Merge pull request #211 from tritonuas/chore/integration-targets
add back integration targets
2 parents 009724f + 4c3e97b commit dc5bf79

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

CMakeLists.txt

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1)
66

77
# Disable in-source builds to prevent source tree corruption.
88
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
9-
message(FATAL_ERROR "
9+
message(FATAL_ERROR "
1010
FATAL: In-source builds are not allowed.
1111
You should create a separate directory for build files.
1212
If you think this error is wrong, try clearing cache:
@@ -57,7 +57,7 @@ project(obcpp VERSION 1.0)
5757
set(LOGURU_WITH_STREAMS TRUE)
5858

5959
# =============================
60-
# Dependencies
60+
# Dependencies
6161
set(FETCHCONTENT_QUIET FALSE)
6262
set(DEPS_DIRECTORY ${PROJECT_SOURCE_DIR}/deps)
6363

@@ -103,11 +103,11 @@ add_definitions( -DMAGICKCORE_HDRI_ENABLE=0 )
103103

104104
find_package(ImageMagick COMPONENTS Magick++ REQUIRED)
105105
# =============================
106-
# Build speed up
106+
# Build speed up
107107

108108
# function to enable unity build for a target
109109
function(set_unity_for_target target_name)
110-
set_target_properties(${target_name} PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE BATCH UNITY_BUILD_BATCH_SIZE 16 UNITY_BUILD_UNIQUE_ID "MY_UNITY_ID")
110+
set_target_properties(${target_name} PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE BATCH UNITY_BUILD_BATCH_SIZE 16 UNITY_BUILD_UNIQUE_ID "MY_UNITY_ID")
111111
endfunction()
112112

113113
# =============================
@@ -120,6 +120,22 @@ add_subdirectory(src)
120120
# =============================
121121
# Integration tests
122122

123+
add_subdirectory(tests/integration)
124+
125+
# cuda_check
126+
add_executable(cuda_check ${SOURCES} tests/integration/cuda_check.cpp)
127+
target_add_torch(cuda_check)
128+
target_add_json(cuda_check)
129+
target_add_httplib(cuda_check)
130+
target_add_mavsdk(cuda_check)
131+
target_add_matplot(cuda_check)
132+
target_add_protobuf(cuda_check)
133+
target_add_opencv(cuda_check)
134+
target_add_loguru(cuda_check)
135+
# for some reason calling target_add_imagemagick here conflicts with, so we are including/linking without the function call
136+
# target_add_imagemagick(cuda_check)
137+
target_include_directories(cuda_check PRIVATE ${ImageMagick_INCLUDE_DIRS})
138+
target_link_libraries(cuda_check PRIVATE -Wl,--copy-dt-needed-entries ${ImageMagick_LIBRARIES})
123139

124140
# =============================
125141

@@ -131,7 +147,7 @@ add_subdirectory(${DEPS_DIRECTORY}/google-test)
131147

132148
# =============================
133149
# Pull models
134-
add_custom_target(pull_models
150+
add_custom_target(pull_models
135151
DEPENDS pull_saliency pull_matching pull_segmentation
136152
)
137153

@@ -141,7 +157,7 @@ add_custom_target(pull_saliency
141157
USES_TERMINAL
142158
)
143159

144-
# Matching model
160+
# Matching model
145161
add_custom_target(pull_matching
146162
COMMAND gdown 1NeFiAfSSLXAZWlehfd0ox7p_jFF4YdrO -O ${CMAKE_BINARY_DIR}/../models/target_siamese_1.pt
147163
USES_TERMINAL
@@ -158,7 +174,7 @@ add_custom_target(pull_segmentation
158174
# =============================
159175
# Pull testing images
160176
add_custom_target(pull_test_images
161-
DEPENDS pull_matching_test_images pull_saliency_test_images
177+
DEPENDS pull_matching_test_images pull_saliency_test_images
162178
)
163179

164180
# pull cropped images from fraternal_targets testing folder
@@ -176,13 +192,13 @@ add_custom_target(pull_saliency_test_images
176192
# =============================
177193

178194
# =============================
179-
# Linting
195+
# Linting
180196

181197
# Adding lint target if cpplint executable is found
182198
find_program(CPPLINT "cpplint")
183199
if(CPPLINT)
184-
# define lint target
185-
add_custom_target(lint
200+
# define lint target
201+
add_custom_target(lint
186202
COMMAND cpplint
187203
# Do not require licenses, TODO assignment, Google versions of C++ libs
188204
# also don't check for runtime/references since Google's public style guidelines are behind https://github.com/cpplint/cpplint/issues/148
@@ -195,6 +211,6 @@ if(CPPLINT)
195211
../include
196212
)
197213
else()
198-
message(FATAL_ERROR "cpplint executable not found. Check the README for steps to install it on your system")
214+
message(FATAL_ERROR "cpplint executable not found. Check the README for steps to install it on your system")
199215
endif()
200216
# =============================

include/cv/classification.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#ifndef INCLUDE_CV_CLASSIFICATION_HPP_
22
#define INCLUDE_CV_CLASSIFICATION_HPP_
33

4-
#include "cv/utilities.hpp"
54
#include <torch/torch.h>
6-
#include "cv/segmentation.hpp"
75

86
#include <map>
7+
#include <string>
8+
9+
#include "cv/utilities.hpp"
10+
#include "cv/segmentation.hpp"
11+
912

1013

1114
struct ClassificationResults {

0 commit comments

Comments
 (0)