Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more flexible cwd and build directory configuration #298

Open
uiofgh opened this issue Feb 14, 2025 · 0 comments
Open

Allow more flexible cwd and build directory configuration #298

uiofgh opened this issue Feb 14, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@uiofgh
Copy link

uiofgh commented Feb 14, 2025

I uses nvim-rooter and workspace.nvim to manange my projects, everytime i open my project, i have to manually use CMakeSelectCwd and CMakeSettings to locate my cmakelists.txt and set build directory.

This behavior comes from the fact that cmake-tools.nvim init all its path config when loading the plugin. Any neovim working dir path changed after by other plugins or user operation is ignored. This is really frustrating.

Currently cmake-tools supports session based on cwd, but that path is also decided at setup which won't help in my situation.

Maybe adding some config function that allow users to determine those paths when they are relevant.

require("cmake-tools").setup {
  cmake_build_directory = function() -- currently runs when plugin setups, which won't work if i later changes my working dir
    if osys.iswin32 then
      return "out\\${variant:buildType}"
    end
    return "out/${variant:buildType}"
  end,
  cwd = function() -- add new cwd function
    return custom_user_function()  -- calls everytime when using cmds like CMakeBuild or CMakeRun.
  end,
}
@uiofgh uiofgh added the enhancement New feature or request label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant