blob: adfa84e2ef56c6d13cc12940a853c09103f84df8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
local config = require("cmake.config")
local commands = require("cmake.commands")
local autocmds = require("cmake.autocmds")
local utils = require("cmake.utils")
local constants = require("cmake.constants")
local uv = vim.uv or vim.loop
local M = {}
function M.setup(opts)
opts = opts or {}
config.setup(opts)
if vim.fn.executable(config.cmake.cmake_path) then
autocmds.setup()
utils.file_exists(vim.fs.joinpath(uv.cwd(), constants.cmakelists), function(cmake_lists_exists)
if cmake_lists_exists then
vim.schedule(function()
autocmds.set_on_variants()
commands.register_commands()
end)
require("cmake.project").setup({ first_time_only = true })
else
end
end)
else
vim.notify(
"CMake: " .. config.cmake.cmake_path .. " is not executable. Plugin is unavailable",
vim.log.levels.WARN
)
end
end
return M
|