I have a simple CMakeLists.txt that looks like this:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(calculator)
FIND_PACKAGE(Qt5Core)
FIND_PACKAGE(Qt5Gui)
FIND_PACKAGE(Qt5Widgets)
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(calculator_SOURCES main.cpp mainwindow.cpp)
SET(calculator_HEADERS mainwindow.h)
SET(calculator_FORMS mainwindow.ui)
QT5_WRAP_CPP(calculator_HEADERS_MOC ${calculator_HEADERS})
QT5_WRAP_UI(calculator_FORMS_HEADERS ${calculator_FORMS})
ADD_LIBRARY(calculator_CONFIG ${calculator_HEADERS_MOC} ${calculator_FORMS_HEADERS})
QT5_USE_MODULES(calculator_CONFIG Widgets)
ADD_EXECUTABLE(calculator ${calculator_SOURCES} ${calculator_CONFIG})
QT5_USE_MODULES(calculator Core Gui Widgets)
And when I try to build the project using cmake -G &