TargetNames: extend CMP0037 to reserved names and custom targets
Merge topic 'forbid-reserved-targets' into next

42f16f6 TargetNames: extend CMP0037 to reserved names and custom targets
Refer to RPATH consistently.
Merge topic 'cross-compiling-toolchain-variables' into next

544698a Refer to RPATH consistently.
Revert "find_library: Find shared libraries with numerical suffixes"

This reverts commit 2e3809314d09372a552c2d6e7b8e656960675957.

The raspbian image I was testing with did not have the libgl1-mesa-dev
package pre-installed. Installing that package adds the missing symlink.
Merge topic 'cross-compiling-toolchain-variables' into next

d2fb4a0 Revert "find_library: Find shared libraries with numerical suffixes"
Add compiler target compile options.

For clang, this allows passing -target <triple> to the compiler, and
for qcc, -V<arch> using toolchain files containing something like

 set(triple arm-linux-gnueabihf)
 set(CMAKE_C_COMPILER "/usr/bin/clang")
 set(CMAKE_C_COMPILER_TARGET ${triple})
 set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
 set(CMAKE_CXX_COMPILER_TARGET ${triple})

or

 set(arch gcc_ntoarmv7le)
 set(CMAKE_C_COMPILER /opt/qnx650/host/linux/x86/usr/bin/qcc)
 set(CMAKE_C_COMPILER_TARGET ${arch})
 set(CMAKE_CXX_COMPILER /opt/qnx650/host/linux/x86/usr/bin/QCC)
 set(CMAKE_CXX_COMPILER_TARGET ${arch})

Both clang and qcc are inherently cross compiler( driver)s.

When cross-compiling with clang, use the CMAKE_${lang}_COMPILER_TARGET
as the _CMAKE_TOOLCHAIN_PREFIX to find the appropriate binutils.

When cross-compiling with QNX qcc, use the CMAKE_${lang}_COMPILER_TARGET
to set the appropriate _CMAKE_TOOLCHAIN_PREFIX.
Allow toolchain files to specify an external toolchain.

Clang can compile code, but uses the gcc tools for other tasks such
as linking. The -gcc-toolchain option can be used for that, but
generalize so that other compilers can be treated the same.

If such a location is specified, use it as a hint for finding
the binutils executables.
Use --sysroot when cross compiling.

As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is
introduced, which is never a list.

The contents of this variable is passed to supporting compilers
as --sysroot. It is also accounted for when processing implicit
link directories reported by the compiler, and when generating
RPATH information.

A toolchain file will generally contain the following lines:

 set(CMAKE_SYSROOT /path/to/sysroot)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

The find_file in Modules/CMakeDetermineCompilerId.cmake should not
look in the sysroot or the CMAKE_FIND_ROOT_PATH entries, so
add the parameter to control that in CMakeDetermineCompilerId.cmake.
Introduce CMAKE_STAGING_PREFIX variable.

This variable can be useful in cross-compiling contexts where the
sysroot is read-only or where the sysroot should otherwise remain
pristine.

If the new CMAKE_STAGING_PREFIX variable is set, it is used instead
of CMAKE_INSTALL_PREFIX when generating the installation rules in
cmake_install.cmake.

This way, the CMAKE_INSTALL_PREFIX variable
always refers to the installation prefix on the target device, regardless
of whether host==target.

If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX,
the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX.
Matching paths in the -rpath-link are not transformed.

The cross-prefix usr-move workaround is assumed not to require extension
regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so
there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX
is still used to determine the workaround path, and that variable
remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the
generated export files are deployed to the target, the workaround
will still be in place, and still be employed if required.
Merge topic 'cross-compiling-toolchain-variables' into next

59cc7f3 Introduce CMAKE_STAGING_PREFIX variable.
4497e12 Use --sysroot when cross compiling.
8d3c6f0 Allow toolchain files to specify an external toolchain.
0d92725 Add compiler target compile options.
Only look in the host for internal CMake file.

A toolchain file will generally contain the following lines:

 set(CMAKE_SYSROOT /path/to/sysroot)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

The find_file in Modules/CMakeDetermineCompilerId.cmake should not
look in the sysroot or the CMAKE_FIND_ROOT_PATH entries, so
add the parameter to control that in CMakeDetermineCompilerId.cmake.
Use --sysroot when cross compiling.

As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is
introduced, which is never a list.

The contents of this variable is passed to supporting compilers
as --sysroot. It is also accounted for when processing implicit
link directories reported by the compiler, and when generating
RPATH information.
Introduce CMAKE_STAGING_PREFIX variable.

This variable can be useful in cross-compiling contexts where the
sysroot is read-only or where the sysroot should otherwise remain
pristine.

If the new CMAKE_STAGING_PREFIX variable is set, it is used instead
of CMAKE_INSTALL_PREFIX when generating the installation rules in
cmake_install.cmake.

This way, the CMAKE_INSTALL_PREFIX variable
always refers to the installation prefix on the target device, regardless
of whether host==target.

If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX,
the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX.
Matching paths in the -rpath-link are not transformed.

The cross-prefix usr-move workaround is assumed not to require extension
regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so
there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX
is still used to determine the workaround path, and that variable
remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the
generated export files are deployed to the target, the workaround
will still be in place, and still be employed if required.
Merge topic 'cross-compiling-toolchain-variables' into next

82266aa Introduce CMAKE_STAGING_PREFIX variable.
c0c31bb Use --sysroot when cross compiling.
ea1ea9e Only look in the host for internal CMake file.