I’m completely new to CMake, so I’m running through the Tutorial.
Everything seems to be working fine, until I reach Step4.
https://cmake.org/cmake/help/latest/guide/tutorial/Installing%20and%20Testing.html
I have cmake installed in c:\program files\cmake and the code files in C:\Cmake\cmake-3.20.3\Help\guide\tutorial
Iam using Visual Studio Code as coding tool.
After going through the steps (Up to ‘Testing Support’), I have created Step4_build folder and I’m executing the build:
PS C:\Cmake\cmake-3.20.3\Help\guide\tutorial\Step4_build> & ‘C:\Program Files\cmake\bin\cmake’ …\Step4
– Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
– Configuring done
– Generating done
– Build files have been written to: C:/Cmake/cmake-3.20.3/Help/guide/tutorial/Step4_build
PS C:\Cmake\cmake-3.20.3\Help\guide\tutorial\Step4_build> & ‘C:\Program Files\cmake\bin\cmake’ --build .
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
MathFunctions.vcxproj → C:\Cmake\cmake-3.20.3\Help\guide\tutorial\Step4_build\MathFunctions\Debug\MathFunctions.lib
Tutorial.vcxproj → C:\Cmake\cmake-3.20.3\Help\guide\tutorial\Step4_build\Debug\Tutorial.exe
But when I’m trying to create the install
PS C:\Cmake\cmake-3.20.3\Help\guide\tutorial\Step4_build> & ‘C:\Program Files\cmake\bin\cmake’ --install .
– Install configuration: “Release”
CMake Error at cmake_install.cmake:39 (file):
file cannot create directory: C:/Program Files (x86)/Tutorial/bin. Maybe need administrative privileges.
So I used the prefix solution
PS C:\Cmake\cmake-3.20.3\Help\guide\tutorial\Step4_build> & ‘C:\Program Files\cmake\bin\cmake’ --install . --prefix "C:\Cmake\cmake-3.20.3\Help\guide\tutorial\Step4_build"
CMake Error at cmake_install.cmake:39 (file):
file INSTALL cannot find
“C:/Cmake/cmake-3.20.3/Help/guide/tutorial/Step4_build/Release/Tutorial.exe”:
No error.
If the intall fails, then why is it “No Error”. But why did it fail in the first place.
Can someone help to find out what’s wrong?
I compared the modified Step4 folder with the Step5 folder and all files are completely identical.
Any support is appreciated.
Kind regards
BlueFlash