pkg_check_modules IMPORTED_TARGET, no option for global target
There is no way to specify the target created from pkg_check_modules
to be global.
I have
find_package(PkgConfig REQUIRED)
pkg_check_modules(libavutil REQUIRED IMPORTED_TARGET libavutil>=55.78.100)
Then the target PkgConfig::libavutil
is not global. add_library
has the option to have a global imported target with the GLOBAL
specifier. For consistency this should be available in pkg_check_modules
also.
The obvious workaround does not work, because you can not have an alias to a non-global imported library, so I can not also alias afterwards.
The only thing left is to use pkg_check_modules
from the top CMakeLists.txt
.