In my experience, you need to manually copy generated compile_commands.json file inside build folder to source root (where CMakeLists resides) to make LSP aware of it.
I am not familiar with CMake so I don't know how this can be automated, but it did work (with neovim and sourcekit-lsp).