How to specify a precompiled header to the output of CMake (2.8.12.1) AUTOMOC ?
So far, in the CMakeLists.txt I've tried these two separately:
set(AUTOMOC_MOC_OPTIONS "-bstdafx.h")
set(AUTOMOC_MOC_OPTIONS "-fstdafx.h")
The generated AUTOMOC output when building the project (project_automoc.cpp) only contains the moc_xxx.cpp files:
/* This file is autogenerated, do not edit*/
/// <- stdafx.h should be here ?!?!
#include "moc_widget_fps.cpp"
#include "moc_widget_sysevents.cpp"
The correct variable to set is called CMAKE_AUTOMOC_MOC_OPTIONS. It is used to initialize the AUTOMOC_MOC_OPTIONS
property of a target, i.e.:
set (CMAKE_AUTOMOC_MOC_OPTIONS "-bstdafx.h" "-fstdafx.h")
Also note that this will only make the Qt MOC compiler add the given includes to each generated moc_xxx.cpp
file. The overall project_automoc.cpp
will not be affected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With