jalcine / cmake.vim

:hammer: CMake functionality within Vim.
https://jalcine.github.io/cmake.vim
MIT License
74 stars 11 forks source link

Can't work properly. #6

Closed robturtle closed 10 years ago

robturtle commented 10 years ago

vim version: 7.3.762

In master branch and tag 0.2.2, when called :CMakeCreateBuild build, every files are created in current folder but not in the 'build' folder. And the 'buld' foler remained empty.

In tag 0.2.1, when the vim started, there comes an error:

Error detected while processing $HOME/.vim/bundle/cmake.vim-0.2.1/plugin/cmake.vim:
line   44:
E461: Illegal variable name: l:build_dir
Press ENTER or type command to continue
jalcine commented 10 years ago

This is something I've been trying to hack at. CMake is very tricky when it comes to making initial builds.

P.S. I've noticed your contributions a lot; would you like direct commit access?

robturtle commented 10 years ago

Well i'm green on vim script. So i'm not sure i can help u a lot : )

jalcine commented 10 years ago

Hahah, as you can see, my Vimscript skills are very hacky! I've also taken on a bit of work too (freelancing). The biggest thing about this when I was coding was to make easier to run certain functions of CMake. One thing this would need is shell completion, perhaps for a CMake Ex command. I'm working on it; might push as a feature branch.

robturtle commented 10 years ago

I must say I'm lazier than you coz I never think of this integration work. I done my job in a stupid way like this: https://github.com/robturtle/linux_config/blob/master/bin/cmakemake.sh

If I have a cmake integration plugin, I would like when it runs CMake commands, it will send the info of compile errors/warns to quickfix window, and stdout to preview window.

The idea of integration of YCM and syntastics is great. And I think there might be another way to do it. Like we let CMake auto export compile commands database with command cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON, and pass the database's path to .ycm_extra_conf.py's variable compilation_database_folder. Since YCM can communicates to syntastics, maybe that's all we need to do?

Recently I don't have much time to learn vim script. But if I got time in the future I'd love to join this project! For now, I just can do some spell check for you. : )

jalcine commented 10 years ago

I've just opened up some time to work on this; I'd do it before the week's closed.

jalcine commented 10 years ago

@robturtle So this should be fixed in the master ref. If you enable the setting of makeprg; it'll use makeprg to build your projects.

I'm looking into getting the logs from CMake passed into the quickfix window as well.

As for the use of a JSON commands, that seems to be the best solution moving forward.

Sorry for the long wait! 67c3c612-8d07-11e3-8746-750139705dbe

robturtle commented 10 years ago

Well! Here is my highest of five! : P

Currently it's not easy for me to get onto the internet. Well i'll try it out later.

On Thu, Feb 20, 2014 at 6:07 AM, Jacky Alciné notifications@github.comwrote:

@robturtle https://github.com/robturtle So this should be fixed in the master ref. If you enable the setting of makeprg; it'll use makeprg to build your projects.

I'm looking into getting the logs from CMake passed into the quickfix window as well.

As for the use of a JSON commands, that seems to be the best solution moving forward.

Sorry for the long wait! [image: 67c3c612-8d07-11e3-8746-750139705dbe]https://f.cloud.github.com/assets/452100/2212393/349efa74-99b2-11e3-90a5-81abe62bb60e.gif

Reply to this email directly or view it on GitHubhttps://github.com/jalcine/cmake.vim/issues/6#issuecomment-35555478 .

robturtle commented 10 years ago

Problem 1: seems a syntax error?

When I called CMakeCreateBuild, I got this error

Error detected while processing function cmake#commands#create_build..cmake#util#run_cmake..cmake#util#shell_exec:
line    3:
E488: Trailing characters:   else if g:cmake_use_vimux == 1 && g:loaded_vimux == 1
[cmake] Project configured.

So I edit the plugin in autoload/cmake/utils.vim at line 116:

    " "else if" ==> "elseif"
    elseif g:cmake_use_vimux == 1 && g:loaded_vimux == 1

Files not built into builddir

In autoload/cmake/utils.vim at line 102 The PWD= setting didn't work for me. So I change this line into:

let l:command = 'cd ' . l:binary_dir . '&& cmake ' . a:command . ' ' .

Now it works. But since I haven't read all the codes (and the vimscript syntax...) so I am not sure if these corrections are OK. Let me do more tests and send u pull requests later.