Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Platform specific subdirs

Platform specific subdirs

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 1.6k 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.
  • E Offline
    E Offline
    Eligijus
    wrote on last edited by
    #1

    Hello,

    I have a Qt project that uses qmake and SUBDIRS template.
    Application subproject and many library subprojects. Application needs to compile and run on both linux and windows.
    Problem is that one of the library subprojects doesn't compile on windows.
    How my root project .pro file looks like:

    TEMPLATE = subdirs
    
    SUBDIRS += \
        gui_application \
        calc \
        swuinfo
    

    I have tried using platform specific identifiers:

    TEMPLATE = subdirs
    
    unix: SUBDIRS += \
        gui_application \
        calc \
        swuinfo
    win32: SUBDIRS += \
        gui_application \
        calc
    

    But that didn't work.

    Is there a way to have platform specific subdirs/components?

    raven-worxR 1 Reply Last reply
    0
    • E Eligijus

      Hello,

      I have a Qt project that uses qmake and SUBDIRS template.
      Application subproject and many library subprojects. Application needs to compile and run on both linux and windows.
      Problem is that one of the library subprojects doesn't compile on windows.
      How my root project .pro file looks like:

      TEMPLATE = subdirs
      
      SUBDIRS += \
          gui_application \
          calc \
          swuinfo
      

      I have tried using platform specific identifiers:

      TEMPLATE = subdirs
      
      unix: SUBDIRS += \
          gui_application \
          calc \
          swuinfo
      win32: SUBDIRS += \
          gui_application \
          calc
      

      But that didn't work.

      Is there a way to have platform specific subdirs/components?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Eligijus said in Platform specific subdirs:

      But that didn't work.

      what exactly didn't work?!?

      Also i don't know if it's allowed to have a space in unix: SUBDIRS. Try to remove the space, maybe this already leads to the desired behavior.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      E 1 Reply Last reply
      2
      • raven-worxR raven-worx

        @Eligijus said in Platform specific subdirs:

        But that didn't work.

        what exactly didn't work?!?

        Also i don't know if it's allowed to have a space in unix: SUBDIRS. Try to remove the space, maybe this already leads to the desired behavior.

        E Offline
        E Offline
        Eligijus
        wrote on last edited by
        #3

        @raven-worx swuinfo is still included in the project and compiling project fails because swuinfo can't be compiled on windows. space removing didn't work.

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by dheerendra
          #4

          I had some configuration like this. It was working fine. Just any miss in your configuration. Only Test_3 and Test_4 were built on mac.

          TEMPLATE = subdirs

          macx {
          SUBDIRS +=
          Test_3
          Test_4
          }
          win32 {
          SUBDIRS += Test_2
          }

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          2
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #5

            Hi
            Are you sure it works without the {} scope ?
            http://doc.qt.io/archives/qt-4.8/qmake-advanced-usage.html

            win32 {
                SOURCES += paintwidget_win.cpp
            }
            

            Oh, as @dheerendra shows :)

            E 1 Reply Last reply
            1
            • mrjjM mrjj

              Hi
              Are you sure it works without the {} scope ?
              http://doc.qt.io/archives/qt-4.8/qmake-advanced-usage.html

              win32 {
                  SOURCES += paintwidget_win.cpp
              }
              

              Oh, as @dheerendra shows :)

              E Offline
              E Offline
              Eligijus
              wrote on last edited by
              #6

              @mrjj yeah it works now even with how I showed in example that "didn't work". After successfully compiling empty project I went to do the same on main project and it failed. After removing build dir(running clean for some reason was not enough) and doing qmake-> build it worked. Thanks anyways :) .

              mrjjM 1 Reply Last reply
              0
              • E Eligijus

                @mrjj yeah it works now even with how I showed in example that "didn't work". After successfully compiling empty project I went to do the same on main project and it failed. After removing build dir(running clean for some reason was not enough) and doing qmake-> build it worked. Thanks anyways :) .

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Eligijus
                Hi
                yeah, it creates a cache file and sometimes , its best to wipe whole folder as
                clean seems not to 100% do the same.

                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