CMake generation problem with Visual Studio 2017 - cmake

Using cmake from command line, I got:
"== Building Windows-Release =="
-- Building for: Visual Studio 15 2017
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_CXX_COMPILER could be found.
Where CMakeError.log contain:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 31/12/2018 12:54:05.
Project "C:\myproj\CMakeFiles\3.13.1\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was 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 /TC /analyze- /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
c1 : fatal error C1083: Cannot open source file: 'CMakeCCompilerId.c': No such file or directory [C:\myproj\CMakeFiles\3.13.1\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "C:\myproj\CMakeFiles\3.13.1\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\myproj\CMakeFiles\3.13.1\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(ClCompile target) ->
c1 : fatal error C1083: Cannot open source file: 'CMakeCCompilerId.c': No such file or directory [C:\myproj\CMakeFiles\3.13.1\CompilerIdC\CompilerIdC.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.43
...
I tried repairing the installation of Visual Studio, and renstalling CMake, but nothing seems to work it. Also looked at similar thread here, but nothing was helpful.

I met the exact same question with you. After a very very long struggle, I finally find the solution for me. I am not sure whether that is the same problem you met, but I still want to write and recode this strange problem.
Firstly, I also reinstall cmake, repair the VS and add many components in it and fixed(brake) many PATH environments, but all of them don't work, and I bet the problem is not because of these problems.
As the two messages:
The C compiler identification is unknown
The CXX compiler identification is unknown
They do not exactly mean the cmake don't detect the VS compiler, it just means that the cmake's use it to build its demo but fail. And from the errorlog, I even can believe your VS has already installed success and work well. The only problem is that the compiler can't open the 'CMakeCCompilerId.c' file.
I don't know whether have your check the .c file is exactly in the project location, but it is in there very well in my computer (otherwise, it means that the cmake failed to create this file, and maybe you need to open it as an administration)
I am very confused about why the compiler can't read that and try to directly open the .vcxproj file in VS and change many settings but still get the same error, like below.
After some try, I move the project to the desktop and reopen it, then it builds success! So as the whole cmake project. I am also be shocked by that.
After some compare and research, I found error reason in me, I am using the git in windows-wsl to clone the project to my windows file system(it has a little risk to break the file permission in wsl), it works well in normal, but as a cmake cross-compilation, I guess it may use some linux-like way to operate files and therefore meet some file permission problem.
So, the final solution to me is using the git in cmd or download the whole project in the browser instead of using the git in wsl. (Truly a little funny-. and may differ with your situation)
Hope these can help you.

The reason for my problem turned out to be that case sensitivity was turned on in the current directory.
Turn off case sensitivity or switch to another directory.

Related

What is the cause for this invalid path issue when trying to run cpp protocol buffer compiler from CMake on Windows 10 and how can I solve it?

I'm trying to build the aasdk project on a Windows 10 computer. To do this, I am attempting to run the following commands in the root of the git repo directory:
mkdir buildDir
cd buildDir
cmake ..\
cmake --build . --config Release
The last command is obviously the one that's failing. I get the following output when I run that command:
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
-- Found libusb-1.0:
-- - Includes: C:/libusb-master/x64/Release
-- - Libraries: C:/libusb-master/x64/Release/lib/libusb-1.0.lib
-- Configuring done
-- Generating done
-- Build files have been written to: C:/aasdk-development/buildDir
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(200
,5): warning MSB8062: Custom build for item "C:\aasdk-development\buildDir\CMakeFiles\b2b8e2a3c1aae1e014a7c3c3f8aadde7\AVCha
nnelData.pb.h.rule" specifies invalid path "C:\aasdk-development\buildDir\aasdk_proto\protobuf::protoc" as an additional dep
endency. This may cause incremental build to work incorrectly. [C:\aasdk-development\buildDir\aasdk_proto\aasdk_proto.vcxpro
j]
...
Running cpp protocol buffer compiler on C:/aasdk-development/aasdk_proto/AVChannelData.proto
The filename, directory name, or volume label syntax is incorrect.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(238
,5): error MSB8066: Custom build for 'C:\aasdk-development\buildDir\CMakeFiles\b2b8e2a3c1aae1e014a7c3c3f8aadde7\AVChannelDat
a.pb.h.rule;...' exited
with code 123. [C:\aasdk-development\buildDir\aasdk_proto\aasdk_proto.vcxproj]
Where ... is the same message repetead for each *.proto file inside aasdk_proto directory. From what I can tell, it seems it thinks some paths are invalid. What I can't tell, is which paths and in what way are they invalid.
After the first comment, I decided to check where it gets those paths. Below is the content of the CMakeLists.txt for protobuf, found in the aasdk_proto directory:
include(FindProtobuf)
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})
file(GLOB_RECURSE proto_files ${CMAKE_CURRENT_SOURCE_DIR}/*.proto)
protobuf_generate_cpp(proto_sources proto_headers ${proto_files})
add_library(aasdk_proto SHARED ${proto_headers} ${proto_sources})
target_link_libraries(aasdk_proto ${PROTOBUF_LIBRARIES})
Of interest is the 5th line which enumerates all the *.proto files in the relevant directory before calling protobuf_generate_cpp, the part which I believe to be causing the errors.
Adding message(STATUS ProtoFiles: ${proto_files}) after line 5 to print the paths yielded correct values, atleast to my eyes:
C:/aasdk-development/aasdk_proto/AbsoluteInputEventData.proto;C:/aasdk-development/aasdk_proto/AbsoluteInputEventData.proto;...
I replaced the forward slash with a backslash just for giggles, since that's how Windows likes them, but that didn't work.
I'm a bit late, but for anyone still having this problem, I ran into a similar issue while building CuraEngine, and found the cause. In my case, I had to set the path to protoc.exe with both variables PROTOC and Protobuf_PROTOC_EXECUTABLE. (I had only set PROTOC and CMake didn't throw any errors.)
I imagine the situation with aasdk must be similar. Some variable (probably PROTOBUF_PROTOC_EXECUTABLE?) that tells the location of protoc.exe must be missing.

Building ZeroMQ on Windows 10 with Visual Studio and / or CMake fails

I am trying to set up a Co-simulation between Matlab / Simulink and an external application using the ZeroMQ library. The example I would like to build upon is described here. Therefore I need a compiled version (.dll) of the libzmq library's source code, which I downloaded from here. To my understanding the header zmq.hpp (from here) can be used directly without further compilation.
Unfortunately, I cannot manage to build the libzmq library, which is where any help would be very much appreciated! The available solutions suggested in some other questions did not work for me (see below).
I am using Windows 10, Visual Studio 2017 Community Edition and CMake 3.18.4.
As I am quite new to the topic it is definitely possible that I made some mistake during the different attempts I made. That is why I will describe in the following what I already tried that DID NOT WORK:
Going the same way as described in the example (section "Installing ZeroMQ") by opening the Native Tool Command Prompt from Visual Studio (admin mode), navigating to the build folder of libzmq and execute the provided build batch script resulted in the following error
C:\Users\MY_PATH\ZeroMQ\Work\libzmq-master_VS_native_tool\builds\deprecated-msvc\build>build.bat
Start Time: 18.11.2020 14:04:36,82
Building ..\vs201\libzmq.sln
Platform=x86
Configuration=DynDebug
*** ERROR, build terminated early, see: build_ni.log
Stop Time: 18.11.2020 14:04:37,01
Start Time: 18.11.2020 14:04:36,82
with the build_ni.log containing
Microsoft (R)-Build-Engine, Version 15.9.21+g9802d43bc3 fr .NET Framework
Copyright (C) Microsoft Corporation. Alle rights reserved.
MSBUILD : error MSB1009: Project file does not exist.
Switch: ..\vs201\libzmq.sln
The same problem has been encoutered here
Build zeromq on Windows 10 with CMake,
where the author writes that the Visual Studio solutions within libzmq have been deprecated because they are too difficult to maintain. The author managed to build the libzmq library from source using CMake.
2. I also tried to build the library with CMake Version 3.18.4 by using the GUI. In the Configurations I specified Visual Studio 15 2017 as generator and the default platform (Win32). Here is a screenshot of the resulting CMake cache variables:
CMake cache variables
I post all of them because I am new to CMake and not sure which of them might possibly be responsible for following errors. The resulting output from CMake indicates that there seems to be a problem with sodium and / or libsodium, although I have no clue here if this is needed whatsoever. Here is the output:
The C compiler identification is MSVC 19.16.27044.0
The CXX compiler identification is MSVC 19.16.27044.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.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:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
Detected ZMQ Version - 4.3.4
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Not building draft classes and methods
Using builtin sha1
**CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
The package name passed to `find_package_handle_standard_args` (sodium)
does not match the name of the calling package (Sodium). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
builds/cmake/Modules/FindSodium.cmake:42 (find_package_handle_standard_args)
CMakeLists.txt:265 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
Could NOT find sodium (missing: SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS)
CMake Warning at CMakeLists.txt:275 (message):
libsodium not installed, instead using builtin tweetnacl, you may want to
install libsodium and run cmake again**
Using tweetnacl for CURVE security
Detected _WIN32_WINNT from CMAKE_SYSTEM_VERSION: 0x0A00
Using polling method in I/O threads: epoll
Including wepoll
Using polling method in zmq_poll(er)_* API: poll
Using 64 bytes alignment for lock-free data structures
Looking for include file windows.h
Looking for include file windows.h - found
Looking for include files winsock2.h, afunix.h
Looking for include files winsock2.h, afunix.h - found
Looking for include file condition_variable
Looking for include file condition_variable - found
Using condition_variable_t implementation: stl11
Looking for WSAStartup
Looking for WSAStartup - found
Looking for UuidCreateSequential
Looking for UuidCreateSequential - found
Looking for GetAdaptersAddresses
Looking for GetAdaptersAddresses - found
Looking for fopen in ws2
Looking for fopen in ws2 - not found
Performing Test HAVE_FLAG_/W3
Performing Test HAVE_FLAG_/W3 - Success
Checking whether noexcept is supported
Performing Test ZMQ_HAVE_NOEXCEPT
Performing Test ZMQ_HAVE_NOEXCEPT - Success
Could NOT find AsciiDoc (missing: ASCIIDOC_EXECUTABLE)
**CMake Warning (dev) at tests/CMakeLists.txt:306 (message):
Test 'test_bind_stream_fuzzer' is not known to CTest.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at tests/CMakeLists.txt:306 (message):
Test 'test_bind_ws_fuzzer' is not known to CTest.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at tests/CMakeLists.txt:306 (message):
Test 'test_connect_stream_fuzzer' is not known to CTest.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at tests/CMakeLists.txt:306 (message):
Test 'test_connect_ws_fuzzer' is not known to CTest.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at tests/CMakeLists.txt:306 (message):
Test 'test_socket_options_fuzzer' is not known to CTest.
This warning is for project developers. Use -Wno-dev to suppress it.**
Configuring done
After generating the Build folder I opened the resulting ZeroMQ.sln in Visual Studio 2017 (with admin rights) and performed the following steps:
In the solution explorer (including ALL_BUILD, ZERO_CHECK, libzmq ...) I set the folder "libzmq" as startup project
Start the "Local Windows Debugger"
Here is the output from Visual Studio (I replaced the actual path to the ZeroMQ folder with "MY_PATH"):
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>Checking Build System
2>------ Build started: Project: libzmq, Configuration: Debug Win32 ------
2>Generating NSIS.template.in
2>Building Custom Rule C:/Users/MY_PATH/ZeroMQ/libzmq/CMakeLists.txt
2>precompiled.cpp
2>sha1.c
2>tweetnacl.c
2>wepoll.c
2>address.cpp
2>channel.cpp
2>client.cpp
2>clock.cpp
2>ctx.cpp
2>curve_mechanism_base.cpp
2>curve_client.cpp
2>curve_server.cpp
2>dealer.cpp
2>devpoll.cpp
2>dgram.cpp
2>dist.cpp
2>endpoint.cpp
2>epoll.cpp
2>err.cpp
2>fq.cpp
2>io_object.cpp
2>io_thread.cpp
2>ip.cpp
2>ipc_address.cpp
2>ipc_connecter.cpp
2>ipc_listener.cpp
2>kqueue.cpp
2>lb.cpp
2>mailbox.cpp
2>mailbox_safe.cpp
2>mechanism.cpp
2>mechanism_base.cpp
2>metadata.cpp
2>msg.cpp
2>mtrie.cpp
2>norm_engine.cpp
2>object.cpp
2>options.cpp
2>own.cpp
2>null_mechanism.cpp
2>pair.cpp
2>peer.cpp
2>pgm_receiver.cpp
2>pgm_sender.cpp
2>pgm_socket.cpp
2>pipe.cpp
2>plain_client.cpp
2>plain_server.cpp
2>poll.cpp
2>poller_base.cpp
2>polling_util.cpp
2>pollset.cpp
2>proxy.cpp
2>pub.cpp
2>pull.cpp
2>push.cpp
2>random.cpp
2>raw_encoder.cpp
2>raw_decoder.cpp
2>raw_engine.cpp
2>reaper.cpp
2>rep.cpp
2>req.cpp
2>router.cpp
2>select.cpp
2>server.cpp
2>session_base.cpp
2>signaler.cpp
2>socket_base.cpp
2>socks.cpp
2>socks_connecter.cpp
2>stream.cpp
2>stream_engine_base.cpp
2>sub.cpp
2>tcp.cpp
2>tcp_address.cpp
2>tcp_connecter.cpp
2>tcp_listener.cpp
2>thread.cpp
2>trie.cpp
2>radix_tree.cpp
2>v1_decoder.cpp
2>v1_encoder.cpp
2>v2_decoder.cpp
2>v2_encoder.cpp
2>v3_1_encoder.cpp
2>xpub.cpp
2>xsub.cpp
2>zmq.cpp
2>zmq_utils.cpp
2>decoder_allocators.cpp
2>socket_poller.cpp
2>timers.cpp
2>radio.cpp
2>dish.cpp
2>udp_engine.cpp
2>udp_address.cpp
2>scatter.cpp
2>gather.cpp
2>ip_resolver.cpp
2>zap_client.cpp
2>zmtp_engine.cpp
2>stream_connecter_base.cpp
2>stream_listener_base.cpp
2> Creating library C:/Users/MY_PATH/ZeroMQ/libzmq/Build/lib/Debug/libzmq-v141-mt-gd-4_3_4.lib and object C:/Users/MY_PATH/ZeroMQ/libzmq/Build/lib/Debug/libzmq-v141-mt-gd-4_3_4.exp
2>libzmq.vcxproj -> C:\Users\MY_PATH\ZeroMQ\libzmq\Build\bin\Debug\libzmq-v141-mt-gd-4_3_4.dll
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
At the end I received the following error from Visual Studio:
Error message from Visual Studio
It says:
Unable to start program
'C:\Users\MY_PATH\ZeroMQ\libzmq\Build\lib\Debug\libzmq-v141-mt-gd-4_3_4.dll'.
C:\Users\MY_PATH\ZeroMQ\libzmq\Build\lib\Debug\libzmq-v141-mt-gd-4_3_4.dll is not a valid Win32 application
This leads me to the assumption that the attempt to correctly build the ZeroMQ library failed.
The last thing I tried was a suggestion from a comment in Build zeromq on Windows 10 with CMake:
"VS2015 Toolbar -> Open -> CMake -> ZMQ folder
Toolbar -> CMake -> Cache -> Generate -> ZeroMQ
Toolbar -> CMake -> Install -> ZeroMQ
You can find builds in /Users/UserName/CMakeBuilds/..."
When I tried this I received some warnings and an error that you can find here, from which I don't know what to do with it. Basically it refers to lines 275 and 306 of CMakeLists.txtand says that libsodium is not installed and the error says:
Cannot open compiler intermediate file 'c\users\MY_USER\cmakebuilds\6d974590-78c5-853d-bf52-b3f968050d60\build\x64-Debug (default)\precompiled.pch': Permission denied
multiple rules generate precompiled.hpp. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
Following the steps from the accepted answer in this post
Getting ZeroMQ up and running on Windows 10
also results in errors and no build folder is added to the user's CMakeBuilds subfolder.

Cannot install Theano libgpuarray on Windows 10

This question is for Python2.7 with Keras as a front end. I have Microsoft Visual Studio 2017 and I believe I have all the tools it needs. I followed the instructions on install CUDA. I believe it is version 10, and I think it is installed correctly. I followed the tutorial video and got a similar result at the end for the sample test. I have now moved on to installing libgpuarray. I have completed the following steps and got this error:
C:\Windows\system32>cd C:\Users\Never\Downloads\libgpuarray
C:\Users\Never\Downloads\libgpuarray>cd Build
C:\Users\Never\Downloads\libgpuarray\Build>cmake .. -DCMAKE_BUILD_TYPE=Release
-- Building for: Visual Studio 15 2017
-- The C compiler identification is MSVC 19.16.27034.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at CMakeLists.txt:26 (cmake_policy):
The OLD behavior for policy CMP0063 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Looking for strlcat
-- Looking for strlcat - not found
-- Looking for mkstemp
-- Looking for mkstemp - not found
-- Found PkgConfig: C:/MinGW_w64/bin/pkg-config.exe (found version "0.25")
-- Checking for one of the modules 'check'
Tests disabled because Check was not found
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_BUILD_TYPE
-- Build files have been written to: C:/Users/Never/Downloads/libgpuarray/Build
I tried running C:\Users\Never\Downloads\libgpuarray\Build>make next but it returned:
'make' is not recognized as an internal or external command,operable program or batch file.
There is a make script in the folder above so I tried using it, with this result:
C:\Users\Never\Downloads\libgpuarray\Build>C:\Users\Never\Downloads\libgpuarray\make.bat
C:\Users\Never\Downloads\libgpuarray\Build>REM This helps repetitive builds on windows
C:\Users\Never\Downloads\libgpuarray\Build>REM It needs the compiler you want to use to be available in the shell
C:\Users\Never\Downloads\libgpuarray\Build>REM and it will build a release version
C:\Users\Never\Downloads\libgpuarray\Build>del bld
Could Not Find C:\Users\Never\Downloads\libgpuarray\Build\bld
C:\Users\Never\Downloads\libgpuarray\Build>mkdir bld
C:\Users\Never\Downloads\libgpuarray\Build>cd bld
C:\Users\Never\Downloads\libgpuarray\Build\bld>cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release
CMake Error: Error: generator : NMake Makefiles
Does not match the generator used previously: Visual Studio 15 2017
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
C:\Users\Never\Downloads\libgpuarray\Build\bld>cmake --build . --config Release
Error: could not load cache
C:\Users\Never\Downloads\libgpuarray\Build\bld>cd ..
I am not 100% sure what to do next. I don't want to tinker and break things further, any assistance would be appreciated, thank you.
It looks like you are following the Linux instructions in the tutorial you linked. You should probably take a look at the Windows-specific instructions, considering you are building on Windows with Visual Studio.
It sounds like you may have corrupted your CMake cache a bit by running the make.bat file, so it's probably best to delete your Build folder and start over:
C:\Users\Never\Downloads\libgpuarray>mkdir Build && cd Build
C:\Users\Never\Downloads\libgpuarray\Build>cmake ..
From there, just follow the Windows-specific guidelines from the tutorial:
It will generate a Visual Studio solution file for the version installed. To build the project open this file (.sln) and run the “Build All” command after selecting the appropriate build type.

How to build a DCMTK project file with CMake?

I am trying to build a DCMTK project file using the CMake gui, so I can use it in Qt. Unfortunately, I still get a few errors. I've read many related topics (e.g. How to use Dcmtk in Qt?), but I cannot find a solution to solve my errors:
Output CMakeError.log:
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
The system cannot find the file specified
Output CMakeOutput.log:
The system is: Windows - 6.1.7601 - AMD64
It turned out to be a probem in the rc version of CMake. I installed the stable version like you told me and the problem disappeared. Thank you!

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!