How to export compile commands?

Hi clangd depends on the compile_commands.json file to work but I can’t generate it by setting the CMAKE_EXPORT_COMPILE_COMMANDS flag like below.

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON Slicer-SuperBuild-Debug/