Use Qt with Cmake
-
Good day . For a long time trying to solve the problem ( the third day ), which I will describe below.
There is a project on xubuntu, which gathers with Cmake. Mandatory requirement to use the library from the repository , ie, you can not download from http://qt-project.org/. Libs i need: libQt5Core.so.5 libQt5Quick.so.5 libQt5Qml.so.5 libQt5Gui.so.5 libQt5Network.so.5 libQt5v8.so.5
I have created a module library search cmake, it looks like this:
@ FIND_LIBRARY (
QT5Libs
NAMES libQt5Core.so.5
libQt5Quick.so.5
libQt5Qml.so.5
libQt5Gui.so.5
libQt5Network.so.5
libQt5v8.so.5
PATHS / usr / local / lib / usr / lib / opt / local / include / usr/lib/i386-linux-gnu /
)
if (NOT QT5Libs)
message (STATUS "Necessary QT5 libraries are not found")
message (STATUS "To install it type in the command line:")
message (STATUS "sudo apt-get install libqt5quick5")
endif (NOT QT5Libs)
FIND_LIBRARY (
ICU_LIBS
NAMES libicui18n.so
libicuuc.so
libicudata.so
PATHS / usr / local / lib / usr / lib / opt / local / include / usr/lib/i386-linux-gnu /
)
if (NOT ICU_LIBS)
message (STATUS "Necessary icu libraries are not found")
message (STATUS "To install it type in the command line:")
message (STATUS "sudo apt-get install libicu")
endif (NOT ICU_LIBS) @
Libraries are searched , everything you need install. Next, the project should compile plugins using qmake.The first question . How can i call qmake of .pro file from CMakeList?( provided that qmake is installed by using apt-get install qt5-qmake and has no links with the necessary modules to it (quick qml) Error : Project error: unknown module (s) in Qt: quick qml)?
The second question . When we set the Qt SDK - it 's all cool : the modules are searched using find_package (Qt ***), qmake knows where everything is. But the reality is that i install separate packages (this condition) with libraries and there are no ties . How to set them up?