View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012640CMakeCMakepublic2011-12-25 08:272016-06-10 14:31
ReporterDaniel Dekkers 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformiOSOSMac OSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0012640: set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator") fails when archiving.
DescriptionWhen building and linking to a static library in your iOS project, CMAKE_XCODE_EFFECTIVE_PLATFORMS lets you declare the correct build paths to the library. Enabling you to change schemes between device and simulator on the fly in Xcode. But this doesn't work when archiving, the library is not found during the linking phase.
Steps To ReproduceThe iOSNavApp example in the CMake test suite shows this behavior.
Additional InformationI have another small example based on the standard XCode (4.0.2) OpenGL|ES application template available if needed: d.dekkers@cthrough.nl.

Also nice to know: Xcode 4.2 doesn't show details of the linking error. Xcode 4.0.2 does.
TagsNo tags attached.
Attached Fileszip file icon openglescmakewithlib.zip [^] (22,925 bytes) 2011-12-25 08:50
zip file icon openglescmakewithlib_iOS5.1.zip [^] (22,179 bytes) 2012-04-03 10:37

 Relationships
related to 0013048closedKitware Robot CMake 2.8.7 Nightly fails to link correctly in XCode 4.3 

  Notes
(0028073)
Daniel Dekkers (reporter)
2011-12-25 08:54

The problem seems to be that when building for device or simulator the library is built in path/to/build/[config]-iphoneos or path/to/build/[config]-iphonesimulator. But when archiving, the library is built in XCode's derived data directory.
(0029064)
Daniel Dekkers (reporter)
2012-04-03 10:34

Things seem to have improved with Xcode4.3/iOS5.1
The lib is now correctly built at the correct location, i.e. [cmakebuilddirectory]/[libname]/[configuration]-iphoneos (with configuration Debug, Release, ...).
You still have to edit the schemes to make sure a Release build of the lib is performed (it's not automatically triggered by invokating an archive build).
(0029065)
Daniel Dekkers (reporter)
2012-04-03 10:38

openglescmakewithlib_iOS5.1.zip is a version of the small self contained example but now using the iOS 5.1 SDK.
(0029524)
Jonathan Lilliemarck (reporter)
2012-05-21 11:21

openglescmakewithlib_iOS5.1.zip doesn't work for me. Maybe you clicked Build For -> Archiving which will put the library files in the expected places. After that it is possible to Archive the app.

I think the solution is to link libraries with a build phase just like Xcode would have done. If I manually do the following changes to project.pbxproj archiving will work.

Add this section (between PBXFileReference section and PBXGroup section)

/* Begin PBXFrameworksBuildPhase section */
        AB88FFCD156A7ABC00185B0D /* Frameworks */ = {
            isa = PBXFrameworksBuildPhase;
            buildActionMask = 2147483647;
            files = (
            );
            runOnlyForDeploymentPostprocessing = 0;
        };
/* End PBXFrameworksBuildPhase section */

Add a reference to the build phase to buildPhases

AB88FFCD156A7ABC00185B0D /* Frameworks */,

Remove liblib.a from from OTHER_LDFLAGS. Open the project in Xcode. Go to Build Phases and add liblib.a to the build phase "Link Binary With Libraries". (This makes a PBXBuildFile for liblib.a appear).
(0029989)
David Cole (manager)
2012-07-09 07:13

Unset target version field; too late for a fix to go into 2.8.9; deferred until a future version.
(0031658)
David Cole (manager)
2012-11-21 14:57

Un-assigning bugs that are not on the active roadmap, which no developers are actively working on for the CMake 2.8.11 release.

If one gets put back on the roadmap, re-assign it appropriately at that time.
(0031664)
David Cole (manager)
2012-11-21 15:11

Re-setting status back to "new" for bugs that are "assigned" but not assigned to a specific developer. When/if these bugs go back on the roadmap for a specific version, assignment to an appropriate developer should take place then...
(0040030)
Gregor Jasny (developer)
2015-12-30 08:25

With CMake 3.4 (maybe already 3.3) CMAKE_XCODE_EFFECTIVE_PLATFORMS is gone and we detect iOS/watchOS/tvOS presence solely be the SDK name. CMake 3.5 will also support fused installs of device and simulator targets (see IOS_INSTALL_COMBINED target property).

Could you please check if the described error still happens?
(0041947)
Kitware Robot (administrator)
2016-06-10 14:28

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2011-12-25 08:27 Daniel Dekkers New Issue
2011-12-25 08:50 Daniel Dekkers File Added: openglescmakewithlib.zip
2011-12-25 08:54 Daniel Dekkers Note Added: 0028073
2011-12-27 19:17 David Cole Assigned To => David Cole
2011-12-27 19:17 David Cole Status new => assigned
2012-01-07 09:59 David Cole Target Version => CMake 2.8.8
2012-04-03 10:34 Daniel Dekkers Note Added: 0029064
2012-04-03 10:37 Daniel Dekkers File Added: openglescmakewithlib_iOS5.1.zip
2012-04-03 10:38 Daniel Dekkers Note Added: 0029065
2012-04-03 12:10 David Cole Relationship added related to 0013048
2012-04-19 08:50 David Cole Target Version CMake 2.8.8 => CMake 2.8.9
2012-05-21 11:21 Jonathan Lilliemarck Note Added: 0029524
2012-07-09 07:13 David Cole Note Added: 0029989
2012-07-09 07:20 David Cole Target Version CMake 2.8.9 =>
2012-11-21 14:57 David Cole Note Added: 0031658
2012-11-21 15:00 David Cole Assigned To David Cole =>
2012-11-21 15:11 David Cole Status assigned => new
2012-11-21 15:11 David Cole Note Added: 0031664
2015-12-30 08:25 Gregor Jasny Note Added: 0040030
2016-06-10 14:28 Kitware Robot Note Added: 0041947
2016-06-10 14:28 Kitware Robot Status new => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team