alxhoff / STM32-uGFX-Cmake

CMake project for a STM32F4 (easily modified for other chip series) using uGFX (optional)
GNU General Public License v3.0
1 stars 2 forks source link

No src or include in Eclipse project #3

Closed alxhoff closed 4 years ago

alxhoff commented 4 years ago

@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.

PhilippvK commented 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.

alxhoff commented 4 years ago

it's not really out of source. just using a build folder instead of cmake . from the project root.

alxhoff commented 4 years ago

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.

PhilippvK commented 4 years ago

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.

alxhoff commented 4 years ago

Yes but the CMakeList.txt always does lie above the source files.

PhilippvK commented 4 years ago

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...

alxhoff commented 4 years ago

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.

PhilippvK commented 4 years ago

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 🤣

alxhoff commented 4 years ago

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.

alxhoff commented 4 years ago

@PhilippvK chec this out. We would just have to write a few of these config things for the different targets.

alxhoff commented 4 years ago

and this

PhilippvK commented 4 years ago

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.

alxhoff commented 4 years ago

We could preconfigure the IDE on the lab machines and maybe document the steps for DIY setups. No rush.