Project without cmake nor compile_commands.json
dlyr opened this issue · 6 comments
I wonder what would be the "good" behavior for a project without any compile informations.
Now I get usually stuck (with a nil in the function cmake-ide--get-project-key)
I have corrected my own version of cmake-ide to "do nothing", but before create a pull request, I prefere to discuss here what is the good behavior ... I mean how to find there is nothing to do and "disable" cmake-ide when visiting such a file.
It happens for me when I open a code file just to inspect, but this file would not be compiled in a near futur
++ d
This might be a bug - cmake-ide shouldn't do anything if it doesn't find a CMakeLists.txt
file. If it does, it's a bug, pure and simple.
However, due to how CMake works, cmake-ide has to keep searching upwards through the filesystem hierarchy to find the topmost CMakeLists.txt
file. It's also possible it's acting due to finding one above the file you're visiting.
Ok, let me finalize my tests and I will propose a PR.
++ d
So my investigations turn me crazy.
Could you maybe tell me more how you see the difference between project-dir and cmakelists-dir
Btw, for test test-issue-125
to work, what is expected from get-build-dir
without any CMakeLists nor project-dir ?
Thank for your reply, my version is quite functionnal, but clearly need to be tested by other since we do not use cmake-ide the same way.
There shouldn't be any difference between where the top CMakelists.txt
is and the project dir. The confusion is due to the code having grown too organically.
For non-cmake projects, get-build-dir
should return what it does for cmake projects - by default it builds in a temporary directory, and has to option to be set to one of the user's choosing.
There shouldn't be any manual testing by either of us - every issue should be covered by an automated test.
Regarding the test thing, what I mean is when the test is running, if I understand well, there is no CMakeLists file in the folder structure not project-dir set, but it relies on one of those to get the build-dir (at least in my version, because I see (setq cmake-ide-build-dir build-dir) is reintroduce by commit 69cfce0
I have no time to get things up (and tested) right now, but I might create a PR soon to show how I try to fix this (and discuss if you are agree with it ;))
The build directory doesn't depend on the project directory. But I guess we'll see better when I see the PR. I really need to add more tests to cmake-ide.