export_compile_commands assumes you have your working copy in
$HOME/dev/code/dindexer and you are running it from your build
directory, which is in something like
$HOME/dev/build/dindexer/<config>
It will then invoke cmake with CMAKE_EXPORT_COMPILE_COMMANDS ON
for YouCompleteMe to work. The exported .json file is
automatically symlinked into your working copy. Any previous
symlink or file is deleted from your working copy first, so if
you run this script for Release and then for Debug, the appropriate
symlink to Debug will be in your working tree.
cmake_default simply wraps export_compile_commands passing
default cmake values I normally like to use.