Я только что установил Qt 5.1.1 для Windows 32-bit (MinGW 4.8, OpenGL) и попытался добавить его в мой cmake. Но CMake просто не хочет его находить, и я не знаю, почему. Что мне не хватает? Нужно ли мне устанавливать переменную среды или что-то еще?cmake не находит qt 5.1.1
Вот мой 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)
и это выход CMake-гуй:
CMake Warning at CMakeLists.txt:14 (FIND_PACKAGE):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:
Qt5WidgetsConfig.cmake
qt5widgets-config.cmake
Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files. If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.
Вы пробовали шаги в нижней части вас выход «Добавить префикс установки «Qt5Widgets» до CMAKE_PREFIX_PATH или установить «Qt5Widgets_DIR» в каталог, содержащий один из вышеуказанных файлов. Если «Qt5Widgets» предоставляет отдельный пакет разработки или SDK, убедитесь, что он имеет ». – drescherjm