
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,

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,
Hello Øyvind,
Is there any work around to this issue..?
How did you edit the CmakeLists.txt? Please fix CmakeLists.txt to the following
# NORDIC SDK APP START target_sources(app PRIVATE src/main.c src/model_handler.c src/main.cpp) target_include_directories(app PRIVATE include) # Preinitialization related to Thingy:53 DFU target_sources_ifdef(CONFIG_BOARD_THINGY53_NRF5340_CPUAPP app PRIVATE boards/thingy53.c ) # NORDIC SDK APP END
-Øyvind
How did you edit the CmakeLists.txt? Please fix CmakeLists.txt to the following
Hello Øyvind,
I just added main.cpp
target_sources(app PRIVATE src/main.c src/model_handler.c src/main.cpp)
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
My apologies for missing some of your comments, and providing some confusing answers.
Thank you so much Øyvind.
I found other issues as well with SES usage. Meanwhile I am progressing well with VSCode, seems suitable for my use.
Hence I have decided to stick with VSCode.
Appreciate all your help Øyvind..!!