How to use a build system other than qmake with a Qt project? -
in qtcreator template qt project has simple .pro configuration file. .pro file qmake utility generates makefiles each of contains lots of includes every qt dependent source file:
release/moc_mainwindow.cpp: src/controller/controller.hpp \ ... ../../../../qt/5.6/mingw49_32/include/qtwidgets/qmainwindow \ ../../../../qt/5.6/mingw49_32/include/qtwidgets/qmainwindow.h \ ... 100 lines here ... ../../../../qt/5.6/mingw49_32/include/qtwidgets/qpushbutton.h \ ../../../../qt/5.6/mingw49_32/include/qtwidgets/qabstractbutton.h \ src/view/qt/mainwindow.hpp
i have difficulties configuring .pro files decided configure qt project build system: make, automake, cmake example.
is there way configure build system automatically including lots of qt header files? or not include them build qt project without qtcreator?
my question different using cmake qt creator because don't need qt creator present solve problem
my cmake template:
cmake_minimum_required (version 2.8) project(qttest) set(project_version 0.0.1) if("${cmake_cxx_compiler_id}" strequal "gnu") set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++1y -pthread -fno-permissive -pedantic -wall -wextra -fpic") endif("${cmake_cxx_compiler_id}" strequal "gnu") set(qt_version_req "5.2") find_package(qt5core ${qt_version_req} required) find_package(qt5quick ${qt_version_req} required) find_package(qt5widgets ${qt_version_req} required) find_package(qt5dbus ${qt_version_req} required) set(cmake_automoc on) include_directories(${cmake_current_source_dir}) list(append sources ) list(append main_sources main.cpp ${sources} ) list(append libs qt5::core qt5::quick qt5::widgets qt5::dbus ) add_executable(${project_name} ${main_sources}) target_link_libraries(${project_name} ${libs})
Comments
Post a Comment