Movesense can't generate ninja files according to documentation - c++

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

Related

Cmake can't find compiler without editing PATH

so what i am doing is that i am having 2 targets in a project, one is program for embedded device that i am crosscompiling, and the second are tests. I need to build them with 2 different compilers.
To main project i am passing arm compiler path by file toolchain.cmake and its working fine.
But right now i would like to build also the tests without having to add path to mingw64/bin to my environment variables (yes its working if i do that).
Test project is added as:
ExternalProject_Add(${UNIT_TEST_TARGET}
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test/
PREFIX ${UNIT_TEST_TARGET}
CMAKE_ARGS ${GTEST_ARGS}
BUILD_ALWAYS TRUE
INSTALL_COMMAND cmake -E echo "Skipping install step."
EXCLUDE_FROM_ALL TRUE)
So right now i would like to pass to this external project file toolchaintests.cmake which looks like :
set(CMAKE_C_COMPILER <my_path_here>/mingw64/bin/gcc.exe)
set(CMAKE_CXX_COMPILER <my_path_here>/mingw64/bin/g++.exe)
with:
list(APPEND GTEST_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchaintests.cmake")
and if i do this cmake can't recognize the compilers:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: <my_path_here>/mingw64/bin/gcc.exe
-- Check for working C compiler: <my_path_here>/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
" <my_path_here>/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: <my_path_here>/out/build/tests/src/tests-build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Ninja/ninja-win/ninja.exe cmTC_a1c48 && [1/2] Building C object CMakeFiles\cmTC_a1c48.dir\testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_a1c48.dir/testCCompiler.c.obj
<my_path_here>\mingw64\bin\gcc.exe -o CMakeFiles\cmTC_a1c48.dir\testCCompiler.c.obj -c <my_path_here>\out\build\tests\src\tests-build\CMakeFiles\CMakeTmp\testCCompiler.c
ninja: build stopped: subcommand failed.
Can i do this somehow else?

Detecting compiler ABI failed by CMAKE

There is a CMake project simple enough but not compiling at all with Visual Studio Code. The source:
// main.cpp
#include <iostream>
int main(int argc, char * argv){
return 0;
}
The CMakeLists.txt:
cmake_minimum_required(VERSION 3.0.0)
project(test VERSION 0.1.0)
add_executable(test main.cpp)
CMake Tools in vscode build with errors in prompt as below:
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - failed
[cmake] -- Check for working C compiler: /bin/gcc-9
[cmake] -- Check for working C compiler: /bin/gcc-9 - works
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] CMake Error at /usr/local/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:82
(configure_file):
[cmake] configure_file Problem configuring file
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:2 (project)
[cmake]
[cmake]
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - failed
[cmake] -- Check for working CXX compiler: /bin/g++-9
[cmake] -- Check for working CXX compiler: /bin/g++-9 - works
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] CMake Error at /usr/local/share/cmake-3.18/Modules/CMakeTestCXXCompiler.cmake:75
(configure_file):
[cmake] configure_file Problem configuring file
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:2 (project)
The CMakeError.log:
Cannot copy output executable
'/data/solution/projects/test/build/CMakeFiles/CMakeTmp/cmTC_efc0d'
to destination specified by COPY_FILE:
'/data/solution/projects/test/build/CMakeFiles/3.18.4/CMakeDetermineCompilerABI_C.bin'
Cannot copy output executable
'/data/solution/projects/test/build/CMakeFiles/CMakeTmp/cmTC_26771'
to destination specified by COPY_FILE:
'/data/solution/projects/test/build/CMakeFiles/3.18.4/CMakeDetermineCompilerABI_CXX.bin'
A selection of the CMakeOutput.log:
The system is: Linux - 5.4.0-52-generic - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /bin/gcc-9
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
The C compiler identification is GNU, found in
"/data/solution/projects/test/build/CMakeFiles/3.18.4/CompilerIdC/a.out"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /bin/g++-9
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in
"/data/solution/projects/test/build/CMakeFiles/3.18.4/CompilerIdCXX/a.out"
Determining if the C compiler works passed with the following output:
Change Dir: /data/solution/projects/test/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_3f39e/fast && /usr/bin/make -f
CMakeFiles/cmTC_3f39e.dir/build.make CMakeFiles/cmTC_3f39e.dir/build
make[1]: Entering directory '/data/solution/projects/test/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3f39e.dir/testCCompiler.c.o
/bin/gcc-9 -o CMakeFiles/cmTC_3f39e.dir/testCCompiler.c.o -c
/data/solution/projects/test/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_3f39e
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3f39e.dir/link.txt --verbose=1
/bin/gcc-9 -rdynamic CMakeFiles/cmTC_3f39e.dir/testCCompiler.c.o -o cmTC_3f39e
make[1]: Leaving directory '/data/solution/projects/test/build/CMakeFiles/CMakeTmp'
The project doesn't build anymore when the OS was upgraded from 18.04 to 20.04 all in a sudden, with later version (9.3) of GCC toolchain. The
a.out
exists under CMAKE building directory, but there is no output executable ABI testing program to copy to anyway, as we can tell from the above logs. Is there anyone to help me finding the real cause? Thank you.
Solution: OK. There is an issue I could have noted, thanks to a comment. The project is under directory mounted to FAT32 file system where permission settings are tricky to configure. A correct /etc/fstab file:
UUID=3FCE-E5CB /data vfat rw,user,exec,utf8,uid=jack,gid=jack 0 0
The CMAKE is not able to access to file system with permission granted. Solution is to edit /etc/fstab accordingly.

Every call to configure_file fails on WSL: configure_file Problem configuring file

I've just built and installed cmake 3.16 on a fresh WSL install (Ubuntu18.04 LTS). I then created a default hello world project
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest$ tree .
.
├── CMakeLists.txt
└── main.cpp
//CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(ATest)
set(CMAKE_CXX_STANDARD 14)
add_executable(ATest main.cpp)
//main.cpp
#include <iostream>
#include <string>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
And then tried to build:
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest$ mkdir build
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest$ cd build/
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest/build$ cmake ..
And I get the following.
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:185 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- The C compiler identification is GNU 10.1.0
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:212 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- The CXX compiler identification is GNU 10.1.0
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake:210 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- 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 - failed
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:80 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- 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 - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:73 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/mnt/d/ATest/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/d/ATest/build/CMakeFiles/CMakeError.log".
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest/build$
I originally tried cmake 3.15 but upgraded to see if it was a version problem, given this, I don't this it is. I've also tried g++-7 and g++-9 which behave the same.
Does anybody know what might be going on here? Thanks.
Create a file named wsl.conf in /etc/ with the following text:
# /etc/wsl.conf
[automount]
options = "metadata"
enabled = true
Reboot wsl:
wsl.exe -t Ubuntu // (or other e.g. Debian)
Sources:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003413779-Troubles-with-WSL-toolchain-Test-CMake-run-finished-with-errors-
https://github.com/microsoft/WSL/issues/3994#issuecomment-507864837
https://learn.microsoft.com/en-us/windows/wsl/wsl-config

CMake find_package can't find WebSockets

According to https://blog.kitware.com/cmake-finding-qt5-the-right-way/, the method find_package(Qt5 COMPONENTS Core Qml Quick Svg Qt5WebSockets REQUIRED) allows me to load lots of QT5 packages while being able to set the QT root only once by setting the Qt5_DIR variable. I'm trying to compile a minimal CMake project which is listed below, using this technique. You can see that WebSockets isn't found. What is the problem?
PS: My home directory at /home/lz/Qt5.11.2 indeed has a new Qt installation that Qt installer just installed for me, and it indeed has libwebsockets and websocket include files.
My CMakeLists.txt:
find_package(Qt5 COMPONENTS Core Qml Quick Svg Qt5WebSockets REQUIRED)
How do I run it:
cmake -DQt5_DIR=/home/lz/Qt5.11.2 .
-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.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 /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
Could not find a package configuration file provided by "Qt5Qt5WebSockets"
with any of the following names:
Qt5Qt5WebSocketsConfig.cmake
qt5qt5websockets-config.cmake
Add the installation prefix of "Qt5Qt5WebSockets" to CMAKE_PREFIX_PATH or
set "Qt5Qt5WebSockets_DIR" to a directory containing one of the above
files. If "Qt5Qt5WebSockets" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:1 (find_package)
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.9)
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!
See also "/home/lz/c/CMakeFiles/CMakeOutput.log".
PS: without WebSockets cmake 'compiles' just fine, so the WebSockets is the only module not found
UPDATE:
After the help below, I'm still having an error related to WebSocket:
/home/lz/orwell/react-native-desktop-orwell/ReactQt/runtime/src/websocketmodule.cpp:12:10: fatal error: QWebSocket: No such file or directory
#include <QWebSocket>
and now I'm successfully using my QT, as you can see in the verbose output:
[ 50%] Building CXX object CMakeFiles/m.dir/main.o
/usr/bin/c++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtWidgets -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtGui -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/include/QtCore -isystem /home/lz/Qt5.11.2/5.11.2/gcc_64/./mkspecs/linux-g++ -fPIC -std=gnu++11 -o CMakeFiles/m.dir/main.o -c /home/lz/c/main.cpp
/home/lz/c/main.cpp:1:10: fatal error: QWebSocket: No such file or directory
#include <QWebSocket>
^~~~~~~~~~~~
compilation terminated.
Change the line in your CMakeLists.txt to
find_package(Qt5 COMPONENTS Core Qml Quick Svg WebSockets REQUIRED)
You don't need to add "Qt5" prefix to the name of the component using this syntax.
For me fixed after installing libqt5websockets5-dev:
sudo apt install libqt5websockets5-dev

How do I correctly set a CMakeLists.txt file?

I have a simple C++ test project and wrote my CMakeLists.txt file as follows;
cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_COMPILER "C:/MinGW/bin/gcc")
set(CMAKE_CXX_COMPILER "C:/MinGW/bin/g++")
project(simpleTest)
add_executable(main main.cpp)
When i try to run CMake GUI an set generator to MinGW i get the following error message:
The C compiler identification is GNU 4.6.1
The CXX compiler identification is GNU 4.6.1
Check for working C compiler: C:/MinGW/bin/gcc
CMake Error: your C compiler: "C:/MinGW/bin/gcc" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
Check for working C compiler: C:/MinGW/bin/gcc -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/MinGW/bin/gcc" is not able to compile a simple test
program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
CMake Error: your C compiler: "C:/MinGW/bin/gcc" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "C:/MinGW/bin/g++" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
Configuring incomplete, errors occurred!
I'm on Windows 7 64 bit and i confirmed on cmd that;
G++ --version gives G++ (GCC) 4.6.1.
What am I doing wrong?
Sorry but this looks like the compiler is not installed where you specified. Also see here why you should avoid setting the compiler in CMakeLists.txt
So I'd remove those, clear the cmake cache, set the environment variables CC and CXX before calling CMake and try again.
I think your problem lies in the path string. Try this:
set(CMAKE_C_COMPILER "C:\\MinGW\\bin\\gcc")
set(CMAKE_CXX_COMPILER "C:\\MinGW\\bin\\g++")
Alternatively, you can also set your compilers in the CMake GUI. After you click on generate, choose the option "Specify native compilers" and set or browse to the correct location.