相关疑难解决方法(0)

cmake找不到qt 5.1.1

我刚刚为Windows 32位(MinGW 4.8,OpenGL)安装了Qt 5.1.1,并尝试将其添加到我的cmake中.但是CMake只是不想找到它,我不知道为什么.我错过了什么?我需要设置环境变量吗?

这是我的cmake:

cmake_minimum_required( VERSION 2.8.11 )
PROJECT(Blemmer)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})

set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
find_package(SFML REQUIRED system window graphics network audio)
# The QUIET option disables messages if the package cannot be found. 
FIND_PACKAGE(Qt5Widgets) 
add_subdirectory(Entity)
add_subdirectory(Engine)
add_subdirectory(Game)
add_executable(Blemmer main.cpp)

include_directories(${SFML_INCLUDE_DIR} ${PROJECT_SOURCE_DIR})
target_link_libraries(Blemmer ${SFML_LIBRARIES} Game Engine Qt5::Widgets)
Run Code Online (Sandbox Code Playgroud)

这是cmake-gui的输出:

CMake …
Run Code Online (Sandbox Code Playgroud)

c++ qt cmake qt5 qtwidgets

12
推荐指数
3
解决办法
5万
查看次数

使用 CMake 检测 Qt5

我正在尝试在 Ubuntu 上安装和使用 Qt 5。为我的需要 Qt 5 的项目运行 CMake 会导致:

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX …
Run Code Online (Sandbox Code Playgroud)

qt cmake qt5

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

cmake ×2

qt ×2

qt5 ×2

c++ ×1

qtwidgets ×1