0
votes

I'm new to QT.

I created the code in QT Application with support of QMake, then I migrated the code in a CMake compatible application.

Since then I'm getting QCoreApplication no such file/directory error.

It also gives following message:

23:03:11: The process "/usr/bin/cmake" exited with code 2. Error while building/deploying project HCIServer (kit: CMake-New-Kit) The kit CMake-New-Kit has configuration issues which might be the root cause for this problem. When executing step "Make"


Kit Configuration:

  • OS: Ubuntu 14.04

  • Compiler: g++

  • QT Version: 5.8.0

1
show CMakeLists.txt please.eyllanesc
cmake_minimum_required(VERSION 2.8) set(CMAKE_CXX_STANDARD 11) project(HCIServer) add_executable(${PROJECT_NAME} "main.cpp" "mouseevent.cpp" "udpserver.cpp" ) Adding the find_package(Qt5Widgets) is giving another error like Configuration incomplete, errors occured!Chaitanya

1 Answers

1
votes

your CMake configuration is wrong.

This is a really small configuration file for CMake based projects:

project(HCIServer)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_STANDARD 11)

find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
add_executable(${PROJECT_NAME} main.cpp mouseevent.cpp udpserver.cpp)
target_link_librarieS(${PROJECT_NAME} Qt5::Widgets)

without the find_package, CMake doesn't knows where to look for Qt, and whithout target_link_libraries, CMake doens't know what your application needs.