I'm not sure if this is a bug, but in my top level CMakeLists.txt file I
try to do something like this:

cmake_minimum_required ( VERSION 2.8.11 FATAL_ERROR )
include ( checkOutOfSource.cmake )
include ( configureBuilds.cmake )
include ( configurePlatform.cmake )
enable_language ( C )
enable_language ( Fortran )

project ( ...
...


Then in configurePlatform.cmake I have the following code:

if (APPLE)
    set ( CMAKE_OSX_DEPLOYMENT_TARGET "10.6"
      CACHE STRING "Oldest OS X version to compile and link for." )
    set_property ( CACHE CMAKE_OSX_DEPLOYMENT_TARGET PROPERTY STRINGS
      "10.6" "10.7" "10.8" "10.9" )
...
endif (APPLE)

I'm using the Makefile generator, not Xcode, etc.

The odd thing is that if I move the `include ( configurePlatform.cmake )`
line after the calls to `enable_language` then CMAKE_OSX_DEPLOYMENT_TARGET
*AND* CMAKE_OSX_SYSROOT become undefined even though I don't explicitly set
or unset OSX_SYSROOT anywhere in my project. If I then set
OSX_DEPLOYMENT_TARGET to a value, say 10.6, then the configure and generate
steps fail with an error about how DEPLOYMENT_TARGET is set but not SYSROOT
and it can't find the proper SDK.

I thought this might be related to this bug report:
http://cmake.3232098.n2.nabble.com/OSX-deployment-target-confusion-for-2-8-10-td7582284.html
so
I upgraded to the latest CMake (2.8.12) to see if it's fixed. The unset
value of SYSROOT persists if DEPLOYMENT_TARGET is set after
enable_language, but gets set by CMake if I set before these calls.
Furthermore, a new warning is now issued:

CMAKE_OSX_DEPLOYMENT_TARGET is '10.6' but the matching SDK does not exist

However, according to the Xcode documentation this is a common, desired
situation: DEPLOYMENT_TARGET specifies the oldest compatible OS X the code
will work for, and the Apple developer docs urge developers to use the
latest SDK with weak  linking etc.

Does anyone have any insight as to what is going on here?

Izaak Beekman
===================================
(301)244-9367
Princeton University Doctoral Candidate
Mechanical and Aerospace Engineering
ibeek...@princeton.edu

UMD-CP Visiting Graduate Student
Aerospace Engineering
ibeek...@umiacs.umd.edu
ibeek...@umd.edu
-- 

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://www.cmake.org/mailman/listinfo/cmake

Reply via email to