Commit Graph

16 Commits

Author SHA1 Message Date
Brad King 86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Brad King 09b2f1c3f5 Windows: Find Program Files directories more robustly from environment
In Modules/Platform/WindowsPaths.cmake our previously recorded
environment variable combinations no longer seem to be correct.  For
example, a 64-bit cmake binary may see ProgramW6432 in the environment
and end up not considering the "ProgramFiles(x86)" variable.  Instead
check for all possible environment variables in the preferred order and
then remove duplicates.

Reported-by: Shawn Waldon <shawn.waldon@kitware.com>
2016-01-15 14:07:22 -05:00
Ben Boeckel e423f1c05d Windows: Avoid () in environment variable references
Use nested variable evaluation instead.
2014-05-08 13:24:49 -04:00
Stephen Kelly 7521da2852 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.
2013-11-21 11:48:03 +01:00
Stephen Kelly fe057ab3cd Allow disabling adding the install prefix to the prefix search path.
In certain scenarios, it is preferable to keep a 'dirty' install prefix
than to clear it, and to expect that content will not be found there.
Add a CMAKE_FIND_NO_INSTALL_PREFIX variable that can be set to disable
searching the install prefix.
2013-10-31 16:40:24 +01:00
Brad King f9eee7f183 Windows: Search '/' prefix only when cross compiling (#10994)
Commit dac78148 (...makes the mingw cross compiler work out of the
box..., 2007-08-02) added to CMAKE_SYSTEM_PROGRAM_PATH and
CMAKE_SYSTEM_LIBRARY_PATH paths like "/bin" and "/lib" with no Windows
drive letter so that cross-compiling to Windows from Linux would search
these paths under CMAKE_FIND_ROOT_PATH.  Later commit 2a782880 (...use
CMAKE_SYSTEM_PREFIX_PATH when possible, 2008-01-16) generalized this
approach by instead adding "/" to CMAKE_SYSTEM_PREFIX_PATH.

Both commits assumed that the paths would never match anything on
Windows hosts without a drive letter.  However, Windows evaluates these
paths relative to the current working drive letter so find_* commands
may report paths like "/lib/..." when paths like "c:/lib/..." exist on
what happens to be current drive.  Such drive-less paths are not
reliable when the working drive changes, so we should not use them.

Fix WindowsPaths.cmake to add '/' to CMAKE_SYSTEM_PREFIX_PATH only when
cross-compiling to Windows from a non-Windows host.  This will avoid
searching and finding local paths without a drive letter on Windows.
2013-04-25 09:07:45 -04:00
Kitware Robot 77543bde41 Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:

cmake --help-command-list |
grep -v "cmake version" |
while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Brad King f98a4e63fd Avoid (Unix|Windows)Paths.cmake multiple include
Block multiple inclusion because "Modules/CMakeCInformation.cmake"
includes "Platform/${CMAKE_SYSTEM_NAME}" even though the generic
module "CMakeSystemSpecificInformation.cmake" already included it.

The extra inclusion is a work-around to address issue #4772 without
intrusive platform file changes.  Once those changes are made the
work-around and these include blockers can be removed.  See issue #9656.
2009-10-05 11:47:25 -04:00
Brad King 3dc80f8d8c Add copyright notice to (Unix|Windows)Paths.cmake
This commit adds our copyright notice to these non-trivial platform
modules.
2009-10-05 11:47:05 -04:00
Brad King d5c1191349 ENH: Use 32-bit and 64-bit Program Files folders
On 64-bit Windows there may be two Program Files folders, one for 32-bit
binaries and one for 64-bit binaries.  When we compute
CMAKE_SYSTEM_PREFIX_PATH we should put both folders in the path.
2008-12-17 09:23:30 -05:00
Brad King 2a78288064 ENH: Convert Modules/Platform specification of system search paths to use CMAKE_SYSTEM_PREFIX_PATH when possible. 2008-01-16 09:51:57 -05:00
Alexander Neundorf dac7814841 ENH: use WindowsPaths.cmake on all Windows platforms, not only for cl, makes
the mingw cross compiler work out of the box and should help mingw users on
windows with a common install dir

Alex
2007-08-02 11:17:32 -04:00
Alexander Neundorf 507896e03b ENH:
-add /usr/openwin/include and /usr/openwin/lib to the default search paths
-add /${CMAKE_INSTALL_PREFIX}/(lib|bin|include) to the default cmake search
paths -> this should help users who install stuff in their home

Alex
2007-07-27 11:57:17 -04:00
Alexander Neundorf 57f25c53e3 ENH: also look in the include/, lib/ and bin/ directories in the cmake
install dir under windows, this will help e.g. people using kdewininstaller
and similar setups

Alex
2007-07-17 08:51:45 -04:00
Bill Hoffman a5825cd11a ENH: check in new find stuff 2006-03-02 13:30:22 -05:00