create_nordic_project.py failed(1) when trying to add existing file in CMakeLists.txt

Hi,

I am trying add existing file in CMakeLists.txt a main.cpp file inside Project libapp.a, at which i am getting this python error.
Kindly help.

Regards,

Parents Reply Children
  • My apologies for missing some of your comments, and providing some confusing answers. 

    Ubaid_M said:
    right click on project libapp.a and select "Add existing file to CmakeLists.txt" and select the main.cpp file

    I missed this information earlier. I tested the same on my side and got the same result. 

    Ubaid_M said:
    Seems manually changing the CMakeLIsts.txt to default is the only way to work around this issue.

    Yes, at the moment it seems that this is the only solution. Either by "Open CmakeLists.txt in Editor" or, in your case, via Notepad++. 

    I did find an answer to why this is happening from our developers (which means it's known):

    SES-NE only supports regular CMake functions inside those tags, and not a Zephyr extension command like: target_sources_ifdef().

    Such functions are written back incorrectly and having their lines wrapped incorrectly, causing the `(` to appear on an independent line, which results in an invalid CMake file.

    This has been fixed in this sample by moving the offending function outside the tags, as can be seen here:
    https://github.com/nrfconnect/sdk-nrf/pull/5130

Related