7

When trying to build Zephyr for the first time I am getting this error message:

CMake Error at CMakeLists.txt:1 (include):
  include could not find load file:

    /cmake/app/boilerplate.cmake


-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:4 (target_sources):
  Cannot specify sources for target "app" which is not built by this project.


CMake Error at CMakeLists.txt:5 (target_sources_ifdef):
  Unknown CMake command "target_sources_ifdef".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.8)

  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".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

1 Answer 1

14

The environment variable ZEPHYR_BASE is not set.

Set the ZEPHYR_BASE environment variable to the root of the Zephyr repository.

2
  • 4
    Note that ZEPHYR_BASE is usually set by sourcing (not executing!) zephyr-env.sh script from Zephyr's top directory. More info is in the docs: docs.zephyrproject.org/getting_started/…
    – pfalcon
    Jan 3, 2018 at 14:35
  • 3
    Also note that after such an error occurs, it's recommended to manually delete build directory and restart from scratch.
    – pfalcon
    Jan 11, 2018 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.