You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

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.
9 years ago
  1. dnl Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. dnl file Copyright.txt or https://cmake.org/licensing for details.
  3. AC_DEFUN([CMAKE_FIND_BINARY],
  4. [AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl
  5. if test "x$ac_cv_env_CMAKE_BINARY_set" != "xset"; then
  6. AC_PATH_TOOL([CMAKE_BINARY], [cmake])dnl
  7. fi
  8. ])dnl
  9. # $1: package name
  10. # $2: language (e.g. C/CXX/Fortran)
  11. # $3: The compiler ID, defaults to GNU.
  12. # Possible values are: GNU, Intel, Clang, SunPro, HP, XL, VisualAge, PGI,
  13. # PathScale, Cray, SCO, MSVC, LCC
  14. # $4: optional extra arguments to cmake, e.g. "-DCMAKE_SIZEOF_VOID_P=8"
  15. # $5: optional path to cmake binary
  16. AC_DEFUN([CMAKE_FIND_PACKAGE], [
  17. AC_REQUIRE([CMAKE_FIND_BINARY])dnl
  18. AC_ARG_VAR([$1][_][$2][FLAGS], [$2 compiler flags for $1. This overrides the cmake output])dnl
  19. AC_ARG_VAR([$1][_LIBS], [linker flags for $1. This overrides the cmake output])dnl
  20. failed=false
  21. AC_MSG_CHECKING([for $1])
  22. if test -z "${$1[]_$2[]FLAGS}"; then
  23. $1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4` || failed=true
  24. fi
  25. if test -z "${$1[]_LIBS}"; then
  26. $1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4` || failed=true
  27. fi
  28. if $failed; then
  29. unset $1[]_$2[]FLAGS
  30. unset $1[]_LIBS
  31. AC_MSG_RESULT([no])
  32. $6
  33. else
  34. AC_MSG_RESULT([yes])
  35. $5
  36. fi[]dnl
  37. ])