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. Qmake: Distinguish between Mac OS X and Solaris
QtWS25 Last Chance

Qmake: Distinguish between Mac OS X and Solaris

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 3.5k Views
  • 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.
  • S Offline
    S Offline
    sptrakesh
    wrote on last edited by
    #1

    Hello,

    I am working on a project that will be developed on Mac OS X and deployed to Solaris 10 and OpenIndiana servers. The code requires slightly different linker flags to compile on these platforms. How do I add specific rules for these platforms to the qmake file? I tried:

    @
    unix: LIBS +=
    -L/usr/local/reflex/lib -lReflex
    -L/usr/local/poco/lib -lPocoFoundation -lPocoNet -lPocoXML -lPocoUtil
    -lsocket

    macx: LIBS +=
    -L/usr/local/reflex/lib -lReflex
    -L/usr/local/poco/lib -lPocoFoundation -lPocoNet -lPocoXML -lPocoUtil
    @

    However, the unix: setting seems to over-ride the macx: setting.

    Thanks
    Rakesh

    [EDIT: code formatting, please wrap in @-tags, Volker]

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      You can add sub-scopes. The mac is unix too, so both of the scopes would match. I would write it like this:

      @
      unix {
      !macx {
      LIBS +=
      -L/usr/local/reflex/lib -lReflex
      -L/usr/local/poco/lib -lPocoFoundation -lPocoNet -lPocoXML -lPocoUtil
      -lsocket
      } else {
      LIBS +=
      -L/usr/local/reflex/lib -lReflex
      -L/usr/local/poco/lib -lPocoFoundation -lPocoNet -lPocoXML -lPocoUtil
      }
      }
      @

      or simplified:

      @
      unix {
      LIBS +=
      -L/usr/local/reflex/lib -lReflex
      -L/usr/local/poco/lib -lPocoFoundation -lPocoNet -lPocoXML -lPocoUtil

      !macx: LIBS += -lsocket
      

      }
      @

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sptrakesh
        wrote on last edited by
        #3

        Perfect, thanks!

        Rakesh

        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