Civitasv/cmake-tools.nvim

Possibility to set a path for `cmake_build_directory` that is not relative to `vim.loop.cwd()`

Closed this issue · 2 comments

Describe the problem or limitation you are having
Certain circumstances in my project structure force me to have a folder called /some_specific_path/build (i.e. imagine this to be an absolute path somewhere on the file system unrelated to where the project is), which contains all the build artefacts that cmake generates. Since the current configurations option cmake_build_directory only allows for relative paths to vim.loop.cwd() and not all my projects have the same depth, Im in a bit of a pickle.

Describe the solution you'd like
Make cmake_build_directory an absolute path and change the default value to

require("cmake-tools").setup {
...
  cmake_build_directory = string.format("%s/out/${variant:buildType}", vim.loop.cwd()), 
...
}

Describe alternatives you've considered
If there is an easy way on how to set the path to an absolute path with the current working of the plugin, Im ofc open to that as well.

@i-ilak :CMakeSelectBuildDir ?

@Gerodote Ah yes, ofc. That works nicely combined with the session support! Thank you!