Check if pkgcfg has package
pkg-config –exists returns 0 only if the package exists
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | name |
Package name |
logical function pkgcfg_has_package(name) result(success) !> Package name character(*), intent(in) :: name integer :: exitcode logical :: cmdok type(string_t) :: log call run_wrapper(wrapper=string_t('pkg-config'), & args=[string_t(name),string_t('--exists')], & exitcode=exitcode,cmd_success=cmdok,screen_output=log) !> pkg-config --exists returns 0 only if the package exists success = cmdok .and. exitcode==0 end function pkgcfg_has_package