If the source-file form of try_compile is given a file name with
multiple '.' characters such as "a.b.c" use only the shortest extension
to check the language. This is the expected behavior and is consistent
with normal language extension determination in the method
cmSourceFileLocation::UpdateExtension.
Set CMAKE_RUNTIME_OUTPUT_DIRECTORY explicitly in try_compile projects so
that the COPY_FILE feature knows where to look. This makes the feature
robust against CMAKE_USER_MAKE_RULES_OVERRIDE files that set variables
like CMAKE_RUNTIME_OUTPUT_DIRECTORY or EXECUTABLE_OUTPUT_PATH.
Pass the full version to cmake_minimum_required(VERSION) in generated
CMake files for try_compile projects. This tells CMake not to use any
backward compatibility behavior while processing code it generates.
Commit 3827991e (...fix...not being able to remove try compile code,
2008-03-26) introduced a loop of RemoveFile attempts to overcome
anti-virus locks on recently created try_compile executables. Fix the
logic in this loop to work when the file is already missing.
Both possible result values need to be convertible to the same type.
Some compilers fail to recognize that they can construct std::string
from the empty string literal, so state it explicitly.
The try_compile() command's COPY_FILE option should not try to actually
copy the file if it cannot be found. Some C runtime library's fopen
cannot handle an empty file name.
This converts the CMake license to a pure 3-clause OSI-approved BSD
License. We drop the previous license clause requiring modified
versions to be plainly marked. We also update the CMake copyright to
cover the full development time range.
The try_compile command builds the cmTryCompileExec executable using the
cmTryCompileExec/fast target with Makefile generators in order to save
time since dependencies are not needed. However, in project mode the
command builds an entire source tree that may have dependencies.
Therefore we can use the /fast target approach only in one-source mode.
Tested with various gcc, XCode, MSVC7, sdcc
For OSX when doing TRY_COMPILE() CMAKE_OSX_ARCHITECTURES is used, if there are different results an error is generated. CMAKE_OSX_ARCHITECTURES can be overwritten for the TRY_COMPILES with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES.
Alex
STYLE: create a new base class cmCoreTryCompile, from which
cmTryCompileCommand and cmTryRunCommand are derived, so there are no public
static functions with lots of arguments anymore
Alex