I'm using the Codelite IDE under ArchLinux and the gcc compiler.
Is there a way to moc the qt-specific headers automatically via project settings or do I have to moc all files manually as pre-build command?
I couldn't find any option in Codelite for selecting single header files in project tree for moc'ing them.
Also it seems not to be possible to adjust build settings for only single files - there are only the overall project settings.
Or am I missing something?
Use Qt5 mocing without qmake
-
- CodeLite Curious
- Posts: 4
- Joined: Mon Dec 19, 2016 9:33 am
- Genuine User: Yes
- IDE Question: c++
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Use Qt5 mocing without qmake
If you are using the default build system of CodeLite, then you need to this for each file. CodeLite does not inspect the header files searching for the Q_OBJECT macro.cody wrote:Is there a way to moc the qt-specific headers automatically via project settings or do I have to moc all files manually as pre-build command?
You could use the 'CMake' build system of CodeLite and in the user section of the generated 'CMakeLists.txt' you can add this line:
Code: Select all
set(CMAKE_AUTOMOC ON)
Details of the 'CMake' plugin of CodeLite:
http://codelite.org/LiteEditor/TheCMakePlugin
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 4
- Joined: Mon Dec 19, 2016 9:33 am
- Genuine User: Yes
- IDE Question: c++
- Contact:
Re: Use Qt5 mocing without qmake
Thanks for the fast response. I will try as you suggested using Cmake