[cmake-developers] [CMake 0014760]: Specify output dir for QT4_WRAP_UI

Mantis Bug Tracker mantis at public.kitware.com
Mon Feb 17 10:54:13 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://cmake.org/Bug/view.php?id=14760 
====================================================================== 
Reported By:                Mathieu Malaterre
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14760
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-02-17 10:54 EST
Last Modified:              2014-02-17 10:54 EST
====================================================================== 
Summary:                    Specify output dir for QT4_WRAP_UI
Description: 
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})

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-02-17 10:54 Mathieu MalaterreNew Issue                                    
======================================================================



More information about the cmake-developers mailing list