Detect opencv with world

This commit is contained in:
John Zhao 2018-06-08 00:48:25 +08:00
parent 064b536822
commit 0af640015b
3 changed files with 14 additions and 3 deletions

View File

@ -25,6 +25,11 @@ else()
add_definitions(-DUSE_OPENCV4)
endif()
list(FIND OpenCV_LIBS "opencv_world" __index)
if(${__index} GREATER -1)
set(WITH_OPENCV_WORLD TRUE)
endif()
if(MSVC OR MSYS OR MINGW)
get_filename_component(OpenCV_LIB_SEARCH_PATH "${OpenCV_LIB_PATH}/../bin" ABSOLUTE)
else()

View File

@ -19,6 +19,7 @@ OpenCV_VERSION_MINOR: @OpenCV_VERSION_MINOR@
OpenCV_VERSION_PATCH: @OpenCV_VERSION_PATCH@
OpenCV_VERSION_TWEAK: @OpenCV_VERSION_TWEAK@
OpenCV_VERSION_STATUS: "@OpenCV_VERSION_STATUS@"
OpenCV_WITH_WORLD: "@WITH_OPENCV_WORLD@"
MYNTEYE_VERSION: "@mynteye_VERSION@"
MYNTEYE_VERSION_MAJOR: @mynteye_VERSION_MAJOR@
MYNTEYE_VERSION_MINOR: @mynteye_VERSION_MINOR@

View File

@ -127,6 +127,8 @@ std::vector<std::string> get_plugin_paths() {
// int opencv_version_patch = fs["OpenCV_VERSION_PATCH"];
// int opencv_version_tweak = fs["OpenCV_VERSION_TWEAK"];
// std::string opencv_version_status = fs["OpenCV_VERSION_STATUS"];
std::string opencv_with_world = fs["OpenCV_WITH_WORLD"];
to_lower(opencv_with_world);
std::string mynteye_version = fs["MYNTEYE_VERSION"];
// int mynteye_version_major = fs["MYNTEYE_VERSION_MAJOR"];
@ -159,10 +161,13 @@ std::vector<std::string> get_plugin_paths() {
// lib_prefix + "plugin_b_ocl" + ocl_version,
lib_prefix + "plugin_g_cuda" + cuda_version,
};
std::string opencv_name("_opencv" + opencv_version);
if (opencv_with_world == "true") {
opencv_name.append("-world");
}
for (auto &&prefix : prefixes) {
names.push_back(
prefix + "_opencv" + opencv_version + "_mynteye" + mynteye_version);
names.push_back(prefix + "_opencv" + opencv_version);
names.push_back(prefix + opencv_name + "_mynteye" + mynteye_version);
names.push_back(prefix + opencv_name);
names.push_back(prefix);
}
for (auto &&name : names) {