Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Compiling Qt 5.7 applications without Xcode
Forum Update on Monday, May 27th 2025

Compiling Qt 5.7 applications without Xcode

Scheduled Pinned Locked Moved Solved C++ Gurus
8 Posts 3 Posters 3.0k 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.
  • F Offline
    F Offline
    FamilyHistorian
    wrote on 15 Dec 2016, 20:40 last edited by
    #1

    Is it possible to build Qt 5.7 applications without using xcode command line tools? I am using clang 3.9 to build and cmake to configure my makefiles. Does this give me everything I need or does Xcode provide some needed libraries not included otherwise?

    Thanks in advance
    Paul

    A 1 Reply Last reply 15 Dec 2016, 20:47
    0
    • F FamilyHistorian
      15 Dec 2016, 20:40

      Is it possible to build Qt 5.7 applications without using xcode command line tools? I am using clang 3.9 to build and cmake to configure my makefiles. Does this give me everything I need or does Xcode provide some needed libraries not included otherwise?

      Thanks in advance
      Paul

      A Offline
      A Offline
      ambershark
      wrote on 15 Dec 2016, 20:47 last edited by
      #2

      @FamilyHistorian As long as your installation of clang installed all the required apple libraries you should be fine. I've never tried it without having a full install of xcode though.

      I don't ever use xcode but I make sure it's installed so all the /Developer stuff is there.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 15 Dec 2016, 20:47 last edited by
        #3

        Hi,

        How did you install clang ?

        Note that Qt officially only supports the compilers provided by Apple.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • F Offline
          F Offline
          FamilyHistorian
          wrote on 15 Dec 2016, 20:55 last edited by
          #4

          I downloaded and extracted ( tar.gz ) the clang package as a binary distribution into /usr/local.
          I have /usr/local in my path before /usr/bin. Also gcc, g++ and cc all point to clang 3.9.
          I do have xcode installed but I am going to clean my hard drive to free up some space and If I don't need xcode it may as well go :) So far, clang compiles Qt 5.7 without any issues. Again I was just wondering what, if anything, xcode contributed to the build. clang will generate Apple app bundles. It's just a command line option.

          Thanks
          Paul

          A 1 Reply Last reply 15 Dec 2016, 21:01
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 15 Dec 2016, 21:01 last edited by
            #5

            Apple provide their custom version of clang (I don't remember the specifics of the differences with the official release, sorry). It also provides the debugger and macOS,iOS,tvOS SDKs.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • F FamilyHistorian
              15 Dec 2016, 20:55

              I downloaded and extracted ( tar.gz ) the clang package as a binary distribution into /usr/local.
              I have /usr/local in my path before /usr/bin. Also gcc, g++ and cc all point to clang 3.9.
              I do have xcode installed but I am going to clean my hard drive to free up some space and If I don't need xcode it may as well go :) So far, clang compiles Qt 5.7 without any issues. Again I was just wondering what, if anything, xcode contributed to the build. clang will generate Apple app bundles. It's just a command line option.

              Thanks
              Paul

              A Offline
              A Offline
              ambershark
              wrote on 15 Dec 2016, 21:01 last edited by ambershark
              #6

              @FamilyHistorian I would hide the XCode stuff, move the directory or what I like to do is just change permissions.

              sudo chmod 000 /Applications/Xcode.app

              Now try your build again and if it tries to use anything in Xcode (since xcode doesn't use /Developer any more but instead uses /Applications/Xcode.app/Developer) then it should fail with a permissions error.

              If not and your build works you could probably safely remove Xcode.

              Oh and in case you aren't good with unix commands, restoring your permissions sudo chmod 755 /Applications/Xcode.app. :)

              I'm betting you need Xcode though.

              My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

              F 1 Reply Last reply 15 Dec 2016, 21:18
              1
              • A ambershark
                15 Dec 2016, 21:01

                @FamilyHistorian I would hide the XCode stuff, move the directory or what I like to do is just change permissions.

                sudo chmod 000 /Applications/Xcode.app

                Now try your build again and if it tries to use anything in Xcode (since xcode doesn't use /Developer any more but instead uses /Applications/Xcode.app/Developer) then it should fail with a permissions error.

                If not and your build works you could probably safely remove Xcode.

                Oh and in case you aren't good with unix commands, restoring your permissions sudo chmod 755 /Applications/Xcode.app. :)

                I'm betting you need Xcode though.

                F Offline
                F Offline
                FamilyHistorian
                wrote on 15 Dec 2016, 21:18 last edited by
                #7

                @ambershark
                First, Linux Rocks!, Mac follows.
                Windoze ..
                .
                .
                .
                You are correct. the build process needs xcrun, apparently to compile a simple test program before configuring my application so I do need Xcode.
                Thanks for your help :)
                Paul

                A 1 Reply Last reply 15 Dec 2016, 21:21
                1
                • F FamilyHistorian
                  15 Dec 2016, 21:18

                  @ambershark
                  First, Linux Rocks!, Mac follows.
                  Windoze ..
                  .
                  .
                  .
                  You are correct. the build process needs xcrun, apparently to compile a simple test program before configuring my application so I do need Xcode.
                  Thanks for your help :)
                  Paul

                  A Offline
                  A Offline
                  ambershark
                  wrote on 15 Dec 2016, 21:21 last edited by
                  #8

                  @FamilyHistorian said in Compiling Qt 5.7 applications without Xcode:

                  @ambershark
                  First, Linux Rocks!, Mac follows.
                  Windoze ..
                  .
                  .
                  .
                  You are correct. the build process needs xcrun, apparently to compile a simple test program before configuring my application so I do need Xcode.
                  Thanks for your help :)
                  Paul

                  Lol agreed on the linux part. Been running Linux since about 2000 with a brief break from 2006-2008 for OSX. And while I love OSX I got real sick of my computers costing more than cars every year, so I've been back on linux since. :)

                  Good to know it does indeed require Xcode. I kind of figured that but it was worth a test. I use that permissions thing on my release builds all the time to make sure my distribution package is working and running independently of the Qt installed on my system. So I just permission out my Qt directory and run my app, if it tries to load something that isn't contained in my dist then it fails with permission probs. ;)

                  My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                  1 Reply Last reply
                  1

                  1/8

                  15 Dec 2016, 20:40

                  • 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