I replace ${OpenCV_LIBRARIES} with sc_opencv.
I try to set ${sc_opencv} with MAP_IMPORTED_CONFIG_<CONFIG>
But ${sc_opencv} is empty with cmake message(${sc_opencv})
cmake_minimum_required (VERSION 3.8)
project(test)
find_package(OpenCV CONFIG REQUIRED)
add_executable (test "main.cpp")
add_library(sc_opencv
STATIC
IMPORTED)
set_property(
TARGET sc_opencv APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG
)
set_target_properties(sc_opencv PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "D:/TEST/debug/opencv/x64/vc16/lib"
)
target_include_directories(test PUBLIC
${OpenCV_INCLUDE_DIRS}
)
target_link_libraries(test PUBLIC
${sc_opencv}
)
Here is the ${OpenCV_LIBRARIES}
opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;