I've reproduced the error. A possible fix would be to extend
pkg_check_module and pkg_search_module to allow globally imported
targets, i.e. to add an IMPORTED_GLOBAL_TARGET or GLOBAL keyword (where
the latter is only usable together with IMPORTED_TARGET) to allow
similar control as
It seems that CMake does not find PkgConfig::GooCanvas because it is
imported but not globally imported, i.e. it is maybe a visibility problem.
For reference, the relaxation of this limitation
(https://gitlab.kitware.com/cmake/cmake/merge_requests/2040) is covered
by this additional check for
> There is an easy workaround, but it feels nasty:
>
> add_library(osm2go_x_lib INTERFACE)
> target_link_libraries(osm2go_x_lib INTERFACE PkgConfig::GooCanvas)
> target_link_libraries(osm2go_lib PRIVATE osm2go_x_lib)
This also seems to be not "stackable", i.e. an additional interface library in
> * The "target_link_libraries()" command may now be called to modify
> targets created outside the current directory.
I played a bit around with that as I hope it would simplify some things in
OSM2go, but it looks there are still some limitations:
in main:
add_library(osm2go_lib ...)
I am proud to announce the second CMake 3.12 release candidate.
https://cmake.org/download/
Documentation is available at:
https://cmake.org/cmake/help/v3.12
Release notes appear below and are also published at
https://cmake.org/cmake/help/v3.12/release/3.12.html
Some of the more