The output directories for CMake's Xcode project generator are specific to the configuration, and so looking in CMAKE_LIBRARY_OUTPUT_DIRECTORY isn't going to work. Fortunately, CMake already provides generator expressions to find the output of a given target.
I call this the bare minimum because the built framework isn't going to respect the configuration; that is, I can't have both Debug and RelWithDebInfo variants of ClangdXPC.framework at the same time like I can with normal library or executable targets. To do that we'd have to put the framework in a configuration-specific output directory too…or use CMake's native support for frameworks instead.