Browse Source

Merge remote-tracking branch 'cmake/release'

master v3.7.1
Kolan Sh 5 years ago
parent
commit
e237211a89
  1. 7
      .gitignore
  2. 13
      .hooks-config.bash
  3. 2
      Auxiliary/CMakeLists.txt
  4. 2
      Auxiliary/bash-completion/cmake
  5. 21
      Auxiliary/cmake-help.vim
  6. 30
      Auxiliary/cmake-mode.el
  7. 89
      Auxiliary/cmake-syntax.vim
  8. 13
      Auxiliary/cmake.m4
  9. 91
      Auxiliary/vim/cmake.vim.in
  10. 141
      Auxiliary/vim/extract-upper-case.pl
  11. 10
      Auxiliary/vim/indent/cmake.vim
  12. 554
      Auxiliary/vim/syntax/cmake.vim
  13. 69
      CMakeCPack.cmake
  14. 33
      CMakeCPackOptions.cmake.in
  15. 116
      CMakeLists.txt
  16. 24
      CONTRIBUTING.rst
  17. 14
      CTestConfig.cmake
  18. 8
      CTestCustom.cmake.in
  19. 22
      CompileFlags.cmake
  20. 85
      Copyright.txt
  21. 14
      DartConfig.cmake
  22. 7
      Help/command/add_custom_command.rst
  23. 11
      Help/command/cmake_parse_arguments.rst
  24. 9
      Help/command/ctest_build.rst
  25. 11
      Help/command/ctest_configure.rst
  26. 9
      Help/command/ctest_coverage.rst
  27. 9
      Help/command/ctest_test.rst
  28. 6
      Help/command/ctest_upload.rst
  29. 15
      Help/command/export.rst
  30. 6
      Help/command/file.rst
  31. 7
      Help/command/find_library.rst
  32. 35
      Help/command/find_package.rst
  33. 11
      Help/command/get_cmake_property.rst
  34. 59
      Help/command/if.rst
  35. 6
      Help/command/include.rst
  36. 14
      Help/command/install.rst
  37. 9
      Help/command/math.rst
  38. 12
      Help/command/separate_arguments.rst
  39. 4
      Help/command/set.rst
  40. 8
      Help/command/string.rst
  41. 6
      Help/command/target_link_libraries.rst
  42. 6
      Help/generator/CodeLite.rst
  43. 27
      Help/generator/Ninja.rst
  44. 2
      Help/generator/Visual Studio 10 2010.rst
  45. 2
      Help/generator/Visual Studio 11 2012.rst
  46. 2
      Help/generator/Visual Studio 12 2013.rst
  47. 2
      Help/generator/Visual Studio 14 2015.rst
  48. 16
      Help/generator/Visual Studio 15 2017.rst
  49. 1
      Help/index.rst
  50. 8
      Help/manual/OPTIONS_BUILD.txt
  51. 2
      Help/manual/cmake-buildsystem.7.rst
  52. 74
      Help/manual/cmake-developer.7.rst
  53. 8
      Help/manual/cmake-generator-expressions.7.rst
  54. 1
      Help/manual/cmake-generators.7.rst
  55. 4
      Help/manual/cmake-modules.7.rst
  56. 8
      Help/manual/cmake-policies.7.rst
  57. 12
      Help/manual/cmake-properties.7.rst
  58. 2
      Help/manual/cmake-qt.7.rst
  59. 672
      Help/manual/cmake-server.7.rst
  60. 204
      Help/manual/cmake-toolchains.7.rst
  61. 35
      Help/manual/cmake-variables.7.rst
  62. 45
      Help/manual/cmake.1.rst
  63. 104
      Help/manual/ctest.1.rst
  64. 1
      Help/module/AndroidTestUtilities.rst
  65. 1
      Help/module/CPackProductBuild.rst
  66. 1
      Help/module/FindICU.rst
  67. 1
      Help/module/FindVulkan.rst
  68. 27
      Help/policy/CMP0066.rst
  69. 5
      Help/prop_dir/BINARY_DIR.rst
  70. 11
      Help/prop_dir/BUILDSYSTEM_TARGETS.rst
  71. 5
      Help/prop_dir/SOURCE_DIR.rst
  72. 15
      Help/prop_dir/SUBDIRECTORIES.rst
  73. 10
      Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst
  74. 5
      Help/prop_sf/VS_TOOL_OVERRIDE.rst
  75. 11
      Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst
  76. 6
      Help/prop_test/DEPENDS.rst
  77. 46
      Help/prop_test/FIXTURES_CLEANUP.rst
  78. 94
      Help/prop_test/FIXTURES_REQUIRED.rst
  79. 47
      Help/prop_test/FIXTURES_SETUP.rst
  80. 3
      Help/prop_test/RESOURCE_LOCK.rst
  81. 9
      Help/prop_tgt/ANDROID_API.rst
  82. 3
      Help/prop_tgt/ANDROID_ARCH.rst
  83. 4
      Help/prop_tgt/ANDROID_GUI.rst
  84. 32
      Help/prop_tgt/ANDROID_STL_TYPE.rst
  85. 5
      Help/prop_tgt/AUTORCC.rst
  86. 7
      Help/prop_tgt/BUNDLE_EXTENSION.rst
  87. 15
      Help/prop_tgt/LINK_WHAT_YOU_USE.rst
  88. 7
      Help/prop_tgt/VS_SDK_REFERENCES.rst
  89. 5
      Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst
  90. 320
      Help/release/3.7.rst
  91. 1
      Help/release/index.rst
  92. 5
      Help/variable/ANDROID.rst
  93. 10
      Help/variable/CMAKE_ANDROID_API.rst
  94. 18
      Help/variable/CMAKE_ANDROID_ARCH.rst
  95. 17
      Help/variable/CMAKE_ANDROID_ARCH_ABI.rst
  96. 7
      Help/variable/CMAKE_ANDROID_ARM_MODE.rst
  97. 6
      Help/variable/CMAKE_ANDROID_ARM_NEON.rst
  98. 7
      Help/variable/CMAKE_ANDROID_NDK.rst
  99. 6
      Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst
  100. 16
      Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst

7
.gitignore

@ -0,0 +1,7 @@
# Exclude MacOS Finder files.
.DS_Store
*.user*
*.pyc
Testing

13
.hooks-config.bash

@ -1,14 +1,5 @@
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Loaded by .git/hooks/(pre-commit|commit-msg|prepare-commit-msg)
# during git commit after local hooks have been installed.

2
Auxiliary/CMakeLists.txt

@ -1,4 +1,4 @@
install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${CMAKE_DATA_DIR}/editors/vim)
install(DIRECTORY vim/indent vim/syntax DESTINATION ${CMAKE_DATA_DIR}/editors/vim)
install(FILES cmake-mode.el DESTINATION ${CMAKE_DATA_DIR}/editors/emacs)
install(FILES cmake.m4 DESTINATION share/aclocal)
add_subdirectory (bash-completion)

2
Auxiliary/bash-completion/cmake

@ -102,7 +102,7 @@ _cmake()
;;
-E)
COMPREPLY=( $( compgen -W "$( cmake -E help |& sed -n \
'/^ /{s|^ \([^ ]\{1,\}\) .*$|\1|;p}' 2>/dev/null )" \
'/^ [^ ]/{s|^ \([^ ]\{1,\}\) .*$|\1|;p}' 2>/dev/null )" \
-- "$cur" ) )
return
;;

21
Auxiliary/cmake-help.vim

@ -1,21 +0,0 @@
nmap ,hc :call OpenCmakeHelp()<CR>
function! OpenCmakeHelp()
let s = getline( '.' )
let i = col( '.' ) - 1
while i > 0 && strpart( s, i, 1 ) =~ '[A-Za-z0-9_]'
let i = i - 1
endwhile
while i < col('$') && strpart( s, i, 1 ) !~ '[A-Za-z0-9_]'
let i = i + 1
endwhile
let start = match( s, '[A-Za-z0-9_]\+', i )
let end = matchend( s, '[A-Za-z0-9_]\+', i )
let ident = strpart( s, start, end - start )
execute "vertical new"
execute "%!cmake --help-command ".ident
set nomodified
set readonly
endfunction
autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in nmap <F1> :call OpenCmakeHelp()<CR>

30
Auxiliary/cmake-mode.el

@ -1,16 +1,7 @@
;;; cmake-mode.el --- major-mode for editing CMake sources
;=============================================================================
; CMake - Cross Platform Makefile Generator
; Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
;
; Distributed under the OSI-approved BSD License (the "License");
; see accompanying file Copyright.txt for details.
;
; This software is distributed WITHOUT ANY WARRANTY; without even the
; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
; See the License for more information.
;=============================================================================
; Distributed under the OSI-approved BSD 3-Clause License. See accompanying
; file Copyright.txt or https://cmake.org/licensing for details.
;------------------------------------------------------------------------------
@ -113,6 +104,14 @@ set the path with these commands:
;------------------------------------------------------------------------------
;;
;; Indentation increment.
;;
(defcustom cmake-tab-width 2
"Number of columns to indent cmake blocks"
:type 'integer
:group 'cmake)
;;
;; Line indentation function.
;;
@ -225,13 +224,6 @@ the indentation. Otherwise it retains the same position on the line"
;;
(defvar cmake-mode-hook nil)
;;
;; Indentation increment.
;;
(defcustom cmake-tab-width 2
"Number of columns to indent cmake blocks"
:type 'integer)
;------------------------------------------------------------------------------
;; For compatibility with Emacs < 24
@ -270,7 +262,7 @@ optional argument topic will be appended to the argument list."
(save-selected-window
(select-window (display-buffer buffer 'not-this-window))
(cmake-mode)
(toggle-read-only t))
(read-only-mode 1))
)
)

89
Auxiliary/cmake-syntax.vim

@ -1,89 +0,0 @@
" =============================================================================
"
" Program: CMake - Cross-Platform Makefile Generator
" Module: $RCSfile$
" Language: VIM
" Date: $Date$
" Version: $Revision$
"
" =============================================================================
" Vim syntax file
" Language: CMake
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: $Date$
" Version: $Revision$
"
" Licence: The CMake license applies to this file. See
" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn case ignore
syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained
syn region cmakeComment start="#" end="$" contains=cmakeTodo
syn region cmakeRegistry start=/\[/ end=/]/
\ contained oneline contains=CONTAINED,cmakeTodo,cmakeEscaped
syn region cmakeVariableValue start=/\${/ end=/}/
\ contained oneline contains=CONTAINED,cmakeTodo
syn region cmakeEnvironment start=/\$ENV{/ end=/}/
\ contained oneline contains=CONTAINED,cmakeTodo
syn region cmakeString start=/"/ end=/"/
\ contains=CONTAINED,cmakeTodo,cmakeOperators
syn region cmakeArguments start=/(/ end=/)/
\ contains=ALLBUT,cmakeArguments,cmakeTodo
syn keyword cmakeSystemVariables
\ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 MSVC90
syn keyword cmakeOperators
\ ABSOLUTE AND BOOL CACHE COMMAND DEFINED DOC EQUAL EXISTS EXT FALSE GREATER INTERNAL LESS MATCHES NAME NAMES NAME_WE NOT OFF ON OR PATH PATHS PROGRAM STREQUAL STRGREATER STRING STRLESS TRUE
\ contained
syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_REMOVE VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WRAP_EXCLUDE_FILES
\ nextgroup=cmakeArguments
" The keywords are generated as: cmake --help-command-list | tr "\n" " " | tr "[:lower:]" "[:upper:]"
syn keyword cmakeStatement
\ ADD_COMPILE_OPTIONS ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BREAK BUILD_COMMAND BUILD_NAME CMAKE_HOST_SYSTEM_INFORMATION CMAKE_MINIMUM_REQUIRED CMAKE_POLICY CONFIGURE_FILE CREATE_TEST_SOURCELIST CTEST_BUILD CTEST_CONFIGURE CTEST_COVERAGE CTEST_EMPTY_BINARY_DIRECTORY CTEST_MEMCHECK CTEST_READ_CUSTOM_FILES CTEST_RUN_SCRIPT CTEST_SLEEP CTEST_START CTEST_SUBMIT CTEST_TEST CTEST_UPDATE CTEST_UPLOAD DEFINE_PROPERTY ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_PROPERTY GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS RETURN SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_PROPERTY SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_COMPILE_DEFINITIONS TARGET_COMPILE_FEATURES TARGET_COMPILE_OPTIONS TARGET_INCLUDE_DIRECTORIES TARGET_LINK_LIBRARIES TARGET_SOURCES TRY_COMPILE TRY_RUN UNSET USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VARIABLE_WATCH WHILE WRITE_FILE
\ nextgroup=cmakeArguments
syn keyword cmakeTodo
\ TODO FIXME XXX
\ contained
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_cmake_syntax_inits")
if version < 508
let did_cmake_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink cmakeStatement Statement
HiLink cmakeComment Comment
HiLink cmakeString String
HiLink cmakeVariableValue Type
HiLink cmakeRegistry Underlined
HiLink cmakeArguments Identifier
HiLink cmakeArgument Constant
HiLink cmakeEnvironment Special
HiLink cmakeOperators Operator
HiLink cmakeMacro PreProc
HiLink cmakeError Error
HiLink cmakeTodo TODO
HiLink cmakeEscaped Special
delcommand HiLink
endif
let b:current_syntax = "cmake"
"EOF"

13
Auxiliary/cmake.m4

@ -1,14 +1,5 @@
dnl ============================================================================
dnl CMake - Cross Platform Makefile Generator
dnl Copyright 2011 Matthias Kretz, kretz@kde.org
dnl
dnl Distributed under the OSI-approved BSD License (the "License");
dnl see accompanying file Copyright.txt for details.
dnl
dnl This software is distributed WITHOUT ANY WARRANTY; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dnl See the License for more information.
dnl ============================================================================
dnl Distributed under the OSI-approved BSD 3-Clause License. See accompanying
dnl file Copyright.txt or https://cmake.org/licensing for details.
AC_DEFUN([CMAKE_FIND_BINARY],
[AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl

91
Auxiliary/vim/cmake.vim.in
File diff suppressed because it is too large
View File

141
Auxiliary/vim/extract-upper-case.pl

@ -0,0 +1,141 @@
#!/usr/bin/env perl
use strict;
use warnings;
my @variables;
my @commands;
my @properties;
my @modules;
my %keywords; # command => keyword-list
# unwanted upper-cases
my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR);
# cannot remove ALL - exists for add_custom_command
# control-statements
my %conditional = map { $_ => 1 } qw(if else elseif endif);
my %loop = map { $_ => 1 } qw(foreach while endforeach endwhile);
# decrecated
my %deprecated = map { $_ => 1 } qw(build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file);
# add some (popular) modules
push @modules, "ExternalProject";
# variables
open(CMAKE, "cmake --help-variable-list|") or die "could not run cmake";
while (<CMAKE>) {
chomp;
push @variables, $_;
}
close(CMAKE);
# transform all variables in a hash - to be able to use exists later on
my %variables = map { $_ => 1 } @variables;
# commands
open(CMAKE, "cmake --help-command-list|");
while (my $cmd = <CMAKE>) {
chomp $cmd;
push @commands, $cmd;
}
close(CMAKE);
# now generate a keyword-list per command
foreach my $cmd (@commands) {
my @word = extract_upper("cmake --help-command $cmd|");
next if scalar @word == 0;
$keywords{$cmd} = [ sort keys %{ { map { $_ => 1 } @word } } ];
}
# and now for modules
foreach my $mod (@modules) {
my @word = extract_upper("cmake --help-module $mod|");
next if scalar @word == 0;
$keywords{$mod} = [ sort keys %{ { map { $_ => 1 } @word } } ];
}
# and now for generator-expressions
my @generator_expr = extract_upper("cmake --help-manual cmake-generator-expressions |");
# properties
open(CMAKE, "cmake --help-property-list|");
while (<CMAKE>) {
chomp;
push @properties, $_;
}
close(CMAKE);
# generate cmake.vim
open(IN, "<cmake.vim.in") or die "could not read cmake.vim.in";
open(OUT, ">syntax/cmake.vim") or die "could not write to syntax/cmake.vim";
my @keyword_hi;
while(<IN>)
{
if (m/\@([A-Z0-9_]+)\@/) { # match for @SOMETHING@
if ($1 eq "COMMAND_LIST") {
# do not include "special" commands in this list
my @tmp = grep { ! exists $conditional{$_} and
! exists $loop{$_} and
! exists $deprecated{$_} } @commands;
print OUT " " x 12 , "\\ ", join(" ", @tmp), "\n";
} elsif ($1 eq "VARIABLE_LIST") {
print OUT " " x 12 , "\\ ", join(" ", @variables), "\n";
} elsif ($1 eq "MODULES") {
print OUT " " x 12 , "\\ ", join("\n", @modules), "\n";
} elsif ($1 eq "GENERATOR_EXPRESSIONS") {
print OUT " " x 12 , "\\ ", join(" ", @generator_expr), "\n";
} elsif ($1 eq "CONDITIONALS") {
print OUT " " x 12 , "\\ ", join(" ", sort keys %conditional), "\n";
} elsif ($1 eq "LOOPS") {
print OUT " " x 12 , "\\ ", join(" ", sort keys %loop), "\n";
} elsif ($1 eq "DEPRECATED") {
print OUT " " x 12 , "\\ ", join(" ", sort keys %deprecated), "\n";
} elsif ($1 eq "KEYWORDS") {
foreach my $k (sort keys %keywords) {
print OUT "syn keyword cmakeKW$k\n";
print OUT " " x 12, "\\ ", join(" ", @{$keywords{$k}}), "\n";
print OUT " " x 12, "\\ contained\n";
print OUT "\n";
push @keyword_hi, "hi def link cmakeKW$k ModeMsg";
}
} elsif ($1 eq "KEYWORDS_HIGHLIGHT") {
print OUT join("\n", @keyword_hi), "\n";
} else {
print "ERROR do not know how to replace $1\n";
}
} else {
print OUT $_;
}
}
close(IN);
close(OUT);
sub extract_upper
{
my $input = shift;
my @word;
open(KW, $input);
while (<KW>) {
foreach my $w (m/\b([A-Z_]{2,})\b/g) {
next
if exists $variables{$w} or # skip if it is a variable
exists $unwanted{$w}; # skip if not wanted
push @word, $w;
}
}
close(KW);
return @word;
}

10
Auxiliary/cmake-indent.vim → Auxiliary/vim/indent/cmake.vim

@ -1,13 +1,3 @@
" =============================================================================
"
" Program: CMake - Cross-Platform Makefile Generator
" Module: $RCSfile$
" Language: VIM
" Date: $Date$
" Version: $Revision$
"
" =============================================================================
" Vim indent file
" Language: CMake (ft=cmake)
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>

554
Auxiliary/vim/syntax/cmake.vim
File diff suppressed because it is too large
View File

69
CMakeCPack.cmake

@ -1,14 +1,5 @@
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# If the cmake version includes cpack, use it
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
@ -70,6 +61,9 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Components
if(CMake_INSTALL_COMPONENTS)
set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack)
if(WIN32 AND NOT CYGWIN)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmcldeps)
endif()
if(APPLE)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmakexbuild)
endif()
@ -87,8 +81,10 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
endif()
if(BUILD_QtDialog)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-gui)
set(_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES "set(CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES
\"LGPLv2.1\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv2.1.txt\")")
if(USE_LGPL)
set(_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES "set(CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES
\"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\")")
endif()
endif()
if(SPHINX_MAN)
list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-man)
@ -102,22 +98,31 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
if(SPHINX_QTHELP)
list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-qthelp)
endif()
if(CMake_BUILD_DEVELOPER_REFERENCE)
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-html)
endif()
if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-qthelp)
endif()
endif()
set(_CPACK_IFW_COMPONENTS_CONFIGURATION "
# Components
set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\")
set(CPACK_COMPONENTS_GROUPING IGNORE)
")
else()
if(BUILD_QtDialog AND CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
if(BUILD_QtDialog AND USE_LGPL)
set(_CPACK_IFW_ADDITIONAL_LICENSES
"\"LGPLv2.1\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv2.1.txt\"")
"\"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\"")
endif()
endif()
# Components scripts configuration
foreach(_script
CMake
CMake.Documentation.SphinxHTML)
CMake.Documentation.SphinxHTML
CMake.DeveloperReference.HTML)
configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/${_script}.qs.in"
"${CMake_BINARY_DIR}/${_script}.qs" @ONLY)
endforeach()
@ -131,6 +136,11 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
if(SPHINX_HTML)
set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/html/index.html\", \"@StartMenuDir@/CMake Documentation.lnk\");\n")
endif()
if(CMake_BUILD_DEVELOPER_REFERENCE)
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/developer-reference/html/index.html\", \"@StartMenuDir@/CMake Developer Reference.lnk\");\n")
endif()
endif()
configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in"
"${CMake_BINARY_DIR}/installscript.qs" @ONLY
)
@ -166,36 +176,11 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
if(UNIX)
set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
set(CPACK_STRIP_FILES "${CMAKE_BIN_DIR}/ccmake;${CMAKE_BIN_DIR}/cmake;${CMAKE_BIN_DIR}/cpack;${CMAKE_BIN_DIR}/ctest")
set(CPACK_SOURCE_STRIP_FILES "")
set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
endif()
# cygwin specific packaging stuff
if(CYGWIN)
# setup the cygwin package name
set(CPACK_PACKAGE_NAME cmake)
# setup the name of the package for cygwin cmake-2.4.3
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
# the source has the same name as the binary
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
# Create a cygwin version number in case there are changes for cygwin
# that are not reflected upstream in CMake
set(CPACK_CYGWIN_PATCH_NUMBER 1 CACHE STRING "patch number for CMake cygwin packages")
mark_as_advanced(CPACK_CYGWIN_PATCH_NUMBER)
# These files are required by the cmCPackCygwinSourceGenerator and the files
# put into the release tar files.
set(CPACK_CYGWIN_BUILD_SCRIPT
"${CMake_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.sh")
set(CPACK_CYGWIN_PATCH_FILE
"${CMake_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.patch")
# include the sub directory cmake file for cygwin that
# configures some files and adds some install targets
# this file uses some of the package file name variables
include(Utilities/Release/Cygwin/CMakeLists.txt)
endif()
set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991")
if(MSVC AND NOT "$ENV{WIX}" STREQUAL "")

33
CMakeCPackOptions.cmake.in

@ -102,13 +102,21 @@ if(CPACK_GENERATOR MATCHES "IFW")
set(CPACK_IFW_COMPONENT_CPACK_PRIORITY 87)
set(CPACK_IFW_COMPONENT_CPACK_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
set(CPACK_COMPONENT_CMCLDEPS_DISPLAY_NAME "cmcldeps")
set(CPACK_COMPONENT_CMCLDEPS_DESCRIPTION
"The \"cmcldeps\" executable is wrapper around \"cl\" program")
set(CPACK_COMPONENT_CMCLDEPS_GROUP Tools)
set(CPACK_IFW_COMPONENT_CMCLDEPS_NAME "CMClDeps")
set(CPACK_IFW_COMPONENT_CMCLDEPS_PRIORITY 86)
set(CPACK_IFW_COMPONENT_CMCLDEPS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
set(CPACK_COMPONENT_CMAKEXBUILD_DISPLAY_NAME "cmakexbuild")
set(CPACK_COMPONENT_CMAKEXBUILD_DESCRIPTION
"The \"cmakexbuild\" executable is a wrapper program for \"xcodebuild\"")
set(CPACK_COMPONENT_CMAKEXBUILD_REQUIRED TRUE)
set(CPACK_COMPONENT_CMAKEXBUILD_GROUP Tools)
set(CPACK_IFW_COMPONENT_CMAKEXBUILD_NAME "CMakeXBuild")
set(CPACK_IFW_COMPONENT_CMAKEXBUILD_PRIORITY 86)
set(CPACK_IFW_COMPONENT_CMAKEXBUILD_PRIORITY 85)
set(CPACK_IFW_COMPONENT_CMAKEXBUILD_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
# Dialogs
@ -167,6 +175,29 @@ if(CPACK_GENERATOR MATCHES "IFW")
set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_NAME "SphinxQtHelp")
set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
# Developer Reference
set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_DISPLAY_NAME "Developer Reference")
set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_DESCRIPTION
"CMake Reference in different formats (html, qch)")
set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_PARENT_GROUP CMake)
set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_PRIORITY 50)
set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_VERSION
"@_CPACK_IFW_PACKAGE_VERSION@")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_DISPLAY_NAME "HTML")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_GROUP DeveloperReference)
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_DISABLED TRUE)
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_NAME "HTML")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_SCRIPT
"@CMake_BINARY_DIR@/CMake.DeveloperReference.HTML.qs")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISPLAY_NAME "Qt Compressed Help")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_GROUP DeveloperReference)
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISABLED TRUE)
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_NAME "QtHelp")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@")
endif()
if(CPACK_GENERATOR MATCHES "CygwinSource")

116
CMakeLists.txt

@ -1,15 +1,7 @@
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
cmake_minimum_required(VERSION 2.8.12.2 FATAL_ERROR)
if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()
@ -18,6 +10,10 @@ if(POLICY CMP0053)
endif()
project(CMake)
# Make sure we can find internal find_package modules only used for
# building CMake and not for shipping externally
list(INSERT CMAKE_MODULE_PATH 0 ${CMake_SOURCE_DIR}/Source/Modules)
if(CMAKE_BOOTSTRAP)
# Running from bootstrap script. Set local variable and remove from cache.
set(CMAKE_BOOTSTRAP 1)
@ -28,6 +24,16 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
endif()
if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL MATCHES "^3|2\\.1$")
set(USE_LGPL "${CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL}")
else()
set(USE_LGPL "2.1")
endif()
else()
set(USE_LGPL "")
endif()
if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Disallow architecture-specific try_run. It may not run on the host.
macro(TRY_RUN)
@ -57,7 +63,7 @@ if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
endif()
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx11_unordered_map.cmake)
include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
endif()
# option to set the internal encoding of CMake to UTF-8
@ -83,6 +89,11 @@ option(CMake_INSTALL_DEPENDENCIES
"Whether to install 3rd-party runtime dependencies" OFF)
mark_as_advanced(CMake_INSTALL_DEPENDENCIES)
# option to build reference for CMake developers
option(CMake_BUILD_DEVELOPER_REFERENCE
"Build CMake Developer Reference" OFF)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)
#-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script
@ -97,7 +108,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA ZLIB)
set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBUV ZLIB)
foreach(util ${UTILITIES})
if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
@ -137,6 +148,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
"${CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
option(CMAKE_USE_SYSTEM_FORM "Use system-installed libform" "${CMAKE_USE_SYSTEM_LIBRARY_FORM}")
option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp" "${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}")
option(CMAKE_USE_SYSTEM_LIBUV "Use system-installed libuv" "${CMAKE_USE_SYSTEM_LIBRARY_LIBUV}")
# For now use system KWIML only if explicitly requested rather
# than activating via the general system libs options.
@ -433,7 +445,7 @@ macro (CMAKE_BUILD_UTILITIES)
# Build jsoncpp library.
if(CMAKE_USE_SYSTEM_JSONCPP)
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
include(${CMake_SOURCE_DIR}/Source/Modules/FindJsonCpp.cmake)
find_package(JsonCpp)
else()
message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP requires CMake >= 3.0")
endif()
@ -448,6 +460,55 @@ macro (CMAKE_BUILD_UTILITIES)
CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
endif()
#---------------------------------------------------------------------
# Build libuv library.
if(NOT DEFINED CMAKE_USE_LIBUV)
set(CMAKE_USE_LIBUV 1)
if(APPLE)
include(CheckCSourceCompiles)
check_c_source_compiles("
#include <CoreServices/CoreServices.h>
#include <AvailabilityMacros.h>
#ifndef MAC_OS_X_VERSION_10_5
#error \"MAC_OS_X_VERSION_10_5 is not defined\"
#endif
int main(void) { return 0; }
" HAVE_CoreServices_OS_X_10_5)
if(NOT HAVE_CoreServices_OS_X_10_5)
set(CMAKE_USE_LIBUV 0)
endif()
elseif(CYGWIN)
# libuv does not support Cygwin
set(CMAKE_USE_LIBUV 0)
elseif(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
# Disable until it can be ported.
set(CMAKE_USE_LIBUV 0)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
# Disable until it can be ported.
set(CMAKE_USE_LIBUV 0)
endif()
endif()
if(CMAKE_USE_LIBUV)
if(CMAKE_USE_SYSTEM_LIBUV)
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
find_package(LibUV 1.0.0)
else()
message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBUV requires CMake >= 3.0")
endif()
if(NOT LIBUV_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!")
endif()
set(CMAKE_LIBUV_LIBRARIES LibUV::LibUV)
else()
set(CMAKE_LIBUV_LIBRARIES cmlibuv)
add_subdirectory(Utilities/cmlibuv)
CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty")
endif()
else()
set(CMAKE_LIBUV_LIBRARIES)
endif()
#---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest.
if(CTEST_USE_XMLRPC)
@ -637,6 +698,31 @@ endif()
# setup some Testing support (a macro defined in this file)
CMAKE_SETUP_TESTING()
# Check whether to build server mode or not:
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(NOT DEFINED CMake_ENABLE_SERVER_MODE)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_auto_type CMake_HAVE_CXX_AUTO_TYPE)
list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_range_for CMake_HAVE_CXX_RANGE_FOR)
if(CMAKE_USE_LIBUV
AND CMake_HAVE_CXX_AUTO_TYPE
AND CMake_HAVE_CXX_MAKE_UNIQUE
AND CMake_HAVE_CXX_RANGE_FOR
)
set(CMake_ENABLE_SERVER_MODE 1)
else()
set(CMake_ENABLE_SERVER_MODE 0)
endif()
endif()
if(CMake_ENABLE_SERVER_MODE AND NOT CMAKE_USE_LIBUV)
message(FATAL_ERROR "The server mode requires libuv!")
endif()
else()
set(CMake_ENABLE_SERVER_MODE 0)
endif()
if(NOT DEFINED CMake_TEST_SERVER_MODE)
set(CMake_TEST_SERVER_MODE ${CMake_ENABLE_SERVER_MODE})
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(NOT CMake_VERSION_IS_RELEASE)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND

24
CONTRIBUTING.rst

@ -6,22 +6,26 @@ Community
CMake is maintained and supported by `Kitware`_ and developed in
collaboration with a productive community of contributors.
Please subscribe and post to the `CMake Developers List`_ to raise
discussion of development topics.
.. _`Kitware`: http://www.kitware.com/cmake
The preferred entry point for new contributors is the mailing list.
Please subscribe and post to the `CMake Developers List`_ to offer
contributions. Regular and productive contributors may be invited
to gain direct push access.
.. _`CMake Developers List`: https://cmake.org/mailman/listinfo/cmake-developers
Patches
=======
Please base all new work on the ``master`` branch. Then use
``git format-patch`` to produce patches suitable to post to
the mailing list.
CMake uses `Kitware's GitLab Instance`_ to manage development and code review.
To contribute patches:
#. Fork the upstream `CMake Repository`_ into a personal account.
#. Base all new work on the upstream ``master`` branch.
#. Create commits making incremental, distinct, logically complete changes.
#. Push a topic branch to a personal repository fork on GitLab.
#. Create a GitLab Merge Request targeting the upstream ``master`` branch.
.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
Code Style
==========
@ -29,9 +33,11 @@ Code Style
We use `clang-format`_ to define our style for C++ code in the CMake source
tree. See the `.clang-format`_ configuration file for our style settings.
Use ``clang-format`` version 3.8 or higher to format source files.
See also the `Utilities/Scripts/clang-format.bash`_ script.
.. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html
.. _`.clang-format`: .clang-format
.. _`Utilities/Scripts/clang-format.bash`: Utilities/Scripts/clang-format.bash
License
=======

14
CTestConfig.cmake

@ -1,14 +1,6 @@
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set(CTEST_PROJECT_NAME "CMake")
set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")

8
CTestCustom.cmake.in

@ -49,6 +49,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"stl_deque.h:1051"
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
"(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)"
"(Lexer|Parser).*warning.*variable.*was set but never used"
"PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c"
"[Qq]t([Cc]ore|[Gg]ui|[Ww]idgets).*warning.*conversion.*may alter its value"
"warning:.*is.*very unsafe.*consider using.*"
@ -62,13 +63,17 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"warning.*This version of Mac OS X is unsupported"
"clang.*: warning: argument unused during compilation: .-g"
"note: in expansion of macro" # diagnostic context note
"note: expanded from macro" # diagnostic context note
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*may return deterministic values"
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto
"IPA warning: function.*multiply defined in"
# Ignore clang's summary warning, assuming prior text has matched some
# other warning expression:
"[0-9,]+ warnings? generated."
# similarly for PGI
"compilation completed with warnings"
# scanbuild exceptions
"char_traits.h:.*: warning: Null pointer argument in call to string length function"
@ -80,8 +85,11 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"index_encoder.c.241.2. warning: Value stored to .out_start. is never read"
"index.c.*warning: Access to field.*results in a dereference of a null pointer.*loaded from variable.*"
"cm_sha2.*warning: Value stored to.*is never read"
"cmFortranLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes"
"testProcess.*warning: Dereference of null pointer .loaded from variable .invalidAddress.."
"liblzma/simple/x86.c:[0-9]+:[0-9]+: warning: The result of the '<<' expression is undefined"
"libuv/src/.*:[0-9]+:[0-9]+: warning: Dereference of null pointer"
"libuv/src/.*:[0-9]+:[0-9]+: warning: The left operand of '==' is a garbage value"
)
if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")

22
CompileFlags.cmake

@ -1,14 +1,5 @@
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#-----------------------------------------------------------------------------
# set some special flags for different compilers
@ -64,7 +55,7 @@ endif()
# Workaround for short jump tables on PA-RISC
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
if(CMAKE_COMPILER_IS_GNUC)
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-calls")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
@ -80,6 +71,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
endif()
endif()
foreach(lang C CXX)
# Suppress warnings from PGI compiler.
if (CMAKE_${lang}_COMPILER_ID STREQUAL "PGI")
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w")
endif()
endforeach()
# use the ansi CXX compile flag for building cmake
if (CMAKE_ANSI_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")

85
Copyright.txt

@ -1,6 +1,5 @@
CMake - Cross Platform Makefile Generator
Copyright 2000-2016 Kitware, Inc.
Copyright 2000-2011 Insight Software Consortium
Copyright 2000-2016 Kitware, Inc. and Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -14,10 +13,9 @@ are met:
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the names of Kitware, Inc., the Insight Software Consortium,
nor the names of their contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
* Neither the name of Kitware, Inc. nor the names of Contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@ -33,12 +31,77 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
The following individuals and institutions are among the Contributors:
* Aaron C. Meadows <cmake@shadowguarddev.com>
* Aleksey Avdeev <solo@altlinux.ru>
* Alexander Neundorf <neundorf@kde.org>
* Alexander Smorkalov <alexander.smorkalov@itseez.com>
* Alex Turbov <i.zaufi@gmail.com>
* Andreas Pakulat <apaku@gmx.de>
* Andreas Schneider <asn@cryptomilk.org>
* André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no>
* Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
* Benjamin Eikel
* Bjoern Ricks <bjoern.ricks@gmail.com>
* Brad Hards <bradh@kde.org>
* Christopher Harvey
* Christoph Grüninger <foss@grueninger.de>
* Clement Creusot <creusot@cs.york.ac.uk>
* Daniel Blezek <blezek@gmail.com>
* Daniel Pfeifer <daniel@pfeifer-mail.de>
* Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
* Eran Ifrah <eran.ifrah@gmail.com>
* Esben Mose Hansen, Ange Optimization ApS
* Geoffrey Viola <geoffrey.viola@asirobots.com>
* Gregor Jasny
* Helio Chissini de Castro <helio@kde.org>
* Ilya Lavrenov <ilya.lavrenov@itseez.com>
* Insight Software Consortium <insightsoftwareconsortium.org>
* Jan Woetzel
* Kelly Thompson <kgt@lanl.gov>
* Konstantin Podsvirov <konstantin@podsvirov.pro>
* Mario Bensi <mbensi@ipsquad.net>
* Mathieu Malaterre <mathieu.malaterre@gmail.com>
* Matthaeus G. Chajdas
* Matthias Kretz <kretz@kde.org>
* Matthias Maennich <matthias@maennich.net>
* Miguel A. Figueroa-Villanueva
* Mike Jackson
* Mike McQuaid <mike@mikemcquaid.com>
* Nicolas Bock <nicolasbock@gmail.com>
* Nicolas Despres <nicolas.despres@gmail.com>
* Nikita Krupen'ko <krnekit@gmail.com>
* OpenGamma Ltd. <opengamma.com>
* Per Øyvind Karlsen <peroyvind@mandriva.org>
* Peter Collingbourne <peter@pcc.me.uk>
* Petr Gotthard <gotthard@honeywell.com>
* Philip Lowman <philip@yhbt.com>
* Philippe Proulx <pproulx@efficios.com>
* Raffi Enficiaud, Max Planck Society
* Raumfeld <raumfeld.com>
* Roger Leigh <rleigh@codelibre.net>
* Rolf Eike Beer <eike@sf-mail.de>
* Roman Donchenko <roman.donchenko@itseez.com>
* Roman Kharitonov <roman.kharitonov@itseez.com>
* Ruslan Baratov
* Sebastian Holtermann <sebholt@xwmw.org>
* Stephen Kelly <steveire@gmail.com>
* Sylvain Joubert <joubert.sy@gmail.com>
* Thomas Sondergaard <ts@medical-insight.com>
* Tobias Hunger <tobias.hunger@qt.io>
* Todd Gamblin <tgamblin@llnl.gov>
* Tristan Carel
* University of Dundee
* Vadim Zhukov
* Will Dicharry <wdicharry@stellarscience.com>
See version control history for details of individual contributions.
The above copyright and license notice applies to distributions of
CMake in source and binary form. Some source files contain additional
notices of original copyright by their contributors; see each source
for details. Third-party software packages supplied with CMake under
compatible licenses provide their own copyright notices documented in
corresponding subdirectories.
CMake in source and binary form. Third-party software packages supplied
with CMake under compatible licenses provide their own copyright notices
documented in corresponding subdirectories or source files.
------------------------------------------------------------------------------

14
DartConfig.cmake

@ -1,14 +1,6 @@
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set(CTEST_PROJECT_NAME "CMake")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")

7
Help/command/add_custom_command.rst

@ -20,6 +20,7 @@ The first signature is for adding a custom command to produce an output::
[<lang2> depend2] ...]
[WORKING_DIRECTORY dir]
[COMMENT comment]
[DEPFILE depfile]
[VERBATIM] [APPEND] [USES_TERMINAL])
This defines a command to generate specified ``OUTPUT`` file(s).
@ -170,6 +171,12 @@ The options are:
If it is a relative path it will be interpreted relative to the
build tree directory corresponding to the current source directory.
``DEPFILE``
Specify a ``.d`` depfile for the :generator:`Ninja` generator.
A ``.d`` file holds dependencies usually emitted by the custom
command itself.
Using ``DEPFILE`` with other generators than Ninja is an error.
Build Events
^^^^^^^^^^^^

11
Help/command/cmake_parse_arguments.rst

@ -11,6 +11,17 @@ respective options.
cmake_parse_arguments(<prefix> <options> <one_value_keywords>
<multi_value_keywords> args...)
cmake_parse_arguments(PARSE_ARGV N <prefix> <options> <one_value_keywords>
<multi_value_keywords>)
The first signature reads processes arguments passed in the ``args...``.
This may be used in either a :command:`macro` or a :command:`function`.
The ``PARSE_ARGV`` signature is only for use in a :command:`function`
body. In this case the arguments that are parsed come from the
``ARGV#`` variables of the calling function. The parsing starts with
the Nth argument, where ``N`` is an unsigned integer. This allows for
the values to have special characters like ``;`` in them.
The ``<options>`` argument contains all options for the respective macro,
i.e. keywords which can be used when calling the macro without any value

9
Help/command/ctest_build.rst

@ -13,6 +13,7 @@ Perform the :ref:`CTest Build Step` as a :ref:`Dashboard Client`.
[NUMBER_ERRORS <num-err-var>]
[NUMBER_WARNINGS <num-warn-var>]
[RETURN_VALUE <result-var>]
[CAPTURE_CMAKE_ERROR <result-var>]
)
Build the project and store results in ``Build.xml``
@ -29,9 +30,11 @@ The options are:
:variable:`CTEST_BINARY_DIRECTORY` variable is used.
``APPEND``
Mark results for append to those previously submitted to a
Mark ``Build.xml`` for append to results previously submitted to a
dashboard server since the last :command:`ctest_start` call.
Append semantics are defined by the dashboard server in use.
This does *not* cause results to be appended to a ``.xml`` file
produced by a previous call to this command.
``CONFIGURATION <config>``
Specify the build configuration (e.g. ``Debug``). If not
@ -66,6 +69,10 @@ The options are:
``RETURN_VALUE <result-var>``
Store the return value of the native build tool in the given variable.
``CAPTURE_CMAKE_ERROR <result-var>``
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
Suppress any CTest-specific non-error output that would have been
printed to the console otherwise. The summary of warnings / errors,

11
Help/command/ctest_configure.rst

@ -6,7 +6,8 @@ Perform the :ref:`CTest Configure Step` as a :ref:`Dashboard Client`.
::
ctest_configure([BUILD <build-dir>] [SOURCE <source-dir>] [APPEND]
[OPTIONS <options>] [RETURN_VALUE <result-var>] [QUIET])
[OPTIONS <options>] [RETURN_VALUE <result-var>] [QUIET]
[CAPTURE_CMAKE_ERROR <result-var>])
Configure the project build tree and record results in ``Configure.xml``
for submission with the :command:`ctest_submit` command.
@ -22,9 +23,11 @@ The options are:
:variable:`CTEST_SOURCE_DIRECTORY` variable is used.
``APPEND``
Mark results for append to those previously submitted to a
Mark ``Configure.xml`` for append to results previously submitted to a
dashboard server since the last :command:`ctest_start` call.
Append semantics are defined by the dashboard server in use.
This does *not* cause results to be appended to a ``.xml`` file
produced by a previous call to this command.
``OPTIONS <options>``
Specify command-line arguments to pass to the configuration tool.
@ -33,6 +36,10 @@ The options are:
Store in the ``<result-var>`` variable the return value of the native
configuration tool.
``CAPTURE_CMAKE_ERROR <result-var>``
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
Suppress any CTest-specific non-error messages that would have
otherwise been printed to the console. Output from the underlying

9
Help/command/ctest_coverage.rst

@ -8,6 +8,7 @@ Perform the :ref:`CTest Coverage Step` as a :ref:`Dashboard Client`.
ctest_coverage([BUILD <build-dir>] [APPEND]
[LABELS <label>...]
[RETURN_VALUE <result-var>]
[CAPTURE_CMAKE_ERROR <result-var]
[QUIET]
)
@ -21,9 +22,11 @@ The options are:
:variable:`CTEST_BINARY_DIRECTORY` variable is used.
``APPEND``
Mark results for append to those previously submitted to a
Mark ``Coverage.xml`` for append to results previously submitted to a
dashboard server since the last :command:`ctest_start` call.
Append semantics are defined by the dashboard server in use.
This does *not* cause results to be appended to a ``.xml`` file
produced by a previous call to this command.
``LABELS``
Filter the coverage report to include only source files labeled
@ -33,6 +36,10 @@ The options are:
Store in the ``<result-var>`` variable ``0`` if coverage tools
ran without error and non-zero otherwise.
``CAPTURE_CMAKE_ERROR <result-var>``
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
Suppress any CTest-specific non-error output that would have been
printed to the console otherwise. The summary indicating how many

9
Help/command/ctest_test.rst

@ -18,6 +18,7 @@ Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`.
[SCHEDULE_RANDOM <ON|OFF>]
[STOP_TIME <time-of-day>]
[RETURN_VALUE <result-var>]
[CAPTURE_CMAKE_ERROR <result-var>]
[QUIET]
)
@ -31,9 +32,11 @@ The options are:
:variable:`CTEST_BINARY_DIRECTORY` variable is used.
``APPEND``
Mark results for append to those previously submitted to a
Mark ``Test.xml`` for append to results previously submitted to a
dashboard server since the last :command:`ctest_start` call.
Append semantics are defined by the dashboard server in use.
This does *not* cause results to be appended to a ``.xml`` file
produced by a previous call to this command.
``START <start-number>``
Specify the beginning of a range of test numbers.
@ -80,6 +83,10 @@ The options are:
Store in the ``<result-var>`` variable ``0`` if all tests passed.
Store non-zero if anything went wrong.
``CAPTURE_CMAKE_ERROR <result-var>``
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
``QUIET``
Suppress any CTest-specific non-error messages that would have otherwise
been printed to the console. Output from the underlying test command is not

6
Help/command/ctest_upload.rst

@ -5,7 +5,7 @@ Upload files to a dashboard server as a :ref:`Dashboard Client`.
::
ctest_upload(FILES <file>... [QUIET])
ctest_upload(FILES <file>... [QUIET] [CAPTURE_CMAKE_ERROR <result-var>])
The options are:
@ -16,3 +16,7 @@ The options are:
``QUIET``
Suppress any CTest-specific non-error output that would have been
printed to the console otherwise.
``CAPTURE_CMAKE_ERROR <result-var>``
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.

15
Help/command/export.rst