Skip to content
Snippets Groups Projects
  • Oswald Buddenhagen's avatar
    13f04d84
    revamp build system · 13f04d84
    Oswald Buddenhagen authored
    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.
    13f04d84
    History
    revamp build system
    Oswald Buddenhagen authored
    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.
qtcreator.pri 2.21 KiB
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) {
    !debug_and_release|build_pass {
        TEST = 1
    }
}

linux-*-64 {
    IDE_LIBRARY_BASENAME = lib64
} else {
    IDE_LIBRARY_BASENAME = lib
}

equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
}

isEmpty(IDE_BUILD_TREE) {
    error("qtcreator.pri: including file must define IDE_BUILD_TREE (probably a relative path)")
}
IDE_BUILD_TREE = $$cleanPath($$IDE_BUILD_TREE)
macx {
    IDE_APP_TARGET   = QtCreator
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/bin/$${IDE_APP_TARGET}.app/Contents/PlugIns
    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
} else {
    win32 {
        IDE_APP_TARGET   = qtcreator
    } else {
        IDE_APP_WRAPPER  = qtcreator
        IDE_APP_TARGET   = qtcreator.bin
    }
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin

INCLUDEPATH += \
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

DEPENDPATH += \
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

LIBS += -L$$IDE_LIBRARY_PATH
# DEFINES += QT_NO_CAST_FROM_ASCII
DEFINES += QT_NO_CAST_TO_ASCII

unix {
    debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    release:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared

    debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
    release:MOC_DIR = $${OUT_PWD}/.moc/release-shared

    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
}

linux-g++-* {
    # Bail out on non-selfcontained libraries. Just a security measure
    # to prevent checking in code that does not compile on other platforms.
    QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
}