Restore rP297047 accidentally reverted by rP313633. This ensures cairo is installed before the check is triggered. It also eliminates the need to use .include <bsd.port.pre.mk> to use ${LOCALBASE}.
Let's go a step further and invoke pkg-config as the port already has USES=pkgconfig and convert ${ECHO_CMD} to ${ECHO_MSG} per Porter's Handbook.