Since commit 1786b121 (OS X: Allow CMAKE_OSX_SYSROOT to be a logical SDK
name, 2012-09-21) we support names like "macosx" or "macosx10.7" as the
specified value of CMAKE_OSX_SYSROOT. Extend the SDK name->path
conversion to save the original value and also convert into a temporary
variable for the Xcode generator. Re-implement the deployment target
sanity check to detect the version from the transformed path.
Since commit 230ea218 (OS X: Improve default CMAKE_OSX_SYSROOT
selection, 2012-09-21) we always set CMAKE_OSX_SYSROOT if any SDK is
found in order to support Makefile generator builds with Xcode >= 4.3
without the command-line tools installed. However, in the basic
POSIX-only case of the Makefile generator with command-line tools and no
CMAKE_OSX_ARCHITECTURES we should not select any SDK by default.
Xcode supports SDKROOT values that just name an SDK rather than
specifying the full path to it. Recognize these values and handle them.
For Xcode we just put the value directly in the generated project file.
For Makefile generators we ask xcodebuild to provide the full path to
the named SDK.
Suggested-by: Jason DiCioccio <jd@ods.org>
On OS X if the user-provided flags do not include -isysroot and
CMAKE_OSX_SYSROOT is defined then add the proper -isysroot flag to the C
compiler invocation we use to generate the .s file.
In order to bootstrap on OS X with Xcode without the command line tools
one must add -isysroot to CFLAGS and CXXFLAGS. In this case the flags
will make it into the configured CMake. Set CMAKE_OSX_SYSROOT to empty
in the initial cache to prevent CMake from adding -isysroot again.
Simplify the search for OSX_DEVELOPER_ROOT and allow it to fail if no
"/Developer" exists. When it does exist, always find a MacOSX SDK
inside it to use as the default CMAKE_OSX_SYSROOT. Otherwise set
CMAKE_OSX_SYSROOT to empty.
Drop the last use of CMAKE_OSX_SYSROOT_DEFAULT. Replace internal
platform variable CMAKE_${lang}_HAS_ISYSROOT with a more general
CMAKE_${lang}_SYSROOT_FLAG variable. If the -isysroot flag exists and
CMAKE_OSX_SYSROOT points to an SDK (not "/") then always add it to
compiler command lines. This is already done in the Xcode IDE.
Like the special case for commas, this ensures that the colon only has
special meaning as the delimiter between the identifier and the
parameters of a particular expression, but constructs such as
INCLUDE_DIRECTORIES "$<1:C:\foo>"
are legal.
This reverts commit 987e12e2f9.
GenerateTargetManifest is called by the global generator before it
creates the generator targets, so we can't move it to cmGeneratorTarget
yet.
The GNU compiler information file tests for GNU >= 3.4 because earlier
versions do not have the flag. The version number test is not valid for
Clang compiler versions, but we know Clang supports the flag.
While Clang presents an almost identical interface to GNU there will be
some differences. Split the compiler information modules to allow
separate rules for Clang. Start by loading the GNU rules but leave a
place to add Clang-specific information.
Make the EXPECTED_HASH option take only a single value instead of two to
avoid handling sub-keyword arguments. This is also consistent with
URL_HASH in ExternalProject.
This way we don't need to check the definitions from the Makefile when
generating later, and can more easily add generator expressions.
Duplication is not a problem as the definitions are de-duplicated before
generating.