View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011244CMakeCMakepublic2010-09-18 09:472010-10-06 13:45
ReporterMikkel Krautz 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionCMake 2.8.3Fixed in VersionCMake 2.8.3 
Summary0011244: Using Xcode built-in variables as CMAKE_OSX_ARCHITECTURES
DescriptionHi,

I've recently begun using CMake for some of my iPhone projects as a way having a more explicit build process (i.e I use CMake to generate my .xcodeprojs so I don't have to fiddle with the Xcode GUI to change build settings).

For these projects it is desirable for me to use the built-in $(ARCHS_STANDARD_32_BIT) to allow the projects to be built both for the iPhone Simulator and for devices. This way, the correct architectures will be used for both of these settings.

However, I've run into a couple of problems using these built-ins from within CMake.

The first problem is that not all ARCHS values in the generated project are properly quoted when using these built-ins. In some places in the file, I would get lines such as:

   ARCHS = $(ARCHS_STANDARD_32_BIT);

Which makes Xcode think the project file is broken. I've tried to fix this in my CMake fork on GitHub by forcing strings containing '$' to be quoted:

http://github.com/mkrautz/CMake/commit/f8319b97c7caaeaca907a28cdffa30228622be3c [^]

I'm not sure if this is the correct fix for this, but it works.


The other issue is a bit different. Not all of the ARCH values in the project file would be missing the quotes. Ones generated by cmGlobalXCodeGenerator::CreateXCodeObjects would have the quotes, because it does this:

 std::string archString;
 for( std::vector<std::string>::iterator i = this->Architectures.begin();
        i != this->Architectures.end(); ++i) {
      archString += *i;
      archString += " ";
 }

The result here is that the ARCH value in the generated project file would have a space appended to it. (This is OK, because without the patch above, not having a space in there would make it not quoted!)

The real issue is that Xcode doesn't recognize its built-ins in the UI if there's a space at the end. So even though ARCHS = "$(ARCHS_STANDARD_32_BIT) ", it would show up as:

  Architectures | $(ARCHS_STANDARD_32_BIT)

instead of:

  Architectures | Standard (armv6, armv7)

I've also committed a "fix" for this issue in my CMake fork on GitHub:

http://github.com/mkrautz/CMake/commit/0815b7b9e327a31441770fbef9ebedf12a552964 [^]


Again, I'm not sure if these are the correct fixes for the problems at hand, but they work around the issues that I've been seeing with the CMAKE_OSX_ARCHITECTURES variable.
TagsNo tags attached.
Attached Files

 Relationships
has duplicate 0011259closedDavid Cole Setting CMAKE_OSX_ARCHITECTURES Produces Invalid Xcode Project File 
related to 0007932closedBill Hoffman XCode Source Grouping doesn't allow for multiple levels of source groups 

  Notes
(0022278)
Brad King (manager)
2010-09-20 10:34

Thanks. I've adapted your patches slightly. Please try this topic:

http://github.com/bradking/CMake/tree/xcode-ARCHS-quoting [^]
http://github.com/bradking/CMake/commit/a8ded5338bf44173fe33e0249ab14aa3d8e7540c [^]
http://github.com/bradking/CMake/commit/0790af3bf54f8b1fcd418fec4ff968ffa55f334c [^]
(0022280)
Mikkel Krautz (reporter)
2010-09-20 11:03

Hi Brad,

Just tried the branch. Works great!
(0022282)
Brad King (manager)
2010-09-20 11:09

Thanks for testing. I've merged to 'next':

http://cmake.org/gitweb?p=cmake.git;a=log;h=3b8d74b9 [^]

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a8ded533 [^]
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0790af3b [^]

 Issue History
Date Modified Username Field Change
2010-09-18 09:47 Mikkel Krautz New Issue
2010-09-20 09:49 Bill Hoffman Status new => assigned
2010-09-20 09:49 Bill Hoffman Assigned To => Brad King
2010-09-20 10:34 Brad King Note Added: 0022278
2010-09-20 11:03 Mikkel Krautz Note Added: 0022280
2010-09-20 11:09 Brad King Note Added: 0022282
2010-09-20 11:09 Brad King Status assigned => closed
2010-09-20 11:09 Brad King Resolution open => fixed
2010-09-23 12:00 Bill Hoffman Relationship added related to 0007932
2010-10-06 13:45 David Cole Fixed in Version => CMake 2.8.3
2010-10-06 13:45 David Cole Target Version => CMake 2.8.3
2011-01-17 16:31 David Cole Relationship added has duplicate 0011259


Copyright © 2000 - 2018 MantisBT Team