revamp build system

now bin and share are not pegged to linking the executable any more,
but are proper subdirs targets of their own.
unforturnately, qmake is a bit tenacious, so we hack around a bit. :)

more or less in passing by, i removed some superfluous trailing slashes
and added path normalization as well.
This commit is contained in:
Oswald Buddenhagen
2009-04-17 11:26:03 +02:00
parent 29b437e42f
commit 13f04d8430
14 changed files with 151 additions and 130 deletions

16
bin/bin.pro Normal file
View File

@@ -0,0 +1,16 @@
IDE_BUILD_TREE = $$OUT_PWD/..
include(../qtcreator.pri)
TEMPLATE = app
TARGET = $$IDE_APP_WRAPPER
OBJECTS_DIR =
PRE_TARGETDEPS = $$PWD/qtcreator
QMAKE_LINK = cp $$PWD/qtcreator $@ && : IGNORE REST
QMAKE_CLEAN = $$IDE_APP_WRAPPER
target.path = /bin
INSTALLS += target

View File

@@ -1,4 +1,22 @@
IDE_SOURCE_TREE = $$PWD/../ IDE_SOURCE_TREE = $$PWD
defineReplace(cleanPath) {
win32:1 ~= s|\\\\|/|g
contains(1, ^/.*):pfx = /
else:pfx =
segs = $$split(1, /)
out =
for(seg, segs) {
equals(seg, ..):out = $$member(out, 0, -2)
else:!equals(seg, .):out += $$seg
}
return($$join(out, /, $$pfx))
}
defineReplace(targetPath) {
win32:1 ~= s|/|\|g
return($$1)
}
isEmpty(TEST):CONFIG(debug, debug|release) { isEmpty(TEST):CONFIG(debug, debug|release) {
!debug_and_release|build_pass { !debug_and_release|build_pass {
@@ -18,33 +36,35 @@ equals(TEST, 1) {
} }
isEmpty(IDE_BUILD_TREE) { isEmpty(IDE_BUILD_TREE) {
error("qworkbench.pri: including file must define IDE_BUILD_TREE (probably a relative path)") error("qtcreator.pri: including file must define IDE_BUILD_TREE (probably a relative path)")
} }
IDE_BUILD_TREE = $$cleanPath($$IDE_BUILD_TREE)
macx { macx {
IDE_APP_TARGET = QtCreator IDE_APP_TARGET = QtCreator
IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/bin/$${IDE_APP_TARGET}.app/Contents/PlugIns IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/bin/$${IDE_APP_TARGET}.app/Contents/PlugIns
IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH
IDE_DATA_PATH = $$IDE_BUILD_TREE/bin/$${IDE_APP_TARGET}.app/Contents/Resources
contains(QT_CONFIG, ppc):CONFIG += ppc x86 contains(QT_CONFIG, ppc):CONFIG += ppc x86
} else {
win32 {
IDE_APP_TARGET = qtcreator
} else { } else {
IDE_APP_WRAPPER = qtcreator IDE_APP_WRAPPER = qtcreator
IDE_APP_TARGET = qtcreator.bin IDE_APP_TARGET = qtcreator.bin
}
IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH/plugins/ IDE_PLUGIN_PATH = $$IDE_LIBRARY_PATH/plugins
IDE_DATA_PATH = $$IDE_BUILD_TREE/share/qtcreator
} }
IDE_APP_PATH = $$IDE_BUILD_TREE/bin IDE_APP_PATH = $$IDE_BUILD_TREE/bin
win32 {
IDE_APP_TARGET = qtcreator
IDE_LIBRARY_PATH ~= s|/+|\|
IDE_APP_PATH ~= s|/+|\|
}
INCLUDEPATH += \ INCLUDEPATH += \
$$IDE_SOURCE_TREE/src/libs \ $$IDE_SOURCE_TREE/src/libs \
$$IDE_SOURCE_TREE/tools \ $$IDE_SOURCE_TREE/tools
DEPENDPATH += \ DEPENDPATH += \
$$IDE_SOURCE_TREE/src/libs \ $$IDE_SOURCE_TREE/src/libs \
$$IDE_SOURCE_TREE/tools \ $$IDE_SOURCE_TREE/tools
LIBS += -L$$IDE_LIBRARY_PATH LIBS += -L$$IDE_LIBRARY_PATH
@@ -58,8 +78,8 @@ unix {
debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
release:MOC_DIR = $${OUT_PWD}/.moc/release-shared release:MOC_DIR = $${OUT_PWD}/.moc/release-shared
RCC_DIR = $${OUT_PWD}/.rcc/ RCC_DIR = $${OUT_PWD}/.rcc
UI_DIR = $${OUT_PWD}/.uic/ UI_DIR = $${OUT_PWD}/.uic
} }
linux-g++-* { linux-g++-* {

View File

@@ -10,7 +10,8 @@ include(doc/doc.pri)
TEMPLATE = subdirs TEMPLATE = subdirs
CONFIG += ordered CONFIG += ordered
SUBDIRS = src SUBDIRS = src share
unix:!macx:!equals(_PRO_FILE_PWD_, $$OUT_PWD):SUBDIRS += bin
# for Qt Creator translations # for Qt Creator translations
QTC_BUILD_ROOT = $$PWD QTC_BUILD_ROOT = $$PWD

View File

@@ -0,0 +1,74 @@
IDE_BUILD_TREE = $$OUT_PWD/../..
include(../../qtcreator.pri)
win32:i_flag = i
defineReplace(stripSrcDir) {
win32 {
!contains(1, ^.:.*):1 = $$OUT_PWD/$$1
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
out = $$cleanPath($$1)
out ~= s|^$$re_escape($$PWD/)||$$i_flag
return($$out)
}
contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
TEMPLATE = app
TARGET = phony_target
isEmpty(vcproj) {
QMAKE_LINK = : IGNORE REST
OBJECTS_DIR =
win32:CONFIG -= embed_manifest_exe
} else {
PHONY_DEPS = .
phony_src.input = PHONY_DEPS
phony_src.output = phony.c
phony_src.commands = echo int main() { return 0; } > phony.c
phony_src.CONFIG += combine
QMAKE_EXTRA_COMPILERS += phony_src
}
DATA_DIRS = \
snippets \
templates \
designer \
schemes \
gdbmacros
macx|!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
for(data_dir, DATA_DIRS) {
files = $$files($$PWD/$$data_dir/*.*, true)
win32:files ~= s|\\\\|/|g
FILES += $$files
}
copy2build.input = FILES
copy2build.output = $$IDE_DATA_PATH/${QMAKE_FUNC_FILE_IN_stripSrcDir}
isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS
copy2build.commands = $$QMAKE_COPY \"${QMAKE_FILE_IN}\" \"${QMAKE_FILE_OUT}\"
copy2build.name = COPY ${QMAKE_FILE_IN}
copy2build.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += copy2build
macx {
run_in_term.target = $$IDE_DATA_PATH/runInTerminal.command
run_in_term.depends = $$PWD/runInTerminal.command
run_in_term.commands = $$QMAKE_COPY $< $@
QMAKE_EXTRA_TARGETS += run_in_term
PRE_TARGETDEPS += $$run_in_term.target
QMAKE_CLEAN += $$run_in_term.target
}
}
unix:!macx {
for(data_dir, DATA_DIRS) {
eval($${data_dir}.files = $$quote($$PWD/$$data_dir))
eval($${data_dir}.path = /share/qtcreator)
INSTALLS += $$data_dir
}
}

View File

@@ -1,74 +0,0 @@
macx {
SNIPPETS.path = Contents/Resources
SNIPPETS.files = $$PWD/qtcreator/snippets
TEMPLATES.path = Contents/Resources
TEMPLATES.files = $$PWD/qtcreator/templates
DESIGNER.path = Contents/Resources
DESIGNER.files = $$PWD/qtcreator/designer
SCHEMES.path = Contents/Resources
SCHEMES.files = $$PWD/qtcreator/schemes
GDBDEBUGGER.path = Contents/Resources
GDBDEBUGGER.files = $$PWD/qtcreator/gdbmacros
RUNINTERMINAL.path = Contents/Resources
RUNINTERMINAL.files = $$PWD/qtcreator/runInTerminal.command
QMAKE_BUNDLE_DATA += SNIPPETS TEMPLATES DESIGNER SCHEMES GDBDEBUGGER RUNINTERMINAL
QMAKE_INFO_PLIST = $$PWD/qtcreator/Info.plist
} else {
# make sure the resources are in place
!exists($$OUT_PWD/app.pro) {
# we are shadow build
unix:SEPARATOR = ;
win32:SEPARATOR = &
COPYSRC = snippets \
templates \
designer \
schemes \
gdbmacros
COPYDEST = $${OUT_PWD}/../../share/qtcreator
win32:COPYDEST ~= s|/+|\|
QMAKE_POST_LINK += $${QMAKE_MKDIR} $$COPYDEST $$SEPARATOR
for(tmp,COPYSRC) {
REALSRC = $$PWD/qtcreator/$$tmp
REALDEST = $$COPYDEST/$$tmp
win32:REALSRC ~= s|/+|\|
win32:REALDEST ~= s|/+|\|
QMAKE_POST_LINK += $${QMAKE_COPY_DIR} $${REALSRC} $${REALDEST} $$SEPARATOR
}
}
}
linux-* {
keymaps.files += $$PWD/qtcreator/schemes/MS_Visual_C++.kms
keymaps.files += $$PWD/qtcreator/schemes/Xcode.kms
keymaps.path = /share/qtcreator/schemes
gdbsupport.files += $$PWD/qtcreator/gdbmacros/LICENSE.LGPL
gdbsupport.files += $$PWD/qtcreator/gdbmacros/LGPL_EXCEPTION.TXT
gdbsupport.files += $$PWD/qtcreator/gdbmacros/gdbmacros.cpp
gdbsupport.files += $$PWD/qtcreator/gdbmacros/gdbmacros.pro
gdbsupport.path = /share/qtcreator/gdbmacros
designertemplates.files += $$PWD/qtcreator/designer/templates.xml
designertemplates.files += $$PWD/qtcreator/designer/templates/*
designertemplates.path = /share/qtcreator/designer/templates
snippets.files += $$PWD/qtcreator/snippets/*.snp
snippets.path = /share/qtcreator/snippets
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget_form.h
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/main.cpp
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget.cpp
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget.h
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/widget.ui
projecttemplates.files += $$PWD/qtcreator/templates/qt4project/mywidget_form.cpp
projecttemplates.path = /share/qtcreator/templates/qt4project
INSTALLS += \
keymaps \
gdbsupport \
designertemplates \
snippets \
projecttemplates
}

2
share/share.pro Normal file
View File

@@ -0,0 +1,2 @@
TEMPLATE = subdirs
SUBDIRS = qtcreator/static.pro

View File

@@ -1,6 +1,6 @@
IDE_BUILD_TREE = $$OUT_PWD/../../ IDE_BUILD_TREE = $$OUT_PWD/../..
include(../qworkbench.pri) include(../../qtcreator.pri)
include(../shared/qtsingleapplication/qtsingleapplication.pri) include(../shared/qtsingleapplication/qtsingleapplication.pri)
TEMPLATE = app TEMPLATE = app
@@ -18,6 +18,7 @@ win32 {
macx { macx {
ICON = qtcreator.icns ICON = qtcreator.icns
QMAKE_INFO_PLIST = Info.plist
} }
macx { macx {
@@ -31,25 +32,6 @@ win32 {
unix:!macx { unix:!macx {
LIBS *= -lExtensionSystem -lAggregation LIBS *= -lExtensionSystem -lAggregation
# make sure the wrapper is in place
!exists($$OUT_PWD/app.pro) {
# we are shadow build
COPYSRC = $$PWD/$$DESTDIR/$$IDE_APP_WRAPPER
COPYDEST = $$OUT_PWD/$$DESTDIR/$$IDE_APP_WRAPPER
win32:COPYSRC ~= s|/+|\|
win32:COPYDEST ~= s|/+|\|
unix:SEPARATOR = ;
win32:SEPARATOR = &
QMAKE_POST_LINK += $${QMAKE_COPY_FILE} $${COPYSRC} $${COPYDEST} $$SEPARATOR
}
wrapper.files = $$OUT_PWD/$$DESTDIR/$$IDE_APP_WRAPPER
wrapper.path = /bin
target.path = /bin target.path = /bin
INSTALLS += target
INSTALLS += target wrapper
} }
include(../../share/share.pri)

View File

@@ -1,5 +1,5 @@
IDE_BUILD_TREE=../../../ IDE_BUILD_TREE=../../..
include(../../qworkbench.pri) include(../../../qtcreator.pri)
TEMPLATE = app TEMPLATE = app
TARGET = qtcreator_process_stub TARGET = qtcreator_process_stub

View File

@@ -1,5 +1,5 @@
IDE_BUILD_TREE = $$OUT_PWD/../../../ IDE_BUILD_TREE = $$OUT_PWD/../../..
include(qworkbench.pri) include(../qtcreator.pri)
win32 { win32 {
DLLDESTDIR = $$IDE_APP_PATH DLLDESTDIR = $$IDE_APP_PATH

View File

@@ -1,13 +1,13 @@
isEmpty(IDE_BUILD_TREE) { isEmpty(IDE_BUILD_TREE) {
IDE_BUILD_TREE = $$OUT_PWD/../../../ IDE_BUILD_TREE = $$OUT_PWD/../../..
} }
include(qworkbench.pri) include(../qtcreator.pri)
isEmpty(PROVIDER) { isEmpty(PROVIDER) {
PROVIDER = Nokia PROVIDER = Nokia
} }
DESTDIR = $$IDE_PLUGIN_PATH/$$PROVIDER/ DESTDIR = $$IDE_PLUGIN_PATH/$$PROVIDER
LIBS += -L$$DESTDIR LIBS += -L$$DESTDIR
INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins INCLUDEPATH += $$IDE_SOURCE_TREE/src/plugins
DEPENDPATH += $$IDE_SOURCE_TREE/src/plugins DEPENDPATH += $$IDE_SOURCE_TREE/src/plugins

View File

@@ -1,5 +1,5 @@
QTCREATOR = ../../plugins/ QTCREATOR = ../../plugins
TARGET = ../../../bin/qdebugger TARGET = ../../../bin/qdebugger
@@ -115,9 +115,9 @@ SOURCES += \
unix { unix {
OBJECTS_DIR = .tmp/ OBJECTS_DIR = .tmp
MOC_DIR = .tmp/ MOC_DIR = .tmp
RCC_DIR = .tmp/ RCC_DIR = .tmp
UI_DIR = .tmp/ UI_DIR = .tmp
} }

View File

@@ -8,7 +8,7 @@ TEMPLATE = app
TARGET = TARGET =
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . INCLUDEPATH += .
DESTDIR = ./ DESTDIR = .
# Input # Input
HEADERS += binpatch.h HEADERS += binpatch.h

View File

@@ -1,5 +1,5 @@
QTCREATOR = ../../plugins/ QTCREATOR = ../../plugins
TARGET = ../../../bin/texteditor TARGET = ../../../bin/texteditor
@@ -39,8 +39,8 @@ SOURCES += \
# $${QTCREATOR}/gdbdebugger/gdbdebugger.qrc # $${QTCREATOR}/gdbdebugger/gdbdebugger.qrc
unix { unix {
OBJECTS_DIR = .tmp/ OBJECTS_DIR = .tmp
MOC_DIR = .tmp/ MOC_DIR = .tmp
RCC_DIR = .tmp/ RCC_DIR = .tmp
UI_DIR = .tmp/ UI_DIR = .tmp
} }