How to put files generated by CMAKE_AUTOMOC in spe

2019-07-09 10:45发布

问题:

I am doing a out of source build with CMake. It is my current folder structure:

|_ProjectRoot
  |_build
  |_src
  |_inc

Since I am using Qt, my CMakeLists.txt file contains these line in order to generate required ui_*.h and moc_*.h:

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

All ui_*.h and moc_*.h files are put in ProjectRoot\build by default.

Is there any chance I can specify the moc_*.h generated to be put under ProjectRoot\moc and ui_*.h to be put under ProjectRoot\ui.

回答1:

CMake has no option to do that.



标签: qt cmake