This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CMake build failing for mesh example using Segger Embedded Studio. Unknown CMake command "set_target_link_options".

Hi, I am trying to build the light switch server in the nRF for Mesh SDK, but I cannot generate the SES build files using cmake. 

I am receiving the following error

CMake Error at CMakeLists.txt:55 (set_target_link_options):
Unknown CMake command "set_target_link_options".

As far as I can tell, I have the correct environment variables setup

Below are the system environment variables

The python environment variable is stored under the user environment variables.

If I go into the CMake directory of the nRF for Mesh SDK I can clearly see the toolchain files installed. 

Development Setup:

Windows 10

Segger Embedded Studio

nRF SDK for Mesh V5

nRF SDK v17.02

  • Hi,

    Have you made any changes to any of the CMakeLists.txt files? If not, you should not have to generate the SES project files again, as the nRF5 SDK for Mesh package includes the SES project files for all examples already.

    How and where did you use the command to generate the project files? The recommended way is to create a build folder in the root directory of your mesh repository and run the command from there. I have seen someone get a similar error to yours when you try to run CMake in a build directory inside of an example, instead of in the root directory. So if your mesh root directory is called for example nrf5_SDK_for_Mesh_v5.0.0, then you should create nrf5_SDK_for_Mesh_v5.0.0/build and run the generate command inside there:

    cmake -G Ninja -DGENERATE_SES_PROJECTS=ON

    Be aware that if you do not specify the platform or SoftDevice it will default to nrf52832_xxAA and s132_7.2.0 SoftDevice. To specify platform and SoftDevice, you can add the DPLATFORM and DSOFTDEVICE parameter:

    cmake -G Ninja -DGENERATE_SES_PROJECTS=ON -DPLATFORM=nrf52832_xxAA -DSOFTDEVICE=s132_7.2.0 ..

    Best regards,

    Marte

  • Thank you for the response. I realized I was building the projects in the example directory and not the root. It is now working.  

  • Hi,

    I am happy to help, and glad to hear that it is working now!

    Best regards,

    Marte

Related