CMake Project Failure

When I add the line below to the CMake options to integrate the vcpkg with the CLion, 

"-DCMAKE_TOOLCHAIN_FILE=Z:/SWLibrary/vcpkg/scripts/buildsystems/vcpkg.cmake"

CMake cannot generate the project anymore and It fails with the following output:

Change Dir: Z:/Repos/C++/EssentialsTraining/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files/JetBrains/CLion 2021.2.3/bin/ninja/win/ninja.exe cmTC_00739 && [1/2] Building C object CMakeFiles\cmTC_00739.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_00739.exe
FAILED: cmTC_00739.exe
cmd.exe /C "cd . && "C:\Program Files\JetBrains\CLion 2021.2.3\bin\cmake\win\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_00739.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MIB055~1\2022\ENTERP~1\VC\Tools\MSVC\1430~1.307\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_00739.dir\testCCompiler.c.obj /out:cmTC_00739.exe /implib:cmTC_00739.lib /pdb:cmTC_00739.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D Z:\Repos\C++\EssentialsTraining\cmake-build-debug\CMakeFiles\CMakeTmp && C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy Bypass -file Z:/SWLibrary/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary Z:/Repos/C++/EssentialsTraining/cmake-build-debug/CMakeFiles/CMakeTmp/cmTC_00739.exe -installedDir Z:/SWLibrary/vcpkg/installed/x64-windows/debug/bin -OutVariable out""
'cmd.exe' is not recognized as an internal or external command,
operable program or batch file.
ninja: build stopped: subcommand failed.


CMake will not be able to correctly generate this project.

1 comment
Comment actions Permalink

Hello!

Could you please try changing the generator by specifying -G "NMake Makefiles" in File | Settings | Build, Execution, Deployment | CMake > CMake options? Does it help?

0

Please sign in to leave a comment.