Previously if headers required to check if a struct has a member can be
compiled with C++ compiler only, the check would fail because the C
compiler fails. As a consequence, the result variable would be set to
false, even if the struct has that particular member.
Teach CHECK_STRUCT_HAS_MEMBER to accept a new optional argument LANGUAGE
that allows one to explicitly set the compiler to use. The new
signature is therefore:
CHECK_STRUCT_HAS_MEMBER (<struct> <member> <header> <variable>
[LANGUAGE <language>])
For things where we may have 2 major versions of the same software
installed in parallel (think of Qt and Python) make sure our version
selection gets this right.
Add a "CMakeOnly.find_library" test covering various cases involving
lib->lib64 (non-)conversion. Comment out cases involving mixed path
components "lib" and "lib64", such as lib/A/lib64 and lib64/A/lib, as
these are known to be broken currently.
If a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE,
the file pointed to by that variable will be included as the last step
of the project command.
Define a "check_language(<lang>)" macro to test whether <lang> can be
enabled. Cache the result in CMAKE_<lang>_COMPILER. Add a test case
covering expected results.
Since commit 183b9509 (Follow all dependencies of shared library private
dependencies, 2011-12-14) we honor LINK_INTERFACE_LIBRARIES when
following dependent shared libraries. The link interface properties may
form a cycle if set incorrectly by a project. Furthermore, the property
LINK_DEPENDENT_LIBRARIES may form a cycle if set incorrectly by hand
(though CMake should never generate one). In either case, do not follow
the cycle forever when following the dependent shared library closure.
We only need to add dependency edges to the constraint graph once.
Add "LinkInterfaceLoop" test to cover this case.
Some tests only need to run CMake to configure and generate a build
tree, but not actually perform the build. Add a new "Tests/CMakeOnly"
directory dedicated for this purpose. Add a helper script to drive each
test by creating a fresh build tree and running CMake on it. Add macro
"add_CMakeOnly_test" to help create tests using the script.