diff --git a/inference-engine/ie_bridges/c/tests/CMakeLists.txt b/inference-engine/ie_bridges/c/tests/CMakeLists.txt index 4feae6bd93a30b..761c23aee9c2ea 100644 --- a/inference-engine/ie_bridges/c/tests/CMakeLists.txt +++ b/inference-engine/ie_bridges/c/tests/CMakeLists.txt @@ -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) diff --git a/inference-engine/tests/unit/inference_engine/CMakeLists.txt b/inference-engine/tests/unit/inference_engine/CMakeLists.txt index e4613f032608f5..a23ca053f83983 100644 --- a/inference-engine/tests/unit/inference_engine/CMakeLists.txt +++ b/inference-engine/tests/unit/inference_engine/CMakeLists.txt @@ -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() diff --git a/inference-engine/tests/unit/inference_engine/saturated_cast_test.cpp b/inference-engine/tests/unit/inference_engine/saturated_cast_test.cpp index c89169eb5c70c0..1667fb984fdd0c 100644 --- a/inference-engine/tests/unit/inference_engine/saturated_cast_test.cpp +++ b/inference-engine/tests/unit/inference_engine/saturated_cast_test.cpp @@ -8,6 +8,8 @@ #include "precision_utils.h" #include "ie_precision.hpp" +#ifdef USE_OPENCV + #include using namespace InferenceEngine; @@ -112,3 +114,5 @@ TEST_F(SaturateCastTestsU16ToI32, U16toI32FMaxToNonMax) { const auto value = std::numeric_limits::max(); EXPECT_EQ(PrecisionUtils::saturate_cast(value), cv::saturate_cast(value)); } + +#endif // USE_OPENCV