Comments (34)
I think I have found a solution, adding
set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM <10 Letter Dev. Team ID>)
Solves the code signing issue. If one can find the Developer Team ID automatically it would be very nice.
from polly.
@gelldur use xcode to create a simple project for ios,and the bundle id is com.example, and check the auto option,then xcode will auto download the provisioning profiles, when compile success, close xcode ,then use the polly to build your's project
from polly.
Awesome, works like a charm :-) thanks guys !
from polly.
For reference: http://stackoverflow.com/a/18727947
from polly.
I use Xcode 8.0 and iOS 10.1 SDK, and it works fine for me.
from polly.
@joeced Thanks for the info. I have not installed Xcode 8 yet. Will take a look later.
from polly.
@ruslo Great. If you have any ideas on either finding Developer Team ID automatically or "just" use a variable to define, I'll be happy to make a pull request.
from polly.
@joeced there is a stupid method, i modify the ios-10-0.cmake,and add the following lines:
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)
to ignore the compile the simple c program
from polly.
i modify the ios-10-0.cmake,and add the following lines
Just for your info this will break Hunter builds: https://github.com/ruslo/hunter/wiki/error.abi.detection.failure
from polly.
Per @joeced, adding the CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM
variable to the toolchain fixes the issue. What convention shall we use for polly toolchains? Environment variable?
if (NOT DEFINED ENV{XCODE_ATTRIBUTE_DEVELOPMENT_TEAM})
polly_fatal_error("XCODE_ATTRIBUTE_DEVELOPMENT_TEAM variable must be set.")
endif()
set(MACOSX_BUNDLE_GUI_IDENTIFIER com.example)
set(CMAKE_MACOSX_BUNDLE YES)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "$ENV{XCODE_ATTRIBUTE_DEVELOPMENT_TEAM}")
from polly.
@headupinclouds I think that looks like a nice solution, and matches the pattern use in other toolchain files.
from polly.
If one can find the Developer Team ID automatically it would be very nice
Can't find anything :(
I think that looks like a nice solution, and matches the pattern use in other toolchain files
Yes, seems like an appropriate solution. Implemented in master
:
Documentation:
from polly.
Thanks!
from polly.
Great! Thanks.
from polly.
Error still occurs?
- [polly] Used toolchain: iOS 10.1 Universal (iphoneos + iphonesimulator) / clang / c++11 support
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- broken
CMake Error at /usr/local/Cellar/cmake/3.7.0/share/cmake/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/gelldur/Projects/app/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/xcodebuild" "-project"
"CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_f876e"
"-configuration" "Debug"
=== BUILD TARGET cmTC_f876e OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION
Debug ===
Check dependencies
No profiles for 'com.example' were found: Xcode couldn't find a
provisioning profile matching 'com.example'.
Code signing is required for product type 'Application' in SDK 'iOS 10.1'
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (PROJECT)
from polly.
@gelldur are you sure everything okay with your provisioning profiles? Can you try to start Xcode and build/run trivial example on your device? (without CMake and without Polly)
from polly.
@ruslo the same with example
Xcode sample project building normally. When i use ios-nocodesign-10-1.cmake
everything ok
from polly.
@gelldur what is the version of Polly you're using? Probably you need to update: git pull
?
from polly.
@ruslo yesterday i downloaded master
from polly.
@gelldur can you show the minimal example to reproduce the problem? Does error occur for this one:
cmake_minimum_required(VERSION 3.7)
project(foo)
?
from polly.
CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED (VERSION 3.7)
PROJECT (test)
ADD_EXECUTABLE(Test main.cpp)
I used: cmake -DCMAKE_TOOLCHAIN_FILE=~/Desktop/polly/ios-10-1.cmake -G Xcode ..
without toolchain it works but this isn't what we want :(
-- Edit
Also when i'm building for simulator it doesn't work :/ simply during linking no such dir: /proj/ios/Debug-iphonesimulator/libmylib.a
from polly.
@gelldur test
is not a good name for project/target. Just to be sure try another names.
from polly.
then xcode will auto download the provisioning profiles
@reasonMix Already checked as far as I understand
@gelldur I can reproduce similar error by providing incorrect team-id. Can you verify that team-id is correct? Here is the guide:
Also I haven't updated Xcode yet, just for your information I'm using Xcode 8.0 and iOS 10.0 SDK.
from polly.
I have changed CMakeLists.txt:
CMAKE_MINIMUM_REQUIRED (VERSION 3.7)
PROJECT (foo)
ADD_EXECUTABLE(Foo main.cpp)
I have checked my team id twice.
After creating Example project with com.example
test script pass :) thx @reasonMix !
So now i am able to run cmake with toolchain.
Currently i have only problem with not found static libs. Simply build dirs are empty. I figure it out that using cocoapods workspace (after pod install
) breaks it. So i simply go back to use oryginal xcodeproj
now everything is building correctly but only in DEBUG when i deploy on iPhone or Simulator
But when i archive errors occur :( because missing libs in release dirs
from polly.
After creating Example project with com.example test script pass :)
Added by Polly here:
Line 28 in 73302a0
But when i archive errors occur :( because missing libs in release dirs
Please open separate issue if the problem is not about team-id. And if the problem is about Polly of course :)
from polly.
Ok now everything ok. Important note is that project MUST BE created next to top level CMakeLists to prevent such bugs... also i reset to default build paths for all submodules. Thx for help!
from polly.
Important note is that project MUST BE created next to top level CMakeLists to prevent such bugs
What do you mean? Your top level CMakeLists.txt doesn't contain project
command?
Ok now everything ok
@gelldur Can you summarize what was the problem exactly and the solution? This may be helpful for other developers. This info can be saved to Errors
section: http://polly.readthedocs.io/en/latest/toolchains/ios.html#errors
from polly.
Normally when you create project simply you do:
mkdir build
cd build
cmake ..
In my case when i do it in this way i have a lot of errors. Ok maybe not errors but sometimes subprojects do not build etc.
i just must execute cmake .
and now installing pods
etc works correctly.
My top level CMakeLists.txt contains project. On linux / android everything is working correctly
from polly.
cmake ..
@gelldur You mean cmake -DCMAKE_TOOLCHAIN_FILE=/.../ios.cmake -GXcode ..
right?
cmake .
In source build?
On linux / android everything is working correctly
Probably issue is masked by some factor on such platforms but on iOS it triggers real errors.
from polly.
yeah cmake.. was only shortcut ;) for whole command.
I have such order:
CMakeLists <-- i must make project next to this file
native
|___ CMakeLists
|___ src
proj
|___ ios
| |___ src
| |___ CMakeLists
|___ android
| |___ src
| |___ CMakeLists
|___ linux
| |___ src
| |___ CMakeLists
from polly.
In my case when i do it in this way i have a lot of errors
It would be much easier if you provide an example and what kind of errors you get. Also this doesn't seems like a Polly related issue, just some cmake related troubles in CMakeLists.txt.
from polly.
use xcode to create a simple project for ios,and the bundle id is com.example, and check the auto option,then xcode will auto download the provisioning profiles, when compile success, close xcode ,then use the polly to build your's project
This post ☝️ from @reasonMix helped me get through an error on a new OS X + Xcode 8 installation. It seems the process of creating a project "manually" has some side-effect that is required for CMake builds to work. ENV = { Xcode 8.2, OS X 10.12.2; Cmake = 3.7.2 }.
from polly.
@headupinclouds Okay, saved to documentation:
@reasonMix thanks for sharing
from polly.
Step by step document with screenshots:
from polly.
Related Issues (20)
- mingw cross compilation from Linux to Windows HOT 9
- CHECK_TYPE_SIZE iOS error HOT 4
- Clang Compiler Test Failing For iOS-10-3-armv7.cmake At Master Commit 3e3f903 HOT 21
- SwiftModule and -Swift.h ObjC compatibility header not copied to framework HOT 7
- xcode8 ios automatic provisioning HOT 1
- Additional C flags required for static-std.cmake to fix behaviour change in CMake HOT 1
- Problem codesigning iOS 11.2 with Xcode 9.2 (9C40b) HOT 5
- build details (active)
- reason for clearing IPHONEOS_DEPLOYMENT_TARGET HOT 4
- How to start for iOS? HOT 4
- --framework fails on codesign for multiple iPhone Developer certificate HOT 3
- ANDROID_NDK_rXX not set HOT 4
- Build failure on latest XCode (10A255) HOT 6
- add support for qnx HOT 2
- colorized ouput HOT 5
- Possible issue with NoCodeSign.xcconfig HOT 11
- "/usr/bin/ld: cannot find -lc++" when using the clang-lto toolchain file HOT 2
- How to reduce Xcodebuild log size? HOT 4
- Add support for Apple's Project Catalyst HOT 2
- Problem with CPack HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polly.