QMake: required libraries.
QT += core
QT -= gui
QT += network
CMake: you only need to add. An exception (QT - = gui) is not required.
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
QMake: additional compiler flags:
CONFIG += c++11
CMake: expand the list of compiler flags as needed.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
QMake: source files
SOURCES += main.cpp \
test_interface.cpp \
motomanlibrary.cpp \
processing.cpp
CMake: create a list of source files
set(SOURCES
main.cpp
test_interface.cpp
motomanlibrary.cpp
processing.cpp
)
QMake: header to include:
SOURCES += main.cpp \
test_interface.h \
motomanlibrary.h \
processing.h
CMake: just show where the header files are.
include_directory(.)
include_directory(some/where/else)
QMake: the goal to build:
TARGET = test
CMake: set the name of the target, add sources, link the necessary libraries.
add_executable(test ${SOURCES} )
qt5_use_modules(test Core Network)
. qmake cmake.