Simplified the CMake check for smart pointers.