Simplified CMake checks about smart pointers