MantisBT - CMake
View Issue Details
0010723CMakeCMakepublic2010-05-17 12:352011-06-17 18:11
Daniel Levin 
David Cole 
normalmajoralways
closedfixed 
CMake-2-8 
CMake 2.8.5CMake 2.8.5 
0010723: CMAKE_OSX_SYSROOT resolved incorrectly
In case when XCode installed not into the /Developer directory CMake tries to resolve SDKs via command line utility:

$ xcode-select --print-path

But this tool adds line end "\n" character into the output, so the result path became like:

"/myxcodedir/<here goes line break>
SDKs"

How to fix. Replace in file $cmakedir/Modules/Platform/Darwin.cmake:

# If nothing is found there, then try locating the dev tools based on the xcode-select tool
# (available in Xcode >= 3.0 installations)
IF(NOT _CMAKE_OSX_SDKS)
  FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select)
  IF(CMAKE_XCODE_SELECT)
    EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path"
      OUTPUT_VARIABLE OSX_DEVELOPER_ROOT)
    FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*")
  ENDIF(CMAKE_XCODE_SELECT)
ENDIF(NOT _CMAKE_OSX_SDKS)

... with this:

# If nothing is found there, then try locating the dev tools based on the xcode-select tool
# (available in Xcode >= 3.0 installations)
IF(NOT _CMAKE_OSX_SDKS)
  FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select)
  IF(CMAKE_XCODE_SELECT)
    EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path"
      OUTPUT_VARIABLE OSX_DEVELOPER_ROOT)
    STRING( STRIP "${OSX_DEVELOPER_ROOT}" OSX_DEVELOPER_ROOT )
    FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*")
  ENDIF(CMAKE_XCODE_SELECT)
ENDIF(NOT _CMAKE_OSX_SDKS)
No tags attached.
Issue History
2010-05-17 12:35Daniel LevinNew Issue
2010-12-14 18:36David ColeAssigned To => David Cole
2010-12-14 18:36David ColeStatusnew => assigned
2011-02-01 14:34David ColeNote Added: 0025212
2011-02-01 14:34David ColeStatusassigned => resolved
2011-02-01 14:34David ColeResolutionopen => fixed
2011-02-16 11:43David ColeTarget Version => CMake 2.8.5
2011-06-06 18:25David ColeStatusresolved => closed
2011-06-06 18:25David ColeNote Added: 0026717
2011-06-17 18:11David ColeFixed in Version => CMake 2.8.5

Notes
(0025212)
David Cole   
2011-02-01 14:34   
Fix pushed to 'next'
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d421a433a89064926ae6aad532850b8bed113562 [^]
(0026717)
David Cole   
2011-06-06 18:25   
Closing resolved issues that have not been updated in more than 3 months.