Pangolin icon indicating copy to clipboard operation
Pangolin copied to clipboard

[suggest] Provide `<pkg>::<comp>` Imported Targets with `pango::` namespace.

Open hwhsu1231 opened this issue 2 years ago • 0 comments

For example:

  • pango::core
  • pango::display
  • pango::geometry
  • pango::glgeometry
  • pango::image
  • pango::opengl
  • ...etc

While the syntax :: seems to be more modern and conventional in CMake, it has an obvious benefit.

If we try to use an IMPORTED target pango::display but forget to add it as a COMPONENT in find_package(). (BTW, I also hope that Pangolin introduce this kind of usage, like Qt, Boost, and Poco...etc)

find_package(Pangolin REQUIRED COMPONENTS core)
target_link_libraries(myEXE pango::core pango::display)

Then, CMake will report a FATAL_ERROR message according to the policy CMP0028.

Target "myExe" links to target "pango::display" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

hwhsu1231 avatar Aug 15 '22 12:08 hwhsu1231