Qt on OS X with just command line tools?
-
When I open a .pro file in Qt Creator, qmake does not happen and I have the following message:
"Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild"When trying to run xcodebuild, I have the following error message:
"xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance"Make sense since I didn't install XCode and xcodebuild does not seems to be bundled with the command line tools (October 2013).
But is there any way I could have Qt Creator/qmake working without depending on xcodebuild (and the huge XCode 5 install) but only the command line tools, which seems to bundle most things Qt would require anyway (compiler and OSX SDK). -
IMO, it depends on your goals.
If you just want to create OSX app, then you even don't command line tools at all, but if you want to compile your app for iOS platform (doesn't matter device, or a simulator), then you need Xcode.
Actually, xcodebuild is a bit more, than just build tool, because it provides abilities to archive app, export .ipa, .pkg or .app, etc. -
In my case I just need to create OSX app, but how can I have Qt Creator work without installing XCode ? If I just install Qt 5.2 SDK, and open any example from the SDK, the project is not parsed and I have to message I quoted above (Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild).
This work if I install XCode before, but my goal is to avoid installing the huge XCode package. I thought just installing the command line tools would be fine, but it's not. Any idea ?
-
Seems I was wrong. I've never had installed Qt without Xcode, so just ignore my previous message, and take my apologies for this mistake :)
-
Try xcodebuild -license
-
Hi and welcome to devnet,
You're welcome ! You can even up-vote the answer, that way other people facing the same issue you had will be able to find it more easily :)
-
Hi @SGaist
I tried xcodebuild -license, but it still complains:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instanceCould you please give some comments?
-
Hi and welcome to devnet,
Did you install Xcode ? If so, which version ?
-
That's the first thing to do when developing on OS X
-
I, too, would like to be able to compile OS X desktop apps without downloading and installing 4.7GB of Xcode.
Further, Qt Creator online installer claims that Xcode 5.0 is required, but developer.apple.com points to download via the App Store, which only offers the latest version (7.3) for download.
-
Where did you saw that requirement ? IIRC That's the minimum version, you can go ahead and get the Xcode matching your version of OS X.
One thing you can try is to install the command line tools. See this page
Where did you saw that requirement ?
It's right on the install of Qt 5.6. I installed Xcode first since I figured that it was needed to interface with OS X itself. That was a lengthy download too.
Further, Qt Creator online installer claims that Xcode 5.0 is required, but developer.apple.com points to download via the App Store, which only offers the latest version (7.3) for download.
7.3.1 (7D1014) to be exact today.
One thing you can try is to install the command line tools.
Trying... and the link for it is currently here rather than digging into a document that has too much information on it beyond the scope of Qt 5.6 and OS X 10.11 El Capitan with Xcode 7.3.1.
Thanks and I'll probably be back if I can't resolve this exact same issue with Qt and OS X. I am a developer, however under Linux mostly and haven't worked on a Mac in a loooooooooong time... but I've been around for several decades. Hopefully can get
qmake
visible in the path too... Qt 5.6 install wasn't very agreeable in setting that for me. One step at a time. :) -
Where did you saw that requirement ? IIRC That's the minimum version, you can go ahead and get the Xcode matching your version of OS X.
One thing you can try is to install the command line tools. See this page
That didn't seem to work either. The Command Line Tools (OS X 10.11) for Xcode 7.3.1 is installed now.
$ /usr/bin/xcodebuild -license xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance $
I'll also have to dig for adding to the environment path as
qmake
still isn't anywhere to be found automatically. -
There's nothing much to dig: you have to update your PATH environment variable and add the folder where qmake is if you really want it. However I'd recommend using the full path when calling qmake so you ensure you are always using the version you actually want to use.
Note that the Qt Installer will not do that for you because it's goal is not to modify your system but allow you to have several Qt versions available for development at the same time (e.g. Desktop Qt, Android Qt and iOS Qt)
-
There's nothing much to dig: you have to update your PATH environment variable and add the folder where qmake is if you really want it. However I'd recommend using the full path when calling qmake so you ensure you are always using the version you actually want to use.
Note that the Qt Installer will not do that for you because it's goal is not to modify your system but allow you to have several Qt versions available for development at the same time (e.g. Desktop Qt, Android Qt and iOS Qt)
you have to update your PATH environment variable and add the folder where qmake is if you really want it.
Sort of correct... have to make the PATH first as Macintosh is a blank slate when it comes to bash.
There's nothing much to dig
Quite a bit to "dig". Getting a pleasant terminal on the Mac was a high priority from the very, very, very, very, ∞ bland black on white text.
Anyhow... back on topic... any news when this might be fixed with the licensing issue or shall I try to debug installation order?
I wasn't paying strict attention when Qt was being installed but I believe it asked to have Command Line Tools installed during the setup... so if I obliterate Qt altogether and redo it it might actually pick this up.
However I'd recommend using the full path when calling qmake so you ensure you are always using the version you actually want to use.
Unlikely that I will continue to develop on the Mac other than this one application just for a quick test. Linux will always be my primary systems and the Mac is just a novelty for others sake. So one default, preferably stable, path will be just fine to the target Qt version that will be mainly used. Having someone type in the full path is not exactly the most sound advice... but thanks for the try.
-
Had to go hunting elsewhere for the solution since it's definitely not present here. :)
Detect current version PATH for Xcode with this:
$ xcode-select --print-path /Applications/Xcode.app/Contents/Developer
... which means where the Apple App Store downloaded it to was in the wrong place... so copy (or move) Xcode to
/Applications
and thenqmake
actually works without the nagging license.Change it, if necessary, with:
$ sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer