Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35928

Wrong error message if just XCode Command Line Tools installed instead of complete XCode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.9.2
    • 5.2.0
    • Build tools: qmake
    • None
    • Qt 5.2.0 on Mac OS X Mavericks (10.9.1) with XCode Command Line Tools but WITHOUT XCode!
    • fa7626713b3a943609453459190e16c49d61dfd3

    Description

      It seems that I need to install the complete XCode IDE instead of just the XCode Command Line Tools (this requirement not that clearly documented - some docs sounds like XCode is just needed to install the Command Line Tools).

      If you try to compile a Qt project using qmake (or QT Creator) without having XCode installed, you get the following error message:

      "Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild."

      But in this case it's not a license issue. The license is confirmed, all XCode Command Line Tools are working properly when called manually.

      The message comes up from the following code:

      mkspecs/features/mac/default_pre.prf
      isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
          # Get path of Xcode's Developer directory
          QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
          isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
              error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
      
          # Make sure Xcode path is valid
          !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
              error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
      
          # Make sure Xcode is set up properly
          isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
              error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
      }
      
      

      xcrun --find xcrun returns an error if the license is not accepted OR if XCode is not installed (or the active developer directory points to the commnd line tools).

      So there should be a separate check performed to detect if XCode is installed and the active developer directory points to the XCode installations (e.g. the output of xcode-select --print-path may not contain the word "CommandLineTools").

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-35928
          # Subject Branch Project Status CR V

          Activity

            People

              jakepetroules Jake Petroules (DO NOT ASSIGN ISSUES)
              mic Michael Hanfland
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes