I have a file who look like this :
    ...
    #ifdef IS_COMPILE_FOR_SPECIAL_TARGET
        #include "ui_myPage_special.h"
    #else
        #include "ui_myPage.h"
    #endif
The project use AutoUIC to include ui_ files. But since AutoUIC is called before the prepocessor, it ignore my #ifdef statement and try to replace the ui_myPage_special.h despite the .ui don't exist in this project.
The error message :
AutoUic error
-------------
"SRC:/path/to/mySource.cpp"
includes the uic file "ui_myPage_special.h",
but the user interface file "myPage_special.ui"
could not be found in the following directories
...
A solution I looked for was if AutoUIC can, in case it didn't find file, replace the #include by a #error or just leave it as is. So it's the preprocessor who will raise the error, and not AutoUIC.
I tried to find if an autouic-option like this exist but I didn't find this one in the CMake documentation.