Qt Creator + CMake не разбирает файлы - PullRequest
0 голосов
/ 07 февраля 2020

Я пытаюсь настроить CMake и Qt. Однако даже простой проект fre sh не анализируется. Я попробовал решение, предоставленное здесь , но без игры в кости. Журналы, кажется, указывают, что существует проблема с поиском jom.exe, поэтому я также добавил связанный путь к переменной PATH.

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(CMake_test LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5 COMPONENTS Widgets REQUIRED)

add_executable(CMake_test
  main.cpp
  mainwindow.cpp
  mainwindow.h
  mainwindow.ui
)

target_link_libraries(CMake_test PRIVATE Qt5::Widgets)

CMakeLists.txt ( Изменено ):

file(GLOB SRC . *.cpp)
add_executable(CMake_test ${SRC})

CMakeError.log

Determining if the CXX compiler works failed with the following output:
Change Dir: C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/CMakeTmp

Run Build Command(s):jom /nologo cmTC_b431b\fast && The system cannot find the file specified
Generator: execution of make failed. Make command was: jom /nologo cmTC_b431b\fast && 

Determining if the CXX compiler works failed with the following output:
Change Dir: C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/CMakeTmp

Run Build Command(s):jom /nologo cmTC_b7633\fast && The system cannot find the file specified
Generator: execution of make failed. Make command was: jom /nologo cmTC_b7633\fast && 

Determining if the CXX compiler works failed with the following output:
Change Dir: C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/CMakeTmp

Run Build Command(s):jom /nologo cmTC_cfa37\fast && The system cannot find the file specified
Generator: execution of make failed. Make command was: jom /nologo cmTC_cfa37\fast && 

Determining if the CXX compiler works failed with the following output:
Change Dir: C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/CMakeTmp

Run Build Command(s):jom /nologo cmTC_33aea\fast && The system cannot find the file specified
Generator: execution of make failed. Make command was: jom /nologo cmTC_33aea\fast && 

Determining if the CXX compiler works failed with the following output:
Change Dir: C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/CMakeTmp

Run Build Command(s):jom /nologo cmTC_44869\fast && The system cannot find the file specified
Generator: execution of make failed. Make command was: jom /nologo cmTC_44869\fast && 

CMakeOutput.log

The system is: Windows - 10.0.18362 - AMD64
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: D:/Tools/Programming/Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/HostX64/x64/cl.exe 
Build flags: 
Id flags:  

The output was: 
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28316 for x64

CMakeCXXCompilerId.cpp
Microsoft (R) Incremental Linker Version 14.24.28316.0

/out:CMakeCXXCompilerId.exe 
CMakeCXXCompilerId.obj 


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe"

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj"

The CXX compiler identification is MSVC, found in "C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb    /qtc-cmake-MpAHVTrV/CMakeFiles/3.15.3/CompilerIdCXX/CMakeCXXCompilerId.exe"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: D:/Tools/Programming/Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/HostX64/x64/cl.exe 
Build flags: /DWIN32;/D_WINDOWS;/W3;/GR;/EHsc
Id flags:  

The output was:
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28316 for x64

CMakeCXXCompilerId.cpp
Microsoft (R) Incremental Linker Version 14.24.28316.0

/out:CMakeCXXCompilerId.exe 
CMakeCXXCompilerId.obj 


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe"

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj"

The CXX compiler identification is MSVC, found in "C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/3.15.3/CompilerIdCXX/CMakeCXXCompilerId.exe"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: D:/Tools/Programming/Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/HostX64/x64/cl.exe 
Build flags: /DWIN32;/D_WINDOWS;/W3;/GR;/EHsc
Id flags:  

The output was:
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28316 for x64

CMakeCXXCompilerId.cpp
Microsoft (R) Incremental Linker Version 14.24.28316.0

/out:CMakeCXXCompilerId.exe 
CMakeCXXCompilerId.obj 


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe"

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj"

The CXX compiler identification is MSVC, found in "C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/3.15.3/CompilerIdCXX/CMakeCXXCompilerId.exe"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: D:/Tools/Programming/Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/HostX64/x64/cl.exe 
Build flags: /DWIN32;/D_WINDOWS;/W3;/GR;/EHsc
Id flags:  

The output was:
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28316 for x64

CMakeCXXCompilerId.cpp
Microsoft (R) Incremental Linker Version 14.24.28316.0

/out:CMakeCXXCompilerId.exe 
CMakeCXXCompilerId.obj 


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe"

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj"

The CXX compiler identification is MSVC, found in "C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/3.15.3/CompilerIdCXX/CMakeCXXCompilerId.exe"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: D:/Tools/Programming/Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/HostX64/x64/cl.exe 
Build flags: /DWIN32;/D_WINDOWS;/W3;/GR;/EHsc
Id flags:  

The output was:
0
Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28316 for x64

CMakeCXXCompilerId.cpp
Microsoft (R) Incremental Linker Version 14.24.28316.0

/out:CMakeCXXCompilerId.exe 
CMakeCXXCompilerId.obj 


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe"

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj"

The CXX compiler identification is MSVC, found in "C:/Users/xips/AppData/Local/Temp/QtCreator-JKugQb/qtc-cmake-MpAHVTrV/CMakeFiles/3.15.3/CompilerIdCXX/CMakeCXXCompilerId.exe"

1 Ответ

0 голосов
/ 08 февраля 2020

Хорошо, я (вроде как) понял, что случилось. После добавления jom.exe в переменную PATH я перезапустил свой компьютер и Qt, однако он все равно не работал. Я тогда отправил свой вопрос. Некоторое время спустя я снова открыл Qt, и проект успешно проанализирован.

Затем мне все еще приходилось сталкиваться с ошибкой «Для сборки необходимо установить инструмент CMake. Настройте инструмент CMake в опциях набора». Но это также можно было исправить, закрыв и снова открыв Qt.

С этого момента сборка и запуск любого проекта работали без ошибок.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...