Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a CMakeLists.txt #10

Open
arctangerines opened this issue Feb 13, 2024 · 0 comments
Open

Adding a CMakeLists.txt #10

arctangerines opened this issue Feb 13, 2024 · 0 comments

Comments

@arctangerines
Copy link

Hello!
I have a CMakeLists.txt version of the Makefile and Makefile.common and I think it'd be a good idea to add it, some of my reasons are:

  1. A decent amount of people use IDEs for their projects, sure, Makefiles work well enough with IDEs but not always
    • And even if they don't use IDEs, a CMakeLists.txt does make life easier for debugging and suggestions/completions
  2. I think a CMakeLists.txt that can be used as a template is in line with what is taught/learned through the Discovering STM32 book
  3. And it gives the user freedom of choice!

Now, some details regarding the CMakeLists.txt file I have been using:

  • It is a single file that simulates both the Makefile and the Makefile.common, I am open to changing it from 1 file to 2 files that are closer to the current Makefile layout if it's truly wanted/needed
  • There are modifications that I know I'd have to make so its more of a template, namely:
    • Lines 14 to 16 which just link the library directly, instead I would add the LIBROOT so it matches the Makefile.common
    • Adding TOOLROOT as well since my compiler is available in the search path and installed system-wide but that is not the case for everyone
    • Organize the file a bit more since I was jumping between looking at what the Makefile and Makefile.common did and modifying or adding things as I needed them
    • As you can see on lines 29 to 35 we have to manually add the files, I would add variables so we shorten this
      • Example: ${PERIPH_SRC}/stm32f10x_gpio.c
      • Obviously the naming convention is up for discussion haha

Excited to hear what you think about this idea!

@arctangerines arctangerines changed the title Adding CMakeLists.txt Adding a CMakeLists.txt Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant