Following up on the What is the proper way to use FindPkgConfig
and FindPkgConfighttps://cmake.org/cmake/help/v3.17/module/FindPkgConfig.html?highlight=pkg_search_module#command:pkg_search_module
Could you please advise what is the use case for IMPORTED_TARGET.
The prefix (e,g, SDL2) variable (eg. SDL2_LIBRARIES ) is accepted by the target_link_libraries so what functionality is added by IMPORTED_TARGET named PkgConfig::<prefix>
( e.g. PkgConfig::SDL2, see snippet below) ?
IMPORTED targets are not allowed to be installed and I doubt this could be circumvented by somehow exporting _LIBRARIES, right?
include(FindPkgConfig)
pkg_search_module(SDL2 REQUIRED sdl2)
target_include_directories(app SYSTEM PUBLIC ${SDL2_INCLUDE_DIRS}
target_link_libraries(app ${SDL2_LIBRARIES})
is there a case when both _XXXX and PkgConfig:: are used?