ARROW-7052: [C++] Fix linking of datasets example when ARROW_BUILD_SHARED=OFF
ARROW-7052: [C++] Fix linking of datasets example when ARROW_BUILD_SHARED=OFF

Closes #5776 from wesm/ARROW-7052 and squashes the following commits:

cd246c60e <Wes McKinney> Fix linking of datasets example when ARROW_BUILD_SHARED=OFF

Authored-by: Wes McKinney <3be70eed0275ec2606f002bff3514252e145d204@apache.org>
Signed-off-by: Wes McKinney <3be70eed0275ec2606f002bff3514252e145d204@apache.org>

icexelloss/arrow,xhochy/arrow,xhochy/arrow,icexelloss/arrow,cpcloud/arrow,cpcloud/arrow,wesm/arrow,kou/arrow,wesm/arrow,wesm/arrow,apache/arrow,laurentgo/arrow,laurentgo/arrow,laurentgo/arrow,cpcloud/arrow,apache/arrow,icexelloss/arrow,laurentgo/arrow,laurentgo/arrow,apache/arrow,cpcloud/arrow,cpcloud/arrow,xhochy/arrow,kou/arrow,cpcloud/arrow,kou/arrow,cpcloud/arrow,kou/arrow,cpcloud/arrow,icexelloss/arrow,apache/arrow,xhochy/arrow,apache/arrow,wesm/arrow,apache/arrow,icexelloss/arrow,kou/arrow,xhochy/arrow,xhochy/arrow,cpcloud/arrow,icexelloss/arrow,icexelloss/arrow,xhochy/arrow,apache/arrow,laurentgo/arrow,apache/arrow,xhochy/arrow,icexelloss/arrow,laurentgo/arrow,apache/arrow,cpcloud/arrow,kou/arrow,apache/arrow,xhochy/arrow,laurentgo/arrow,wesm/arrow,wesm/arrow,icexelloss/arrow,laurentgo/arrow,kou/arrow,laurentgo/arrow,kou/arrow,kou/arrow,kou/arrow,laurentgo/arrow,cpcloud/arrow,cpcloud/arrow,wesm/arrow,xhochy/arrow,wesm/arrow,xhochy/arrow,icexelloss/arrow,apache/arrow,apache/arrow,xhochy/arrow,xhochy/arrow,wesm/arrow,laurentgo/arrow,kou/arrow,kou/arrow,icexelloss/arrow,cpcloud/arrow,kou/arrow,laurentgo/arrow,laurentgo/arrow,wesm/arrow,wesm/arrow,apache/arrow,icexelloss/arrow,kou/arrow,wesm/arrow,cpcloud/arrow,laurentgo/arrow,xhochy/arrow,icexelloss/arrow,apache/arrow,wesm/arrow,xhochy/arrow,icexelloss/arrow,wesm/arrow