CMake was unable to find a build program corresponding to "Visual Studio 11 Win64" - cmake

I get with CMake 2.8.9 the following error:
CMake Error: CMake was unable to find a build program corresponding to "Visual Studio 11 Win64". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Could not find cmake module file:H:/ogredeps/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file:H:/ogredeps/CMakeFiles/CMakeCXXCompiler.cmake
Configuring incomplete, errors occurred!
I am using Visual C++ 2012 Express on Windows 7 64.
What am I doing wrong?

I think you are facing this bug: http://www.cmake.org/Bug/view.php?id=13348
You might have a luck with CMake 2.8.10-RC1

Related

CMake does not support toolset specification

I'm trying to build the Checked-C project which uses CMake, but when I go to generate the makefile CMake gives the following error.
~/checkedc/build$ cmake ../llvm
CMake Error at CMakeLists.txt:57 (project):
Generator
Unix Makefiles
does not support toolset specification, but toolset
host=x64
was specified.
-- Configuring incomplete, errors occurred!
I have CMake version 3.9.1 installed along with GNU Make 4.1, Clang 5, and GCC 7. Anyone able to tell me what this CMake error means?
That section of CMakeLists.txt looks like this:
57 project(LLVM
58 ${cmake_3_0_PROJ_VERSION}
59 ${cmake_3_0_LANGUAGES}
60 C CXX ASM)
I've tried setting C/CXX/ASM but get the same error:
~/checkedc/build$ cmake -DCMAKE_C_COMPILER="clang-5.0" -DCMAKE_CXX_COMPILER="clang-5.0" -DCMAKE_ASM_COMPILER="clang-5.0" ../llvm
CMake Error at CMakeLists.txt:57 (project):
Generator
Unix Makefiles
does not support toolset specification, but toolset
host=x64
was specified.
-- Configuring incomplete, errors occurred!
I'm on Kubuntu 17.10 64bit.
It means that somewhere CMake file the variable CMAKE_GENERATOR_TOOLSET is set to host=x64. This only makes sense for Visual Studio generator so CMake opts to throw an error in this case.
To fix it double check the setup for your OS and generator. If this doesn't help then you'll need to find where this variable is set and remove this line.
I have the same issue - how I fixed it in my case. Indeed, I had copied the setup for cmake from windows then ported to Linux. When you run the first time, it will create in the build directory a file called: CMakeCache.txt. This file keeps some variables set initially for Windows. I removed it, together with all the CMakeFiles directory and rerun the cmake command to generate the project. It was working perfectly, but I had to set the CMAKE_CXX_COMPILER and CMAKE_C_COMPILER variables to the cmake command: -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_C_COMPILER=/usr/bin/gcc
Hope it is working for you too.

Wireshark 2.4.x or 2.6.x compilation error in Windows

cmake -G "Visual Studio 14 2015 Win64" ..\wireshark succeeds.
Then building with msbuild /m /p:Configration=RelWithDebInfo Wireshark.sln fails after a while with 4 errors like this
D:\wireshark\wsutil/file_util.h(32): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [D:\wireshark\build_win64_2015_2.6\rawshark.vcxproj]
I don't think it's supposed to include that file on Windows at all.
Any hint what might be wrong with my environment?
Older questions hinted that it might be because same source tree is shared between Windows and Linux, but I don't get why that would be a problem with out of source builds. (I am trying that now anyway.)

CMake cannot find MathGL's dependency PNG

I'm trying to generate Visual Studio 2013 projects files for MathGL 2.3.3 with CMake.
For some reason cmake does not understand my PNG_PNG_INCLUDE_DIR statement.
cmake "-DZLIB_INCLUDE_DIR=c:\users\chenning\projects\zlib-1.2.8\" "-DZLIB_LIBRARY_DEBUG=c:\users\chenning\projects\zlib-1.2.8\zlib.lib" "-DZLIB_LIBRARY_Release=c:\users\chenning\projects\zlib-1.2.8\zlib.lib" "-DPNG_PNG_INCLUDE_DIR=C:\Users\chenning\projects\lpng1620\" "-DPNG_LIBRARY_DEBUG=C:\Users\chenning\projects\lpng1620\projects\vstudio\x64\Debug\libpng16.lib" "-DPNG_LIBRARY_Release=C:\Users\chenning\projects\lpng1620\projects\vstudio\x64\Release\libpng16.lib" .
The Path exists and the variable is really called PNG_PNG_INCLUDE_DIR with two PNG.
cmake is telling me:
-- Found ZLIB: c:\users\chenning\projects\zlib-1.2.8\zlib.lib
-- Could NOT find PNG (missing: PNG_PNG_INCLUDE_DIR)
CMake Error at CMakeLists.txt:341 (message):
Couldn't find PNG library.
-- Configuring incomplete, errors occurred!
See also "C:/Users/chenning/projects/mathgl-2.3.3/CMakeFiles/CMakeOutput.log".
See also "C:/Users/chenning/projects/mathgl-2.3.3/CMakeFiles/CMakeError.log".
When I set the paths with cmake-gui all works fine.
Any ideas what's wrong?

CMAKE_CXX_COMPILER not set in qtcreator

Is there a way (like command line argument or some function in CMakeLists.txt) to print all command line arguments supplied to cmake invocation? Equivalent of bash "echo $#"
I need this to debug, why cmake invoked from qtcreator does not find my compiler (msvc12). After inspecting qtcreator sources, I see that it appends some environment by cmake arguments depending on selected kit. I got messages like
CMAKE_CXX_COMPILER not set
, when I select both "Nmake Desktop Qt MSVC2013 ..." or "Ninja Qt MSVC2013".
When I call cmake from command line, it finds compiler with no additional parameters:
-- Check for working CXX compiler using: Visual Studio 12 2013
-- Check for working CXX compiler using: Visual Studio 12 2013 -- works
My main problem was solved by installing ninja. I thought that the problem was not finding compiler by cmake invoked by qtcreator:
CMAKE_CXX_COMPILER not set
After installing ninja and restarting qtcreator, the problem was gone.
I had the same problem after upgrading Visual Studio 2017.
For some reason, when ADDING (?) CMAKE_CXX_COMPILER in the cmake configuration in Build & Run to the location of the Visual Studio compiler, it should work:
Key: CMAKE_CXX_COMPILER
Value: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe ==> replace version with the correct one
Don't forget to click "Apply Configuration Changes" below.
Very strange though, because after building, the cmake run becomes CMake Project was parsed successfully.and believe-it-or-not, the CMAKE_CXX_COMPILER is gone!

Error with cmake when trying to load yamlcpp

I've tried to install Astron-master using cmake, however there seems to be a problem with cmake not recognizing yamlcpp when doing so. I was told that this is a cmake error and not yamlcpp, since I was able build yamlcpp successfully. cmake gives this error
Could NOT find YamlCpp (missing: YAMLCPP_LIBRARY YAMLCPP_LIBRARY_DIR)
CMake Error at CMakeLists.txt:116 (message):
You need yamlcpp to build this, build yamlcpp in the 'dependencies/'
directory, or install it as a system package
I'm using yaml-cpp-0.5.1 on windows 7
I have images showing my folders and it helps get a better idea, but I am not allowed to upload until I have 10 rep.