Zephyr app location

I use Zephyr with CLion for some time now and it works well. But recently I created a new project and copied the project structure from the example project: https://github.com/zephyrproject-rtos/example-application

That works very well with west from the terminal (building with `west build app`). But I can't get it to work in CLion. With only ‘west build’ it complains about:


CMake Error at CMakeLists.txt:2 (zephyr_syscall_include_directories):
 Unknown CMake command "zephyr_syscall_include_directories".


CMake Error in CMakeLists.txt:
 No cmake_minimum_required command is present.  A line of code such as

   cmake_minimum_required(VERSION 4.1)

 should be added at the top of the file.  The version specified may be lower
 if you wish to support older CMake versions for this project.  For more
 information run "cmake --help-policy CMP0000".



I don't know how to point to `app` as app directory. I tried to change the root CMakeLists but I get other problems then and this is just a valid way of doing it as Zephyr gives it as an advice to do it this way.

What I do now is just in the terminal run `west build app` and then I can at least ‘click through’ in CLion, but building with CLion is not an option. This works ok for me now, but I want to be able to build and debug with CLion as well. 

Another thing is that I created my own west command to set some variables (west build-project), but I can only use `west build`. It would be nice if there were more options in CLion to set such things.

0
1 comment

CLion is likely configuring the wrong CMake root, so it’s picking up the top-level file instead of the Zephyr app context. Try setting the CMake profile to use the build directory generated by west or point CLion to the correct toolchain and run configuration via west instead of plain CMake.

https://intellij-support.jetbrains.com/hc/en-us/community/posts/33998696392594-Zephyr-app-location Slope Game 2

 

0

Please sign in to leave a comment.