最近,我用openvino
完成了我的项目,并编写了CMakeLists.txt用于编译和生成目标,正如我所做的:
find_package(InferenceEngine 2.1 QUIET)
根据InferenceEngineConfig.cmake
,我知道将定义以下变量:
# This will define the following variables:
# InferenceEngine_FOUND - True if the system has the
# Inference Engine library
# InferenceEngine_INCLUDE_DIRS - Inference Engine include
directories
# InferenceEngine_LIBRARIES - Inference Engine libraries
在执行find_package()
之后,我执行:
include_directories(${OpenCV_INCLUDE_DIRS} ${InferenceEngine_INCLUDE_DIRS} )
并做所有它需要的事情来获取共享库,这正是我所需要的。
然而,当我删除这一行时:#include_directories(${OpenCV_INCLUDE_DIRS} ${InferenceEngine_INCLUDE_DIRS} )
一切仍然工作正常,这真的让我困惑...谁能告诉我这一切背后的逻辑?提前感谢!
1条答案
按热度按时间a8jjtwal1#
可能与
OpenCVConfig.cmake
和InferenceEngineConfig.cmake
文件的内容有关,我在OpenCVConfig.cmake
文件中发现了一个注解:include_directories(${OpenCV_INCLUDE_DIRS}) # Not needed for CMake >= 2.8.11
因此,我认为
include_directories()
在find_package(OpenCV)
完成时已经执行。