Setting up Qt in CLion
Introduction
This page is for configuring CLion for Qt development.
If having trouble with "Go to declaration": Invalid caches, if this doesn't work: Close Project > Open Project > Select CMakeList.txt
CMakeList.txt
Note: When first building your cmake project, you may need to delete target_link_libraries
and add it after the initial build. For some reason I've had problems with CMake detecting the source.
CMakeList.txt meta-object compiler
We need to specify sources to include in the moc (meta-object compiler) we can do this as follows: If we don't include this we will get all sorts of ugly vtable errors.
CLion CMake Profile
Next you need to add a custom CMake profile for Qt. This is as follows:
Last updated