Closed alxhoff closed 4 years ago
Out of Source build with CMake and Eclipse are quite tricky as the Project Generator for Eclipse CDT4 does not really support it. Even if we would solve the problem with the src
and include
folders, some things like version control,... would not work in Eclipse.
it's not really out of source. just using a build folder instead of cmake .
from the project root.
Did we come up with a solution for this? Given the problems with cleaning, having the cmake run from root would make cleaning tricky and the project directory very messy.
I‘ve written you a mail about this:
There are many reasons for not using a build directory for Eclipse-managed Projects. The project root (where the CMakeList.txt lies) always should be a parent directory of the Source Files so that the related sources are linked to the project. Also the build configuration and some features like looking up declarations across files are broken in this setup.
Yes but the CMakeList.txt always does lie above the source files.
https://jvgomez.github.io/pages/how-to-configure-a-cc-project-with-eclipse-and-cmake.html#out-of-source-builds Explains the situation quite good. The only „solution“ mentioned is to use a build directory which is a sibling to the repository...
We could move the user source into the root directory. Although this is messy as well. Maybe it's time to show students the beauty of a heavily modified text editor. Have you looked into how VS code handles this? Maybe if we just switch the "supported" IDE for the course to it we could negate this problem.
I never worked with vscode. But by googling I found out that the cmake project generator can not generate vscode projects and setting up openocd,... would be hard. So it will be tricky as well. I have no problems working with VIM but I would be careful forcing students to use it 🤣
Hm this is crappy. Those two students from this semester seemed to be able to debug and everything from VS code. Maybe VS code can handle openocd/gdb targets? I've also never used it. VIM4LYFE.
@PhilippvK chec this out. We would just have to write a few of these config things for the different targets.
Could be an option if the number of manual steps required would be minimal. I can look into this later this week, if you don‘t anticipate.
We could preconfigure the IDE on the lab machines and maybe document the steps for DIY setups. No rush.
@PhilippvK
When generating an Eclipse project with a build folder
cmake -B build -G "Eclipse CDT4 - Unix Makefiles" .
the src and include folders are not showing in eclipse. Running cmake from the project includes them but it would be ideal to have a build folder.