<h3 dir="auto">Feature Request</h3>
<p dir="auto">OpenCV already provides its own <strong>IMPORTED</strong> library targets. For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="opencv_calib3d
opencv_core
opencv_dnn
opencv_features2d
opencv_flann
opencv_gapi
opencv_highgui
..."><pre class="notranslate"><code class="notranslate">opencv_calib3d
opencv_core
opencv_dnn
opencv_features2d
opencv_flann
opencv_gapi
opencv_highgui
...
</code></pre></div>
<p dir="auto">However, I hope OpenCV can provide this form <code class="notranslate">pkg::comp</code> or <code class="notranslate">pkg::pkg</code> of <strong>IMPORTED</strong> library targets. For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="opencv::calib3d
opencv::core
opencv::dnn
opencv::features2d
opencv::flann
opencv::gapi
opencv::highgui
..."><pre class="notranslate"><code class="notranslate">opencv::calib3d
opencv::core
opencv::dnn
opencv::features2d
opencv::flann
opencv::gapi
opencv::highgui
...
</code></pre></div>
<p dir="auto">Because lots of other libraries take it.</p>
<h3 dir="auto">Some examples of other libraries</h3>
<ul dir="auto">
<li><a href="https://github.com/fmtlib/fmt/blob/8.1.1/CMakeLists.txt#L245"><code class="notranslate">fmt::fmt</code></a></li>
<li><a href="https://github.com/CLIUtils/CLI11/blob/v2.2.0/CMakeLists.txt#L156"><code class="notranslate">CLI11::CLI11</code></a></li>
<li><a href="https://github.com/libevent/libevent/blob/release-2.1.12-stable/cmake/LibeventConfig.cmake.in#L30"><code class="notranslate">libevent::core</code></a></li>
<li><a href="https://github.com/pocoproject/poco/blob/poco-1.11.3-release/Data/CMakeLists.txt#L21"><code class="notranslate">Poco::Data</code></a></li>
<li><a href="https://github.com/gabime/spdlog/blob/v1.9.2/CMakeLists.txt#L162"><code class="notranslate">spdlog::spdlog</code></a></li>
<li><a href="https://doc.qt.io/qt-6/qtcore-index.html#building-with-cmake" rel="nofollow"><code class="notranslate">Qt6::Core</code></a></li>
<li><a href="https://github.com/protocolbuffers/protobuf/blob/v3.21.2/cmake/libprotobuf.cmake#L134"><code class="notranslate">protobuf::libprotobuf</code></a></li>
<li><a href="https://github.com/boostorg/regex/blob/boost-1.79.0/CMakeLists.txt#L12"><code class="notranslate">Boost::regex</code></a></li>
<li><a href="https://gitlab.com/libeigen/eigen/-/blob/3.4/CMakeLists.txt#L597" rel="nofollow"><code class="notranslate">Eigen3::Eigen</code></a></li>
<li>...etc</li>
</ul>
<p dir="auto">While the syntax <code class="notranslate">::</code> seems to be more modern and conventional in cmake, it has a obvious benefit.</p>
<p dir="auto">The following won't get any error until the linking time with a undefined reference error to <code class="notranslate">cv::imshow</code>.</p>
<div class="highlight highlight-source-cmake notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="find_package(OpenCV 3.3 REQUIRED COMPONENTS core)
target_link_libraries(myExe opencv_core opencv_highgui)"><pre class="notranslate"><span class="pl-c1">find_package</span>(OpenCV 3.3 <span class="pl-k">REQUIRED</span> <span class="pl-k">COMPONENTS</span> core)
<span class="pl-c1">target_link_libraries</span>(myExe opencv_core opencv_highgui)</pre></div>
<p dir="auto">But if using <code class="notranslate">opencv::highgui</code>, we get a configuration error from cmake:</p>
<div class="highlight highlight-source-cmake notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Target &quot;myExe&quot; links to target &quot;opencv::highgui&quot; but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?"><pre class="notranslate">Target <span class="pl-s">"myExe"</span> links to target <span class="pl-s">"opencv::highgui"</span> but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?</pre></div>