Reputation: 2355
I have got following problem:
using CLion with Qt for programming I have some problems with autogenerated automoc files (all *automoc.cpp files annoyingly appear in my project view).
The way I configured CMake to use Qt is as follows:
invoke CONFIGURE_QT5() macro, which code is:
macro(CONFIGURE_QT5)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";" ${QT5_PACKAGE_DIR})
find_package(Qt5Widgets REQUIRED)
endmacro()
link libraries:
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
After each build there are automoc files generated for each CMake project for my build, which appear on top of my Project View in CLion (note: I cannot find those files in the directory in simple explorer).
Any advice on how to get rid of them from the project view? Or maybe how to do it the hard way - delete them after build is finished?
Upvotes: 1
Views: 535
Reputation: 963
automoc file is generated when the compiler sees a Q_OBJECT macro in a header file: it (or them) tells that the object can use signals and slots or other interactive features. If you delete it, it will be re-create the next time you click "run my project".
Upvotes: 1
Reputation: 1937
CLion relies on CMake, that considers such files as a part of the project. So currently CLion has to display them somehow. There is a request to show them grouped. Also there are changes planned that will help with this.
Upvotes: 0