Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compilation without OpenCV #2309

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions inference-engine/ie_bridges/c/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ set(TARGET_NAME "InferenceEngineCAPITests")
# Find OpenCV components if exist
find_package(OpenCV COMPONENTS imgcodecs videoio imgproc QUIET)
if(NOT OpenCV_FOUND)
message(WARNING "OPENCV is disabled or not found, " ${TARGET_NAME} " is built without OPENCV support")
else()
add_definitions(-DUSE_OPENCV)
message(WARNING "OPENCV is disabled or not found, " ${TARGET_NAME} " is disabled")
return()
endif()

add_executable(${TARGET_NAME} ie_c_api_test.cpp test_model_repo.hpp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(TARGET_NAME ieUnitTests)
# Find OpenCV components if exist
find_package(OpenCV COMPONENTS imgcodecs videoio imgproc QUIET)
if(NOT OpenCV_FOUND)
message(ERROR "OPENCV is disabled or not found, " ${TARGET_NAME} " needs OpenCV for its build")
message(WARNING "OPENCV is disabled or not found, " ${TARGET_NAME} " needs OpenCV for its build")
else()
add_definitions(-DUSE_OPENCV)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "precision_utils.h"
#include "ie_precision.hpp"

#ifdef USE_OPENCV

#include <opencv2/core.hpp>

using namespace InferenceEngine;
Expand Down Expand Up @@ -112,3 +114,5 @@ TEST_F(SaturateCastTestsU16ToI32, U16toI32FMaxToNonMax) {
const auto value = std::numeric_limits<fromType>::max();
EXPECT_EQ(PrecisionUtils::saturate_cast<toType>(value), cv::saturate_cast<toType>(value));
}

#endif // USE_OPENCV