C++ development and related evironments are not something I use so I might be missing som knowledge in this area.
I want to do som sensor programming and want to deploy the example-project to get it working and then write my own code to extend it there after.
I've managed running projects in the Simulator using Visual Studio 2017. But couldn't get building example-project using Visual Studio C++ Compiler working so installed MinGW firstly: https://sourceforge.net/projects/mingw/
But following the instructions at https://movesense.com/docs/esw/getting_started/#example-project
I can't run the create ninja files
step correctly.
I get this error running the command:
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=../movesense-device-lib/MovesenseCoreLib/toolchain/gcc-nrf52.cmake -DMOVESENSE_CORE_LIBRARY=../movesense-device-lib/MovesenseCoreLib ../ -DCMAKE_BUILD_TYPE=Debug ../
CMake Warning:
Ignoring extra path from command line:
"C:/Development/movesense-device-lib/MovesenseCoreLib/toolchain/gcc-nrf52.cmake"
CMake Warning:
Ignoring extra path from command line:
"../movesense-device-lib/MovesenseCoreLib"
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/MinGW/bin/gcc.exe - 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: C:/MinGW/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: C:/MinGW/bin/gcc.exe
CMake Error at CMakeLists.txt:13 (include):
include could not find requested file:
C:/Development/builddir//MovesenseFromStaticLib.cmake
Adding the MovesenseFromStaticLib.cmake manually doesn't work either gives me these errors:
Ignoring extra path from command line:
"C:/Development/movesense-device-lib/MovesenseCoreLib/toolchain/gcc-nrf52.cmake"
CMake Warning:
Ignoring extra path from command line:
"../movesense-device-lib/MovesenseCoreLib"
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/MinGW/bin/gcc.exe - 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: C:/MinGW/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: C:/MinGW/bin/gcc.exe
CMake Error at builddir/MovesenseFromStaticLib.cmake:29 (include):
include could not find requested file:
C:/Development/builddir/app-build/toolchain-setup.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
CMake Error at builddir/MovesenseFromStaticLib.cmake:30 (include):
include could not find requested file:
C:/Development/builddir/app-build/prolog.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
CMake Error at builddir/MovesenseFromStaticLib.cmake:32 (include):
include could not find requested file:
C:/Development/builddir/app-build/platform/.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
CMake Error at builddir/MovesenseFromStaticLib.cmake:33 (include):
include could not find requested file:
C:/Development/builddir/app-build/compiler/.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
CMake Error at builddir/MovesenseFromStaticLib.cmake:40 (INIT_SIMULATOR_ENVIRONMENT):
Unknown CMake command "INIT_SIMULATOR_ENVIRONMENT".
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
-- Configuring incomplete, errors occurred!
Like Tsyvarev
mentioned should be space after -D, but still get:
cmake -G "Ninja" -D CMAKE_TOOLCHAIN_FILE=../movesense-device-lib/MovesenseCoreLib/toolchain/gcc-nrf52.cmake -D MOVESENSE_CORE_LIBRARY=../movesense-device-lib/MovesenseCoreLib ../ -D CMAKE_BUILD_TYPE=Debug ../
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
The CMAKE_C_COMPILER:
arm-none-eabi-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt:
The CMAKE_CXX_COMPILER:
arm-none-eabi-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
The CMakeLists.txt look like this:
cmake_minimum_required(VERSION 3.4)
enable_language(C CXX ASM)
if(NOT DEFINED MOVESENSE_CORE_LIBRARY)
# Give error that user must provide path to movescount-core library
message(FATAL_ERROR "Path to movesense-core library not set. Add -DMOVESENSE_CORE_LIBRARY=<path_to_core_lib> to cmake command line")
endif()
if(NOT IS_ABSOLUTE ${MOVESENSE_CORE_LIBRARY})
set(MOVESENSE_CORE_LIBRARY ${CMAKE_BINARY_DIR}/${MOVESENSE_CORE_LIBRARY})
endif()
include(${MOVESENSE_CORE_LIBRARY}/MovesenseFromStaticLib.cmake REQUIRED)
Any help on what is the issue and how to solve it?
You are trying to build the project on the MinGW terminal in windows instead of the Docker container as described in the documentation:
https://movesense.com/docs/esw/getting_started/#build-commands-real-hw
Starting Movesense 2.0 the docker environment is the only supported build environment.
Full disclosure: I work for the Movesense