|
|
@ -31,8 +31,16 @@ if( TDE_QTPLUGINS_DIR )
|
|
|
|
set( L -L ${TDE_QTPLUGINS_DIR} )
|
|
|
|
set( L -L ${TDE_QTPLUGINS_DIR} )
|
|
|
|
endif( )
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Choose translation function, different for TQt and TDE
|
|
|
|
|
|
|
|
if ( TDE_FOUND AND NOT TQT_ONLY )
|
|
|
|
|
|
|
|
set( TR_FUNC "tr2i18n" )
|
|
|
|
|
|
|
|
else( TDE_FOUND AND NOT TQT_ONLY )
|
|
|
|
|
|
|
|
set( TR_FUNC "tr" )
|
|
|
|
|
|
|
|
endif( TDE_FOUND AND NOT TQT_ONLY )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Generate ui .h file
|
|
|
|
tde_execute_process( COMMAND ${UIC_EXECUTABLE}
|
|
|
|
tde_execute_process( COMMAND ${UIC_EXECUTABLE}
|
|
|
|
-nounload -tr tr2i18n
|
|
|
|
-nounload -tr ${TR_FUNC}
|
|
|
|
${L}
|
|
|
|
${L}
|
|
|
|
${local_ui_file}
|
|
|
|
${local_ui_file}
|
|
|
|
OUTPUT_VARIABLE _ui_h_content )
|
|
|
|
OUTPUT_VARIABLE _ui_h_content )
|
|
|
@ -40,30 +48,35 @@ tde_execute_process( COMMAND ${UIC_EXECUTABLE}
|
|
|
|
if( _ui_h_content )
|
|
|
|
if( _ui_h_content )
|
|
|
|
string( REGEX REPLACE "#ifndef " "#ifndef UI_" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "#ifndef " "#ifndef UI_" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "#define " "#define UI_" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "#define " "#define UI_" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "public TQWizard" "public KWizard" _ui_h_content "${_ui_h_content}" )
|
|
|
|
if ( TDE_FOUND AND NOT TQT_ONLY )
|
|
|
|
string( REGEX REPLACE "public QWizard" "public KWizard" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "public TQWizard" "public KWizard" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "#include <ntqwizard.h>" "#include <kwizard.h>" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "public QWizard" "public KWizard" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "#include <qwizard.h>" "#include <kwizard.h>" _ui_h_content "${_ui_h_content}" )
|
|
|
|
string( REGEX REPLACE "#include <ntqwizard.h>" "#include <kwizard.h>" _ui_h_content "${_ui_h_content}" )
|
|
|
|
|
|
|
|
string( REGEX REPLACE "#include <qwizard.h>" "#include <kwizard.h>" _ui_h_content "${_ui_h_content}" )
|
|
|
|
|
|
|
|
endif( TDE_FOUND AND NOT TQT_ONLY )
|
|
|
|
file( WRITE ${_ui_basename}.h "${_ui_h_content}" )
|
|
|
|
file( WRITE ${_ui_basename}.h "${_ui_h_content}" )
|
|
|
|
endif( )
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Generate ui .cpp file
|
|
|
|
tde_execute_process( COMMAND ${UIC_EXECUTABLE}
|
|
|
|
tde_execute_process( COMMAND ${UIC_EXECUTABLE}
|
|
|
|
-nounload -tr tr2i18n
|
|
|
|
-nounload -tr ${TR_FUNC}
|
|
|
|
${L}
|
|
|
|
${L}
|
|
|
|
-impl ${_ui_basename}.h
|
|
|
|
-impl ${_ui_basename}.h
|
|
|
|
${local_ui_file}
|
|
|
|
${local_ui_file}
|
|
|
|
OUTPUT_VARIABLE _ui_cpp_content )
|
|
|
|
OUTPUT_VARIABLE _ui_cpp_content )
|
|
|
|
|
|
|
|
|
|
|
|
if( _ui_cpp_content )
|
|
|
|
if( _ui_cpp_content )
|
|
|
|
string( REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _ui_cpp_content "${_ui_cpp_content}" )
|
|
|
|
string( REGEX REPLACE "${TR_FUNC}\\(\"\"\\)" "TQString::null" _ui_cpp_content "${_ui_cpp_content}" )
|
|
|
|
string( REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _ui_cpp_content "${_ui_cpp_content}" )
|
|
|
|
string( REGEX REPLACE "${TR_FUNC}\\(\"\", \"\"\\)" "TQString::null" _ui_cpp_content "${_ui_cpp_content}" )
|
|
|
|
string( REGEX REPLACE ": TQWizard\\(" ": KWizard(" _ui_cpp_content "${_ui_cpp_content}" )
|
|
|
|
if ( TDE_FOUND AND NOT TQT_ONLY )
|
|
|
|
string( REGEX REPLACE ": QWizard\\(" ": KWizard(" _ui_cpp_content "${_ui_cpp_content}" )
|
|
|
|
string( REGEX REPLACE ": TQWizard\\(" ": KWizard(" _ui_cpp_content "${_ui_cpp_content}" )
|
|
|
|
file( WRITE ${_ui_basename}.cpp "#include <kdialog.h>\n#include <tdelocale.h>\n\n${_ui_cpp_content}" )
|
|
|
|
string( REGEX REPLACE ": QWizard\\(" ": KWizard(" _ui_cpp_content "${_ui_cpp_content}" )
|
|
|
|
|
|
|
|
set( _ui_cpp_content "#include <kdialog.h>\n#include <tdelocale.h>\n\n${_ui_cpp_content}" )
|
|
|
|
|
|
|
|
endif( TDE_FOUND AND NOT TQT_ONLY )
|
|
|
|
|
|
|
|
file( WRITE ${_ui_basename}.cpp "${_ui_cpp_content}" )
|
|
|
|
|
|
|
|
|
|
|
|
tde_execute_process( COMMAND ${MOC_EXECUTABLE}
|
|
|
|
tde_execute_process( COMMAND ${MOC_EXECUTABLE}
|
|
|
|
${_ui_basename}.h
|
|
|
|
${_ui_basename}.h
|
|
|
|
OUTPUT_VARIABLE _ui_h_moc_content )
|
|
|
|
OUTPUT_VARIABLE _ui_h_moc_content )
|
|
|
|
file( APPEND ${_ui_basename}.cpp "${_ui_h_moc_content}" )
|
|
|
|
file( APPEND ${_ui_basename}.cpp "${_ui_h_moc_content}" )
|
|
|
|
|
|
|
|
endif( _ui_cpp_content )
|
|
|
|
endif( )
|
|
|
|
|
|
|
|