cmake: check for std::shared_ptr support before doing anything else