filipwasil / ios-cmake

Automatically exported from code.google.com/p/ios-cmake
0 stars 0 forks source link

Having MACOSX_DEPLOYMENT_TARGET=10.8 env. var breaks cmake invokation. #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

On command line,
1. export MACOSX_DEPLOYMENT_TARGET=10.8
2. cmake -DCMAKE_TOOLCHAIN_FILE=iOS.cmake -G "Xcode" path_to_project

CMake will report:

Xcode 4.6
Build version 4H127
-- Toolchain using default iOS SDK: 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
/SDKs/iPhoneOS6.1.sdk
-- CMAKE_OSX_DEPLOYMENT_TARGET 10.8
CMake Error at /Applications/CMake 
2.8-10.app/Contents/share/cmake-2.8/Modules/Platform/Darwin.cmake:192 (message):
  CMAKE_OSX_DEPLOYMENT_TARGET is '10.8' but CMAKE_OSX_SYSROOT:

   "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk"

  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.
Call Stack (most recent call first):
  /Applications/CMake 2.8-10.app/Contents/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
  CMakeLists.txt:42 (project)

-- Configuring incomplete, errors occurred!

As a workaround/remedy, if instead of step 1, one does "export 
MACOSX_DEPLOYMENT_TARGET=", i.e. kills the environment variable, the above 
error doesn't occur.

Should CMake ignore this environment variable when iOS toolchain is used? Can 
this be done from the iOS toolchain itself?

Thanks!

Original issue reported on code.google.com by juj...@gmail.com on 19 Apr 2013 at 5:22

GoogleCodeExporter commented 9 years ago
Good find. Should be easy enough to fix by unsetting that value in the 
toolchain. Will test and fix.

Original comment by wizzr...@gmail.com on 22 Apr 2013 at 3:42

GoogleCodeExporter commented 9 years ago
Looks like this just showed up in cmake 2.8.10. Fixed by forcefully unsetting 
CMAKE_OSX_DEPLOYMENT_TARGET as a cache value in the toolchain. 

Original comment by wizzr...@gmail.com on 22 Apr 2013 at 4:02

GoogleCodeExporter commented 9 years ago
Thanks for the quick fix! Tested the fix without my manual workaround, and it 
works perfectly!

Original comment by juj...@gmail.com on 4 May 2013 at 8:44