Skip to content

Commit

Permalink
remove unused includes, use target_compile_definitions instead of add…
Browse files Browse the repository at this point in the history
…_definitions
  • Loading branch information
luo-cheng2021 committed Apr 15, 2021
1 parent 4cdb4bb commit d7d1ef9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 5 additions & 1 deletion inference-engine/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,13 @@ include(CMakeParseArguments)
# [INCLUDE_DIRECTORIES <include dir>]
# [DEPENDENCIES <dependencies>]
# [OPENCV_DEPENDENCIES <opencv modules>]
# [MACRO_DEFINITIONS <definitions>]
# [EXCLUDE_CPPLINT]
#
macro(ie_add_sample)
set(options EXCLUDE_CPPLINT)
set(oneValueArgs NAME)
set(multiValueArgs SOURCES HEADERS DEPENDENCIES OPENCV_DEPENDENCIES INCLUDE_DIRECTORIES)
set(multiValueArgs SOURCES HEADERS DEPENDENCIES OPENCV_DEPENDENCIES INCLUDE_DIRECTORIES MACRO_DEFINITIONS)
cmake_parse_arguments(IE_SAMPLE "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )

Expand All @@ -217,6 +218,9 @@ macro(ie_add_sample)
if(IE_SAMPLE_OPENCV_DEPENDENCIES)
target_compile_definitions(${IE_SAMPLE_NAME} PRIVATE USE_OPENCV)
endif()
if(IE_SAMPLE_MACRO_DEFINITIONS)
target_compile_definitions(${IE_SAMPLE_NAME} PRIVATE ${IE_SAMPLE_MACRO_DEFINITIONS})
endif()

set(folder_name cpp_samples)
if(IE_SAMPLE_NAME MATCHES ".*_c$")
Expand Down
11 changes: 5 additions & 6 deletions inference-engine/samples/benchmark_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ if(HddlUnite_FOUND)
# test kmb_plugin directory
if(EXISTS ${KMBPLUGIN_HOME}/include/)
set(HDDL2_PARAMS_DIR ${KMBPLUGIN_HOME}/include/)
add_definitions(-DUSE_REMOTE_MEM)
set(HDDL2_DEP "HddlUnite::HddlUnite")
set(HDDL2_DEFINITION USE_REMOTE_MEM)
set(HDDL2_DEPENDENCE "HddlUnite::HddlUnite")
else()
message(WARNING "kmb_plugin/include could not find. Preallocating memory in remote device feature is disabled.")
remove_definitions(-DUSE_REMOTE_MEM)
endif()
endif()

ie_add_sample(NAME benchmark_app
SOURCES ${SRC}
HEADERS ${HDR}
DEPENDENCIES format_reader ${HDDL2_DEP}
DEPENDENCIES format_reader ${HDDL2_DEPENDENCE}
OPENCV_DEPENDENCIES imgcodecs
INCLUDE_DIRECTORIES ${HDDL2_PARAMS_DIR})

INCLUDE_DIRECTORIES ${HDDL2_PARAMS_DIR}
MACRO_DEFINITIONS ${HDDL2_DEFINITION})
1 change: 0 additions & 1 deletion inference-engine/samples/benchmark_app/inputs_filling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <samples/slog.hpp>

#include "inputs_filling.hpp"
#include "../../src/plugin_api/blob_factory.hpp"

using namespace InferenceEngine;

Expand Down

0 comments on commit d7d1ef9

Please sign in to comment.