MantisBT - CMake
View Issue Details
0014760CMake(No Category)public2014-02-17 10:542016-06-10 14:31
Mathieu Malaterre 
Kitware Robot 
normalminorhave not tried
closedmoved 
CMake 2.8.9 
 
0014760: Specify output dir for QT4_WRAP_UI
It would be nice to have an option to specify an output dir for QT4_WRAP_UI. This way it would be easier to port QMake -> CMake application.

Eg. QMake input:

[...]
UI_DIR = UI/AutoGen
FORMS += UI/UI/BrowseData.ui
[...]

Here is a suggestion for enhancement:

Change current macro into:

macro (QT4_WRAP_UI outfiles )
  QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})

  foreach (it ${ui_files})
    get_filename_component(outfile ${it} NAME_WE)
    get_filename_component(infile ${it} ABSOLUTE)
    set(outfile ${CMAKE_CURRENT_BINARY_DIR}/${QT4_WRAP_UI_DIR}/ui_${outfile}.h)
    add_custom_command(OUTPUT ${outfile}
      COMMAND ${QT_UIC_EXECUTABLE}
      ARGS ${ui_options} -o ${outfile} ${infile}
      MAIN_DEPENDENCY ${infile} VERBATIM)
    set(${outfiles} ${${outfiles}} ${outfile})
  endforeach ()

endmacro ()


Typical usage:

set(QT4_WRAP_UI_DIR UI/AutoGen )
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${QT4_WRAP_UI_DIR})
QT4_WRAP_UI(myproject_FORMS_HEADERS ${myproject_FORMS})
No tags attached.
Issue History
2014-02-17 10:54Mathieu MalaterreNew Issue
2014-02-17 10:57Brad KingNote Added: 0035129
2014-02-17 11:00Mathieu MalaterreNote Added: 0035131
2014-02-17 11:29Stephen KellyNote Added: 0035133
2016-06-10 14:29Kitware RobotNote Added: 0042490
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035129)
Brad King   
2014-02-17 10:57   
CMake 3.0 introduces an AUTOUIC feature to replace the need for qt4_wrap_ui. Will that be able to handle this?
(0035131)
Mathieu Malaterre   
2014-02-17 11:00   
Neat! I'll give it a try when cmake enters debian. thx
(0035133)
Stephen Kelly   
2014-02-17 11:29   
I don't think AUTOUIC changes anything regarding this in particular.

Regarding porting, you might find it easier to change your use of UI_DIR as a porting step.
(0042490)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.