Do I have to create or edit the CMakeLists.txt files after I tried to add new files and edit the project files?

Hi All,

Sorry to ask this question, I just learned a little about cmake. 

Now I wanted to add a few src files based on the light switch example in SES.  Do I have to create or edit the CMakeLists.txt files for my new added files? 

Currently I used the configuration of the light switch example (using gcc), and didn't change anything for the cmakelists.txt files. I builded the project successfully.

Is it right?  I wanna know how to create or edit the cmakelists.txt files for my project or Is there a nother way to build the project?  Any suggestions will be helpful.

Thanks in advance.

  • followed this page "Building the stack and examples" from the infocenter.

  • Hi, 

    Young said:
    ...\mesh sdk\nrf5_SDK_for_Mesh_v5.0.0_src

    My bad, I did not see that you were working with nRF5 SDK for Mesh v5.0.0.  The tutorial I sent in my previous reply is for nRF Connect SDK which is not the same as nRF5 SDK. 

    Now I wanted to add a few src files based on the light switch example in SES.  Do I have to create or edit the CMakeLists.txt files for my new added files? 

    According to my colleague you can edit and change projects without editing cmakelist, as they are not used for older nRF5 SDK projects. Instead you can build together in SES. As for nRF5 SDK for Mesh v5 you can do either, meaning that both building the projects with SES and you can use CMake. Using CMake requires that you have set up the environment properly and if done so it should work similarly as in NCS with regard to configuring the cmakelist

    From your error you have:

    Young said:
    No cmake_minimum_required command is present. A line of code such as

    This means that you need to add a line that states a minimum version that cmake is going to look for/use. You can fix this by adding cmake_minimum_required(VERSION x.x) at the top of the top-level cmakelists.txt in your project application (remember to replace x.x with a version that you are using. 

    I will take a closer look on how the switch sample in mesh is set up, but in the meanwhile you can try the suggestions above,

    Kind regards,
    Andreas

Related