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. Exclude source from build
Forum Updated to NodeBB v4.3 + New Features

Exclude source from build

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 3 Posters 3.3k Views 2 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.
  • M Offline
    M Offline
    moravas
    wrote on 10 Jan 2017, 10:47 last edited by
    #1

    Hi Folks,

    My use case is the following:
    I have some classes (source and header) that implement Windows, Linux or MAC dependent part.
    How should I edit my .pro file for exclude the appropriate classes from the build, BUT they stay there in the project side bar for reading or even editing them?
    Can I do this via the .pro file?

    Regards,
    Norbert

    R K 2 Replies Last reply 10 Jan 2017, 11:02
    0
    • M moravas
      10 Jan 2017, 10:47

      Hi Folks,

      My use case is the following:
      I have some classes (source and header) that implement Windows, Linux or MAC dependent part.
      How should I edit my .pro file for exclude the appropriate classes from the build, BUT they stay there in the project side bar for reading or even editing them?
      Can I do this via the .pro file?

      Regards,
      Norbert

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 10 Jan 2017, 11:02 last edited by
      #2

      @moravas
      i can only think of something like this:

      win32 {
          SOURCES += win.cpp
      } else {
          OTHER_FILES += win.cpp
      }
      

      --- 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

      1 Reply Last reply
      1
      • M moravas
        10 Jan 2017, 10:47

        Hi Folks,

        My use case is the following:
        I have some classes (source and header) that implement Windows, Linux or MAC dependent part.
        How should I edit my .pro file for exclude the appropriate classes from the build, BUT they stay there in the project side bar for reading or even editing them?
        Can I do this via the .pro file?

        Regards,
        Norbert

        K Offline
        K Offline
        kshegunov
        Moderators
        wrote on 10 Jan 2017, 11:05 last edited by
        #3

        I scope them as @raven-worx shows for the different platforms, but I don't use OTHER_FILES, they are visible in my Creator (4.2) even if not built.

        Read and abide by the Qt Code of Conduct

        R 1 Reply Last reply 10 Jan 2017, 11:05
        0
        • K kshegunov
          10 Jan 2017, 11:05

          I scope them as @raven-worx shows for the different platforms, but I don't use OTHER_FILES, they are visible in my Creator (4.2) even if not built.

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 10 Jan 2017, 11:05 last edited by raven-worx 1 Oct 2017, 11:07
          #4

          @kshegunov
          that was what he requested ... as i understood it?
          If i am wrong, remove the else part.

          --- 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

          K 1 Reply Last reply 10 Jan 2017, 11:08
          0
          • R raven-worx
            10 Jan 2017, 11:05

            @kshegunov
            that was what he requested ... as i understood it?
            If i am wrong, remove the else part.

            K Offline
            K Offline
            kshegunov
            Moderators
            wrote on 10 Jan 2017, 11:08 last edited by
            #5

            Yes, I know, I meant that OTHER_FILES += win.cpp shouldn't be needed. At least I don't need it for the files to show in Creator. For example I have:

            macx {
                SOURCES += \
                    $$PWD/qdaemoncontroller_osx.cpp \
                    $$PWD/qdaemon_osx.cpp
            } else: unix {
                SOURCES += \
                    $$PWD/qdaemoncontroller_linux.cpp \
                    $$PWD/qdaemon_linux.cpp
            }
            

            and I see all of them in the sidebar regardless of the platform.

            Read and abide by the Qt Code of Conduct

            R 1 Reply Last reply 10 Jan 2017, 11:09
            2
            • K kshegunov
              10 Jan 2017, 11:08

              Yes, I know, I meant that OTHER_FILES += win.cpp shouldn't be needed. At least I don't need it for the files to show in Creator. For example I have:

              macx {
                  SOURCES += \
                      $$PWD/qdaemoncontroller_osx.cpp \
                      $$PWD/qdaemon_osx.cpp
              } else: unix {
                  SOURCES += \
                      $$PWD/qdaemoncontroller_linux.cpp \
                      $$PWD/qdaemon_linux.cpp
              }
              

              and I see all of them in the sidebar regardless of the platform.

              R Offline
              R Offline
              raven-worx
              Moderators
              wrote on 10 Jan 2017, 11:09 last edited by
              #6

              @kshegunov
              ah ok, didn't know that.

              --- 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

              K 1 Reply Last reply 10 Jan 2017, 11:10
              0
              • R raven-worx
                10 Jan 2017, 11:09

                @kshegunov
                ah ok, didn't know that.

                K Offline
                K Offline
                kshegunov
                Moderators
                wrote on 10 Jan 2017, 11:10 last edited by kshegunov 1 Oct 2017, 11:10
                #7

                This might've been a change between Creator versions, that's why I'm raising it as a point (and providing my IDE's version). I think that on older versions this wasn't the case.

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  moravas
                  wrote on 10 Jan 2017, 11:21 last edited by
                  #8

                  Hi,

                  It seems to be what I want.
                  Thank you!

                  Regards,
                  Norbert

                  1 Reply Last reply
                  0

                  1/8

                  10 Jan 2017, 10:47

                  • Login

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