Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Share my qmake project file

Share my qmake project file

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ibingow
    wrote on last edited by
    #1

    I don't like the default pro file. The objects will be in release/debug in windows, but in linux they are in the same dir of source files. With my method, the objects will be output into .obj/_win32 in windows, .obj/_linux in linux and .obj/_linux_arm and so on. Moc generated files will be in .moc/$[QT_VERSION](e.g. .moc/4.7.3), because they does not depends on platform, but the qt version.
    here is config.pri
    @CONFIG += #ezx#static ezx
    CONFIG += profile
    #profiling, -pg is not supported for msvc
    debug:!msvc:profile {
    QMAKE_CXXFLAGS_DEBUG += -pg
    QMAKE_LFLAGS_DEBUG += -pg
    }

    #$$[TARGET_PLATFORM]
    #$$[QT_ARCH] #windows symbian windowsce arm
    PLATFORM_EXT =
    ARCH_EXT =
    TOOLCHAIN_EXT =
    unix {
    PLATFORM_EXT = _unix
    linux: PLATFORM_EXT = _linux
    maemo*: PLATFORM_EXT = _maemo
    } else:win32 {
    PLATFORM_EXT = _win32
    } else:macx {
    PLATFORM_EXT = _macx
    }

    ezx {
    QT_VERSION = 2.3.8
    CONFIG += qt warn_on release
    DEFINES += QT_THREAD_SUPPORT CONFIG_EZX
    PLATFORM_EXT = _ezx
    QMAKE_CXXFLAGS.ARMCC +=
    }

    #arm: ARCH_EXT = $${ARCH_EXT}arm
    #isEqual(QT_ARCH, arm) {
    contains(QT_ARCH, arm.*) {
    ARCH_EXT = $${ARCH_EXT}
    $${QT_ARCH}
    }
    *64: ARCH_EXT = $${ARCH_EXT}_x64

    llvm: TOOLCHAIN_EXT = _llvm
    #msvc:

    DESTDIR = bin
    TARGET = $${TARGET}$${PLATFORM_EXT}$${ARCH_EXT}$${TOOLCHAIN_EXT}
    OBJECTS_DIR = .obj/$${PLATFORM_EXT}$${ARCH_EXT}$${TOOLCHAIN_EXT}
    #for Qt2, Qt3 which does not have QT_VERSION. Qt4: $$[QT_VERSION]
    MOC_DIR = .moc/$${QT_VERSION}
    RCC_DIR = .rcc/$${QT_VERSION}
    UI_DIR = .ui/$${QT_VERSION}@

    In a pro file, just write a few information and include config.pri, for example
    

    @TEMPLATE = app
    TARGET = hello
    INCLUDEPATH += src
    LIBS +=
    TRANSLATIONS+= i18n/hello_zh-cn.ts
    FORMS =

    include(config.pri)@

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Why don't you just use shadow building?

      Just do create a directory "linux" next to the directory holding your sources, change into it and do qmake ../sources/myprofile.pro and you have all your linux stuff nicely separated from the sources. Of course you can have several other build directories in parallel, each with their own settings.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved