CMAKE_OSX_DEPLOYMENT_TARGET vs CMAKE_OSX_SYSROOT

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

CMAKE_OSX_DEPLOYMENT_TARGET vs CMAKE_OSX_SYSROOT

braden
When setting CMAKE_OSX_SYSROOT to the unversioned directory name (using Xcode 8, as it happens) and setting CMAKE_OSX_DEPLOYMENT_TARGET, I get this error:


-- The CXX compiler identification is AppleClang 8.0.0.8000038
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/Platform/Darwin.cmake:76 (message):
CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but CMAKE_OSX_SYSROOT:

"/Applications/Xcode-8.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.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.app/Contents/share/cmake-3.6/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
CMakeLists.txt:37 (project)


I'm able to suppress the error by using the versioned (symlink) directory; but isn't the premise of this error message invalid? As I understand it, since Xcode 7 (or perhaps earlier?), there is no requirement that the deployment target match the SDK version.

Braden


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
--
Braden McDaniel <braden@endoframe.com>
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_OSX_DEPLOYMENT_TARGET vs CMAKE_OSX_SYSROOT

James Turner-2

> On 20 Sep 2016, at 16:00, Braden McDaniel <[hidden email]> wrote:
>
> When setting CMAKE_OSX_SYSROOT to the unversioned directory name (using Xcode 8, as it happens) and setting CMAKE_OSX_DEPLOYMENT_TARGET, I get this error:
>
>
> -- The CXX compiler identification is AppleClang 8.0.0.8000038
> CMake Error at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/Platform/Darwin.cmake:76 (message):
> CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but CMAKE_OSX_SYSROOT:
>
> "/Applications/Xcode-8.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.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.app/Contents/share/cmake-3.6/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
> CMakeLists.txt:37 (project)
>
>
> I'm able to suppress the error by using the versioned (symlink) directory; but isn't the premise of this error message invalid? As I understand it, since Xcode 7 (or perhaps earlier?), there is no requirement that the deployment target match the SDK version.
I’m seeing a similar error when setting CMAKE_OSX_DEPLOYMENT_TARGET to 10.7 with XCode 8, and leaving CMAKE_OSX_SYSROOT unset. I’m couldn’t identify where (from  Modules/Platform/Darwin.cmake) the detected value of _CMAKE_OSX_SYSROOT is computed. (I don’t wish to explicitly set it)

Kind regards,
James


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_OSX_DEPLOYMENT_TARGET vs CMAKE_OSX_SYSROOT

CMake mailing list
On 21/09/2016 10:54, James Turner wrote:

>
>> On 20 Sep 2016, at 16:00, Braden McDaniel <[hidden email]> wrote:
>>
>> When setting CMAKE_OSX_SYSROOT to the unversioned directory name (using Xcode 8, as it happens) and setting CMAKE_OSX_DEPLOYMENT_TARGET, I get this error:
>>
>>
>> -- The CXX compiler identification is AppleClang 8.0.0.8000038
>> CMake Error at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/Platform/Darwin.cmake:76 (message):
>> CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but CMAKE_OSX_SYSROOT:
>>
>> "/Applications/Xcode-8.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.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.app/Contents/share/cmake-3.6/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
>> CMakeLists.txt:37 (project)
>>
>>
>> I'm able to suppress the error by using the versioned (symlink) directory; but isn't the premise of this error message invalid? As I understand it, since Xcode 7 (or perhaps earlier?), there is no requirement that the deployment target match the SDK version.
>
> I’m seeing a similar error when setting CMAKE_OSX_DEPLOYMENT_TARGET to 10.7 with XCode 8, and leaving CMAKE_OSX_SYSROOT unset. I’m couldn’t identify where (from  Modules/Platform/Darwin.cmake) the detected value of _CMAKE_OSX_SYSROOT is computed. (I don’t wish to explicitly set it)

Could you please file a bug report and CC me? I'll try to submit a patch
next week but would appreciate a reminder :)

In my projects and toolchain files I always used xcrun to query for the
SDK path:

$ xcrun --sdk macosx --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk

The xcrun approach has the advantage that it respects the DEVELOPER_DIR
environment variable and thus works with different Xcode installations.

Thanks,
Gregor

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_OSX_DEPLOYMENT_TARGET vs CMAKE_OSX_SYSROOT

CMake mailing list
On 23/09/2016 22:35, Gregor Jasny wrote:

> On 21/09/2016 10:54, James Turner wrote:
>>
>>> On 20 Sep 2016, at 16:00, Braden McDaniel <[hidden email]> wrote:
>>>
>>> When setting CMAKE_OSX_SYSROOT to the unversioned directory name (using Xcode 8, as it happens) and setting CMAKE_OSX_DEPLOYMENT_TARGET, I get this error:
>>>
>>>
>>> -- The CXX compiler identification is AppleClang 8.0.0.8000038
>>> CMake Error at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/Platform/Darwin.cmake:76 (message):
>>> CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but CMAKE_OSX_SYSROOT:
>>>
>>> "/Applications/Xcode-8.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.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.app/Contents/share/cmake-3.6/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
>>> CMakeLists.txt:37 (project)
>>>
>>>
>>> I'm able to suppress the error by using the versioned (symlink) directory; but isn't the premise of this error message invalid? As I understand it, since Xcode 7 (or perhaps earlier?), there is no requirement that the deployment target match the SDK version.

The deployment target gives you backwards compatibility back to the
specified version. In your example the binary should be runnable on
macOS 10.10 and later even that you used a newer SDK. That way you have
access to the latest SDK features which you could use after a thorough
check at runtime.

>> I’m seeing a similar error when setting CMAKE_OSX_DEPLOYMENT_TARGET to 10.7 with XCode 8, and leaving CMAKE_OSX_SYSROOT unset. I’m couldn’t identify where (from  Modules/Platform/Darwin.cmake) the detected value of _CMAKE_OSX_SYSROOT is computed. (I don’t wish to explicitly set it)

Will be fixed, too.

> Could you please file a bug report and CC me? I'll try to submit a patch
> next week but would appreciate a reminder :)

I filed https://gitlab.kitware.com/cmake/cmake/issues/16323 and will
push a fix soon.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_OSX_DEPLOYMENT_TARGET vs CMAKE_OSX_SYSROOT

braden
On Sun, 2016-09-25 at 11:54 +0200, Gregor Jasny wrote:

> On 23/09/2016 22:35, Gregor Jasny wrote:
> >
> > On 20 Sep 2016, at 16:00, Braden McDaniel <[hidden email]
> > > > > wrote:
> > > >
> > > > When setting CMAKE_OSX_SYSROOT to the unversioned directory
> > > > name (using Xcode 8, as it happens) and setting
> > > > CMAKE_OSX_DEPLOYMENT_TARGET, I get this error:
> > > >
> > > >
> > > > -- The CXX compiler identification is AppleClang 8.0.0.8000038
> > > > CMake Error at /Applications/CMake.app/Contents/share/cmake-
> > > > 3.6/Modules/Platform/Darwin.cmake:76 (message):
> > > > CMAKE_OSX_DEPLOYMENT_TARGET is '10.10' but CMAKE_OSX_SYSROOT:
> > > >
> > > > "/Applications/Xcode-
> > > > 8.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SD
> > > > Ks/MacOSX.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.app/Contents/share/cmake-
> > > > 3.6/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
> > > > CMakeLists.txt:37 (project)
> > > >
> > > >
> > > > I'm able to suppress the error by using the versioned (symlink)
> > > > directory; but isn't the premise of this error message invalid?
> > > > As I understand it, since Xcode 7 (or perhaps earlier?), there
> > > > is no requirement that the deployment target match the SDK
> > > > version.
>
> The deployment target gives you backwards compatibility back to the
> specified version. In your example the binary should be runnable on
> macOS 10.10 and later even that you used a newer SDK. That way you
> have
> access to the latest SDK features which you could use after a
> thorough
> check at runtime.

Yes, that squares with my understanding of the current semantics.

Interestingly, in Xcode 8, the versioned SDK directory is actually a
symlink to the unversioned one.  It would not surprise me if the
versioned SDK directory went away altogether in a future release; this
version number is moot with the current semantics.

> I filed https://gitlab.kitware.com/cmake/cmake/issues/16323 and will
> push a fix soon.

Thanks!

--
Braden McDaniel <[hidden email]>
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
--
Braden McDaniel <braden@endoframe.com>
Reply | Threaded
Open this post in threaded view
|

Re: CMAKE_OSX_DEPLOYMENT_TARGET vs CMAKE_OSX_SYSROOT

James Turner-2

> On 25 Sep 2016, at 16:53, Braden McDaniel <[hidden email]> wrote:
>
> Yes, that squares with my understanding of the current semantics.
>
> Interestingly, in Xcode 8, the versioned SDK directory is actually a
> symlink to the unversioned one.  It would not surprise me if the
> versioned SDK directory went away altogether in a future release; this
> version number is moot with the current semantics.
>
>> I filed https://gitlab.kitware.com/cmake/cmake/issues/16323 and will
>> push a fix soon.
>
> Thanks!
Agreed on all counts - my assumptions is that versioned SDKs will go away in the next release, we’ll simply use the one inside the chosen platform, and set the deployment target (as I already do).

Thanks for working on this fix!

Kind regards,
James


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

smime.p7s (5K) Download Attachment