[cmake-developers] [CMake 0014324]: CMAKE_OSX_SYSROOT isn't set with pre-4.3 Xcode
Mantis Bug Tracker
mantis at public.kitware.com
Tue Jul 30 19:23:10 EDT 2013
The following issue has been SUBMITTED.
======================================================================
http://www.cmake.org/Bug/view.php?id=14324
======================================================================
Reported By: John Ralls
Assigned To:
======================================================================
Project: CMake
Issue ID: 14324
Category: CMake
Reproducibility: have not tried
Severity: block
Priority: normal
Status: new
======================================================================
Date Submitted: 2013-07-30 19:23 EDT
Last Modified: 2013-07-30 19:23 EDT
======================================================================
Summary: CMAKE_OSX_SYSROOT isn't set with pre-4.3 Xcode
Description:
When bootstrapping cmake with pre-XCode-4.3 compilers (in this case
Xcode-3.2.2), CMAKE_OSX_SYSROOT isn't set, resulting in this error:
CMake Error at Modules/Platform/Darwin.cmake:196 (message):
CMAKE_OSX_DEPLOYMENT_TARGET is '10.5' but CMAKE_OSX_SYSROOT:
""
is not set to a MacOSX SDK with a recognized version. Either set
CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
empty.
Steps to Reproduce:
With a pre-Xcode-4.3 Xcode installed and configured with xcode-select, run
bootstrap.
Set $SDKROOT to the path for the appropriate SDK in the environment and try
again. Both attempts fail.
Additional Information:
There are in fact two problems: The first is at Darwin.cmake line 123:
foreach(d Platforms/MacOSX.platform/Developer/SDKs SDKs)
The path 'Platforms/MacOSX.platform/Developer/SDKs' applies only to Xcode-4.3
and later, those where Xcode is a self-contained application bundle. Earlier
versions of Xcode, those distributed as a .mpkg, installed to
$DEVELOPER_DIR/SDKs, where $DEVELOPER_DIR defaults to /Developer.
The second problem is that set(foo bar CACHE baz "waldo") seems to not work with
the gcc-4.2.1 provided with Xcode before version 4. This can be observed by
instrumenting Darwin.cmake as follows:
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index f0652b9..3ccff88 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -150,8 +150,12 @@ foreach(v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT)
break()
endif()
endforeach()
+message(STATUS "CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT}")
+message(STATUS "_CMAKE_OSX_SYSROOT_DEFAULT: ${_CMAKE_OSX_SYSROOT_DEFAULT}")
set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_DEFAULT}" CACHE
${_CMAKE_OSX_SYSROOT_TYPE}
"The product will be built against the headers and libraries located inside
the indicated SDK.")
+message(STATUS "CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT}")
+message(STATUS "_CMAKE_OSX_SYSROOT_DEFAULT: ${_CMAKE_OSX_SYSROOT_DEFAULT}")
# Transform the cached value to something we can use.
set(_CMAKE_OSX_SYSROOT_ORIG "${CMAKE_OSX_SYSROOT}")
Which produces this output with Xcode-3.2.2:
-- CMAKE_OSX_SYSROOT:
-- _CMAKE_OSX_SYSROOT_DEFAULT: /Volumes/Data/XCode3/SDKs/MacOSX10.5.sdk
-- CMAKE_OSX_SYSROOT:
-- _CMAKE_OSX_SYSROOT_DEFAULT: /Volumes/Data/XCode3/SDKs/MacOSX10.5.sdk
and this with Xcode-4.6.3:
-- CMAKE_OSX_SYSROOT:
-- _CMAKE_OSX_SYSROOT_DEFAULT:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
-- CMAKE_OSX_SYSROOT:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
-- _CMAKE_OSX_SYSROOT_DEFAULT:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2013-07-30 19:23 John Ralls New Issue
======================================================================
More information about the cmake-developers
mailing list