MantisBT - CMake
View Issue Details
0015237CMakeCMakepublic2014-11-07 15:202015-04-06 09:07
Ruslan Baratov 
Brad King 
normalminoralways
closedfixed 
 
CMake 3.1CMake 3.1 
0015237: No CMAKE_C_COMPILER could be found (3.1.0-rc1 regression)
Error while configuring project with Xcode 5.0.2 and CMake 3.1.0-rc1:

-- The C compiler identification is AppleClang 5.0.0.5000279
-- The CXX compiler identification is AppleClang 5.0.0.5000279
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_C_COMPILER could be found.
Create toolchain.cmake file:

    set(CMAKE_OSX_SYSROOT "iphoneos" CACHE STRING "" FORCE)
    set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
    set(MACOSX_BUNDLE_GUI_IDENTIFIER com.example)
    set(CMAKE_MACOSX_BUNDLE YES)
    set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")

Create CMakeLists.txt:

    cmake_minimum_required(VERSION 3.0)
    project(Foo)

Run build:

    cmake -H. -B_builds -GXcode -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake
Works fine with CMake 3.0.2
No tags attached.
related to 0015214closed Brad King Error getting iOS compiler identification on master 
Issue History
2014-11-07 15:20Ruslan BaratovNew Issue
2014-11-07 15:56Brad KingRelationship addedrelated to 0015214
2014-11-07 16:41Brad KingAssigned To => Brad King
2014-11-07 16:41Brad KingStatusnew => assigned
2014-11-07 16:41Brad KingTarget Version => CMake 3.1
2014-11-07 16:44Brad KingNote Added: 0037163
2014-11-08 10:16Ruslan BaratovNote Added: 0037164
2014-11-10 10:46Brad KingNote Added: 0037168
2014-11-10 10:46Brad KingStatusassigned => resolved
2014-11-10 10:46Brad KingResolutionopen => fixed
2014-11-10 10:46Brad KingFixed in Version => CMake 3.1
2015-04-06 09:07Robert MaynardNote Added: 0038438
2015-04-06 09:07Robert MaynardStatusresolved => closed

Notes
(0037163)
Brad King   
2014-11-07 16:44   
Thanks for trying the release candidate and reporting this issue.

As explained in 0015214:0037064 CMake 3.0 and below were not actually detecting the compiler Xcode uses for a given SDK. It happens to be the same in this case, and so appeared to work before, but it may not be in other cases. CMake 3.1 honors the SDK when building the compiler identification project.

Here is a fix:

 Xcode: Fix compiler path detection for iOS tools on Xcode <= 5.0
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f89552a [^]

see commit message for an explanation.
(0037164)
Ruslan Baratov   
2014-11-08 10:16   
Thanks, branch 'next' with commit '7f89552' work fine for me.
(0037168)
Brad King   
2014-11-10 10:46   
Thanks for testing. I've merged the fix to the 'release' branch for inclusion in the next 3.1 release candidate.
(0038438)
Robert Maynard   
2015-04-06 09:07   
Closing resolved issues that have not been updated in more than 4 months.