source: branches/vendor/trolltech/qt/current/mkspecs/features/uic.prf @ 2

Last change on this file since 2 was 2, checked in by Dmitry A. Kuminov, 12 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 4.6 KB
Line 
1
2isEmpty(QMAKE_UIC3) {
3    win32:QMAKE_UIC3 = $$[QT_INSTALL_BINS]\uic3.exe
4    else:QMAKE_UIC3 = $$[QT_INSTALL_BINS]/uic3
5}
6
7isEmpty(QMAKE_UIC) {
8   win32:QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe
9   else:QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
10}
11
12isEmpty(UI_DIR):UI_DIR = .
13isEmpty(UI_SOURCES_DIR):UI_SOURCES_DIR = $$UI_DIR
14isEmpty(UI_HEADERS_DIR):UI_HEADERS_DIR = $$UI_DIR
15isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_
16
17# Allow FORMS3 to contain old UIC3 forms, while FORMS contains new
18# UIC files in the same project. However, if CONFIG+=uic3 and no
19# FORMS3 is defined, FORMS may only contain old UIC3 files.
20
21!uic3|!isEmpty(FORMS3) {
22    # If we have CONFIG+=uic3 and no FORMS3, then don't do this step,
23    # as UIC3 files don't need a ui_<formname>.h file
24
25    uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
26    uic.depend_command = "$$QMAKE_UIC" -d "${QMAKE_FILE_IN}"
27    uic.output = $$UI_HEADERS_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
28    uic.input = FORMS
29    uic.variable_out = GENERATED_FILES
30    uic.CONFIG += no_link target_predeps
31    uic.name = UIC ${QMAKE_FILE_IN}
32    silent:uic.commands = @echo uic ${QMAKE_FILE_IN} && $$uic.commands
33    QMAKE_EXTRA_COMPILERS += uic
34    INCREDIBUILD_XGE += uic
35}
36
37ui_dir_short = $$UI_HEADERS_DIR
38win32:ui_dir_short ~= s,^.:,/,
39contains(ui_dir_short, ^[/\\\\].*):INCLUDEPATH += $$UI_HEADERS_DIR
40else:INCLUDEPATH += $$OUT_PWD/$$UI_HEADERS_DIR
41
42# Backwards compatibility: Make shadow builds with default UI_DIR work
43# if the user did not add the source dir explicitly.
44equals(UI_DIR, .) {
45    CONFIG -= include_source_dir
46    CONFIG = include_source_dir $$CONFIG
47}
48
49uic3 {
50    isEmpty(FORMS3) {
51        UIC3_FORMS = FORMS
52        !build_pass:message("Project contains CONFIG+=uic3, but no files in FORMS3; .ui files in FORMS treated as UIC3 form files.")
53    } else {
54        UIC3_FORMS = FORMS3
55    }
56
57    uic3_decl.commands = $$QMAKE_UIC3 ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
58    uic3_decl.dependency_type = TYPE_UI
59    uic3_decl.output = $$UI_HEADERS_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
60    uic3_decl.input = $$UIC3_FORMS
61    uic3_decl.CONFIG += no_link
62    uic3_decl.variable_out = GENERATED_FILES UIC3_HEADERS
63    uic3_decl.name = UIC3 Decl ${QMAKE_FILE_IN}
64    silent:uic3_decl.commands = @echo uic3 ${QMAKE_FILE_IN} && $$uic3_decl.commands
65    QMAKE_EXTRA_COMPILERS += uic3_decl
66
67    uic3_impl.commands = $$QMAKE_UIC3 -impl ${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
68    uic3_impl.dependency_type = TYPE_UI
69    uic3_impl.output = $$UI_SOURCES_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_CPP)}
70    uic3_impl.depends = $$UI_HEADERS_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
71    uic3_impl.input = $$UIC3_FORMS
72    uic3_impl.variable_out = GENERATED_SOURCES
73    uic3_impl.name = UIC3 Impl ${QMAKE_FILE_IN}
74    silent:uic3_impl.commands = @echo uic3 -impl ${QMAKE_FILE_IN} && $$uic3_impl.commands
75    QMAKE_EXTRA_COMPILERS += uic3_impl
76
77    ### add a moc step
78    load(moc)
79    uic3_moc.commands = $$moc_header.commands
80    uic3_moc.output = $$moc_header.output
81    uic3_moc.depends = $$UI_HEADERS_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
82    uic3_moc.input = UIC3_HEADERS
83    uic3_moc.variable_out = GENERATED_SOURCES
84    uic3_moc.name = $$moc_header.name
85    QMAKE_EXTRA_COMPILERS += uic3_moc
86}
87
88defineReplace(imageCollectionCmd) {
89    unset(EMBEDDED_IMAGES)
90    RET =
91    for(image, $$list($$split(1))) {
92           EMBEDDED_IMAGES += $$image
93           count(EMBEDDED_IMAGES, 5) {
94                isEmpty(RET): RET += echo $$EMBEDDED_IMAGES > images.tmp $$escape_expand(\n\t)
95                else:         RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\n\t)
96                unset(EMBEDDED_IMAGES)
97           }
98    }
99    !isEmpty(EMBEDDED_IMAGES):RET += echo $$EMBEDDED_IMAGES >> images.tmp $$escape_expand(\n\t)
100    !isEmpty(RET) {
101        RET += $$QMAKE_UIC3 -embed $$TARGET -f images.tmp -o $$2 $$escape_expand(\n\t)
102        return($$RET)
103    }
104    return($$QMAKE_UIC3 -embed $$TARGET $$1 -o $$2)
105}
106
107image_collection.output = qmake_image_collection$${first(QMAKE_EXT_CPP)}
108image_collection.variable_out = SOURCES
109image_collection.input = IMAGES
110image_collection.CONFIG += combine
111image_collection.name = UIC3 Image collection in ${QMAKE_FILE_OUT}
112!win32 {
113    image_collection.commands = $$QMAKE_UIC3 -embed $$TARGET ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
114    silent:image_collection.commands = @echo uic3 -embed ${QMAKE_FILE_IN} && $$image_collection.commands
115} else {
116    image_collection.commands = ${QMAKE_FUNC_imageCollectionCmd}
117    silent:image_collection.commands = @echo uic3 -embed $$TARGET -f images.tmp && $image_collection.commands
118}
119QMAKE_EXTRA_COMPILERS += image_collection
120
121
Note: See TracBrowser for help on using the repository browser.