FindPkgConfig always runs pkg-config --static even if it is not needed
When we run simple CMakeLists.txt
include(FindPkgConfig)
pkg_search_module(CAIRO REQUIRED cairo>=1.14.0)
it produces follow output:
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Checking for one of the modules 'cairo>=1.14.0'
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
Package 'pixman-1', required by 'cairo', not found
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
pixman-1 is not needed for dynamic linking, but FindPkgConfig always run pkg-config --static even if we don't need static linking.
Edited by Vitaly Lipatov