cmake_minimum_required(VERSION 2.8.11) project(testproject) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) find_package(Qt5Widgets) add_executable(helloworld main.cpp) target_link_libraries(helloworld Qt5::Widgets)