MantisBT - CMake
View Issue Details
0013144CMakeCMakepublic2012-04-18 11:132013-01-09 10:57
Lukas Mezera 
David Cole 
normalmajoralways
closedfixed 
 
CMake 2.8.10CMake 2.8.10 
0013144: Compatibility with Xcode 4.2 (Build 4C199)
I try to compile my project using CMake (cmake v2.8.7-860-g32e0b19 - master and v2.8.7-3470-g19f003f - next) and Xcode 4.2. Mac OS X 10.6.8.

The build ended with error "xcodebuild: error: option '-buildstyle' is no longer supported". Whole log is attached as Additional Information.

I think that this problem is related to 0012621

Note: I am able to test everything what you need.
/Users/lukasmezera/cmake/bin/cmake -G Xcode ..
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- broken
CMake Error at /Users/lukasmezera/cmake/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "/usr/bin/gcc" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /iPhoneCheckout/iPhone/bin/CMakeFiles/CMakeTmp

  

  Run Build Command:/Users/lukasmezera/cmake/bin/cmakexbuild -project
  CMAKE_TRY_COMPILE.xcode build -target cmTryCompileExec3550203041
  -buildstyle Development

  xcodebuild: error: option '-buildstyle' is no longer supported

  

  Usage: xcodebuild [-project <projectname>] [[-target
  <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch
  <architecture>]... [-sdk [<sdkname>|<sdkpath>]]
  [<buildsetting>=<value>]... [<buildaction>]...

         xcodebuild [-project <projectname>] -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [<buildsetting>=<value>]... [<buildaction>]...
         xcodebuild -workspace <workspacename> -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [<buildsetting>=<value>]... [<buildaction>]...
         xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
         xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]]
         xcodebuild -showsdks

  Options:

      -usage print full usage
      -verbose provide additional status output
      -project NAME build the project NAME
      -target NAME build the target NAME
      -alltargets build all targets
      -workspace NAME build the workspace NAME
      -scheme NAME build the scheme NAME
      -configuration NAME use the build configuration NAME for building each target
      -xcconfig PATH apply the build settings defined in the file at PATH as overrides
      -arch ARCH build each target for the architecture ARCH; this will override architectures defined in the project
      -sdk SDK use SDK as the name or path of the base SDK when building the project
      -parallelizeTargets build independent targets in parallel
      -jobs NUMBER specify the maximum number of concurrent build operations
      -showsdks display a compact list of the installed SDKs
      -list lists the targets and configurations in a project, or the schemes in a workspace
      -find BINARY display the full path to BINARY in the provided SDK
      -version display the version of Xcode; with -sdk will display info about one or all installed SDKs

  

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)
No tags attached.
related to 0012621closed David Cole Compatibility with Xcode 4.3 
related to 0013463closed Brad King Bug 12621 is maybe back 
? patch (3,578) 2012-05-06 23:49
https://public.kitware.com/Bug/file/4318/patch
Issue History
2012-04-18 11:13Lukas MezeraNew Issue
2012-04-18 11:40Brad KingAssigned To => David Cole
2012-04-18 11:40Brad KingStatusnew => assigned
2012-04-18 11:40Brad KingRelationship addedrelated to 0012621
2012-04-18 13:29David ColeNote Added: 0029218
2012-04-18 13:30David ColeNote Added: 0029219
2012-04-18 13:31David ColeNote Added: 0029220
2012-04-19 02:39Lukas MezeraNote Added: 0029225
2012-04-23 04:41Lukas MezeraNote Added: 0029301
2012-04-23 08:29David ColeNote Added: 0029305
2012-05-06 16:36Wade TregaskisNote Added: 0029407
2012-05-06 23:48Wade TregaskisNote Added: 0029408
2012-05-06 23:49Wade TregaskisFile Added: patch
2012-05-06 23:50Wade TregaskisNote Edited: 0029408bug_revision_view_page.php?bugnote_id=29408#r639
2012-08-13 15:31David ColeRelationship addedrelated to 0013463
2012-08-13 15:32David ColeNote Added: 0030615
2012-08-13 15:32David ColeStatusassigned => resolved
2012-08-13 15:32David ColeFixed in Version => CMake 2.8.10
2012-08-13 15:32David ColeResolutionopen => fixed
2012-08-13 15:32David ColeTarget Version => CMake 2.8.10
2013-01-09 10:57Robert MaynardNote Added: 0032056
2013-01-09 10:57Robert MaynardStatusresolved => closed

Notes
(0029218)
David Cole   
2012-04-18 13:29   
We have code in the Xcode generator that looks like this:

  if(this->XcodeVersion == 15)
    {
    makeCommand += " -buildstyle Development ";
    }

Furthermore, that's the only occurrence of the string "buildstyle" in our entire source tree:

$ git grep buildstyle
Source/cmGlobalXCodeGenerator.cxx: makeCommand += " -buildstyle Development ";

...which means that CMake thinks you have an Xcode version 1.5 installed as the "selected" Xcode.

What does "xcode-select -print-path" yield on your machine? (Is it the same as the Xcode 4.2 installation that you think it should be?)

Do you by any chance have multiple versions of Xcode installed? (Most, if not all, of our dashboards have a single version of Xcode installed/available.)
(0029219)
David Cole   
2012-04-18 13:30   
And..... can you please try this same exact thing with CMake 2.8.7 on that machine?

I'd really like to know if this problem is a regression that has been introduced recently, or if it's an existing problem, and we have just never encountered this particular setup on one of our own Macs.

Thanks!
(0029220)
David Cole   
2012-04-18 13:31   
One more note: I've tried to reproduce this on my own machine which is running Lion OSX 10.7.3 with Xcode 4.2.1 (4D502) installed.

I can't reproduce it here.
(0029225)
Lukas Mezera   
2012-04-19 02:39   
"xcode-select -print-path" command prints path where Xcode 4.2 is installed - /Xcode 4.2.

I have the same problem with CMake 2.8.7. It was the reason why I try to compile you origin/master and origin/next branches.

I have installed two version of Xcode. Xcode 3.2.6 and Xcode 4.2. So problem is probably when you have multiple version of Xcode.

I will try to uninstall both Xcode versions and then install only Xcode 4.2 and I will write you if everything is ok.
(0029301)
Lukas Mezera   
2012-04-23 04:41   
I tried to uninstall Xcode 3.2.6 and Xcode 4.2 and install Xcode 4.2 again. Now I have only one version of Xcode 4.2 and everything works well.
(0029305)
David Cole   
2012-04-23 08:29   
It really should work with multiple Xcode versions installed... I'll try to duplicate such on environment on one of our machines here and see what the root problem is. It should work with the "active" Xcode according to xcode-select.
(0029407)
Wade Tregaskis   
2012-05-06 16:36   
I'm seeing the same thing, on a Lion machine that's never seen a version of Xcode prior to 4.{whatever-was-the-first-Lion-GM-version}.

$ /usr/bin/xcode-select -print-path
/Applications/Developer/Xcode.app/Contents/Developer
$ /Applications/Developer/Xcode.app/Contents/Developer/usr/bin/xcodebuild -version
Xcode 4.3.2
Build version 4E2002
(0029408)
Wade Tregaskis   
2012-05-06 23:48   
(edited on: 2012-05-06 23:50)
The code for detecting the current Xcode version is broken. The following is a quick and dirty patch which fixes it. [FYI: I tried following the instructions in the wiki on how to push this back, but either the instructions are wrong/incomplete, or git on my machine doesn't work the way it's described as working by those instructions. ]

[Update: patch attached instead; the indentation got mangled when pasting it here, inline]

(0030615)
David Cole   
2012-08-13 15:32   
This should be fixed by the same commit that fixed related issue 0013463 -- let us know if that's not the case. That fix should be in nightly builds of CMake from today forward.

Thanks.
(0032056)
Robert Maynard   
2013-01-09 10:57   
Closing resolved issues that have not been updated in more than 4 months.