SCM

Discussion Forums: help

Monitor Forum | Start New Thread Start New Thread

 

RE: How to use a specific Qt module (not already included in CamiTK 4) in a library [ reply ]
By: Emmanuel Promayon on 2016-05-28 10:09
[forum:3642]
Glad it worked, and thank you for sharing!

Just to add a little precision: this will work for CamiTK 4 because QSerialPort is only available in Qt5 as a module.
However, the trick for adding an extra Qt module can also be applied to components or actions.
It can also be applied to older CamiTK version using adequate modifications (use Qt4 in the find_package macro and qt4_use_modules after the camitk_xxx macro)

More generally, the camitk_xxx macro are here to help writing the CMakelists.txt. We tried to put as much as we can in them to simplify the developer's life, but they cannot be universal and ready for all the ever possible configurations!
But thanks to the cmake language, these macros that can be tweaked to fit your need. Exactly like Baptiste presented here. Thanks again!

Mahnu

How to use a specific Qt module (not already included in CamiTK 4) in a library [ reply ]
By: Baptiste Veron on 2016-05-27 14:16
[forum:3641]
Hello,

I wanted to build a camitk library to manage RS232 communications. To do that I used the SerialPort Qt module (included in Qt since Qt5.1).

The camitk_library cmake macro does not allow to add a specific Qt module, thus I "manually" added the module as follows:

gather_headers_and_sources(MYLIB)
find_package(Qt5 COMPONENTS SerialPort REQUIRED)
camitk_library( SHARED
SOURCES ${MYLIB_SOURCES}
NEEDS_QT
)
qt5_use_modules(library-lprmaterial SerialPort)

Note : this won't work if you want to build a static library

PS: Thanks Manu and Antoine for the advices

   
Powered By FusionForge