Skip to content

Commit 76de697

Browse files
authored
Merge pull request #93 from microsoft/dev/jgoshi/updateToCMake3_17
Dev/jgoshi/update to c make3 17
2 parents 5f518ec + 4ff5746 commit 76de697

File tree

1,517 files changed

+32971
-8855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,517 files changed

+32971
-8855
lines changed

.clang-format

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ IncludeBlocks: Regroup
2222
IncludeCategories:
2323
- Regex: '^[<"]cmConfigure\.h'
2424
Priority: -1
25-
- Regex: '^(<|")cm/'
25+
- Regex: '^<queue>'
26+
Priority: 1
27+
- Regex: '^(<|")cm(ext)?/'
2628
Priority: 2
2729
- Regex: '^(<|")windows\.h'
2830
Priority: 3

Auxiliary/vim/syntax/cmake.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ syn keyword cmakeProperty contained
101101
\ CLEAN_NO_CUSTOM
102102
\ CMAKE_CONFIGURE_DEPENDS
103103
\ CMAKE_CXX_KNOWN_FEATURES
104+
\ CMAKE_CUDA_KNOWN_FEATURES
104105
\ CMAKE_C_KNOWN_FEATURES
105106
\ CMAKE_ROLE
106107
\ COMMON_LANGUAGE_RUNTIME
@@ -220,6 +221,7 @@ syn keyword cmakeProperty contained
220221
\ JOB_POOLS
221222
\ JOB_POOL_COMPILE
222223
\ JOB_POOL_LINK
224+
\ JOB_POOL_PRECOMPILE_HEADER
223225
\ KEEP_EXTENSION
224226
\ LABELS
225227
\ LANGUAGE
@@ -725,6 +727,7 @@ syn keyword cmakeVariable contained
725727
\ CMAKE_CUDA_COMPILER_AR
726728
\ CMAKE_CUDA_COMPILER_ARCHITECTURE_ID
727729
\ CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN
730+
\ CMAKE_CUDA_COMPILE_FEATURES
728731
\ CMAKE_CUDA_COMPILER_ID
729732
\ CMAKE_CUDA_COMPILER_LAUNCHER
730733
\ CMAKE_CUDA_COMPILER_LOADED
@@ -1064,6 +1067,7 @@ syn keyword cmakeVariable contained
10641067
\ CMAKE_JOB_POOLS
10651068
\ CMAKE_JOB_POOL_COMPILE
10661069
\ CMAKE_JOB_POOL_LINK
1070+
\ CMAKE_JOB_POOL_PRECOMPILE_HEADER
10671071
\ CMAKE_Java
10681072
\ CMAKE_Java_ANDROID_TOOLCHAIN_MACHINE
10691073
\ CMAKE_Java_ANDROID_TOOLCHAIN_PREFIX
@@ -2862,6 +2866,11 @@ syn keyword cmakeKWtarget_link_options contained
28622866
\ _LINKER_WRAPPER_FLAG
28632867
\ _LINKER_WRAPPER_FLAG_SEP
28642868

2869+
syn keyword cmakeKWtarget_precompile_headers contained
2870+
\ INTERFACE
2871+
\ PRIVATE
2872+
\ PUBLIC
2873+
28652874
syn keyword cmakeKWtarget_sources contained
28662875
\ ALIAS
28672876
\ IMPORTED
@@ -3166,6 +3175,7 @@ syn keyword cmakeCommand
31663175
\ target_link_directories
31673176
\ target_link_libraries
31683177
\ target_link_options
3178+
\ target_precompile_headers
31693179
\ target_sources
31703180
\ try_compile
31713181
\ try_run
@@ -3322,6 +3332,7 @@ hi def link cmakeKWtarget_include_directories ModeMsg
33223332
hi def link cmakeKWtarget_link_directories ModeMsg
33233333
hi def link cmakeKWtarget_link_libraries ModeMsg
33243334
hi def link cmakeKWtarget_link_options ModeMsg
3335+
hi def link cmakeKWtarget_precompile_headers ModeMsg
33253336
hi def link cmakeKWtarget_sources ModeMsg
33263337
hi def link cmakeKWtry_compile ModeMsg
33273338
hi def link cmakeKWtry_run ModeMsg

CMakeLists.txt

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ macro(CMAKE_SETUP_TESTING)
264264
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
265265
endif()
266266
mark_as_advanced(DART_ROOT)
267-
mark_as_advanced(CURL_TESTING)
268267
endmacro()
269268

270269

@@ -368,7 +367,7 @@ macro (CMAKE_BUILD_UTILITIES)
368367
# Setup third-party libraries.
369368
# Everything in the tree should be able to include files from the
370369
# Utilities directory.
371-
if (CMAKE_SYSTEM_NAME STREQUAL "AIX" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
370+
if ((CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
372371
# using -isystem option generate error "template with C linkage"
373372
include_directories("${CMake_SOURCE_DIR}/Utilities/std")
374373
else()
@@ -671,10 +670,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
671670
set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
672671
"Where to put the libraries for CMake")
673672

674-
# The CMake executables usually do not need any rpath to run in the build or
675-
# install tree.
676-
set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
677-
678673
# Load install destinations.
679674
include(Source/CMakeInstallDestinations.cmake)
680675

@@ -714,19 +709,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
714709
# build the utilities (a macro defined in this file)
715710
CMAKE_BUILD_UTILITIES()
716711

717-
# On NetBSD ncurses is required, since curses doesn't have the wsyncup()
718-
# function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
719-
# which isn't in the default linker search path. So without RPATH ccmake
720-
# doesn't run and the build doesn't succeed since ccmake is executed for
721-
# generating the documentation.
722-
if(BUILD_CursesDialog)
723-
get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
724-
set(CURSES_NEED_RPATH FALSE)
725-
if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
726-
set(CURSES_NEED_RPATH TRUE)
727-
endif()
728-
endif()
729-
730712
if(BUILD_QtDialog)
731713
if(APPLE)
732714
set(CMAKE_BUNDLE_VERSION
@@ -739,28 +721,15 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
739721
set(CMAKE_INSTALL_PREFIX
740722
"${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
741723
endif()
742-
743-
set(QT_NEED_RPATH FALSE)
744-
if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
745-
set(QT_NEED_RPATH TRUE)
746-
endif()
747724
endif()
748725

749-
750-
# The same might be true on other systems for other libraries.
751-
# Then only enable RPATH if we have are building at least with cmake 2.4,
752-
# since this one has much better RPATH features than cmake 2.2.
753-
# The executables are then built with the RPATH for the libraries outside
754-
# the build tree, which is both the build and the install RPATH.
755-
if (UNIX)
756-
if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
757-
OR CMAKE_USE_SYSTEM_EXPAT OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
758-
set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
759-
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
760-
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
761-
endif()
762-
endif ()
763-
726+
if(UNIX)
727+
# Install executables with the RPATH set for libraries outside the build tree.
728+
# This is also suitable for binaries in the build tree. Avoid re-link on install.
729+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON CACHE BOOL "Install with RPATH set to find custom-built libraries.")
730+
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "Build with RPATH set to match install-tree RPATH.")
731+
mark_as_advanced(CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_BUILD_WITH_INSTALL_RPATH)
732+
endif()
764733

765734
# add the uninstall support
766735
configure_file(

CTestCustom.cmake.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
4949
"WarningMessagesDialog\\.cxx"
5050
"warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*"
5151
"stl_deque.h:1051"
52+
"Tests/CMakeLib/testCTestResourceSpec.cxx:.*warning: missing initializer for member.*cmCTestResourceSpec::.*" # GCC 4.8 disagrees with later compilers on C++11 initializer list conversion
5253
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
5354
"(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)"
5455
"(Lexer|Parser).*warning.*variable.*was set but never used"
@@ -71,6 +72,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
7172
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto
7273
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto
7374
"IPA warning: function.*multiply defined in"
75+
"LICENSE WARNING" # PGI license expiry. Not useful in nightly testing.
7476

7577
# Ignore compiler summary warning, assuming prior text has matched some
7678
# other warning expression:

CompileFlags.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
5454
endif()
5555

5656
# Workaround for TOC Overflow on ppc64
57+
set(bigTocFlag "")
5758
if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND
5859
CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
59-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-bbigtoc")
60+
set(bigTocFlag "-Wl,-bbigtoc")
6061
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
6162
CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
62-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-multi-toc")
63+
set(bigTocFlag "-Wl,--no-multi-toc")
64+
endif()
65+
if(bigTocFlag)
66+
include(CheckCXXLinkerFlag)
67+
check_cxx_linker_flag(${bigTocFlag} BIG_TOC_FLAG_SUPPORTED)
68+
if(BIG_TOC_FLAG_SUPPORTED)
69+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${bigTocFlag}")
70+
endif()
6371
endif()
6472

6573
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND

Copyright.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CMake - Cross Platform Makefile Generator
2-
Copyright 2000-2019 Kitware, Inc. and Contributors
2+
Copyright 2000-2020 Kitware, Inc. and Contributors
33
All rights reserved.
44

55
Redistribution and use in source and binary forms, with or without
@@ -99,6 +99,7 @@ The following individuals and institutions are among the Contributors:
9999
* Sebastian Holtermann <[email protected]>
100100
* Stephen Kelly <[email protected]>
101101
* Sylvain Joubert <[email protected]>
102+
* The Qt Company Ltd.
102103
* Thomas Sondergaard <[email protected]>
103104
* Tobias Hunger <[email protected]>
104105
* Todd Gamblin <[email protected]>

Help/command/add_custom_command.rst

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ The options are:
6868
order-only dependencies to ensure the byproducts will be
6969
available before their dependents build.
7070

71+
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
72+
:prop_sf:`GENERATED` files during ``make clean``.
73+
7174
``COMMAND``
7275
Specify the command-line(s) to execute at build time.
7376
If more than one ``COMMAND`` is specified they will be executed in order,
@@ -112,24 +115,42 @@ The options are:
112115
build time.
113116

114117
``DEPENDS``
115-
Specify files on which the command depends. If any dependency is
116-
an ``OUTPUT`` of another custom command in the same directory
117-
(``CMakeLists.txt`` file) CMake automatically brings the other
118+
Specify files on which the command depends. Each argument is converted
119+
to a dependency as follows:
120+
121+
1. If the argument is the name of a target (created by the
122+
:command:`add_custom_target`, :command:`add_executable`, or
123+
:command:`add_library` command) a target-level dependency is
124+
created to make sure the target is built before any target
125+
using this custom command. Additionally, if the target is an
126+
executable or library, a file-level dependency is created to
127+
cause the custom command to re-run whenever the target is
128+
recompiled.
129+
130+
2. If the argument is an absolute path, a file-level dependency
131+
is created on that path.
132+
133+
3. If the argument is the name of a source file that has been
134+
added to a target or on which a source file property has been set,
135+
a file-level dependency is created on that source file.
136+
137+
4. If the argument is a relative path and it exists in the current
138+
source directory, a file-level dependency is created on that
139+
file in the current source directory.
140+
141+
5. Otherwise, a file-level dependency is created on that path relative
142+
to the current binary directory.
143+
144+
If any dependency is an ``OUTPUT`` of another custom command in the same
145+
directory (``CMakeLists.txt`` file), CMake automatically brings the other
118146
custom command into the target in which this command is built.
119147
A target-level dependency is added if any dependency is listed as
120148
``BYPRODUCTS`` of a target or any of its build events in the same
121149
directory to ensure the byproducts will be available.
122-
If ``DEPENDS`` is not specified the command will run whenever
150+
151+
If ``DEPENDS`` is not specified, the command will run whenever
123152
the ``OUTPUT`` is missing; if the command does not actually
124-
create the ``OUTPUT`` then the rule will always run.
125-
If ``DEPENDS`` specifies any target (created by the
126-
:command:`add_custom_target`, :command:`add_executable`, or
127-
:command:`add_library` command) a target-level dependency is
128-
created to make sure the target is built before any target
129-
using this custom command. Additionally, if the target is an
130-
executable or library a file-level dependency is created to
131-
cause the custom command to re-run whenever the target is
132-
recompiled.
153+
create the ``OUTPUT``, the rule will always run.
133154

134155
Arguments to ``DEPENDS`` may use
135156
:manual:`generator expressions <cmake-generator-expressions(7)>`.

Help/command/add_custom_target.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ The options are:
4949
order-only dependencies to ensure the byproducts will be
5050
available before their dependents build.
5151

52+
The :ref:`Makefile Generators` will remove ``BYPRODUCTS`` and other
53+
:prop_sf:`GENERATED` files during ``make clean``.
54+
5255
``COMMAND``
5356
Specify the command-line(s) to execute at build time.
5457
If more than one ``COMMAND`` is specified they will be executed in order,

Help/command/ctest_test.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`.
2323
[STOP_TIME <time-of-day>]
2424
[RETURN_VALUE <result-var>]
2525
[CAPTURE_CMAKE_ERROR <result-var>]
26+
[REPEAT <mode>:<n>]
2627
[QUIET]
2728
)
2829

@@ -95,6 +96,25 @@ The options are:
9596
and then the ``--test-load`` command-line argument to :manual:`ctest(1)`.
9697
See also the ``TestLoad`` setting in the :ref:`CTest Test Step`.
9798

99+
``REPEAT <mode>:<n>``
100+
Run tests repeatedly based on the given ``<mode>`` up to ``<n>`` times.
101+
The modes are:
102+
103+
``UNTIL_FAIL``
104+
Require each test to run ``<n>`` times without failing in order to pass.
105+
This is useful in finding sporadic failures in test cases.
106+
107+
``UNTIL_PASS``
108+
Allow each test to run up to ``<n>`` times in order to pass.
109+
Repeats tests if they fail for any reason.
110+
This is useful in tolerating sporadic failures in test cases.
111+
112+
``AFTER_TIMEOUT``
113+
Allow each test to run up to ``<n>`` times in order to pass.
114+
Repeats tests only if they timeout.
115+
This is useful in tolerating sporadic timeouts in test cases
116+
on busy machines.
117+
98118
``SCHEDULE_RANDOM <ON|OFF>``
99119
Launch tests in a random order. This may be useful for detecting
100120
implicit test dependencies.

Help/command/file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ are only traversed if ``FOLLOW_SYMLINKS`` is given or policy
540540
By default ``GLOB_RECURSE`` omits directories from result list - setting
541541
``LIST_DIRECTORIES`` to true adds directories to result list.
542542
If ``FOLLOW_SYMLINKS`` is given or policy :policy:`CMP0009` is not set to
543-
``OLD`` then ``LIST_DIRECTORIES`` treats symlinks as directories.
543+
``NEW`` then ``LIST_DIRECTORIES`` treats symlinks as directories.
544544

545545
Examples of recursive globbing include::
546546

0 commit comments

Comments
 (0)