summaryrefslogtreecommitdiff
path: root/muse2/cmake/QtWrapMacros.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/cmake/QtWrapMacros.cmake')
-rw-r--r--muse2/cmake/QtWrapMacros.cmake28
1 files changed, 28 insertions, 0 deletions
diff --git a/muse2/cmake/QtWrapMacros.cmake b/muse2/cmake/QtWrapMacros.cmake
new file mode 100644
index 00000000..662cabae
--- /dev/null
+++ b/muse2/cmake/QtWrapMacros.cmake
@@ -0,0 +1,28 @@
+ ## QT4_WRAP_UI3(outfiles inputfile ... )
+ ##
+ ## Adapted from QT4_WRAP_UI in FindQt4.cmake module, for MusE, by Tim.
+ ##
+ ##
+
+ MACRO (QT4_WRAP_UI3 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_h ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
+ SET(outfile_cpp ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.cpp)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile_h} ${outfile_cpp}
+ COMMAND ${QT_UIC3_EXECUTABLE}
+ ARGS ${ui_options} -o ${outfile_h} ${infile}
+ COMMAND ${QT_UIC3_EXECUTABLE}
+ ARGS ${ui_options} -o ${outfile_cpp} -impl ${outfile_h} ${infile}
+ COMMAND ${QT_MOC_EXECUTABLE}
+ ARGS ${outfile_h} >> ${outfile_cpp}
+ MAIN_DEPENDENCY ${infile})
+ SET(${outfiles} ${${outfiles}} ${outfile_h} ${outfile_cpp})
+ ENDFOREACH (it)
+
+ ENDMACRO (QT4_WRAP_UI3)
+
+