Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [solved] qmake configurations for target device

[solved] qmake configurations for target device

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 1.4k 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.
  • D Offline
    D Offline
    digorydoo
    wrote on last edited by
    #1

    How do I define configurations to include a different set of resources for each target device? I managed to define macros that are visible inside .cpp/.h sources: In MyProject.pro I included the following lines:

    @
    DEFINES +=
    USE_THEME_ANDROID_HOLOLIGHT=1
    USE_THEME_ANDROID_HOLODARK=0
    USE_THEME_IOS=0
    @

    To use a different set of icons, I tried the following:

    @

    (USE_THEME_ANDROID_HOLOLIGHT == 1) {
    RESOURCES += images/android-holo-light/android-holo-light.qrc
    }
    (USE_THEME_ANDROID_HOLODARK == 1) {
    RESOURCES += images/android-holo-dark/android-holo-dark.qrc
    }
    (USE_THEME_IOS == 1) {
    RESOURCES += images/ios/ios.qrc
    }
    @

    However, this does not seem to be syntactically correct. The compiler says: "Opening parenthesis without prior test name".

    What's the correct way of doing this?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You can use "contains":http://qt-project.org/doc/qt-5/qmake-test-function-reference.html#contains-variablename-value test function:
      @
      contains(DEFINES, USE_THEME_ANDROID_HOLOLIGHT) {
      RESOURCES += images/android-holo-light/android-holo-light.qrc
      }
      @

      (Z(:^

      1 Reply Last reply
      0
      • D Offline
        D Offline
        digorydoo
        wrote on last edited by
        #3

        Apparently, contains doesn't work for defines that are set to some value (I set them to 1 or 0 in the example above), but if I remove this and simply define the constant or not, your suggestion works. Thanks!

        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