Skip to content

Commit d3f2313

Browse files
authored
Merge pull request vhdirk#17 from ilyachur/master
Creating a build directory if it doesn't exist
2 parents ebdacc5 + e5d4b0c commit d3f2313

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugin/cmake.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ function! s:cmake(...)
2828
let g:cmake_build_dir = get(g:, 'cmake_build_dir', 'build')
2929
let s:build_dir = finddir(g:cmake_build_dir, '.;')
3030

31-
if s:build_dir !=""
31+
if s:build_dir == ""
32+
echo g:cmake_build_dir
33+
silent call mkdir(g:cmake_build_dir, 'p')
34+
let s:build_dir = finddir(g:cmake_build_dir, '.;')
35+
endif
3236

37+
if s:build_dir != ""
3338
let &makeprg='cmake --build ' . shellescape(s:build_dir) . ' --target '
3439

3540
exec 'cd' s:fnameescape(s:build_dir)

0 commit comments

Comments
 (0)