From bddeea2d25ccdff297b87aa0d4ed02d1c497870d Mon Sep 17 00:00:00 2001 From: vurusovs Date: Fri, 28 May 2021 13:44:05 +0300 Subject: [PATCH] Make stress tests dependent on IE gflags 3rdparty from samples/ --- tests/stress_tests/CMakeLists.txt | 20 +++++++++++++++++++ .../memcheck_tests/CMakeLists.txt | 12 ----------- .../memleaks_tests/CMakeLists.txt | 12 ----------- tests/stress_tests/unittests/CMakeLists.txt | 12 ----------- 4 files changed, 20 insertions(+), 36 deletions(-) diff --git a/tests/stress_tests/CMakeLists.txt b/tests/stress_tests/CMakeLists.txt index 5a37fd9a7115e9..a5bffc3d6af787 100644 --- a/tests/stress_tests/CMakeLists.txt +++ b/tests/stress_tests/CMakeLists.txt @@ -9,11 +9,31 @@ if (CMAKE_BUILD_TYPE STREQUAL "") set(CMAKE_BUILD_TYPE "Release") endif() +set (GFLAGS_IS_SUBPROJECT TRUE) set (HAVE_SYS_STAT_H 1) set (HAVE_INTTYPES_H 1) set (INTTYPES_FORMAT C99) +set (BUILD_TESTING OFF) + find_package(InferenceEngineDeveloperPackage REQUIRED) +set(OpenVINO_MAIN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../") + +if(EXISTS "${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/samples/thirdparty/gflags") + function(add_gflags) + if(NOT WIN32) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-all") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-all") + endif() + set(BUILD_SHARED_LIBS OFF) + add_subdirectory(${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/samples/thirdparty/gflags + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + EXCLUDE_FROM_ALL) + set_target_properties(gflags_nothreads_static PROPERTIES FOLDER thirdparty) + endfunction() + add_gflags() +endif() + add_subdirectory(unittests) add_subdirectory(memleaks_tests) add_subdirectory(memcheck_tests) diff --git a/tests/stress_tests/memcheck_tests/CMakeLists.txt b/tests/stress_tests/memcheck_tests/CMakeLists.txt index 635797c58e752e..726fa50a037172 100644 --- a/tests/stress_tests/memcheck_tests/CMakeLists.txt +++ b/tests/stress_tests/memcheck_tests/CMakeLists.txt @@ -19,18 +19,6 @@ file (GLOB HDR # Create library file from sources. add_executable(${TARGET_NAME} ${HDR} ${SRC}) -include(FetchContent) -FetchContent_Declare( - gflags - GIT_REPOSITORY "https://github.com/gflags/gflags.git" - GIT_TAG "v2.2.2" -) -FetchContent_GetProperties(gflags) -if(NOT gflags_POPULATED) - FetchContent_Populate(gflags) - add_subdirectory(${gflags_SOURCE_DIR} ${gflags_BINARY_DIR}) -endif() - target_link_libraries(${TARGET_NAME} IE::gtest IE::gtest_main diff --git a/tests/stress_tests/memleaks_tests/CMakeLists.txt b/tests/stress_tests/memleaks_tests/CMakeLists.txt index c24e43433d2bff..b5eecf0547aeb7 100644 --- a/tests/stress_tests/memleaks_tests/CMakeLists.txt +++ b/tests/stress_tests/memleaks_tests/CMakeLists.txt @@ -20,18 +20,6 @@ file (GLOB HDR # Create library file from sources. add_executable(${TARGET_NAME} ${HDR} ${SRC}) -include(FetchContent) -FetchContent_Declare( - gflags - GIT_REPOSITORY "https://github.com/gflags/gflags.git" - GIT_TAG "v2.2.2" -) -FetchContent_GetProperties(gflags) -if(NOT gflags_POPULATED) - FetchContent_Populate(gflags) - add_subdirectory(${gflags_SOURCE_DIR} ${gflags_BINARY_DIR}) -endif() - target_link_libraries(${TARGET_NAME} IE::gtest IE::gtest_main diff --git a/tests/stress_tests/unittests/CMakeLists.txt b/tests/stress_tests/unittests/CMakeLists.txt index fea767898f7bf7..e67191a9ed61ec 100644 --- a/tests/stress_tests/unittests/CMakeLists.txt +++ b/tests/stress_tests/unittests/CMakeLists.txt @@ -20,18 +20,6 @@ file (GLOB HDR # Create library file from sources. add_executable(${TARGET_NAME} ${HDR} ${SRC}) -include(FetchContent) -FetchContent_Declare( - gflags - GIT_REPOSITORY "https://github.com/gflags/gflags.git" - GIT_TAG "v2.2.2" -) -FetchContent_GetProperties(gflags) -if(NOT gflags_POPULATED) - FetchContent_Populate(gflags) - add_subdirectory(${gflags_SOURCE_DIR} ${gflags_BINARY_DIR}) -endif() - target_link_libraries(${TARGET_NAME} IE::gtest IE::gtest_main