[CMake] MinGW Compilers on Windows

Kevan Hashemi hashemi at brandeis.edu
Fri Dec 8 14:15:26 EST 2017


Greetings,

I'm new to CMake, so please forgive this basic question.

I'd like to use CMake to build OpenCV on Windows 7 using the C and C++ compilers that come with my 
installation of MinGW. I compile all my other code with GCC compilers, from the command line of the 
MSYS Bash shell, so I figure I can be certain to link OpenCV to my existing code if I compile with 
GCC compilers.

I installed the Windows GUI of CMake and I told it to use the MinGW C and C++ compilers. I point 
CMake at my OpenCV directory and a build directory. When I press configure, I get this error:

Selecting Windows SDK version to target Windows 6.1.7601.
CMake Error at CMakeLists.txt:64 (project):
Failed to run MSBuild command:
MSBuild.exe to get the value of VCTargetsPath:
The system cannot find the file specified
Configuring incomplete, errors occurred!
See also "F:/OpenCV/build/CMakeFiles/CMakeOutput.log".

If my understanding of CMake is correct, this error cannot not come directly from CMake, but rather 
is caused by OpenCV asking for MSBuild. But I can find no instance of the styring "MSBuild" in the 
OpenCV diretory tree. So my understanding must be wrong.

Why is CMake looking for MSBuild? Can I build on Windows using compilers of my choice?

Yours, Kevan

-- 
Kevan Hashemi, Electrical Engineer
Physics Department, Brandeis University
http://alignment.hep.brandeis.edu/


More information about the CMake mailing list