PDA

View Full Version : Problem while building Qt5 with cmake



alizadeh91
8th August 2012, 13:45
Hi all...
There is problem during building Qt5 with cmake. What's the problem?
Here is the error:

CMake Error at CMakeLists.txt:15 (qt5_use_modules):
Unknown CMake command "qt5_use_modules".

And in following comes CMakeLists.txt file:

cmake_minimum_required(VERSION 2.8.8)
project(untitled4)

# Tell CMake to run moc when necessary:
set(CMAKE_AUTOMOC ON)
# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Widgets finds its own dependencies.
find_package(Qt5Widgets REQUIRED)

add_executable(untitled4 main.cpp mainwindow.cpp)

qt5_use_modules(untitled4 Widgets)

spud
20th September 2012, 12:23
According to the documentation (http://doc-snapshot.qt-project.org/5.0/cmake-manual.html) it you need cmake 2.8.9.

cmake_minimum_required(VERSION 2.8.9)