Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Compiling Qt 5.7 applications without Xcode

    C++ Gurus
    3
    8
    2571
    Loading More Posts
    • 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
      FamilyHistorian last edited by

      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 Reply Quote 0
      • A
        ambershark @FamilyHistorian last edited by

        @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 Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          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 Reply Quote 0
          • F
            FamilyHistorian last edited by

            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 Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              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 Reply Quote 0
              • A
                ambershark @FamilyHistorian last edited by ambershark

                @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 Reply Quote 1
                • F
                  FamilyHistorian @ambershark last edited by

                  @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 Reply Quote 1
                  • A
                    ambershark @FamilyHistorian last edited by

                    @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 Reply Quote 1
                    • First post
                      Last post