OSDN Git Service

VCS[git]: Added git fetch
[qt-creator-jp/qt-creator-jp.git] / qtcreator.pri
1 defineReplace(cleanPath) {
2     win32:1 ~= s|\\\\|/|g
3     contains(1, ^/.*):pfx = /
4     else:pfx =
5     segs = $$split(1, /)
6     out =
7     for(seg, segs) {
8         equals(seg, ..):out = $$member(out, 0, -2)
9         else:!equals(seg, .):out += $$seg
10     }
11     return($$join(out, /, $$pfx))
12 }
13
14 defineReplace(targetPath) {
15     return($$replace(1, /, $$QMAKE_DIR_SEP))
16 }
17
18 defineReplace(qtLibraryName) {
19    unset(LIBRARY_NAME)
20    LIBRARY_NAME = $$1
21    CONFIG(debug, debug|release) {
22       !debug_and_release|build_pass {
23           mac:RET = $$member(LIBRARY_NAME, 0)_debug
24               else:win32:RET = $$member(LIBRARY_NAME, 0)d
25       }
26    }
27    isEmpty(RET):RET = $$LIBRARY_NAME
28    return($$RET)
29 }
30
31 # For use in custom compilers which just copy files
32 win32:i_flag = i
33 defineReplace(stripSrcDir) {
34     win32 {
35         !contains(1, ^.:.*):1 = $$OUT_PWD/$$1
36     } else {
37         !contains(1, ^/.*):1 = $$OUT_PWD/$$1
38     }
39     out = $$cleanPath($$1)
40     out ~= s|^$$re_escape($$PWD/)||$$i_flag
41     return($$out)
42 }
43
44 isEmpty(TEST):CONFIG(debug, debug|release) {
45     !debug_and_release|build_pass {
46         TEST = 1
47     }
48 }
49
50 isEmpty(IDE_LIBRARY_BASENAME) {
51     IDE_LIBRARY_BASENAME = lib
52 }
53
54 DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
55
56 equals(TEST, 1) {
57     QT +=testlib
58     DEFINES += WITH_TESTS
59 }
60
61 IDE_SOURCE_TREE = $$PWD
62 isEmpty(IDE_BUILD_TREE) {
63     sub_dir = $$_PRO_FILE_PWD_
64     sub_dir ~= s,^$$re_escape($$PWD),,
65     IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
66     IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
67 }
68 IDE_APP_PATH = $$IDE_BUILD_TREE/bin
69 macx {
70     IDE_APP_TARGET   = "Qt Creator"
71     IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
72     IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
73     IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
74     IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
75     IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
76     IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
77     contains(QT_CONFIG, ppc):CONFIG += ppc x86
78     copydata = 1
79 } else {
80     win32 {
81         contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
82         IDE_APP_TARGET   = qtcreator
83     } else {
84         IDE_APP_TARGET   = qtcreator
85     }
86     IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
87     IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
88     IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
89     IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
90     IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
91     IDE_BIN_PATH     = $$IDE_APP_PATH
92     !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
93 }
94
95 INCLUDEPATH += \
96     $$IDE_SOURCE_TREE/src/libs \
97     $$IDE_SOURCE_TREE/tools
98
99 DEPENDPATH += \
100     $$IDE_SOURCE_TREE/src/libs \
101     $$IDE_SOURCE_TREE/tools
102
103 LIBS += -L$$IDE_LIBRARY_PATH
104
105 #DEFINES += QT_NO_CAST_FROM_ASCII
106 DEFINES += QT_NO_CAST_TO_ASCII
107 !macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
108
109 unix {
110     CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
111     CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
112
113     CONFIG(debug, debug|release):MOC_DIR = $${OUT_PWD}/.moc/debug-shared
114     CONFIG(release, debug|release):MOC_DIR = $${OUT_PWD}/.moc/release-shared
115
116     RCC_DIR = $${OUT_PWD}/.rcc
117     UI_DIR = $${OUT_PWD}/.uic
118 }
119
120 linux-g++-* {
121     # Bail out on non-selfcontained libraries. Just a security measure
122     # to prevent checking in code that does not compile on other platforms.
123     QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
124 }
125
126 win32-msvc* { 
127     #Don't warn about sprintf, fopen etc being 'unsafe'
128     DEFINES += _CRT_SECURE_NO_WARNINGS
129 }
130
131 # Handle S60 support: default on Windows, conditionally built on other platforms.
132 macx:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
133 else:SUPPORT_QT_S60=1