summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/pull_request_template.md2
-rw-r--r--.gitlab-ci.yml36
-rw-r--r--.gitlab/ci/configure_common.cmake4
-rw-r--r--.gitlab/ci/configure_external_test.cmake3
-rw-r--r--.gitlab/ci/configure_windows_vs2019_x64.cmake3
-rw-r--r--.gitlab/ci/ctest_exclusions.cmake9
-rw-r--r--.gitlab/ci/ctest_test_external.cmake66
-rw-r--r--.gitlab/ci/gitlab_ci.cmake9
-rw-r--r--CMakeLists.txt2
-rw-r--r--Help/command/cmake_language.rst9
-rw-r--r--Help/cpack_gen/deb.rst6
-rw-r--r--Help/cpack_gen/rpm.rst4
-rw-r--r--Help/dev/review.rst8
-rw-r--r--Help/dev/testing.rst2
-rw-r--r--Help/release/3.10.rst2
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake2
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake2
-rw-r--r--Modules/Compiler/IAR.cmake2
-rw-r--r--Modules/ExternalProject.cmake2
-rw-r--r--Modules/FindHDF5.cmake4
-rw-r--r--Modules/readme.txt2
-rw-r--r--README.rst4
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx5
-rw-r--r--Source/cmCMakeLanguageCommand.cxx26
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx4
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx2
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx8
-rw-r--r--Source/cmLocalGenerator.cxx8
-rw-r--r--Source/cmState.h1
-rw-r--r--Tests/CPackComponents/Issue 7470.html4
-rw-r--r--Tests/CTestLimitDashJ/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/Graphviz/GraphvizTestProject.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/CallInvalidCommand.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/CheckIncludeGuard.cmake4
-rw-r--r--Tests/RunCMake/cmake_language/CheckProject/CMakeLists.txt19
-rw-r--r--Tests/RunCMake/cmake_language/CheckProject/lib.c0
-rw-r--r--Tests/RunCMake/cmake_language/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/call_invalid_command.cmake14
-rw-r--r--Tests/RunCMake/cmake_language/call_valid_command.cmake99
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake38
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatNotRun-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt5
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatNotRun.cmake10
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/message/message-indent-multiline.cmake2
-rwxr-xr-xbootstrap2
52 files changed, 403 insertions, 56 deletions
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index d934bf9..5281c92 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -2,6 +2,6 @@ Thanks for your interest in contributing to CMake! The GitHub repository
is a mirror provided for convenience, but CMake does not use GitHub pull
requests for contribution. Please see
- https://gitlab.kitware.com/cmake/cmake/tree/master/CONTRIBUTING.rst
+ https://gitlab.kitware.com/cmake/cmake/-/tree/master/CONTRIBUTING.rst
for contribution instructions. GitHub OAuth may be used to sign in.
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bd8a0d3..a8b31da 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,7 @@
.manual_rules_settings: &manual_rules_settings
- if: '$CI_PROJECT_PATH == "cmake/cmake"'
- when: always
+ when: delayed
+ start_in: 5 minutes
- if: '$CI_MERGE_REQUEST_ID'
when: manual
- when: never
@@ -113,9 +114,17 @@
variables:
CMAKE_CONFIGURATION: windows_vs2019_x64_ninja
- VCVARSALL: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat"
+ VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
VCVARSPLATFORM: x64
+.windows_vs2019_x64: &windows_vs2019_x64
+ extends: .windows
+
+ variables:
+ CMAKE_CONFIGURATION: windows_vs2019_x64
+ CMAKE_GENERATOR: "Visual Studio 16 2019"
+ CMAKE_GENERATOR_PLATFORM: "x64"
+
.linux_builder_tags: &linux_builder_tags
tags:
- build
@@ -176,7 +185,7 @@
script:
- *before_script_windows
- - Invoke-Expression -Command .gitlab/ci/sccache.ps1
+ - Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$env:SCCACHE_PATH"
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- sccache --start-server
- sccache --show-stats
@@ -277,9 +286,18 @@
interruptible: true
+.cmake_test_windows_external: &cmake_test_windows_external
+ stage: test-ext
+
+ script:
+ - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_test_external.cmake
+
+ interruptible: true
+
stages:
- build
- test
+ - test-ext
build:debian10-iwyu:
<<:
@@ -391,8 +409,20 @@ test:windows-vs2019-x64-ninja:
- *windows_vs2019_x64_ninja
- *cmake_test_windows
- *windows_builder_tags
+ - *cmake_test_artifacts
rules: *rules_settings
dependencies:
- build:windows-vs2019-x64-ninja
needs:
- build:windows-vs2019-x64-ninja
+
+test:windows-vs2019-x64:
+ <<:
+ - *windows_vs2019_x64
+ - *cmake_test_windows_external
+ - *windows_builder_tags
+ rules: *rules_settings
+ dependencies:
+ - test:windows-vs2019-x64-ninja
+ needs:
+ - test:windows-vs2019-x64-ninja
diff --git a/.gitlab/ci/configure_common.cmake b/.gitlab/ci/configure_common.cmake
index 4585224..df49b2d 100644
--- a/.gitlab/ci/configure_common.cmake
+++ b/.gitlab/ci/configure_common.cmake
@@ -1,7 +1,7 @@
-set(CTEST_USE_LAUNCHERS "ON" CACHE STRING "")
+set(CTEST_USE_LAUNCHERS "ON" CACHE BOOL "")
# We run the install right after the build. Avoid rerunning it when installing.
-set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "ON" CACHE STRING "")
+set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "ON" CACHE BOOL "")
# Install CMake under the build tree.
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "")
set(CMake_TEST_INSTALL "OFF" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_external_test.cmake b/.gitlab/ci/configure_external_test.cmake
new file mode 100644
index 0000000..71397d1
--- /dev/null
+++ b/.gitlab/ci/configure_external_test.cmake
@@ -0,0 +1,3 @@
+set(CMake_TEST_HOST_CMAKE "ON" CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_windows_vs2019_x64.cmake b/.gitlab/ci/configure_windows_vs2019_x64.cmake
new file mode 100644
index 0000000..f6ece57
--- /dev/null
+++ b/.gitlab/ci/configure_windows_vs2019_x64.cmake
@@ -0,0 +1,3 @@
+set(CMake_TEST_WIX_NO_VERIFY "ON" CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake
index d8980f6..eb9b724 100644
--- a/.gitlab/ci/ctest_exclusions.cmake
+++ b/.gitlab/ci/ctest_exclusions.cmake
@@ -1,6 +1,15 @@
set(test_exclusions
)
+if (CTEST_CMAKE_GENERATOR MATCHES "Visual Studio")
+ list(APPEND test_exclusions
+ # This test takes around 5 minutes with Visual Studio.
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/20733
+ "^ExternalProjectUpdate$"
+ # This test is a dependency of the above and is only required for it.
+ "^ExternalProjectUpdateSetup$")
+endif ()
+
string(REPLACE ";" "|" test_exclusions "${test_exclusions}")
if (test_exclusions)
set(test_exclusions "(${test_exclusions})")
diff --git a/.gitlab/ci/ctest_test_external.cmake b/.gitlab/ci/ctest_test_external.cmake
new file mode 100644
index 0000000..1e61d52
--- /dev/null
+++ b/.gitlab/ci/ctest_test_external.cmake
@@ -0,0 +1,66 @@
+cmake_minimum_required(VERSION 3.8)
+
+include("${CMAKE_CURRENT_LIST_DIR}/gitlab_ci.cmake")
+
+set(cmake_args
+ -C "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
+
+# Create an entry in CDash.
+ctest_start(Experimental TRACK "${ctest_track}")
+
+# Gather update information.
+find_package(Git)
+set(CTEST_UPDATE_VERSION_ONLY ON)
+set(CTEST_UPDATE_COMMAND "${GIT_EXECUTABLE}")
+ctest_update()
+
+# Configure the project.
+ctest_configure(
+ OPTIONS "${cmake_args}"
+ RETURN_VALUE configure_result)
+
+# Read the files from the build directory.
+ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
+
+# We can now submit because we've configured. This is a cmb-superbuild-ism.
+ctest_submit(PARTS Update)
+ctest_submit(PARTS Configure)
+
+if (configure_result)
+ message(FATAL_ERROR
+ "Failed to configure")
+endif ()
+
+include(ProcessorCount)
+ProcessorCount(nproc)
+
+if (CTEST_CMAKE_GENERATOR STREQUAL "Unix Makefiles")
+ set(CTEST_BUILD_FLAGS "-j${nproc}")
+endif ()
+
+ctest_build(
+ NUMBER_WARNINGS num_warnings
+ RETURN_VALUE build_result)
+ctest_submit(PARTS Build)
+
+if (build_result)
+ message(FATAL_ERROR
+ "Failed to build")
+endif ()
+
+if ("$ENV{CTEST_NO_WARNINGS_ALLOWED}" AND num_warnings GREATER 0)
+ message(FATAL_ERROR
+ "Found ${num_warnings} warnings (treating as fatal).")
+endif ()
+
+include("${CMAKE_CURRENT_LIST_DIR}/ctest_exclusions.cmake")
+ctest_test(
+ PARALLEL_LEVEL "${nproc}"
+ RETURN_VALUE test_result
+ EXCLUDE "${test_exclusions}")
+ctest_submit(PARTS Test)
+
+if (test_result)
+ message(FATAL_ERROR
+ "Failed to test")
+endif ()
diff --git a/.gitlab/ci/gitlab_ci.cmake b/.gitlab/ci/gitlab_ci.cmake
index b49f51d..e9c9f80 100644
--- a/.gitlab/ci/gitlab_ci.cmake
+++ b/.gitlab/ci/gitlab_ci.cmake
@@ -27,6 +27,7 @@ endif ()
if (NOT CTEST_BUILD_CONFIGURATION)
set(CTEST_BUILD_CONFIGURATION "Release")
endif ()
+set(CTEST_CONFIGURATION_TYPE "${CTEST_BUILD_CONFIGURATION}")
# Default to using Ninja.
if (NOT "$ENV{CMAKE_GENERATOR}" STREQUAL "")
@@ -36,6 +37,14 @@ if (NOT CTEST_CMAKE_GENERATOR)
set(CTEST_CMAKE_GENERATOR "Ninja")
endif ()
+# Set the toolset and platform if requested.
+if (NOT "$ENV{CMAKE_GENERATOR_PLATFORM}" STREQUAL "")
+ set(CTEST_CMAKE_GENERATOR_PLATFORM "$ENV{CMAKE_GENERATOR_PLATFORM}")
+endif ()
+if (NOT "$ENV{CMAKE_GENERATOR_TOOLSET}" STREQUAL "")
+ set(CTEST_CMAKE_GENERATOR_TOOLSET "$ENV{CMAKE_GENERATOR_TOOLSET}")
+endif ()
+
# Determine the track to submit to.
set(ctest_track "Experimental")
if (NOT "$ENV{CI_MERGE_REQUEST_ID}" STREQUAL "")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6aaf60..35531c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,7 +37,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
message(FATAL_ERROR
"CMake no longer compiles on HP-UX. See\n"
- " https://gitlab.kitware.com/cmake/cmake/issues/17137\n"
+ " https://gitlab.kitware.com/cmake/cmake/-/issues/17137\n"
"Use CMake 3.9 or lower instead."
)
endif()
diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst
index 21f51a0..0988097 100644
--- a/Help/command/cmake_language.rst
+++ b/Help/command/cmake_language.rst
@@ -42,6 +42,15 @@ is equivalent to
message(STATUS "Hello World!")
+.. note::
+ To ensure consistency of the code, the following commands are not allowed:
+
+ * ``if`` / ``elseif`` / ``else`` / ``endif``
+ * ``while`` / ``endwhile``
+ * ``foreach`` / ``endforeach``
+ * ``function`` / ``endfunction``
+ * ``macro`` / ``endmacro``
+
Evaluating Code
^^^^^^^^^^^^^^^
diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst
index db71c87..bf50c55 100644
--- a/Help/cpack_gen/deb.rst
+++ b/Help/cpack_gen/deb.rst
@@ -25,8 +25,8 @@ or a component GROUP name.
Here are some CPack DEB generator wiki resources that are here for historic
reasons and are no longer maintained but may still prove useful:
- - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/Configuration
- - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/PackageGenerators#deb-unix-only
+ - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configuration
+ - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#deb-unix-only
List of CPack DEB generator specific variables:
@@ -282,7 +282,7 @@ List of CPack DEB generator specific variables:
You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value
if you use this feature, because if you don't ``dpkg-shlibdeps``
may fail to find your own shared libs.
- See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
+ See https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
.. variable:: CPACK_DEBIAN_PACKAGE_DEBUG
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index 66d5464..ccb7ebd 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -36,8 +36,8 @@ http://www.rpm.org/wiki/Docs
Here are some CPack RPM generator wiki resources that are here for historic
reasons and are no longer maintained but may still prove useful:
- - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/Configuration
- - https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/PackageGenerators#rpm-unix-only
+ - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configuration
+ - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#rpm-unix-only
List of CPack RPM generator specific variables:
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index 8ec41d2..ad0bb22 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -28,7 +28,7 @@ request is accepted" option when creating the MR or by editing it.
This will cause the MR topic branch to be automatically removed from
the user's fork during the `Merge`_ step.
-.. _`CMake Merge Requests Page`: https://gitlab.kitware.com/cmake/cmake/merge_requests
+.. _`CMake Merge Requests Page`: https://gitlab.kitware.com/cmake/cmake/-/merge_requests
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
Workflow Status
@@ -60,7 +60,7 @@ in GitLab to track the state of a MR:
The workflow status labels are intended to be mutually exclusive,
so please remove any existing workflow label when adding one.
-.. _`CMake GitLab Project Developers`: https://gitlab.kitware.com/cmake/cmake/settings/members
+.. _`CMake GitLab Project Developers`: https://gitlab.kitware.com/cmake/cmake/-/settings/members
Robot Review
============
@@ -454,8 +454,8 @@ comment instead):
The ``-t`` option to a ``Do: merge`` command overrides any topic
rename set in the MR description.
-.. _`CMake GitLab Project Masters`: https://gitlab.kitware.com/cmake/cmake/settings/members
-.. _`backport instructions`: https://gitlab.kitware.com/utils/git-workflow/wikis/Backport-topics
+.. _`CMake GitLab Project Masters`: https://gitlab.kitware.com/cmake/cmake/-/settings/members
+.. _`backport instructions`: https://gitlab.kitware.com/utils/git-workflow/-/wikis/Backport-topics
.. _`git rev-parse`: https://git-scm.com/docs/git-rev-parse
Close
diff --git a/Help/dev/testing.rst b/Help/dev/testing.rst
index 23d0ca3..279e4b2 100644
--- a/Help/dev/testing.rst
+++ b/Help/dev/testing.rst
@@ -33,7 +33,7 @@ CTest script with local settings and include ``cmake_common.cmake``.
.. _`CMake Review Process`: review.rst
.. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake
.. _`CMake Dashboard Scripts Repository`: https://gitlab.kitware.com/cmake/dashboard-scripts
-.. _`cmake_common.cmake`: https://gitlab.kitware.com/cmake/dashboard-scripts/blob/master/cmake_common.cmake
+.. _`cmake_common.cmake`: https://gitlab.kitware.com/cmake/dashboard-scripts/-/blob/master/cmake_common.cmake
Nightly Start Time
------------------
diff --git a/Help/release/3.10.rst b/Help/release/3.10.rst
index 03eda36..117415b 100644
--- a/Help/release/3.10.rst
+++ b/Help/release/3.10.rst
@@ -236,7 +236,7 @@ Deprecated and Removed Features
support for C++11 and a port of libuv. See `CMake Issue 17137`_.
Use CMake 3.9 or lower instead for HP-UX support.
-.. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/issues/17137
+.. _`CMake Issue 17137`: https://gitlab.kitware.com/cmake/cmake/-/issues/17137
Other Changes
=============
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index f870956..86683d1 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -99,7 +99,7 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
# The IAR compiler produces weird output.
- # See https://gitlab.kitware.com/cmake/cmake/issues/10176#note_153591
+ # See https://gitlab.kitware.com/cmake/cmake/-/issues/10176#note_153591
list(APPEND CMAKE_C_COMPILER_ID_VENDORS IAR)
set(CMAKE_C_COMPILER_ID_VENDOR_FLAGS_IAR )
set(CMAKE_C_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler")
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index e6b46b8..662b831 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -94,7 +94,7 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
# The IAR compiler produces weird output.
- # See https://gitlab.kitware.com/cmake/cmake/issues/10176#note_153591
+ # See https://gitlab.kitware.com/cmake/cmake/-/issues/10176#note_153591
list(APPEND CMAKE_CXX_COMPILER_ID_VENDORS IAR)
set(CMAKE_CXX_COMPILER_ID_VENDOR_FLAGS_IAR )
set(CMAKE_CXX_COMPILER_ID_VENDOR_REGEX_IAR "IAR .+ Compiler")
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index 199005d..e563a12 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -25,7 +25,7 @@ function(_FIND_ECLIPSE_VERSION)
if(NOT DEFINED CMAKE_ECLIPSE_VERSION)
if(CMAKE_ECLIPSE_EXECUTABLE)
- # use REALPATH to resolve symlinks (https://gitlab.kitware.com/cmake/cmake/issues/13036)
+ # use REALPATH to resolve symlinks (https://gitlab.kitware.com/cmake/cmake/-/issues/13036)
get_filename_component(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
get_filename_component(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index 8e75caa..296e2fd 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -1,6 +1,6 @@
# This file is processed when the IAR compiler is used for a C or C++ file
# Documentation can be downloaded here: http://www.iar.com/website1/1.0.1.0/675/1/
-# The initial feature request is here: https://gitlab.kitware.com/cmake/cmake/issues/10176
+# The initial feature request is here: https://gitlab.kitware.com/cmake/cmake/-/issues/10176
# It also contains additional links and information.
# See USER GUIDES -> C/C++ Development Guide and ReleaseNotes for EWARM:
# version 6.30.8: http://supp.iar.com/FilesPublic/UPDINFO/006607/arm/doc/infocenter/index.ENU.html
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index e366b80..3a47090 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -2942,7 +2942,7 @@ function(_ep_add_configure_command name)
# If anything about the configure command changes, (command itself, cmake
# used, cmake args or cmake generator) then re-run the configure step.
- # Fixes issue https://gitlab.kitware.com/cmake/cmake/issues/10258
+ # Fixes issue https://gitlab.kitware.com/cmake/cmake/-/issues/10258
#
if(NOT EXISTS ${tmp_dir}/${name}-cfgcmd.txt.in)
file(WRITE ${tmp_dir}/${name}-cfgcmd.txt.in "cmd='\@cmd\@'\n")
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 8d71d27..60a313d 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -823,7 +823,7 @@ if( NOT HDF5_FOUND )
if(HDF5_USE_STATIC_LIBRARIES)
# According to bug 1643 on the CMake bug tracker, this is the
# preferred method for searching for a static library.
- # See https://gitlab.kitware.com/cmake/cmake/issues/1643. We search
+ # See https://gitlab.kitware.com/cmake/cmake/-/issues/1643. We search
# first for the full static library name, but fall back to a
# generic search on the name if the static search fails.
set( THIS_LIBRARY_SEARCH_DEBUG
@@ -864,7 +864,7 @@ if( NOT HDF5_FOUND )
if(HDF5_USE_STATIC_LIBRARIES)
# According to bug 1643 on the CMake bug tracker, this is the
# preferred method for searching for a static library.
- # See https://gitlab.kitware.com/cmake/cmake/issues/1643. We search
+ # See https://gitlab.kitware.com/cmake/cmake/-/issues/1643. We search
# first for the full static library name, but fall back to a
# generic search on the name if the static search fails.
set( THIS_LIBRARY_SEARCH_DEBUG
diff --git a/Modules/readme.txt b/Modules/readme.txt
index a629478..da78730 100644
--- a/Modules/readme.txt
+++ b/Modules/readme.txt
@@ -1,4 +1,4 @@
See the "Find Modules" section of the cmake-developer(7) manual page.
For more information about how to contribute modules to CMake, see this page:
-https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/dev/Module-Maintainers
+https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/dev/Module-Maintainers
diff --git a/README.rst b/README.rst
index 5020d39..64e2353 100644
--- a/README.rst
+++ b/README.rst
@@ -11,7 +11,7 @@ references useful guides and recipes.
.. _`CMake Home Page`: https://cmake.org
.. _`CMake Documentation Page`: https://cmake.org/documentation
-.. _`CMake Community Wiki`: https://gitlab.kitware.com/cmake/community/wikis/home
+.. _`CMake Community Wiki`: https://gitlab.kitware.com/cmake/community/-/wikis/home
CMake is maintained and supported by `Kitware`_ and developed in
collaboration with a productive community of contributors.
@@ -122,7 +122,7 @@ If you have found a bug:
3. Finally, if the issue is not resolved by the above steps, open
an entry in the `CMake Issue Tracker`_.
-.. _`CMake Issue Tracker`: https://gitlab.kitware.com/cmake/cmake/issues
+.. _`CMake Issue Tracker`: https://gitlab.kitware.com/cmake/cmake/-/issues
Contributing
============
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 26e38d8..60846d4 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 17)
-set(CMake_VERSION_PATCH 20200526)
+set(CMake_VERSION_PATCH 20200527)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index ba7d47e..2c8e385 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -344,6 +344,11 @@ bool cmCTestRunTest::NeedsToRepeat()
if (this->NumberOfRunsLeft == 0) {
return false;
}
+ // If a test is marked as NOT_RUN it will not be repeated
+ // no matter the repeat settings, so just record it as-is.
+ if (this->TestResult.Status == cmCTestTestHandler::NOT_RUN) {
+ return false;
+ }
// if number of runs left is not 0, and we are running until
// we find a failed (or passed) test, then return true so the test can be
// restarted
diff --git a/Source/cmCMakeLanguageCommand.cxx b/Source/cmCMakeLanguageCommand.cxx
index 66857be..eb9269f 100644
--- a/Source/cmCMakeLanguageCommand.cxx
+++ b/Source/cmCMakeLanguageCommand.cxx
@@ -3,15 +3,32 @@
#include "cmCMakeLanguageCommand.h"
#include <algorithm>
+#include <array>
#include <cstddef>
#include <memory>
#include <string>
+#include <cm/string_view>
+#include <cmext/string_view>
+
#include "cmExecutionStatus.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
+
+namespace {
+std::array<cm::static_string_view, 12> InvalidCommands{
+ { // clang-format off
+ "function"_s, "endfunction"_s,
+ "macro"_s, "endmacro"_s,
+ "if"_s, "elseif"_s, "else"_s, "endif"_s,
+ "while"_s, "endwhile"_s,
+ "foreach"_s, "endforeach"_s
+ } // clang-format on
+};
+}
bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args,
cmExecutionStatus& status)
@@ -64,6 +81,15 @@ bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args,
startArg = 1;
}
+ // ensure specified command is valid
+ // start/end flow control commands are not allowed
+ auto cmd = cmSystemTools::LowerCase(callCommand);
+ if (std::find(InvalidCommands.cbegin(), InvalidCommands.cend(), cmd) !=
+ InvalidCommands.cend()) {
+ status.SetError(cmStrCat("invalid command specified: "_s, callCommand));
+ return false;
+ }
+
cmListFileFunction func;
func.Name = callCommand;
func.Line = context.Line;
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 42fd0ea..32b0ca9 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -723,7 +723,7 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
if (generator == "NMake Makefiles" || generator == "NMake Makefiles JOM") {
// For Windows ConvertToOutputPath already adds quotes when required.
// These need to be escaped, see
- // https://gitlab.kitware.com/cmake/cmake/issues/13952
+ // https://gitlab.kitware.com/cmake/cmake/-/issues/13952
std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
command += " /NOLOGO /f ";
command += makefileName;
@@ -731,7 +731,7 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
command += target;
} else if (generator == "MinGW Makefiles") {
// no escaping of spaces in this case, see
- // https://gitlab.kitware.com/cmake/cmake/issues/10014
+ // https://gitlab.kitware.com/cmake/cmake/-/issues/10014
std::string const& makefileName = makefile;
command += " -f \"";
command += makefileName;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 80d61c3..582a9f0 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -429,7 +429,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
if (this->IsOutOfSourceBuild) {
// create a linked resource to CMAKE_SOURCE_DIR
// (this is not done anymore for each project because of
- // https://gitlab.kitware.com/cmake/cmake/issues/9978 and because I found
+ // https://gitlab.kitware.com/cmake/cmake/-/issues/9978 and because I found
// it actually quite confusing in bigger projects with many directories and
// projects, Alex
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 6dbc7b7..253834f 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -329,7 +329,7 @@ std::string cmExtraSublimeTextGenerator::BuildMakeCommand(
std::string makefileName;
if (generator == "MinGW Makefiles") {
// no escaping of spaces in this case, see
- // https://gitlab.kitware.com/cmake/cmake/issues/10014
+ // https://gitlab.kitware.com/cmake/cmake/-/issues/10014
makefileName = makefile;
} else {
makefileName = cmSystemTools::ConvertToOutputPath(makefile);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 0b7ba04..6f73b0c 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1426,13 +1426,13 @@ bool cmGlobalGenerator::Compute()
// so create the map from project name to vector of local generators
this->FillProjectMap();
- // Iterate through all targets and set up AUTOMOC, AUTOUIC and AUTORCC
- if (!this->QtAutoGen()) {
+ // Add automatically generated sources (e.g. unity build).
+ if (!this->AddAutomaticSources()) {
return false;
}
- // Add automatically generated sources (e.g. unity build).
- if (!this->AddAutomaticSources()) {
+ // Iterate through all targets and set up AUTOMOC, AUTOUIC and AUTORCC
+ if (!this->QtAutoGen()) {
return false;
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ad1cbd8..e42eb58 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2750,9 +2750,14 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
// Add pchHeader to source files, which will
// be grouped as "Precompile Header File"
auto pchHeader_sf = this->Makefile->GetOrCreateSource(
- pchHeader, false, cmSourceFileLocationKind::Known);
+ pchHeader, true, cmSourceFileLocationKind::Known);
std::string err;
pchHeader_sf->ResolveFullPath(&err);
+
+ // The pch file is generated, but mark it as not generated
+ // so that a clean operation will not remove it from disk
+ pchHeader_sf->SetProperty("GENERATED", "0");
+
target->AddSource(pchHeader);
}
}
@@ -2767,6 +2772,7 @@ inline void RegisterUnitySources(cmGeneratorTarget* target, cmSourceFile* sf,
{
target->AddSourceFileToUnityBatch(sf->ResolveFullPath());
sf->SetProperty("UNITY_SOURCE_FILE", filename.c_str());
+ sf->SetProperty("SKIP_AUTOGEN", "ON");
}
inline void IncludeFileInUnitySources(cmGeneratedFileStream& unity_file,
diff --git a/Source/cmState.h b/Source/cmState.h
index f2bd32a..125e4dd 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -94,7 +94,6 @@ public:
cmProp GetInitializedCacheValue(std::string const& key) const;
cmStateEnums::CacheEntryType GetCacheEntryType(std::string const& key) const;
void SetCacheEntryValue(std::string const& key, std::string const& value);
- void SetCacheValue(std::string const& key, std::string const& value);
void RemoveCacheEntry(std::string const& key);
diff --git a/Tests/CPackComponents/Issue 7470.html b/Tests/CPackComponents/Issue 7470.html
index c2a1688..59fbee7 100644
--- a/Tests/CPackComponents/Issue 7470.html
+++ b/Tests/CPackComponents/Issue 7470.html
@@ -3,7 +3,7 @@
The install rule for this file demonstrates the problem described in<br/>
CMake issue #7470:<br/>
<br/>
-<a href="https://gitlab.kitware.com/cmake/cmake/issues/7470">
-https://gitlab.kitware.com/cmake/cmake/issues/7470</a><br/>
+<a href="https://gitlab.kitware.com/cmake/cmake/-/issues/7470">
+https://gitlab.kitware.com/cmake/cmake/-/issues/7470</a><br/>
</body>
</html>
diff --git a/Tests/CTestLimitDashJ/CMakeLists.txt b/Tests/CTestLimitDashJ/CMakeLists.txt
index 92d743f..5208d2d 100644
--- a/Tests/CTestLimitDashJ/CMakeLists.txt
+++ b/Tests/CTestLimitDashJ/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8)
project(CTestLimitDashJ NONE)
-# This file demonstrates https://gitlab.kitware.com/cmake/cmake/issues/12904
+# This file demonstrates https://gitlab.kitware.com/cmake/cmake/-/issues/12904
# when configured with CMake 2.8.10.2 and earlier, and when running
# "ctest -j 4" in the resulting build tree. This example is hard-coded
# to assume -j 4 just to reproduce the issue easily. Adjust the
diff --git a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
index e1951f1..a7fb2d7 100644
--- a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
@@ -104,7 +104,7 @@ require_change_not(B)
require_change(C)
require_change(D)
# There's a bug in Ninja on Windows:
-# https://gitlab.kitware.com/cmake/cmake/issues/16776
+# https://gitlab.kitware.com/cmake/cmake/-/issues/16776
if(NOT ("${CMAKE_GENERATOR}" MATCHES "Ninja"))
require_change(E)
endif()
@@ -128,7 +128,7 @@ require_change_not(B)
require_change(C)
require_change(D)
# There's a bug in Ninja on Windows
-# https://gitlab.kitware.com/cmake/cmake/issues/16776
+# https://gitlab.kitware.com/cmake/cmake/-/issues/16776
if(NOT ("${CMAKE_GENERATOR}" MATCHES "Ninja"))
require_change(E)
endif()
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 983f7e4..868eb24 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -416,7 +416,7 @@ endif()
if(TARGET ctresalloc)
add_RunCMake_test(CTestResourceAllocation -DCTRESALLOC_COMMAND=$<TARGET_FILE:ctresalloc>)
else()
- message(WARNING "Could not find or build ctresalloc")
+ message(STATUS "Could not find ctresalloc")
endif()
find_package(Qt4 QUIET)
diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
index 772f312..10cd2bc 100644
--- a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
+++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
@@ -32,7 +32,7 @@ target_link_libraries(GraphicLibrary PRIVATE CoreLibrary)
# Test target labels with quotes in them; they should be escaped in the dot
# file.
-# See https://gitlab.kitware.com/cmake/cmake/issues/19746
+# See https://gitlab.kitware.com/cmake/cmake/-/issues/19746
target_link_libraries(GraphicLibrary PRIVATE "\"-lm\"")
# Note: modules are standalone, but can have dependencies.
diff --git a/Tests/RunCMake/cmake_language/CallInvalidCommand.cmake b/Tests/RunCMake/cmake_language/CallInvalidCommand.cmake
new file mode 100644
index 0000000..8bee6f2
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CallInvalidCommand.cmake
@@ -0,0 +1,2 @@
+
+cmake_language(CALL ${COMMAND})
diff --git a/Tests/RunCMake/cmake_language/CheckIncludeGuard.cmake b/Tests/RunCMake/cmake_language/CheckIncludeGuard.cmake
new file mode 100644
index 0000000..902c1e4
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CheckIncludeGuard.cmake
@@ -0,0 +1,4 @@
+
+cmake_language (CALL "include_guard")
+
+set (GUARD_VALUE 1)
diff --git a/Tests/RunCMake/cmake_language/CheckProject/CMakeLists.txt b/Tests/RunCMake/cmake_language/CheckProject/CMakeLists.txt
new file mode 100644
index 0000000..9a27692
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CheckProject/CMakeLists.txt
@@ -0,0 +1,19 @@
+
+cmake_language (CALL cmake_minimum_required VERSION 3.17...3.18)
+
+cmake_language (CALL project CheckProject VERSION 1.2.3 LANGUAGES C)
+
+if (NOT PROJECT_NAME STREQUAL "CheckProject")
+ message (SEND_ERROR "error on project() usage.")
+endif()
+
+if (NOT CheckProject_VERSION VERSION_EQUAL "1.2.3")
+ message (SEND_ERROR "error on project() usage.")
+endif()
+
+get_property (languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+if (NOT "C" IN_LIST languages)
+ message (SEND_ERROR "error on project() usage.")
+endif()
+
+add_library (lib SHARED lib.c)
diff --git a/Tests/RunCMake/cmake_language/CheckProject/lib.c b/Tests/RunCMake/cmake_language/CheckProject/lib.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CheckProject/lib.c
diff --git a/Tests/RunCMake/cmake_language/RunCMakeTest.cmake b/Tests/RunCMake/cmake_language/RunCMakeTest.cmake
index c556e42..5fb93c8 100644
--- a/Tests/RunCMake/cmake_language/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_language/RunCMakeTest.cmake
@@ -2,6 +2,8 @@ include(RunCMake)
run_cmake(no_parameters)
run_cmake(unknown_meta_operation)
+run_cmake(call_invalid_command)
+run_cmake(call_valid_command)
run_cmake(call_double_evaluation)
run_cmake(call_expanded_command)
run_cmake(call_expanded_command_and_arguments)
diff --git a/Tests/RunCMake/cmake_language/call_invalid_command.cmake b/Tests/RunCMake/cmake_language/call_invalid_command.cmake
new file mode 100644
index 0000000..88bf08c
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_invalid_command.cmake
@@ -0,0 +1,14 @@
+
+foreach (command IN ITEMS "function" "ENDFUNCTION"
+ "macro" "endMACRO"
+ "if" "elseif" "else" "endif"
+ "while" "endwhile"
+ "foreach" "endforeach")
+ execute_process(COMMAND "${CMAKE_COMMAND}" -DCOMMAND=${command}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/CallInvalidCommand.cmake"
+ OUTPUT_QUIET ERROR_QUIET
+ RESULT_VARIABLE result)
+ if (NOT result)
+ message (SEND_ERROR "cmake_language(CALL ${command}) unexpectedly successfull.")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/cmake_language/call_valid_command.cmake b/Tests/RunCMake/cmake_language/call_valid_command.cmake
new file mode 100644
index 0000000..2e965dc
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_valid_command.cmake
@@ -0,0 +1,99 @@
+
+## check continue() usage
+set (VALUE 0)
+foreach (i RANGE 1 4)
+ set (VALUE "${i}")
+ cmake_language (CALL "continue")
+ set (VALUE "0")
+endforeach()
+if (NOT VALUE EQUAL "4")
+ message (SEND_ERROR "error on continue() usage.")
+endif()
+
+
+## check break() usage
+set (VALUE 0)
+foreach (i RANGE 1 4)
+ set (VALUE "${i}")
+ cmake_language (CALL "break")
+ set (VALUE 0)
+endforeach()
+if (NOT VALUE EQUAL "1")
+ message (SEND_ERROR "error on break() usage.")
+endif()
+
+
+## check return() usage in macro
+macro (call_return_in_macro)
+ cmake_language (CALL "return")
+ set (VALUE 1)
+endmacro()
+function (wrapper)
+ call_return_in_macro()
+ set (VALUE 1 PARENT_SCOPE)
+endfunction()
+
+set (VALUE 0)
+wrapper()
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in macro.")
+endif()
+
+set (VALUE 0)
+cmake_language (CALL "wrapper")
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in macro.")
+endif()
+
+function (wrapper2)
+ cmake_language (CALL "call_return_in_macro")
+ set (VALUE 1 PARENT_SCOPE)
+endfunction()
+
+set (VALUE 0)
+wrapper2()
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in macro.")
+endif()
+
+set (VALUE 0)
+cmake_language (CALL "wrapper2")
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in macro.")
+endif()
+
+## check return() usage in function
+function (call_return_in_function)
+ cmake_language (CALL "return")
+ set (VALUE 1 PARENT_SCOPE)
+endfunction()
+
+set (VALUE 0)
+call_return_in_function()
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in function.")
+endif()
+
+set (VALUE 0)
+cmake_language (CALL "call_return_in_function")
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in function.")
+endif()
+
+
+## check usage of include_guard()
+set (GUARD_VALUE 0)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckIncludeGuard.cmake")
+if (NOT GUARD_VALUE EQUAL "1")
+ message (SEND_ERROR "error on include_guard() on first include.")
+endif()
+
+set (GUARD_VALUE 0)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckIncludeGuard.cmake")
+if (NOT GUARD_VALUE EQUAL "0")
+ message (SEND_ERROR "error on include_guard() on second include.")
+endif()
+
+
+## check usage of cmake_minimum_required() and project()
+add_subdirectory (CheckProject)
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index 18ae793..b82335f 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -81,20 +81,46 @@ run_TestOutputSize()
run_ctest_test(TestRepeatBad1 REPEAT UNKNOWN:3)
run_ctest_test(TestRepeatBad2 REPEAT UNTIL_FAIL:-1)
-function(run_TestRepeat case)
- set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion ${ARGN})
- string(CONCAT CASE_CMAKELISTS_SUFFIX_CODE [[
+function(run_TestRepeat case return_value )
+ set(CASE_CTEST_TEST_ARGS RETURN_VALUE result EXCLUDE RunCMakeVersion ${ARGN})
+ string(CONCAT suffix_code [[
add_test(NAME testRepeat
COMMAND ${CMAKE_COMMAND} -D COUNT_FILE=${CMAKE_CURRENT_BINARY_DIR}/count.cmake
-P "]] "${RunCMake_SOURCE_DIR}/TestRepeat${case}" [[.cmake")
set_property(TEST testRepeat PROPERTY TIMEOUT 5)
]])
+ string(APPEND CASE_CMAKELISTS_SUFFIX_CODE "${suffix_code}")
run_ctest(TestRepeat${case})
+
+ #write to end of the test file logic to Verify we get the expected
+ #return code
+ string(REPLACE "RETURN_VALUE:" "" return_value "${return_value}" )
+ file(APPEND "${RunCMake_BINARY_DIR}/TestRepeat${case}/test.cmake"
+"
+
+ set(expected_result ${return_value})
+ message(STATUS \${result})
+ if(NOT result EQUAL expected_result)
+ message(FATAL_ERROR \"expected a return value of: \${expected_result},
+ instead got: \${result}\")
+ endif()
+"
+ )
endfunction()
-run_TestRepeat(UntilFail REPEAT UNTIL_FAIL:3)
-run_TestRepeat(UntilPass REPEAT UNTIL_PASS:3)
-run_TestRepeat(AfterTimeout REPEAT AFTER_TIMEOUT:3)
+
+run_TestRepeat(UntilFail RETURN_VALUE:1 REPEAT UNTIL_FAIL:3)
+run_TestRepeat(UntilPass RETURN_VALUE:0 REPEAT UNTIL_PASS:3)
+run_TestRepeat(AfterTimeout RETURN_VALUE:0 REPEAT AFTER_TIMEOUT:3)
+
+# test repeat and not run tests interact correctly
+set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_test(NAME testNotRun
+ COMMAND ${CMAKE_COMMAND}/doesnt_exist)
+ set_property(TEST testNotRun PROPERTY TIMEOUT 5)
+ ]])
+run_TestRepeat(NotRun RETURN_VALUE:1 REPEAT UNTIL_PASS:3)
+unset(CASE_CMAKELISTS_SUFFIX_CODE)
# test --stop-on-failure
function(run_stop_on_failure)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatNotRun-result.txt b/Tests/RunCMake/ctest_test/TestRepeatNotRun-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatNotRun-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt b/Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt
new file mode 100644
index 0000000..a69932d
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatNotRun-stderr.txt
@@ -0,0 +1 @@
+.*Unable to find executable.*
diff --git a/Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt
new file mode 100644
index 0000000..72c98bc
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatNotRun-stdout.txt
@@ -0,0 +1,5 @@
+.*
+50% tests passed, 1 tests failed out of 2
+.*
+The following tests FAILED:
+.*testNotRun.*Not Run.*
diff --git a/Tests/RunCMake/ctest_test/TestRepeatNotRun.cmake b/Tests/RunCMake/ctest_test/TestRepeatNotRun.cmake
new file mode 100644
index 0000000..abde4f0
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatNotRun.cmake
@@ -0,0 +1,10 @@
+include("${COUNT_FILE}" OPTIONAL)
+if(NOT COUNT)
+ set(COUNT 0)
+endif()
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n")
+if(NOT COUNT EQUAL 2)
+ message("this test times out except on the 2nd run")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
+endif()
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index a681c7e..c50e552 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -176,8 +176,7 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
if(DEFINED ENV{LDFLAGS})
# Some setups prebake disable-new-dtags into LDFLAGS
- set(new_ldflags $ENV{LDFLAGS}})
- string(REPLACE "-Wl,--disable-new-dtags" "" new_ldflags "${new_ldflags}")
+ string(REPLACE "-Wl,--disable-new-dtags" "" new_ldflags "$ENV{LDFLAGS}")
set(ENV{LDFLAGS} "${new_ldflags}")
endif()
diff --git a/Tests/RunCMake/message/message-indent-multiline.cmake b/Tests/RunCMake/message/message-indent-multiline.cmake
index 0f789bf..3815569 100644
--- a/Tests/RunCMake/message/message-indent-multiline.cmake
+++ b/Tests/RunCMake/message/message-indent-multiline.cmake
@@ -9,5 +9,5 @@ message]]) # No `\n` at the end!
message(STATUS "${msg}\n\n")
message(STATUS "${msg}")
# This is just to make sure NOTICE messages are also get indented:
-# https://gitlab.kitware.com/cmake/cmake/issues/19418#note_588011
+# https://gitlab.kitware.com/cmake/cmake/-/issues/19418#note_588011
message(NOTICE "${msg}")
diff --git a/bootstrap b/bootstrap
index 6b205cc..fe7b2ad 100755
--- a/bootstrap
+++ b/bootstrap
@@ -139,7 +139,7 @@ fi
if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then
die 'CMake no longer compiles on HP-UX. See
- https://gitlab.kitware.com/cmake/cmake/issues/17137
+ https://gitlab.kitware.com/cmake/cmake/-/issues/17137
Use CMake 3.9 or lower instead.'
cmake_system_hpux=true