Commit Graph

10 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
Chuck Atkins 3e84e78c3f Use a more reliable regex for extracting binary INFO strings
A few different regular expressions were being used in various
places to extract info strings from binaries.  This uses a
consistent regex amongst all of them now.  This also fixes the
broken ABI detection for Cray compilers.
2014-09-03 17:00:48 -04:00
Rolf Eike Beer 2622bc3f65 Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
The matches have already been calculated and can simply be taken from
CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very
similar regular expressions.
2014-04-14 18:16:58 +02:00
Michel Zou d7a65a2f2c FortranCInterface: Fix cross-compiling Linux to MinGW (#14358)
After building the test binary tell find_program to search for it with
the ${CMAKE_EXECUTABLE_SUFFIX} so that the .exe can be found.  Since
find_program is normally used to locate host tools while cross-compiling
it needs this hint to find the target binary.

Suggested-by: Denis Barbier <bouzim@gmail.com>
2013-08-14 19:31:31 -04:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Brad King 0306080e6e FortranCInterface: Support '=' in language flags
The commit "FortranCInterface: Honor language flags in checks" taught
the FortranCInterface module to pass C and Fortran flags into its
detection and verification checks.  We improve on the change to allow
the '=' character in the language flags.  This requires passing the
cache entry type with the -D options.
2009-12-15 14:02:52 -05:00
Brad King 1699836b06 FortranCInterface: Honor language flags in checks
We pass CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, and CMAKE_Fortran_FLAGS through
try_compile() for the FortranCInterface Detect and Verify projects.
This honors user-specified compiler flags for each language, thus
supporting flags that affect the Fortran mangling.
2009-11-19 17:42:48 -05:00
Brad King 3a666595c9 Convert CMake non-find modules to BSD License
This adds copyright/license notification blocks CMake's non-find
modules.  Most of the modules had no notices at all.  Some had notices
referring to the BSD license already.  This commit normalizes existing
notices and adds missing notices.
2009-09-28 11:46:51 -04:00
Brad King a9be85da2e Create FortranCInterface_VERIFY function
This function builds a simple test project using a combination of
Fortran and C (and optionally C++) to verify that the compilers are
compatible.  The idea is to help projects report very early to users
that the compilers specified cannot mix languages.
2009-08-24 08:49:35 -04:00
Brad King 14f7a043e3 Teach FortranCInterface to load outside results
We split the main detection logic into a Detect.cmake support module and
load it only when detection results are not already available.  This
allows results computed by the main project to be used in try-compile
projects without recomputing them.  The call to try_compile() need only
to pass FortranCInterface_BINARY_DIR through the CMAKE_FLAGS option.
2009-08-24 08:49:07 -04:00