The CMake failed to generate cache when CMake project name is Non-English.
Repro Steps:
- Open the VS.
- Create a CMake project via File->New->Project->Visual C++->CMakeProject
- Change the default project name to Non-English (the name language is same with OS language).
- Click the "OK" and open the CMake project. The CMake cache should be generated successfully,actually CMake failed to generate cache.And this should be a CMake Proper issue.
The error messages:
"1> Příkazový řádek: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\PREVIEW\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\mdTestAU\CMakeBuilds\0bce73df-7849-2031-89c7-f1f7c4051778\install\x86-Debug" -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/Preview/Enterprise/VC/Tools/MSVC/14.14.26412/bin/HostX86/x86/cl.exe" -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/Preview/Enterprise/VC/Tools/MSVC/14.14.26412/bin/HostX86/x86/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\PREVIEW\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Users\mdTestAU\Desktop\stavětstavět"
1> Pracovní adresář: C:\Users\mdTestAU\CMakeBuilds\0bce73df-7849-2031-89c7-f1f7c4051778\build\x86-Debug
1> -- The C compiler identification is MSVC 19.14.26412.0
1> -- The CXX compiler identification is MSVC 19.14.26412.0
1> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/Preview/Enterprise/VC/Tools/MSVC/14.14.26412/bin/HostX86/x86/cl.exe
1> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/Preview/Enterprise/VC/Tools/MSVC/14.14.26412/bin/HostX86/x86/cl.exe -- works
1> -- Detecting C compiler ABI info
1> -- Detecting C compiler ABI info - done
1> -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/Preview/Enterprise/VC/Tools/MSVC/14.14.26412/bin/HostX86/x86/cl.exe
1> -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/Preview/Enterprise/VC/Tools/MSVC/14.14.26412/bin/HostX86/x86/cl.exe -- works
1> -- Detecting CXX compiler ABI info
1> -- Detecting CXX compiler ABI info - done
1> -- Detecting CXX compile features
1> -- Detecting CXX compile features - done
1> CMake Error at stavětstavět/CMakeLists.txt:7 (add_executable):
1> The target name "stavětstavět" is reserved or not valid for certain CMake
1> features, such as generator expressions, and may result in undefined
1> behavior.
1>
1>
1> -- Configuring incomplete, errors occurred!
1> See also "C:/Users/mdTestAU/CMakeBuilds/0bce73df-7849-2031-89c7-f1f7c4051778/build/x86-Debug/CMakeFiles/CMakeOutput.log".
1> C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\PREVIEW\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\mdTestAU\CMakeBuilds\0bce73df-7849-2031-89c7-f1f7c4051778\install\x86-Debug" -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/Preview/Enterprise/VC/Tools/MSVC/14.14.26412/bin/HostX86/x86/cl.exe" -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/Preview/Enterprise/VC/Tools/MSVC/14.14.26412/bin/HostX86/x86/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\PREVIEW\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Users\mdTestAU\Desktop\stavětstavět" – vráceno s ukončovacím kódem: 1
CMake Error at stavětstavět/CMakeLists.txt:7 (add_executable):
The target name "stavětstavět" is reserved or not valid for certain CMake
features, such as generator expressions, and may result in undefined
behavior"
Thank you!
Edited by Brad King