PDA

View Full Version : Using Cmake in qt5 projects



alizadeh91
14th August 2012, 11:21
Hi all...
I want to use cmake instead of qmake in qt5 base projecs
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)