Move shared_ptr check below Boost find package.