Mbed CLI2 config

Thank you Ladislas for the tip!

mbed-tools configure -m LPC1768 -t GCC_ARM --mbed-os-path absolute_path_to_mbed-os
seems to work OK.

However,

mbed-tools compile -m LPC1768 -t GCC_ARM --mbed-os-path absolute_path_to_mbed-os

reports the following error:

CMake Error at CMakeLists.txt:10 (include):
  include could not find requested file:

    /.../prog01/mbed-os/tools/cmake/app.cmake


-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:14 (add_subdirectory):
  add_subdirectory given source
  "/.../prog01/mbed-os" which is not an existing
  directory.


CMake Error at CMakeLists.txt:22 (mbed_set_post_build):
  Unknown CMake command "mbed_set_post_build".


-- Configuring incomplete, errors occurred!
See also "/.../prog01/cmake_build/LPC1768/develop/GCC_ARM/CMakeFiles/CMakeOutput.log".
ERROR: CMake invocation failed!

More information may be available by using the command line option '-v'.

Build the project with CMake (advanced)

We’ll show how to build your project using CMake directly, which provides you with the full capabilities of CMake. You are no longer limited by what Mbed CLI 2 has to offer.

Translate from the Mbed configuration system to a form CMake can understand:
mbed-tools configure -m LPC1768 -t GCC_ARM ...

This will create a build folder at …

  1. Set the build parameters:
    cmake -S . -B cmake_build/LPC1768/develop/GCC_ARM -GNinja

Unfortunately, this command reports error too.