cmake использует неверную версию компилятора
Я работаю с cmake и ninja в Windows 7. Это работало безупречно, пока я не открыл более старую версию своей IDE. Теперь cmake использует неправильный компилятор. Вместо C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc32x.exe теперь пытается использовать C:/Program Files (x86)/Embarcadero/RAD Studio/9.0/bin/bcc32x.exe. Конечно, я читал подобные вопросы здесь на stackru и пробовал решения, описанные там, но, похоже, ничего не работает ( как вы устанавливаете CMAKE_C_COMPILER и CMAKE_CXX_COMPILER для сборки Assimp для iOS? Например). Даже переустановка cmake ничего не делает. Мои переменные среды Windows в порядке.
Когда я пытаюсь установить переменные CMake в командной строке следующим образом:
cmake -G Ninja -D CMAKE_C_COMPILER="C:\\Program Files
(x86)\\Embarcadero\\Studio\\19.0\\bin\\bcc32x.exe" -D
CMAKE_CXX_COMPILER="C:\\Program Files (x86)\\Embarcadero\\Studio\\19.0
\\bin\\bcc32x.exe"
Вывод cmd был
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
C:\Users\cld>cd c:\
c:\>cmake -G Ninja -D CMAKE_C_COMPILER="C:\\Program Files
(x86)\\Embarcadero\\Studio\\19.0\\bin\\bcc32x.exe" -D
CMAKE_CXX_COMPILER="C:\\Program Files (x86)\\Embarcadero\\Studio\\19.0
\\bin\\bcc32x.exe"
C:\Users\cld\Desktop\smallCmakeTest
-- The C compiler identification is Embarcadero 7.30.36015
-- The CXX compiler identification is Embarcadero 7.30.36015
-- Check for working C compiler: C:/Program Files (x86)/Embarcadero/RAD
Studio/9.0/bin/bcc32x.exe
-- Check for working C compiler: C:/Program Files (x86)/Embarcadero/RAD
Studio/9.0/bin/bcc32x.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules
/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/Program Files (x86)/Embarcadero/RAD Studio/9.0/bin/bcc32x.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/cld/Desktop/smallCmakeTest/CMakeFiles/CMakeTmp
Run Build Command:"C:/ninja/ninja.exe" "cmTC_c1b2f"
[1/2] Building C object CMakeFiles\cmTC_c1b2f.dir\testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_c1b2f.dir/testCCompiler.c.obj
"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin\bcc32x.exe"
-I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\include\windows\crtl"
-I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\
include\windows\sdk" -I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0
\include\windows\rtl" -I"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0
\include\dinkumware64" -tM -O0 -v -oCMakeFiles\cmTC_
c1b2f.dir\testCCompiler.c.obj -c testCCompiler.c
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
CMake Error at CMakeLists.txt:1 (project):
The CMAKE_CXX_COMPILER:
C:/Program Files (x86)/Embarcadero/RAD Studio/9.0/bin/bcc32x.exe
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full
path
to the compiler, or to the compiler name if it is in the PATH.
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.10)
should be added at the top of the file. The version specified may be
lower
if you wish to support older CMake versions for this project. For
more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "C:/Users/cld/Desktop/smallCmakeTest/CMakeFiles
/CMakeOutput.log".
See also "C:/Users/cld/Desktop/smallCmakeTest/CMakeFiles
/CMakeError.log".