[SOLVED] Scriptable updates to project possible? (for cmake use)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Scriptable updates to project possible? (for cmake use)

    Hi,

    I'm working with the RP2040 and their SDK which is heavily dependent on cmake. Setting up an "externally built executable" works well, as documented on other parts of this forum, however there are a couple of problems...

    1. Manually managing the user_include_directories is painful (I know it doesn't change much, but seems bad to hardcode stuff) ... and this is needed to ensure the editor looks in all the right places for prototypes etc.
    2. Any defines in the CMakeLists.txt file are not visible to SES and therefore the highlighting/lowlighting of code around #ifdefs is not correct and can be very misleading. Obviously I could also manually enter all of these in Preprocess definitions ... but again manually editing seems wrong. And these do change quite frequently.

    I'm thinking about writing a small script as part of the build process that uses relevant bits of the cmake output and updates the .emProject file (if needed) so that it always have the correct set of defines and include directories. However that also feels wrong.

    Is there any other sensible way of doing this? i.e. referencing a file that contains the list of paths, or list of defines? Or some other way?

    Many thanks,

    Lee.
  • Hello Lee,

    Thank you for your inquiry.
    Embedded Studio is a graphical IDE. So all usecases are designed around using the GUI with the integrated tool chain.
    So our recommendation is to use the GUI and project options and set all includes and preprocessor defines there.
    When linking against a third party IDE you have to ideally do this only once (except the SDK is designed bad, but that is not on us).

    We do not recommend to edit the .emProject manually. Any issues you might run into this as a result of manual edits will not be supported by us.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • SEGGER - Nino wrote:

    Hello Lee,

    Thank you for your inquiry.
    Embedded Studio is a graphical IDE. So all usecases are designed around using the GUI with the integrated tool chain.
    So our recommendation is to use the GUI and project options and set all includes and preprocessor defines there.
    When linking against a third party IDE you have to ideally do this only once (except the SDK is designed bad, but that is not on us).

    We do not recommend to edit the .emProject manually. Any issues you might run into this as a result of manual edits will not be supported by us.

    Best regards,
    Nino
    It will be very good option of SES will understand generated by cmake outputs (makefile for example). It will not destroy SES's GUI functionality, but it will improve UX.
    Cmake it's really good tool to manage a lot of code. SES is good tool to write and debug code. But always during development of some firmware, it's required to make a lot of SES projects for tests, for different HW versions, bootloader, samples and examples, and adding all preprocessors manually it's not good way. Please solve this problem.
  • You can already generate make file output by right clicking your project in the project explorer and selecting "Export Makefile".

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.