Extend and use qt4_wrap_ui

This commit is contained in:
Vincent van Ravesteijn 2013-04-23 19:26:15 +02:00
parent 4e6932e44f
commit 09c2e58373
2 changed files with 24 additions and 5 deletions

View File

@ -758,17 +758,38 @@ if(QT4_QMAKE_FOUND)
ENDMACRO (QT4_WRAP_CPP)
macro (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
set(${_qt4_files})
set(${_qt4_options})
set(_QT4_DOING_OPTIONS FALSE)
foreach (_currentArg ${ARGN})
if ("${_currentArg}" STREQUAL "OPTIONS")
set(_QT4_DOING_OPTIONS TRUE)
else ()
if (_QT4_DOING_OPTIONS)
list(APPEND ${_qt4_options} "${_currentArg}")
else()
list(APPEND ${_qt4_files} "${_currentArg}")
endif()
endif()
endforeach()
endmacro()
# QT4_WRAP_UI(outfiles inputfile ... )
MACRO (QT4_WRAP_UI outfiles )
QT4_EXTRACT_OPTIONS(ui_files_list ui_options ${ARGN})
FOREACH (it ${ui_files_list})
FOREACH (it ${ARGN})
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_UIC_EXECUTABLE}
ARGS -o ${outfile} ${infile}
ARGS ${ui_options} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile})
set(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH (it)

View File

@ -51,9 +51,7 @@ macro(LYX_ADD_UI_FILES _sources _ui)
# ######
# Latest test showed on linux and windows show no bad consequeces,
# so we removed the call to LyXuic.cmake
add_custom_command(OUTPUT ${_header}
COMMAND ${QT_UIC_EXECUTABLE} -tr lyx::qt_ ${_tmp_FILE} -o ${_header}
MAIN_DEPENDENCY ${_tmp_FILE})
qt4_wrap_ui(${_header} ${_tmp_FILE} OPTIONS -tr lyx::qt_)
set(${_ui} ${${_ui}} ${_header})
endforeach (_current_FILE)
endmacro(LYX_ADD_UI_FILES)