Fix cmake errors when attempting to get target properties on libs.

We should check first if the relevant library is a target or
a path to a library before getting the EXTERNAL_PROJECT and
IMPORTED_LOCATION properties.
Merge pull request #5 from smspillaz/cpp-subprocess-cmake.item_4

Fix cmake errors when attempting to get target properties on libs.