CMake with Microsoft Visual C++ Build Tools -


edit: having posted issue tracker , stepped through cmake devs, isn't cmake problem. broken msbuild installation causes return "the operation completed successfully." error. still no resolution on issue overall, narrows down potential causes.


i'm trying build cmake project on windows using ms visual c++ build tools 2015 (note: not full visual studio). cmake, however, apparently unable find cl.exe

cmake .. -- building for: visual studio 14 2015 -- c compiler identification unknown -- cxx compiler identification unknown cmake error @ cmakelists.txt:4 (project):   no cmake_c_compiler found.    cmake error @ cmakelists.txt:4 (project):   no cmake_cxx_compiler found. 

i suspect because cmake expecting find compiler in visual studio installation perhaps standalone build tools install in different location? possible configure cmake elsewhere compiler?

edit: head possibility off @ pass, cl.exe installed. when open visual c++ shell (adds tools path) cl.exe outputs:

cl.exe microsoft (r) c/c++ optimizing compiler version 19.00.24210 x86 copyright (c) microsoft corporation.  rights reserved.  usage: cl [ option... ] filename... [ /link linkoption... ] 

and same environment i'm running cmake .. cl.exe on path discovery cmake.

edit 2: looking @ cmakeerror.log file see couple variants of following

compiling cxx compiler identification source file "cmakecxxcompilerid.cpp" failed. compiler:   build flags:  id flags:    output was: 1 microsoft (r) build engine version 14.0.25420.1 copyright (c) microsoft corporation. rights reserved.  build started 4/14/2017 11:58:13 am. project "e:\<project_dir>\build\cmakefiles\3.8.0-rc4\compileridcxx\compileridcxx.vcxproj" on node 1 (default targets). prepareforbuild:   creating directory "debug\".   creating directory "debug\compileridcxx.tlog\". initializebuildstatus:   creating "debug\compileridcxx.tlog\unsuccessfulbuild" because "alwayscreate" specified. clcompile:   c:\program files (x86)\microsoft visual studio 14.0\vc\bin\cl.exe /c /nologo /w0 /wx- /od /oy- /d _mbcs /gm- /ehsc /rtc1 /mdd /gs /fp:precise /zc:wchar_t /zc:forscope /zc:inline /fo"debug\\" /fd"debug\vc140.pdb" /gd /tp /analyze- /errorreport:queue cmakecxxcompilerid.cpp tracker : error trk0002: failed execute command: ""c:\program files (x86)\microsoft visual studio 14.0\vc\bin\cl.exe" @c:\users\<user>\appdata\local\temp\tmpa0925a9f05d5426d82afdcee8d722031.rsp". operation completed successfully. [e:\<project_dir>\build\cmakefiles\3.8.0-rc4\compileridcxx\compileridcxx.vcxproj]   done building project "e:\<project_dir>\build\cmakefiles\3.8.0-rc4\compileridcxx\compileridcxx.vcxproj" (default targets) -- failed.  build failed.  "e:\<project_dir>\build\cmakefiles\3.8.0-rc4\compileridcxx\compileridcxx.vcxproj" (default target) (1) -> (clcompile target) ->    tracker : error trk0002: failed execute command: ""c:\program files (x86)\microsoft visual studio 14.0\vc\bin\cl.exe" @c:\users\<user>\appdata\local\temp\tmpa0925a9f05d5426d82afdcee8d722031.rsp". operation completed successfully. [e:\<project_dir>\build\cmakefiles\3.8.0-rc4\compileridcxx\compileridcxx.vcxproj]      0 warning(s)     1 error(s)  time elapsed 00:00:01.21 

this looks kind of output compatibility issue, "error: operation completed successfully." lines. i'm using cmake 3.8.0-rc4 , visual c++ 2015 build tools. ideas?

edit 3: thought upgrading 3.8.0-rc4 3.8.0 might fix it, no avail. considered using 64bit cmake trying build 32 bit program changed well. no luck yet.

edit 4: also, record, build cmake on pc full vs 2015 installed.

i'm not sure bring solution the operation completed successfully problem, able compile [big] real-life project using cmake 3.8.1 , c++2015 buildtools.

the trick use "vs2015 x64 native tools command prompt" (or x86). either call cmake using prompt, or call prompt normal prompt , set path properly.

rem set include/lib paths of visual studio call "c:\program files (x86)\microsoft visual c++ build tools\vcbuildtools.bat" amd64  cd to_build_dir  rem call cmake right parameters "c:\program files\cmake\bin\cmake.exe" .......  rem build xyz project msbuild.exe solution_file.sln /t:xyz ....... 

as wrote, i'm not sure fix error because wasn't able reproduce it. however, know project compile when use right prompt. when i'm not using it, error msb4019: imported project "c:\microsoft.cpp.default.props" not found. confirm path in <import> declaration correct, , file exists on disk.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -