I have main window class includes:
#include "mainwindow.h"
#include "ui_mainwindow.h"
Where ui_mainwindow.h
is source file generated from mainwindow.ui
file by cmake AUTOUIC
option:
set(CMAKE_AUTOUIC ON)
But if I do my build in another folder called "build" and generated ui_mainwindow.h
appears there:
cmake_qt_project\build\ui_mainwindow.h
How to fix the build to include ui_mainwindow.h
from another directory or if there is no such possibility generating it in src/
dir?
Also I can not include it in source file as
#include "build/ui_mainwindow.h"
I need to keep possibility to make build in any dir I want.
Add your build directory to the list of directories searched for include files:
include_directories( ${CMAKE_BINARY_DIR} )
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