diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 4301554..452d75f 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -303,11 +303,11 @@ macro( tde_add_ui_files _sources ) -DUIC_EXECUTABLE:FILEPATH=${UIC_EXECUTABLE} -DTQT_REPLACE_SCRIPT:FILEPATH=${TQT_REPLACE_SCRIPT} -DTDE_QTPLUGINS_DIR:FILEPATH=${TDE_QTPLUGINS_DIR} + -DMOC_EXECUTABLE:FILEPATH=${MOC_EXECUTABLE} -DUI_FILE:FILEPATH=${_ui_absolute_path} -DMASTER_SOURCE_DIR:FILEPATH=${CMAKE_SOURCE_DIR} -DMASTER_BINARY_DIR:FILEPATH=${CMAKE_BINARY_DIR} -P ${CMAKE_MODULE_PATH}/tde_uic.cmake - COMMAND ${MOC_EXECUTABLE} ${_ui_basename}.h >> ${_ui_basename}.cpp DEPENDS ${_ui_absolute_path} ) endforeach( _ui_file ) diff --git a/modules/tde_uic.cmake b/modules/tde_uic.cmake index 1c1fc9f..27a237a 100644 --- a/modules/tde_uic.cmake +++ b/modules/tde_uic.cmake @@ -52,4 +52,10 @@ if( _ui_cpp_content ) string( REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _ui_cpp_content "${_ui_cpp_content}" ) string( REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _ui_cpp_content "${_ui_cpp_content}" ) file( WRITE ${_ui_basename}.cpp "#include \n#include \n\n${_ui_cpp_content}" ) + + tde_execute_process( COMMAND ${MOC_EXECUTABLE} + ${_ui_basename}.h + OUTPUT_VARIABLE _ui_h_moc_content ) + file( APPEND ${_ui_basename}.cpp "${_ui_h_moc_content}" ) + endif( )