According to the documentation, regarding autouic:
If a preprocessor #include directive is found which matches ui_.h, and a .ui file exists, then uic will be executed to generate the appropriate file.
But what if the .ui file is in another folder? I currently get the following error when trying to build:
AUTOUIC : error : process for ui_module.h failed:
File 'C:/app/source/headers/module.ui' is not valid
The ui file is actually located here:
C:/app/source/forms/module.ui
I've tried to add the C:/app/source/forms/
to the include_directories()
-macro without success. Any ideas?
Issue mentioned in this answer is now resolved.
This worked in CMake v3.9.0-rc6:
set(CMAKE_AUTOUIC_SEARCH_PATHS your/folder/here)
See documentation of AUTOUIC_SEARCH_PATHS.
Update
A search path, CMAKE_AUTOUIC_SEARCH_PATHS, has been added to CMake version 3.9.
After further investigation, it seems like it's not possible to do. There is an open issue in their tracking system, but it is so far not implemented:
Add Search path for AUTOUIC
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