summaryrefslogtreecommitdiffstats
path: root/tools/designer/src/lib/shared/invisible_widget.cpp
blob: f88022c3f79775683b8aed5d88b794d0488a42a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the either Technology Preview License Agreement or the
** Beta Release License Agreement.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain
** additional rights. These rights are described in the Nokia Qt LGPL
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
** package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/

#include "invisible_widget_p.h"

QT_BEGIN_NAMESPACE

namespace qdesigner_internal {

InvisibleWidget::InvisibleWidget(QWidget *parent)
    : QWidget()
{
    setAttribute(Qt::WA_NoChildEventsForParent);
    setParent(parent);
}

} // namespace qdesigner_internal

QT_END_NAMESPACE
modules_ninja.cmake?h=v3.27.3&id=25f6f98eb19d3d4c4bf70b5ea3d68a0554e9f304&id2=b47092fddb51e2e89fa083af5c15fb6b81f35186'>.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake4
-rw-r--r--.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake4
-rw-r--r--.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake2
-rw-r--r--.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake1
-rw-r--r--.gitlab/ci/configure_windows_vs2022_x64_ninja_multi.cmake1
-rw-r--r--.gitlab/ci/ctest_standalone.cmake6
-rw-r--r--.gitlab/ci/cxx_modules_rules_gcc.cmake10
-rw-r--r--.gitlab/ci/cxx_modules_rules_msvc.cmake1
-rwxr-xr-x.gitlab/ci/docker/debian10-aarch64/install_deps.sh15
-rwxr-xr-x.gitlab/ci/docker/debian10/install_deps.sh15
-rw-r--r--.gitlab/ci/docker/fedora36/Dockerfile18
-rwxr-xr-x.gitlab/ci/docker/fedora36/install_clang_tidy_headers.sh18
-rwxr-xr-x.gitlab/ci/docker/fedora36/install_deps.sh15
-rwxr-xr-x.gitlab/ci/docker/fedora36/install_iwyu.sh44
-rw-r--r--.gitlab/ci/docker/gcc_cxx_modules/Dockerfile9
-rwxr-xr-x.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh7
-rwxr-xr-x.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh26
-rwxr-xr-x.gitlab/ci/env.ps13
-rw-r--r--.gitlab/ci/env_debian10_aarch64_extdeps.sh1
-rw-r--r--.gitlab/ci/env_debian10_extdeps.sh1
-rw-r--r--.gitlab/ci/env_debian10_ninja.sh8
-rw-r--r--.gitlab/ci/env_extdeps_common.sh5
-rw-r--r--.gitlab/ci/env_fedora36_extdeps.sh1
-rw-r--r--.gitlab/ci/env_windows_clang_common.cmake7
-rw-r--r--.gitlab/ci/env_windows_clang_ninja.cmake1
-rwxr-xr-x.gitlab/ci/env_windows_clang_ninja.ps12
-rw-r--r--.gitlab/ci/env_windows_clang_nmake.cmake1
-rwxr-xr-x.gitlab/ci/env_windows_clang_nmake.ps11
-rwxr-xr-x.gitlab/ci/env_windows_vs2022_x64_ninja.ps12
-rwxr-xr-x.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps17
-rwxr-xr-x.gitlab/ci/extdeps-linux.sh62
-rwxr-xr-x.gitlab/ci/ispc-env.ps12
-rwxr-xr-x.gitlab/ci/ninja-env.ps14
-rw-r--r--.gitlab/os-linux.yml56
-rw-r--r--.gitlab/os-windows.yml90
-rw-r--r--Auxiliary/cmake-mode.el42
-rw-r--r--Auxiliary/vim/indent/cmake.vim4
-rw-r--r--Auxiliary/vim/syntax/cmake.vim10
-rw-r--r--CMakeLists.txt468
-rw-r--r--CTestCustom.cmake.in6
-rw-r--r--CompileFlags.cmake17
-rw-r--r--Copyright.txt1
-rw-r--r--Help/command/FIND_XXX.txt26
-rw-r--r--Help/command/add_custom_command.rst4
-rw-r--r--Help/command/add_custom_target.rst2
-rw-r--r--Help/command/add_subdirectory.rst9
-rw-r--r--Help/command/block.rst76
-rw-r--r--Help/command/build_command.rst8
-rw-r--r--Help/command/cmake_language.rst28
-rw-r--r--Help/command/cmake_policy.rst41
-rw-r--r--Help/command/continue.rst6
-rw-r--r--Help/command/ctest_build.rst6
-rw-r--r--Help/command/ctest_run_script.rst6
-rw-r--r--Help/command/ctest_start.rst2
-rw-r--r--Help/command/ctest_test.rst10
-rw-r--r--Help/command/enable_language.rst9
-rw-r--r--Help/command/endblock.rst11
-rw-r--r--Help/command/export.rst16
-rw-r--r--Help/command/file.rst7
-rw-r--r--Help/command/find_package.rst53
-rw-r--r--Help/command/foreach.rst8
-rw-r--r--Help/command/function.rst6
-rw-r--r--Help/command/get_test_property.rst3
-rw-r--r--Help/command/if.rst7
-rw-r--r--Help/command/install.rst49
-rw-r--r--Help/command/message.rst7
-rw-r--r--Help/command/return.rst85
-rw-r--r--Help/command/set.rst19
-rw-r--r--Help/command/target_compile_definitions.rst6
-rw-r--r--Help/command/target_compile_options.rst6
-rw-r--r--Help/command/target_include_directories.rst6
-rw-r--r--Help/command/target_link_directories.rst11
-rw-r--r--Help/command/target_link_libraries.rst4
-rw-r--r--Help/command/target_link_options.rst6
-rw-r--r--Help/command/target_precompile_headers.rst6
-rw-r--r--Help/command/target_sources.rst85
-rw-r--r--Help/command/try_compile.rst151
-rw-r--r--Help/command/try_run.rst96
-rw-r--r--Help/command/while.rst8
-rw-r--r--Help/cpack_gen/archive.rst6
-rw-r--r--Help/cpack_gen/deb.rst14
-rw-r--r--Help/cpack_gen/external.rst4
-rw-r--r--Help/cpack_gen/freebsd.rst12
-rw-r--r--Help/cpack_gen/ifw.rst2
-rw-r--r--Help/cpack_gen/nsis.rst31
-rw-r--r--Help/cpack_gen/nuget.rst20
-rw-r--r--Help/cpack_gen/rpm.rst4
-rw-r--r--Help/cpack_gen/wix.rst2
-rw-r--r--Help/dev/experimental.rst39
-rw-r--r--Help/envvar/ASM_DIALECTFLAGS.rst19
-rw-r--r--Help/envvar/CFLAGS.rst11
-rw-r--r--Help/envvar/CMAKE_GENERATOR.rst6
-rw-r--r--Help/envvar/CMAKE_GENERATOR_PLATFORM.rst2
-rw-r--r--Help/envvar/CMAKE_GENERATOR_TOOLSET.rst2
-rw-r--r--Help/envvar/CSFLAGS.rst11
-rw-r--r--Help/envvar/CTEST_PROGRESS_OUTPUT.rst4
-rw-r--r--Help/envvar/CUDAFLAGS.rst11
-rw-r--r--Help/envvar/CXXFLAGS.rst11
-rw-r--r--Help/envvar/DESTDIR.rst5
-rw-r--r--Help/envvar/FFLAGS.rst11
-rw-r--r--Help/envvar/HIPFLAGS.rst11
-rw-r--r--Help/envvar/ISPCFLAGS.rst11
-rw-r--r--Help/envvar/LANG_FLAGS.txt6
-rw-r--r--Help/envvar/RCFLAGS.rst11
-rw-r--r--Help/envvar/SSL_CERT_DIR.rst9
-rw-r--r--Help/envvar/SSL_CERT_FILE.rst9
-rw-r--r--Help/generator/Green Hills MULTI.rst12
-rw-r--r--Help/generator/Ninja Multi-Config.rst4
-rw-r--r--Help/generator/Visual Studio 10 2010.rst54
-rw-r--r--Help/generator/Visual Studio 11 2012.rst13
-rw-r--r--Help/generator/Visual Studio 12 2013.rst4
-rw-r--r--Help/generator/Visual Studio 14 2015.rst4
-rw-r--r--Help/generator/Visual Studio 15 2017.rst4
-rw-r--r--Help/generator/Visual Studio 16 2019.rst4
-rw-r--r--Help/generator/Visual Studio 17 2022.rst4
-rw-r--r--Help/generator/Visual Studio 9 2008.rst2
-rw-r--r--Help/generator/Xcode.rst14
-rw-r--r--Help/guide/ide-integration/index.rst17
-rw-r--r--Help/guide/tutorial/A Basic Starting Point.rst468
-rw-r--r--Help/guide/tutorial/Adding Export Configuration.rst2
-rw-r--r--Help/guide/tutorial/Adding Generator Expressions.rst294
-rw-r--r--Help/guide/tutorial/Adding Support for a Testing Dashboard.rst20
-rw-r--r--Help/guide/tutorial/Adding System Introspection.rst12
-rw-r--r--Help/guide/tutorial/Adding Usage Requirements for a Library.rst151
-rw-r--r--Help/guide/tutorial/Adding a Custom Command and Generated File.rst14
-rw-r--r--Help/guide/tutorial/Adding a Library.rst465
-rw-r--r--Help/guide/tutorial/Complete/CMakeLists.txt3
-rw-r--r--Help/guide/tutorial/Complete/License.txt2
-rw-r--r--Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt3
-rw-r--r--Help/guide/tutorial/Installing and Testing.rst330
-rw-r--r--Help/guide/tutorial/Packaging Debug and Release.rst8
-rw-r--r--Help/guide/tutorial/Packaging an Installer.rst10
-rw-r--r--Help/guide/tutorial/Selecting Static or Shared Libraries.rst14
-rw-r--r--Help/guide/tutorial/Step1/CMakeLists.txt16
-rw-r--r--Help/guide/tutorial/Step1/TutorialConfig.h.in2
-rw-r--r--Help/guide/tutorial/Step1/tutorial.cxx7
-rw-r--r--Help/guide/tutorial/Step10/CMakeLists.txt33
-rw-r--r--Help/guide/tutorial/Step10/License.txt2
-rw-r--r--Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt71
-rw-r--r--Help/guide/tutorial/Step10/MathFunctions/MathFunctions.h15
-rw-r--r--Help/guide/tutorial/Step10/MathFunctions/mysqrt.cxx4
-rw-r--r--Help/guide/tutorial/Step10/TutorialConfig.h.in1
-rw-r--r--Help/guide/tutorial/Step10/tutorial.cxx15
-rw-r--r--Help/guide/tutorial/Step11/CMakeLists.txt6
-rw-r--r--Help/guide/tutorial/Step11/License.txt2
-rw-r--r--Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt5
-rw-r--r--Help/guide/tutorial/Step11/tutorial.cxx1
-rw-r--r--Help/guide/tutorial/Step12/CMakeLists.txt3
-rw-r--r--Help/guide/tutorial/Step12/License.txt2
-rw-r--r--Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt3
-rw-r--r--Help/guide/tutorial/Step2/CMakeLists.txt23
-rw-r--r--Help/guide/tutorial/Step2/MathFunctions/CMakeLists.txt2
-rw-r--r--Help/guide/tutorial/Step2/TutorialConfig.h.in2
-rw-r--r--Help/guide/tutorial/Step2/tutorial.cxx8
-rw-r--r--Help/guide/tutorial/Step3/CMakeLists.txt4
-rw-r--r--Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt4
-rw-r--r--Help/guide/tutorial/Step4/CMakeLists.txt26
-rw-r--r--Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt2
-rw-r--r--Help/guide/tutorial/Step5/CMakeLists.txt64
-rw-r--r--Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt13
-rw-r--r--Help/guide/tutorial/Step6/CMakeLists.txt17
-rw-r--r--Help/guide/tutorial/Step6/CTestConfig.cmake7
-rw-r--r--Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt30
-rw-r--r--Help/guide/tutorial/Step6/MathFunctions/MakeTable.cxx25
-rw-r--r--Help/guide/tutorial/Step6/MathFunctions/mysqrt.cxx8
-rw-r--r--Help/guide/tutorial/Step7/CMakeLists.txt19
-rw-r--r--Help/guide/tutorial/Step7/CTestConfig.cmake7
-rw-r--r--Help/guide/tutorial/Step7/License.txt2
-rw-r--r--Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt29
-rw-r--r--Help/guide/tutorial/Step7/MathFunctions/MakeTable.cxx25
-rw-r--r--Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx9
-rw-r--r--Help/guide/tutorial/Step8/CMakeLists.txt28
-rw-r--r--Help/guide/tutorial/Step8/License.txt2
-rw-r--r--Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt52
-rw-r--r--Help/guide/tutorial/Step8/MathFunctions/mysqrt.cxx17
-rw-r--r--Help/guide/tutorial/Step9/CMakeLists.txt24
-rw-r--r--Help/guide/tutorial/Step9/License.txt2
-rw-r--r--Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt11
-rw-r--r--Help/guide/tutorial/Step9/MathFunctions/MathFunctions.cxx19
-rw-r--r--Help/guide/tutorial/Step9/MathFunctions/mysqrt.h6
-rw-r--r--Help/guide/tutorial/index.rst4
-rw-r--r--Help/guide/user-interaction/index.rst107
-rw-r--r--Help/manual/OPTIONS_BUILD.txt103
-rw-r--r--Help/manual/OPTIONS_HELP.txt68
-rw-r--r--Help/manual/ccmake.1.rst4
-rw-r--r--Help/manual/cmake-buildsystem.7.rst8
-rw-r--r--Help/manual/cmake-commands.7.rst2
-rw-r--r--Help/manual/cmake-env-variables.7.rst2
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst38
-rw-r--r--Help/manual/cmake-generators.7.rst16
-rw-r--r--Help/manual/cmake-gui.1.rst16
-rw-r--r--Help/manual/cmake-language.7.rst2
-rw-r--r--Help/manual/cmake-modules.7.rst2
-rw-r--r--Help/manual/cmake-policies.7.rst10
-rw-r--r--Help/manual/cmake-presets.7.rst606
-rw-r--r--Help/manual/cmake-properties.7.rst24
-rw-r--r--Help/manual/cmake-qt.7.rst2
-rw-r--r--Help/manual/cmake-toolchains.7.rst72
-rw-r--r--Help/manual/cmake-variables.7.rst48
-rw-r--r--Help/manual/cmake.1.rst533
-rw-r--r--Help/manual/cpack.1.rst52
-rw-r--r--Help/manual/ctest.1.rst465
-rw-r--r--Help/manual/presets/example.json34
-rw-r--r--Help/manual/presets/schema.json405
-rw-r--r--Help/module/FindOpenSP.rst1
-rw-r--r--Help/module/FindSDL_gfx.rst1
-rw-r--r--Help/policy/CMP0058.rst5
-rw-r--r--Help/policy/CMP0140.rst17
-rw-r--r--Help/policy/CMP0141.rst55
-rw-r--r--Help/policy/CMP0142.rst27
-rw-r--r--Help/prop_dir/SYSTEM.rst10
-rw-r--r--Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst5
-rw-r--r--Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst125
-rw-r--r--Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst2
-rw-r--r--Help/prop_test/FIXTURES_REQUIRED.rst9
-rw-r--r--Help/prop_test/LABELS.rst2
-rw-r--r--Help/prop_tgt/COMPILE_WARNING_AS_ERROR.rst8
-rw-r--r--Help/prop_tgt/CONFIG_POSTFIX.rst10
-rw-r--r--Help/prop_tgt/CUDA_STANDARD.rst6
-rw-r--r--Help/prop_tgt/CXX_MODULE_DIRS.rst19
-rw-r--r--Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst19
-rw-r--r--Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS.rst19
-rw-r--r--Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS_NAME.rst21
-rw-r--r--Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET.rst20
-rw-r--r--Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SETS.rst20
-rw-r--r--Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET_NAME.rst21
-rw-r--r--Help/prop_tgt/CXX_MODULE_SET.rst20
-rw-r--r--Help/prop_tgt/CXX_MODULE_SETS.rst18
-rw-r--r--Help/prop_tgt/CXX_MODULE_SET_NAME.rst20
-rw-r--r--Help/prop_tgt/CXX_STANDARD.rst6
-rw-r--r--Help/prop_tgt/EXPORT_NO_SYSTEM.rst11
-rw-r--r--Help/prop_tgt/HIP_STANDARD.rst6
-rw-r--r--Help/prop_tgt/IMPORTED_NO_SYSTEM.rst12
-rw-r--r--Help/prop_tgt/INTERFACE_CXX_MODULE_HEADER_UNIT_SETS.rst18
-rw-r--r--Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst18
-rw-r--r--Help/prop_tgt/LANG_CLANG_TIDY.rst18
-rw-r--r--Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst5
-rw-r--r--Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt16
-rw-r--r--Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst33
-rw-r--r--Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt5
-rw-r--r--Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst4
-rw-r--r--Help/prop_tgt/OBJCXX_STANDARD.rst6
-rw-r--r--Help/prop_tgt/SYSTEM.rst22
-rw-r--r--Help/prop_tgt/VS_DEBUGGER_COMMAND.rst2
-rw-r--r--Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst2
-rw-r--r--Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst2
-rw-r--r--Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst2
-rw-r--r--Help/prop_tgt/VS_KEYWORD.rst2
-rw-r--r--Help/prop_tgt/XCODE_GENERATE_SCHEME.rst4
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst14
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst14
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_LAUNCH_CONFIGURATION.rst13
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_LAUNCH_MODE.rst22
-rw-r--r--Help/release/3.0.rst2
-rw-r--r--Help/release/3.11.rst2
-rw-r--r--Help/release/3.12.rst4
-rw-r--r--Help/release/3.20.rst6
-rw-r--r--Help/release/3.21.rst14
-rw-r--r--Help/release/3.23.rst11
-rw-r--r--Help/release/3.24.rst36
-rw-r--r--Help/release/3.25.rst240
-rw-r--r--Help/release/3.3.rst2
-rw-r--r--Help/release/3.4.rst2
-rw-r--r--Help/release/3.7.rst2
-rw-r--r--Help/release/index.rst1
-rw-r--r--Help/variable/BSD.rst7
-rw-r--r--Help/variable/CMAKE_ANDROID_API.rst7
-rw-r--r--Help/variable/CMAKE_BINARY_DIR.rst2
-rw-r--r--Help/variable/CMAKE_CFG_INTDIR.rst2
-rw-r--r--Help/variable/CMAKE_COMMAND.rst2
-rw-r--r--Help/variable/CMAKE_CPACK_COMMAND.rst6
-rw-r--r--Help/variable/CMAKE_CTEST_COMMAND.rst6
-rw-r--r--Help/variable/CMAKE_CURRENT_BINARY_DIR.rst2
-rw-r--r--Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst2
-rw-r--r--Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst2
-rw-r--r--Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst2
-rw-r--r--Help/variable/CMAKE_FIND_DEBUG_MODE.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst2
-rw-r--r--Help/variable/CMAKE_GENERATOR.rst2
-rw-r--r--Help/variable/CMAKE_GENERATOR_PLATFORM.rst2
-rw-r--r--Help/variable/CMAKE_GENERATOR_TOOLSET.rst2
-rw-r--r--Help/variable/CMAKE_HOST_BSD.rst7
-rw-r--r--Help/variable/CMAKE_HOST_LINUX.rst6
-rw-r--r--Help/variable/CMAKE_INSTALL_PREFIX.rst5
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER.rst3
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst93
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS.rst10
-rw-r--r--Help/variable/CMAKE_MAKE_PROGRAM.rst4
-rw-r--r--Help/variable/CMAKE_MESSAGE_CONTEXT.rst2
-rw-r--r--Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst10
-rw-r--r--Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst36
-rw-r--r--Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst7
-rw-r--r--Help/variable/CMAKE_SCRIPT_MODE_FILE.rst4
-rw-r--r--Help/variable/CMAKE_SOURCE_DIR.rst2
-rw-r--r--Help/variable/CMAKE_TASKING_TOOLSET.rst34
-rw-r--r--Help/variable/CMAKE_VS_DEVENV_COMMAND.rst2
-rw-r--r--Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst2
-rw-r--r--Help/variable/CMAKE_WARN_DEPRECATED.rst3
-rw-r--r--Help/variable/CMAKE_XCODE_PLATFORM_TOOLSET.rst4
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst13
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst13
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION.rst12
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_MODE.rst13
-rw-r--r--Help/variable/CPACK_CUSTOM_INSTALL_VARIABLES.rst2
-rw-r--r--Help/variable/CTEST_CONFIGURATION_TYPE.rst2
-rw-r--r--Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst2
-rw-r--r--Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt9
-rw-r--r--Help/variable/LINUX.rst6
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in1
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake1
-rw-r--r--Modules/CMakeDependentOption.cmake2
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake7
-rw-r--r--Modules/CMakeDetermineCSharpCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake5
-rw-r--r--Modules/CMakeDetermineCompileFeatures.cmake19
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake10
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake10
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake36
-rw-r--r--Modules/CMakeDetermineHIPCompiler.cmake1
-rw-r--r--Modules/CMakeDetermineVSServicePack.cmake6
-rw-r--r--Modules/CMakeFindBinUtils.cmake2
-rw-r--r--Modules/CMakeFindFrameworks.cmake9
-rw-r--r--Modules/CMakeHIPInformation.cmake2
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake7
-rw-r--r--Modules/CMakePlatformId.h.in24
-rw-r--r--Modules/CMakeSwiftInformation.cmake2
-rw-r--r--Modules/CMakeSystemSpecificInformation.cmake2
-rw-r--r--Modules/CMakeTestCCompiler.cmake7
-rw-r--r--Modules/CMakeTestCSharpCompiler.cmake18
-rw-r--r--Modules/CMakeTestCUDACompiler.cmake7
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake11
-rw-r--r--Modules/CMakeTestFortranCompiler.cmake14
-rw-r--r--Modules/CMakeTestHIPCompiler.cmake7
-rw-r--r--Modules/CMakeTestOBJCCompiler.cmake7
-rw-r--r--Modules/CMakeTestOBJCXXCompiler.cmake7
-rw-r--r--Modules/CMakeTestSwiftCompiler.cmake8
-rw-r--r--Modules/CPack.cmake55
-rw-r--r--Modules/CPackComponent.cmake2
-rw-r--r--Modules/CPackIFW.cmake44
-rw-r--r--Modules/CTest.cmake2
-rw-r--r--Modules/CTestTargets.cmake2
-rw-r--r--Modules/CTestUseLaunchers.cmake7
-rw-r--r--Modules/CheckCXXSymbolExists.cmake2
-rw-r--r--Modules/CheckFortranFunctionExists.cmake7
-rw-r--r--Modules/CheckFunctionExists.cmake8
-rw-r--r--Modules/CheckIPOSupported.cmake46
-rw-r--r--Modules/CheckIncludeFile.cmake7
-rw-r--r--Modules/CheckIncludeFileCXX.cmake7
-rw-r--r--Modules/CheckIncludeFiles.cmake17
-rw-r--r--Modules/CheckLibraryExists.cmake8
-rw-r--r--Modules/CheckPrototypeDefinition.cmake9
-rw-r--r--Modules/CheckSymbolExists.cmake28
-rw-r--r--Modules/CheckTypeSize.cmake12
-rw-r--r--Modules/CheckVariableExists.cmake3
-rw-r--r--Modules/Compiler/Clang-CUDA.cmake4
-rw-r--r--Modules/Compiler/Clang.cmake3
-rw-r--r--Modules/Compiler/IAR-CXX.cmake4
-rw-r--r--Modules/Compiler/IntelLLVM-FindBinUtils.cmake45
-rw-r--r--Modules/Compiler/IntelLLVM.cmake21
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake13
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake24
-rw-r--r--Modules/Compiler/Tasking-ASM.cmake7
-rw-r--r--Modules/Compiler/Tasking-C.cmake47
-rw-r--r--Modules/Compiler/Tasking-CXX.cmake31
-rw-r--r--Modules/Compiler/Tasking-DetermineCompiler.cmake10
-rw-r--r--Modules/Compiler/Tasking-FindBinUtils.cmake18
-rw-r--r--Modules/Compiler/Tasking.cmake54
-rw-r--r--Modules/ExternalProject.cmake23
-rw-r--r--Modules/ExternalProject/gitupdate.cmake.in38
-rw-r--r--Modules/FetchContent.cmake26
-rw-r--r--Modules/FindAVIFile.cmake2
-rw-r--r--Modules/FindBLAS.cmake13
-rw-r--r--Modules/FindBacktrace.cmake2
-rw-r--r--Modules/FindCUDA.cmake8
-rw-r--r--Modules/FindCUDA/select_compute_arch.cmake4
-rw-r--r--Modules/FindCUDAToolkit.cmake82
-rw-r--r--Modules/FindCURL.cmake5
-rw-r--r--Modules/FindCoin3D.cmake4
-rw-r--r--Modules/FindCxxTest.cmake2
-rw-r--r--Modules/FindDCMTK.cmake11
-rw-r--r--Modules/FindDevIL.cmake2
-rw-r--r--Modules/FindDoxygen.cmake60
-rw-r--r--Modules/FindGDAL.cmake2
-rw-r--r--Modules/FindGLEW.cmake27
-rw-r--r--Modules/FindGLUT.cmake74
-rw-r--r--Modules/FindGTK2.cmake1
-rw-r--r--Modules/FindHDF5.cmake6
-rw-r--r--Modules/FindICU.cmake12
-rw-r--r--Modules/FindLAPACK.cmake14
-rw-r--r--Modules/FindLTTngUST.cmake2
-rw-r--r--Modules/FindLibArchive.cmake3
-rw-r--r--Modules/FindMFC.cmake12
-rw-r--r--Modules/FindMPI.cmake156
-rw-r--r--Modules/FindMatlab.cmake26
-rw-r--r--Modules/FindOpenACC.cmake47
-rw-r--r--Modules/FindOpenAL.cmake26
-rw-r--r--Modules/FindOpenGL.cmake2
-rw-r--r--Modules/FindOpenMP.cmake108
-rw-r--r--Modules/FindOpenSP.cmake155
-rw-r--r--Modules/FindOpenSSL.cmake24
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake22
-rw-r--r--Modules/FindPython.cmake6
-rw-r--r--Modules/FindPython/Support.cmake274
-rw-r--r--Modules/FindPython2.cmake2
-rw-r--r--Modules/FindPython3.cmake6
-rw-r--r--Modules/FindRuby.cmake53
-rw-r--r--Modules/FindSDL_gfx.cmake86
-rw-r--r--Modules/FindSDL_image.cmake4
-rw-r--r--Modules/FindSDL_mixer.cmake4
-rw-r--r--Modules/FindSDL_net.cmake4
-rw-r--r--Modules/FindSDL_sound.cmake31
-rw-r--r--Modules/FindSDL_ttf.cmake4
-rw-r--r--Modules/FindSWIG.cmake2
-rw-r--r--Modules/FindThreads.cmake8
-rw-r--r--Modules/FindVulkan.cmake117
-rw-r--r--Modules/FindXCTest.cmake2
-rw-r--r--Modules/FindwxWindows.cmake3
-rw-r--r--Modules/FortranCInterface.cmake8
-rw-r--r--Modules/FortranCInterface/Detect.cmake8
-rw-r--r--Modules/GoogleTest.cmake6
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake30
-rw-r--r--Modules/Internal/CPack/CPackRPM.cmake6
-rw-r--r--Modules/Internal/CheckSourceCompiles.cmake6
-rw-r--r--Modules/Internal/CheckSourceRuns.cmake6
-rw-r--r--Modules/Internal/FeatureTesting.cmake9
-rw-r--r--Modules/Platform/AIX-GNU.cmake4
-rw-r--r--Modules/Platform/AIX-XL.cmake4
-rwxr-xr-xModules/Platform/AIX/ExportImportList46
-rw-r--r--Modules/Platform/DragonFly.cmake1
-rw-r--r--Modules/Platform/FreeBSD.cmake1
-rw-r--r--Modules/Platform/Linux-IntelLLVM.cmake26
-rw-r--r--Modules/Platform/Linux-NVHPC.cmake16
-rw-r--r--Modules/Platform/Linux.cmake12
-rw-r--r--Modules/Platform/NetBSD.cmake1
-rw-r--r--Modules/Platform/OpenBSD.cmake1
-rw-r--r--Modules/Platform/SerenityOS-Clang-ASM.cmake2
-rw-r--r--Modules/Platform/SerenityOS-Clang-C.cmake2
-rw-r--r--Modules/Platform/SerenityOS-Clang-CXX.cmake2
-rw-r--r--Modules/Platform/SerenityOS-GNU-ASM.cmake2
-rw-r--r--Modules/Platform/SerenityOS-GNU-C.cmake2
-rw-r--r--Modules/Platform/SerenityOS-GNU-CXX.cmake2
-rw-r--r--Modules/Platform/SerenityOS-GNU.cmake24
-rw-r--r--Modules/Platform/SerenityOS.cmake12
-rw-r--r--Modules/Platform/Windows-Clang-HIP.cmake19
-rw-r--r--Modules/Platform/Windows-Clang.cmake85
-rw-r--r--Modules/Platform/Windows-Intel-C.cmake11
-rw-r--r--Modules/Platform/Windows-Intel-CXX.cmake11
-rw-r--r--Modules/Platform/Windows-Intel-Fortran.cmake2
-rw-r--r--Modules/Platform/Windows-IntelLLVM-Fortran.cmake2
-rw-r--r--Modules/Platform/Windows-IntelLLVM.cmake51
-rw-r--r--Modules/Platform/Windows-MSVC.cmake21
-rw-r--r--Modules/Platform/Windows-NVIDIA-CUDA.cmake14
-rw-r--r--Modules/Platform/Windows.cmake4
-rw-r--r--Modules/Platform/kFreeBSD.cmake3
-rw-r--r--Modules/TestBigEndian.cmake18
-rw-r--r--Modules/TestCXXAcceptsFlag.cmake3
-rw-r--r--Modules/TestForANSIForScope.cmake4
-rw-r--r--Modules/TestForSSTREAM.cmake4
-rw-r--r--Modules/TestForSTDNamespace.cmake4
-rw-r--r--Modules/UseJava.cmake2
-rw-r--r--Modules/UseSWIG.cmake4
-rw-r--r--Source/CMakeLists.txt542
-rw-r--r--Source/CMakeVersion.cmake12
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx12
-rw-r--r--Source/CPack/cmCPackConfigure.h.in5
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx7
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.cxx54
-rw-r--r--Source/CPack/cmCPackGeneratorFactory.cxx8
-rw-r--r--Source/CPack/cmCPackGeneratorFactory.h2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx34
-rw-r--r--Source/CPack/cpack.cxx171
-rw-r--r--Source/CTest/cmCTestCoverageCommand.cxx12
-rw-r--r--Source/CTest/cmCTestCoverageCommand.h6
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx20
-rw-r--r--Source/CTest/cmCTestHandlerCommand.h5
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx21
-rw-r--r--Source/CTest/cmCTestRunTest.cxx146
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx65
-rw-r--r--Source/CTest/cmCTestSubmitCommand.h13
-rw-r--r--Source/CTest/cmCTestUploadCommand.cxx2
-rw-r--r--Source/CTest/cmCTestUploadCommand.h5
-rw-r--r--Source/CursesDialog/form/CMakeLists.txt2
-rw-r--r--Source/LexerParser/cmFortranLexer.cxx377
-rw-r--r--Source/LexerParser/cmFortranLexer.in.l16
-rw-r--r--Source/LexerParser/cmFortranParser.cxx324
-rw-r--r--Source/LexerParser/cmFortranParser.y18
-rw-r--r--Source/Modules/CMakeBuildUtilities.cmake379
-rw-r--r--Source/QtDialog/CMakeLists.txt88
-rw-r--r--Source/QtDialog/FirstConfigure.cxx3
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx12
-rw-r--r--Source/cmArgumentParser.cxx186
-rw-r--r--Source/cmArgumentParser.h400
-rw-r--r--Source/cmArgumentParserTypes.h69
-rw-r--r--Source/cmBlockCommand.cxx197
-rw-r--r--Source/cmBlockCommand.h14
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx12
-rw-r--r--Source/cmCMakeLanguageCommand.cxx35
-rw-r--r--Source/cmCMakePathCommand.cxx134
-rw-r--r--Source/cmCMakePresetsGraph.cxx310
-rw-r--r--Source/cmCMakePresetsGraph.h112
-rw-r--r--Source/cmCMakePresetsGraphInternal.h8
-rw-r--r--Source/cmCMakePresetsGraphReadJSON.cxx92
-rw-r--r--Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx95
-rw-r--r--Source/cmCMakePresetsGraphReadJSONTestPresets.cxx2
-rw-r--r--Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx95
-rw-r--r--Source/cmCTest.cxx18
-rw-r--r--Source/cmCTest.h3
-rw-r--r--Source/cmCommands.cxx16
-rw-r--r--Source/cmCommonTargetGenerator.cxx4
-rw-r--r--Source/cmComputeLinkInformation.cxx48
-rw-r--r--Source/cmConfigure.cmake.h.in13
-rw-r--r--Source/cmCoreTryCompile.cxx950
-rw-r--r--Source/cmCoreTryCompile.h89
-rw-r--r--Source/cmCreateTestSourceList.cxx4
-rw-r--r--Source/cmCurl.cxx11
-rw-r--r--Source/cmCxxModuleMapper.cxx308
-rw-r--r--Source/cmCxxModuleMapper.h85
-rw-r--r--Source/cmDefinePropertyCommand.cxx5
-rw-r--r--Source/cmDocumentation.cxx42
-rw-r--r--Source/cmExecuteProcessCommand.cxx12
-rw-r--r--Source/cmExecutionStatus.h17
-rw-r--r--Source/cmExperimental.cxx63
-rw-r--r--Source/cmExperimental.h21
-rw-r--r--Source/cmExportBuildFileGenerator.cxx98
-rw-r--r--Source/cmExportBuildFileGenerator.h16
-rw-r--r--Source/cmExportCommand.cxx23
-rw-r--r--Source/cmExportFileGenerator.cxx33
-rw-r--r--Source/cmExportFileGenerator.h5
-rw-r--r--Source/cmExportInstallAndroidMKGenerator.cxx3
-rw-r--r--Source/cmExportInstallFileGenerator.cxx113
-rw-r--r--Source/cmExportInstallFileGenerator.h25
-rw-r--r--Source/cmExportTryCompileFileGenerator.h3
-rw-r--r--Source/cmFileAPICodemodel.cxx16
-rw-r--r--Source/cmFileCommand.cxx434
-rw-r--r--Source/cmFileCopier.cxx44
-rw-r--r--Source/cmFindBase.cxx62
-rw-r--r--Source/cmFindBase.h7
-rw-r--r--Source/cmFindLibraryCommand.cxx33
-rw-r--r--Source/cmFindPackageCommand.cxx1257
-rw-r--r--Source/cmFindPackageCommand.h2
-rw-r--r--Source/cmFindPathCommand.cxx6
-rw-r--r--Source/cmFindProgramCommand.cxx12
-rw-r--r--Source/cmForEachCommand.cxx2
-rw-r--r--Source/cmFunctionBlocker.cxx18
-rw-r--r--Source/cmFunctionBlocker.h2
-rw-r--r--Source/cmFunctionCommand.cxx1
-rw-r--r--Source/cmGeneratedFileStream.cxx18
-rw-r--r--Source/cmGeneratedFileStream.h10
-rw-r--r--Source/cmGeneratorTarget.cxx147
-rw-r--r--Source/cmGeneratorTarget.h35
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx19
-rw-r--r--Source/cmGlobalGenerator.h57
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx546
-rw-r--r--Source/cmGlobalNinjaGenerator.h4
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx200
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h17
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx33
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h2
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx10
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h1
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx48
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx294
-rw-r--r--Source/cmGlobalXCodeGenerator.h7
-rw-r--r--Source/cmIfCommand.cxx2
-rw-r--r--Source/cmInstallCommand.cxx157
-rw-r--r--Source/cmInstallCommandArguments.h5
-rw-r--r--Source/cmInstallCxxModuleBmiGenerator.cxx75
-rw-r--r--Source/cmInstallCxxModuleBmiGenerator.h52
-rw-r--r--Source/cmInstallExportGenerator.cxx73
-rw-r--r--Source/cmInstallExportGenerator.h8
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx21
-rw-r--r--Source/cmLinkLineDeviceComputer.h1
-rw-r--r--Source/cmListFileCache.cxx11
-rw-r--r--Source/cmLocalGenerator.cxx104
-rw-r--r--Source/cmLocalGenerator.h17
-rw-r--r--Source/cmLocalNinjaGenerator.cxx26
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx37
-rw-r--r--Source/cmLocalVisualStudio10Generator.h4
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx7
-rw-r--r--Source/cmMacroCommand.cxx2
-rw-r--r--Source/cmMakefile.cxx105
-rw-r--r--Source/cmMakefile.h22
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx27
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx25
-rw-r--r--Source/cmMakefileTargetGenerator.cxx136
-rw-r--r--Source/cmMakefileTargetGenerator.h20
-rw-r--r--Source/cmMessageCommand.cxx65
-rw-r--r--Source/cmMessageType.h16
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx22
-rw-r--r--Source/cmNinjaTargetGenerator.cxx327
-rw-r--r--Source/cmOutputConverter.cxx7
-rw-r--r--Source/cmParseArgumentsCommand.cxx17
-rw-r--r--Source/cmPolicies.h15
-rw-r--r--Source/cmQtAutoGenInitializer.cxx25
-rw-r--r--Source/cmQtAutoGenInitializer.h2
-rw-r--r--Source/cmReturnCommand.cxx44
-rw-r--r--Source/cmScanDepFormat.cxx15
-rw-r--r--Source/cmScanDepFormat.h5
-rw-r--r--Source/cmScriptGenerator.cxx2
-rw-r--r--Source/cmSetPropertyCommand.cxx4
-rw-r--r--Source/cmStandardLevelResolver.cxx35
-rw-r--r--Source/cmState.cxx21
-rw-r--r--Source/cmStatePrivate.h2
-rw-r--r--Source/cmStateSnapshot.cxx29
-rw-r--r--Source/cmStringCommand.cxx2
-rw-r--r--Source/cmSubdirCommand.cxx4
-rw-r--r--Source/cmSystemTools.cxx287
-rw-r--r--Source/cmSystemTools.h74
-rw-r--r--Source/cmTarget.cxx125
-rw-r--r--Source/cmTarget.h10
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.cxx4
-rw-r--r--Source/cmTargetExport.h2
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.cxx3
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx8
-rw-r--r--Source/cmTargetPrecompileHeadersCommand.cxx4
-rw-r--r--Source/cmTargetSourcesCommand.cxx47
-rw-r--r--Source/cmTryCompileCommand.cxx61
-rw-r--r--Source/cmTryCompileCommand.h30
-rw-r--r--Source/cmTryRunCommand.cxx355
-rw-r--r--Source/cmTryRunCommand.h44
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx106
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h1
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx92
-rw-r--r--Source/cmWhileCommand.cxx2
-rw-r--r--Source/cmWindowsRegistry.h2
-rw-r--r--Source/cmXCodeScheme.cxx34
-rw-r--r--Source/cm_codecvt.cxx6
-rw-r--r--Source/cm_codecvt.hxx3
-rw-r--r--Source/cmake.cxx297
-rw-r--r--Source/cmake.h54
-rw-r--r--Source/cmake.version.manifest2
-rw-r--r--Source/cmakemain.cxx104
-rw-r--r--Source/cmcldeps.cxx1
-rw-r--r--Source/cmcmd.cxx84
-rw-r--r--Source/kwsys/Directory.cxx39
-rw-r--r--Source/kwsys/SystemTools.cxx103
-rw-r--r--Templates/MSBuild/FlagTables/v10_CSharp.json6
-rw-r--r--Templates/MSBuild/FlagTables/v10_Cuda.json112
-rw-r--r--Templates/MSBuild/FlagTables/v11_CSharp.json6
-rw-r--r--Templates/MSBuild/FlagTables/v12_CSharp.json6
-rw-r--r--Templates/MSBuild/FlagTables/v140_CSharp.json6
-rw-r--r--Templates/MSBuild/FlagTables/v141_CSharp.json6
-rw-r--r--Templates/MSBuild/FlagTables/v142_CSharp.json6
-rw-r--r--Templates/MSBuild/FlagTables/v143_CSharp.json6
-rw-r--r--Tests/Assembler/CMakeLists.txt6
-rw-r--r--Tests/CMakeLib/CMakeLists.txt6
-rw-r--r--Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt6
-rw-r--r--Tests/CMakeLib/testArgumentParser.cxx340
-rw-r--r--Tests/CMakeLib/testCMExtEnumSet.cxx9
-rw-r--r--Tests/CMakeLists.txt392
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt13
-rw-r--r--Tests/CMakeTests/CMakeLists.txt15
-rw-r--r--Tests/CMakeTests/CheckSourceTreeTest.cmake.in365
-rw-r--r--Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in89
-rw-r--r--Tests/CTestCoverageCollectGCOV/test.cmake.in5
-rw-r--r--Tests/CTestTestFdSetSize/sleep.c14
-rw-r--r--Tests/CTestUpdateCommon.cmake6
-rw-r--r--Tests/CTestUpdateP4.cmake.in6
-rw-r--r--Tests/CheckSourceTree/CMakeLists.txt6
-rw-r--r--Tests/CheckSourceTree/check.cmake22
-rw-r--r--Tests/CheckSwift.cmake2
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt1
-rw-r--r--Tests/CompileFeatures/genex_test.cpp3
-rw-r--r--Tests/Complex/CMakeLists.txt8
-rw-r--r--Tests/Complex/Executable/complex.cxx2
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt8
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx2
-rw-r--r--Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt5
-rw-r--r--Tests/CudaOnly/CMakeLists.txt25
-rw-r--r--Tests/CudaOnly/DeviceLTO/CMakeLists.txt37
-rw-r--r--Tests/CudaOnly/DeviceLTO/file1.cu17
-rw-r--r--Tests/CudaOnly/DeviceLTO/file2.cu5
-rw-r--r--Tests/CudaOnly/DeviceLTO/file3.cu4
-rw-r--r--Tests/CudaOnly/DeviceLTO/main.cu62
-rw-r--r--Tests/CudaOnly/ToolkitMultipleDirs/CMakeLists.txt22
-rw-r--r--Tests/CudaOnly/ToolkitMultipleDirs/main.cu8
-rw-r--r--Tests/CudaOnly/ToolkitMultipleDirs/subdir/CMakeLists.txt2
-rw-r--r--Tests/EnforceConfig.cmake.in4
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt11
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt14
-rw-r--r--Tests/ExternalProject/CMakeLists.txt6
-rw-r--r--Tests/FindOpenAL/CMakeLists.txt10
-rw-r--r--Tests/FindOpenAL/Test/CMakeLists.txt14
-rw-r--r--Tests/FindOpenAL/Test/main.cxx13
-rw-r--r--Tests/FindOpenSP/CMakeLists.txt10
-rw-r--r--Tests/FindOpenSP/Test/CMakeLists.txt16
-rw-r--r--Tests/FindOpenSP/Test/main.cxx55
-rw-r--r--Tests/FindOpenSP/Test/test.sgml7
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt2
-rw-r--r--Tests/FindVulkan/Test/CMakeLists.txt20
-rw-r--r--Tests/FindVulkan/Test/Run-dxc_exe.cmake20
-rw-r--r--Tests/FindVulkan/Test/main-dxc_lib.cxx23
-rw-r--r--Tests/FindVulkan/Test/main-volk.cxx14
-rw-r--r--Tests/FortranModules/Submodules/CMakeLists.txt1
-rw-r--r--Tests/FortranModules/Submodules/main.f907
-rw-r--r--Tests/FortranModules/Submodules/obfuscated_parent.f9033
-rw-r--r--Tests/FortranModules/test_module_main.f902
-rw-r--r--Tests/FunctionTest/CMakeLists.txt4
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt54
-rw-r--r--Tests/MSVCDebugInformationFormat/CMakeLists.txt81
-rw-r--r--Tests/MSVCDebugInformationFormat/override-C.cmake7
-rw-r--r--Tests/MSVCDebugInformationFormat/override-CUDA.cmake6
-rw-r--r--Tests/MSVCDebugInformationFormat/override-CXX.cmake7
-rw-r--r--Tests/MSVCDebugInformationFormat/override-Fortran.cmake4
-rw-r--r--Tests/MSVCDebugInformationFormat/verify.F901
-rw-r--r--Tests/MSVCDebugInformationFormat/verify.c1
-rw-r--r--Tests/MSVCDebugInformationFormat/verify.cu1
-rw-r--r--Tests/MSVCDebugInformationFormat/verify.cxx1
-rw-r--r--Tests/MSVCDebugInformationFormat/verify.h29
-rw-r--r--Tests/Module/CheckIPOSupported-CUDA/CMakeLists.txt32
-rw-r--r--Tests/Module/CheckIPOSupported-CUDA/bar.cu12
-rw-r--r--Tests/Module/CheckIPOSupported-CUDA/foo.cu4
-rw-r--r--Tests/Module/CheckIPOSupported-CUDA/main.cu62
-rw-r--r--Tests/ModuleDefinition/CMakeLists.txt12
-rw-r--r--Tests/Preprocess/CMakeLists.txt7
-rw-r--r--Tests/Preprocess/preprocess.c2
-rw-r--r--Tests/Preprocess/preprocess.cxx2
-rw-r--r--Tests/RunCMake/AutoExportDll/AutoExport.cmake4
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CMP0102/CMP0102-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CMakeDependentOption/UseDotSymbol-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakeDependentOption/UseDotSymbol.cmake4
-rw-r--r--Tests/RunCMake/CMakeLists.txt45
-rw-r--r--Tests/RunCMake/CMakePresets/Comment-stderr.txt9
-rw-r--r--Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt22
-rw-r--r--Tests/RunCMake/CMakePresets/EmptyPresetName-stderr.txt5
-rw-r--r--Tests/RunCMake/CMakePresets/GoodNoSCache.cmake1
-rw-r--r--Tests/RunCMake/CMakePresets/IncludeNotFound-stderr.txt5
-rw-r--r--Tests/RunCMake/CMakePresets/JSONParseError-stderr.txt9
-rw-r--r--Tests/RunCMake/CMakePresets/ListAllPresetsNoBuild-stdout.txt8
-rw-r--r--Tests/RunCMake/CMakePresets/ListAllPresetsNoBuild.json.in14
-rw-r--r--Tests/RunCMake/CMakePresets/ListAllPresetsNoTest-stdout.txt8
-rw-r--r--Tests/RunCMake/CMakePresets/ListAllPresetsNoTest.json.in14
-rw-r--r--Tests/RunCMake/CMakePresets/ListPresetsInvalidType-result.txt (renamed from Tests/RunCMake/file-CHMOD/CHMOD-write-only-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresets/ListPresetsInvalidType-stderr.txt3
-rw-r--r--Tests/RunCMake/CMakePresets/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/CMakeLists.txt.in3
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-config-file-check.cmake6
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-configurations-check.cmake18
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-debug-stdout.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-generators-check.cmake1
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-no-environment-check.cmake7
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-package-directory-check.cmake6
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-package-name-check.cmake7
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-package-version-check.cmake7
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-variables-check.cmake6
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-verbose-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good-package-with-environment-check.cmake7
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good.cmake31
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/Good.json.in135
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/ListPresets-package-x-stdout.txt4
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/ListPresets.cmake (renamed from Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON.cmake)0
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/ListPresets.json.in20
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/RunCMakeTest.cmake102
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/UnsupportedVersion-configure-x-result.txt (renamed from Tests/RunCMake/file-CHMOD/CHMOD-no-perms-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/UnsupportedVersion-configure-x-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/UnsupportedVersion.json.in4
-rw-r--r--Tests/RunCMake/CMakePresetsPackage/check.cmake3
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-outputJUnit-check.cmake4
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-outputLog-check.cmake4
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good.json.in16
-rw-r--r--Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-result.txt (renamed from Tests/RunCMake/file-CHMOD/CHMOD-no-keyword-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported.json.in17
-rw-r--r--Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-result.txt (renamed from Tests/RunCMake/file-CHMOD/CHMOD-invalid-perms-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported.json.in17
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stderr.txt4
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stdout.txt17
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/BadExitCode.cmake8
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/BadExitCodeTest.cmake1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/CMakeLists.txt.in3
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-result.txt (renamed from Tests/RunCMake/file-CHMOD/CHMOD-invalid-path-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch.json.in32
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-result.txt (renamed from Tests/RunCMake/CommandLine/DeprecateVS10-WARN-OFF.cmake)0
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure.json.in27
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/Fresh.cmake4
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/Fresh.json.in21
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/Good-stdout.txt19
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/Good.cmake8
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/Good.json.in87
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/GoodUser-stdout.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/GoodUser.cmake1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/GoodUser.json.in14
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/InvalidOption-result.txt (renamed from Tests/RunCMake/file-CHMOD/CHMOD-all-perms-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/InvalidOption-stderr.txt6
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/InvalidOption-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/ListPresets-stdout.txt4
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/ListPresets.json.in30
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps.json.in9
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep.json.in14
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/RunCMakeTest.cmake89
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure.json.in25
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep.json.in14
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/UnreachableStepUser.json.in8
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion.json.in4
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled.json.in23
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden.json.in20
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-stderr.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro.json.in20
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/check.cmake3
-rw-r--r--Tests/RunCMake/CMakePresetsWorkflow/cpack_staging.cmake.in1
-rw-r--r--Tests/RunCMake/CPack/DEB/Helpers.cmake4
-rw-r--r--Tests/RunCMake/CPack/DEB/Prerequirements.cmake6
-rw-r--r--Tests/RunCMake/CPack/RPM/Prerequirements.cmake6
-rw-r--r--Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/DEB-Prerequirements.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/DEB-Prerequirements.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/RPM-Prerequirements.cmake2
-rw-r--r--Tests/RunCMake/CTestTimeout/TestTimeout.c1
-rw-r--r--Tests/RunCMake/CUDA_architectures/architectures-suffix-stderr.txt2
-rw-r--r--Tests/RunCMake/CXXModules/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/CXXModules/ExportBuildCxxModules-check.cmake40
-rw-r--r--Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/ExportBuildCxxModules.cmake22
-rw-r--r--Tests/RunCMake/CXXModules/ExportInstallCxxModules-check.cmake35
-rw-r--r--Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/ExportInstallCxxModules.cmake22
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterface-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterface-stderr.txt12
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterface.cmake8
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterfaceImported-stderr.txt6
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterfaceImported.cmake8
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsPrivate-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsPrivate.cmake13
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsPublic-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsPublic.cmake13
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesInterface-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt12
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesInterface.cmake8
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt6
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported.cmake8
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesPrivate.cmake12
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/FileSetModulesPublic.cmake12
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMI-check.cmake24
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMI-stderr.txt6
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMI.cmake23
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMIGenericArgs-check.cmake8
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt6
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMIGenericArgs.cmake9
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMIIgnore-check.cmake13
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt6
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMIIgnore.cmake9
-rw-r--r--Tests/RunCMake/CXXModules/InstallBMINoGenericArgs-check.cmake8
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-check.cmake34
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall.cmake76
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoExport-check.cmake34
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoExport.cmake85
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-check.cmake34
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt11
-rw-r--r--Tests/RunCMake/CXXModules/NinjaDependInfoFileSet.cmake59
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX-stderr.txt20
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX.cmake9
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20-stderr.txt20
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20.cmake11
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt20
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20ModuleFlag.cmake12
-rw-r--r--Tests/RunCMake/CXXModules/NoDyndepSupport-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt30
-rw-r--r--Tests/RunCMake/CXXModules/NoDyndepSupport.cmake16
-rw-r--r--Tests/RunCMake/CXXModules/NotCXXSourceModuleHeaderUnits-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/NotCXXSourceModuleHeaderUnits-stderr.txt22
-rw-r--r--Tests/RunCMake/CXXModules/NotCXXSourceModuleHeaderUnits.cmake15
-rw-r--r--Tests/RunCMake/CXXModules/NotCXXSourceModules-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt17
-rw-r--r--Tests/RunCMake/CXXModules/NotCXXSourceModules.cmake13
-rw-r--r--Tests/RunCMake/CXXModules/RunCMakeTest.cmake170
-rw-r--r--Tests/RunCMake/CXXModules/check-json.cmake160
-rw-r--r--Tests/RunCMake/CXXModules/compiler_introspection.cmake25
-rw-r--r--Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi-and-interfaces.cmake22
-rw-r--r--Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi.cmake27
-rw-r--r--Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake18
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt66
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain/a.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain/b.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain/c.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain/d.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain/e.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/deep-chain/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt56
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/forward.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/importable.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/private.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt32
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt59
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/forward.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/importable.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/private.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt32
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt53
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-build/forward.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-build/importable.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-build/private.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt32
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt56
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-install/forward.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-install/importable.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-install/private.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt32
-rw-r--r--Tests/RunCMake/CXXModules/examples/generated-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt23
-rw-r--r--Tests/RunCMake/CXXModules/examples/generated/importable.cxx.in5
-rw-r--r--Tests/RunCMake/CXXModules/examples/generated/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/CMakeLists.txt27
-rw-r--r--Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/check-for-bmi.cmake7
-rw-r--r--Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/importable.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/install-bmi/CMakeLists.txt25
-rw-r--r--Tests/RunCMake/CXXModules/examples/install-bmi/check-for-bmi.cmake4
-rw-r--r--Tests/RunCMake/CXXModules/examples/install-bmi/importable.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt31
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx9
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/library-static-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/library/CMakeLists.txt30
-rw-r--r--Tests/RunCMake/CXXModules/examples/library/importable.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/library/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/partitions-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/partitions/CMakeLists.txt31
-rw-r--r--Tests/RunCMake/CXXModules/examples/partitions/importable.cxx9
-rw-r--r--Tests/RunCMake/CXXModules/examples/partitions/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/partitions/partition.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/public-req-private-build-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/examples/public-req-private-build-stdout.txt1
-rw-r--r--Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/public-req-private/CMakeLists.txt22
-rw-r--r--Tests/RunCMake/CXXModules/examples/public-req-private/priv.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/public-req-private/pub.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/simple-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/examples/simple/CMakeLists.txt18
-rw-r--r--Tests/RunCMake/CXXModules/examples/simple/importable.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/simple/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/expect/NinjaDependInfoBMIInstall-private.json45
-rw-r--r--Tests/RunCMake/CXXModules/expect/NinjaDependInfoBMIInstall-public.json45
-rw-r--r--Tests/RunCMake/CXXModules/expect/NinjaDependInfoExport-private.json73
-rw-r--r--Tests/RunCMake/CXXModules/expect/NinjaDependInfoExport-public.json73
-rw-r--r--Tests/RunCMake/CXXModules/expect/NinjaDependInfoFileSet-private.json40
-rw-r--r--Tests/RunCMake/CXXModules/expect/NinjaDependInfoFileSet-public.json40
-rw-r--r--Tests/RunCMake/CXXModules/sources/c-anchor.c4
-rw-r--r--Tests/RunCMake/CXXModules/sources/cxx-anchor.cxx4
-rw-r--r--Tests/RunCMake/CXXModules/sources/module-header.h9
-rw-r--r--Tests/RunCMake/CXXModules/sources/module-impl.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx11
-rw-r--r--Tests/RunCMake/CXXModules/sources/module-internal-part.cxx3
-rw-r--r--Tests/RunCMake/CXXModules/sources/module-part-impl.cxx13
-rw-r--r--Tests/RunCMake/CXXModules/sources/module-part.cxx3
-rw-r--r--Tests/RunCMake/CXXModules/sources/module-use.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/sources/module.cxx5
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake38
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake27
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake33
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCUDA.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCXX.cmake26
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagFortran.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagHIP.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckHIPCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagISPC.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckISPCCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagOBJC.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagOBJCXX.cmake (renamed from Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/CheckIPOSupported/default-lang-none-stderr.txt4
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagC.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckCLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagCUDA.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckCUDALinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagCXX.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckCXXLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagFortran.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckFortranLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagHIP.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckHIPLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagOBJC.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckOBJCLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlagOBJCXX.cmake (renamed from Tests/RunCMake/CheckLinkerFlag/CheckOBJCXXLinkerFlag.cmake)0
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake6
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake10
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake9
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake9
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesC.cmake15
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCUDA.cmake (renamed from Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCXX.cmake28
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesFortran.cmake (renamed from Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesHIP.cmake (renamed from Tests/RunCMake/CheckSourceCompiles/CheckHIPSourceCompiles.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesISPC.cmake (renamed from Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJC.cmake16
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJCXX.cmake19
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake10
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake10
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake9
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake9
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsC.cmake15
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCUDA.cmake (renamed from Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCXX.cmake22
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsFortran.cmake (renamed from Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsHIP.cmake (renamed from Tests/RunCMake/CheckSourceRuns/CheckHIPSourceRuns.cmake)0
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJC.cmake16
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJCXX.cmake19
-rw-r--r--Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/ClangTidy/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/ClangTidy/compdb.cmake7
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON-stderr.txt5
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS11-WARN-OFF.cmake0
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON-stderr.txt5
-rw-r--r--Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON.cmake0
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_env-equal.cmake15
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-bad-operation-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-bad-operation-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-cmake_list-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-path_list-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-reset-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-reset-to-unset-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-set-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-string-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-unset-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-with-double-dash-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-without-double-dash-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_env_modify-without-double-dash-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/P_working-dir.cmake7
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake70
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/debug-trycompile-stderr.txt11
-rw-r--r--Tests/RunCMake/CommandLine/debug-trycompile.cmake5
-rw-r--r--Tests/RunCMake/CommandLine/trycompile-clean.cmake8
-rw-r--r--Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/C-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerTest/C.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CompilerTest/CUDA-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerTest/CUDA.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/CXX-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerTest/CXX.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/Fortran-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerTest/Fortran.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/HIP-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerTest/HIP.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/ISPC-stdout.txt3
-rw-r--r--Tests/RunCMake/CompilerTest/ISPC.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/OBJC-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerTest/OBJC.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/OBJCXX-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerTest/OBJCXX.cmake3
-rw-r--r--Tests/RunCMake/CompilerTest/RunCMakeTest.cmake25
-rw-r--r--Tests/RunCMake/Configure/CopyFileABI-override.cmake (renamed from Tests/RunCMake/Configure/FailCopyFileABI-override.cmake)3
-rw-r--r--Tests/RunCMake/Configure/CopyFileABI-stdout.txt (renamed from Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt)2
-rw-r--r--Tests/RunCMake/Configure/CopyFileABI.cmake (renamed from Tests/RunCMake/Configure/FailCopyFileABI.cmake)2
-rw-r--r--Tests/RunCMake/Configure/FailCopyFileABI-check.cmake14
-rw-r--r--Tests/RunCMake/Configure/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ExternalProject/BUILD_ALWAYS-build1-stdout.txt6
-rw-r--r--Tests/RunCMake/ExternalProject/BUILD_ALWAYS-build2-stdout.txt2
-rw-r--r--Tests/RunCMake/ExternalProject/BUILD_ALWAYS.cmake20
-rw-r--r--Tests/RunCMake/ExternalProject/RunCMakeTest.cmake22
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/FPHSA/empty_version-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/empty_version-stderr.txt9
-rw-r--r--Tests/RunCMake/FPHSA/empty_version.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1_no_version_var-stdout.txt1
-rw-r--r--Tests/RunCMake/FPHSA/exact_1_no_version_var.cmake1
-rw-r--r--Tests/RunCMake/FetchContent/IncludesNonSystem/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/FetchContent/IncludesNonSystem/bar.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesNonSystem/foo.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/CMakeLists.txt20
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/SubSub1/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/SubSub1/bar.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/SubSub1/foo.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/SubSub1/zot.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/SubSub2/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/SubSub2/bar.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/SubSub2/foo.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/SubSub2/zot.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/bar.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/foo.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/IncludesSystem/zot.cpp0
-rw-r--r--Tests/RunCMake/FetchContent/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/FetchContent/System.cmake37
-rw-r--r--Tests/RunCMake/FileAPI/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateful-check.py6
-rw-r--r--Tests/RunCMake/FileAPI/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py12
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/interface.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/subdir.json11
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json32
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json6
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json150
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json6
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2.cmake3
-rw-r--r--Tests/RunCMake/FileAPI/subdir/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/FileAPI/subdir/empty.c0
-rw-r--r--Tests/RunCMake/File_Archive/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/File_Archive/create-missing-args-result.txt1
-rw-r--r--Tests/RunCMake/File_Archive/create-missing-args-stderr.txt19
-rw-r--r--Tests/RunCMake/File_Archive/create-missing-args.cmake8
-rw-r--r--Tests/RunCMake/File_Archive/extract-missing-args-result.txt1
-rw-r--r--Tests/RunCMake/File_Archive/extract-missing-args-stderr.txt11
-rw-r--r--Tests/RunCMake/File_Archive/extract-missing-args.cmake5
-rw-r--r--Tests/RunCMake/File_Configure/BadArgContent-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Configure/BadArgOutput-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Configure/NoArgContent-result.txt1
-rw-r--r--Tests/RunCMake/File_Configure/NoArgContent-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Configure/NoArgContent.cmake1
-rw-r--r--Tests/RunCMake/File_Configure/NoArgOutput-result.txt1
-rw-r--r--Tests/RunCMake/File_Configure/NoArgOutput-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Configure/NoArgOutput.cmake1
-rw-r--r--Tests/RunCMake/File_Configure/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Generate/InputAndContent-check.cmake8
-rw-r--r--Tests/RunCMake/File_Generate/InputAndContent-input.txt1
-rw-r--r--Tests/RunCMake/File_Generate/InputAndContent.cmake10
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-NoArg-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Generate/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake25
-rw-r--r--Tests/RunCMake/Framework/FrameworkConsumption.cmake18
-rw-r--r--Tests/RunCMake/Framework/main2.c9
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-NEW-result.txt1
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-NEW-stderr.txt5
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-NEW.cmake2
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-NoEffect.cmake4
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-OLD.cmake2
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-WARN.cmake2
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-common.cmake31
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/MSVCDebugInformationFormat/empty.cxx0
-rw-r--r--Tests/RunCMake/Ninja/QtAutoMocSkipPch.cmake17
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake25
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-54936-check.cmake3
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-54936-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-54936.cmake2
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-65001-check.cmake3
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-65001-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-65001.cmake2
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-check.cmake17
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes-cmake.cmake7
-rw-r--r--Tests/RunCMake/Ninja/ShowIncludes.cmake22
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake28
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CompileCommands.cmake3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake1
-rw-r--r--Tests/RunCMake/PrecompileHeaders/DisabledPch.cmake3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchDebugGenex.cmake3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchIncludedAllLanguages.cmake4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchIncludedOneLanguage.cmake4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchInterface.cmake3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchLibObjLibExe.cmake3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue.cmake5
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-NEW-empty.cmake4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-NEW.cmake2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-OLD.cmake2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFrom-common.cmake (renamed from Tests/RunCMake/PrecompileHeaders/PchReuseFrom.cmake)3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFromObjLib.cmake5
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFromPrefixed.cmake3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/PrecompileHeaders/SkipPrecompileHeaders.cmake5
-rw-r--r--Tests/RunCMake/RunCMake.cmake11
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/VS10Project/DebugInformationFormat-check.cmake46
-rw-r--r--Tests/RunCMake/VS10Project/DebugInformationFormat.cmake24
-rw-r--r--Tests/RunCMake/VS10Project/InterfaceLibSources-check.cmake9
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets-check.cmake2
-rw-r--r--Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VsDotnetSdk/VsDotnetSdk.cmake10
-rw-r--r--Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines-check.cmake64
-rw-r--r--Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake19
-rw-r--r--Tests/RunCMake/XcodeProject/Clean-build-check.cmake5
-rw-r--r--Tests/RunCMake/XcodeProject/Clean-clean-check.cmake5
-rw-r--r--Tests/RunCMake/XcodeProject/Clean.cmake2
-rw-r--r--Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/XcodeProject/Clean/empty.c0
-rw-r--r--Tests/RunCMake/XcodeProject/EffectivePlatformNameOFF.cmake12
-rw-r--r--Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase.cmake62
-rw-r--r--Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_BUILT_ONLY-check.cmake9
-rw-r--r--Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_KNOWN_LOCATION-check.cmake9
-rw-r--r--Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_NONE-check.cmake2
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake27
-rw-r--r--Tests/RunCMake/XcodeProject/SearchPaths-check.cmake14
-rw-r--r--Tests/RunCMake/XcodeProject/SearchPaths.cmake10
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake4
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake4
-rw-r--r--Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/add_subdirectory/System.cmake22
-rw-r--r--Tests/RunCMake/add_subdirectory/System/CMakeLists.txt11
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub1/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub1/bar.cpp0
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub1/foo.cpp0
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub1/zot.cpp0
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub2/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub2/bar.cpp0
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub2/foo.cpp0
-rw-r--r--Tests/RunCMake/add_subdirectory/System/SubSub2/zot.cpp0
-rw-r--r--Tests/RunCMake/add_subdirectory/System/bar.cpp0
-rw-r--r--Tests/RunCMake/add_subdirectory/System/foo.cpp0
-rw-r--r--Tests/RunCMake/add_subdirectory/System/zot.cpp0
-rw-r--r--Tests/RunCMake/block/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/block/EndAlone-result.txt1
-rw-r--r--Tests/RunCMake/block/EndAlone-stderr.txt4
-rw-r--r--Tests/RunCMake/block/EndAlone.cmake1
-rw-r--r--Tests/RunCMake/block/EndAloneWithArgument-result.txt1
-rw-r--r--Tests/RunCMake/block/EndAloneWithArgument-stderr.txt4
-rw-r--r--Tests/RunCMake/block/EndAloneWithArgument.cmake1
-rw-r--r--Tests/RunCMake/block/EndMissing-result.txt1
-rw-r--r--Tests/RunCMake/block/EndMissing-stderr.txt4
-rw-r--r--Tests/RunCMake/block/EndMissing.cmake1
-rw-r--r--Tests/RunCMake/block/EndWithArgument-stderr.txt9
-rw-r--r--Tests/RunCMake/block/EndWithArgument.cmake2
-rw-r--r--Tests/RunCMake/block/InvalidArgument-result.txt1
-rw-r--r--Tests/RunCMake/block/InvalidArgument-stderr.txt4
-rw-r--r--Tests/RunCMake/block/InvalidArgument.cmake2
-rw-r--r--Tests/RunCMake/block/InvalidNesting1-result.txt1
-rw-r--r--Tests/RunCMake/block/InvalidNesting1-stderr.txt4
-rw-r--r--Tests/RunCMake/block/InvalidNesting1.cmake6
-rw-r--r--Tests/RunCMake/block/InvalidNesting2-result.txt1
-rw-r--r--Tests/RunCMake/block/InvalidNesting2-stderr.txt4
-rw-r--r--Tests/RunCMake/block/InvalidNesting2.cmake6
-rw-r--r--Tests/RunCMake/block/InvalidNesting3-result.txt1
-rw-r--r--Tests/RunCMake/block/InvalidNesting3-stderr.txt4
-rw-r--r--Tests/RunCMake/block/InvalidNesting3.cmake5
-rw-r--r--Tests/RunCMake/block/InvalidNesting4-result.txt1
-rw-r--r--Tests/RunCMake/block/InvalidNesting4-stderr.txt4
-rw-r--r--Tests/RunCMake/block/InvalidNesting4.cmake5
-rw-r--r--Tests/RunCMake/block/InvalidNesting5-result.txt1
-rw-r--r--Tests/RunCMake/block/InvalidNesting5-stderr.txt4
-rw-r--r--Tests/RunCMake/block/InvalidNesting5.cmake5
-rw-r--r--Tests/RunCMake/block/InvalidNesting6-result.txt1
-rw-r--r--Tests/RunCMake/block/InvalidNesting6-stderr.txt4
-rw-r--r--Tests/RunCMake/block/InvalidNesting6.cmake5
-rw-r--r--Tests/RunCMake/block/MissingArgument-result.txt1
-rw-r--r--Tests/RunCMake/block/MissingArgument-stderr.txt7
-rw-r--r--Tests/RunCMake/block/MissingArgument.cmake2
-rw-r--r--Tests/RunCMake/block/RunCMakeTest.cmake22
-rw-r--r--Tests/RunCMake/block/Scope-POLICIES.cmake40
-rw-r--r--Tests/RunCMake/block/Scope-VARIABLES.cmake62
-rw-r--r--Tests/RunCMake/block/Scope.cmake62
-rw-r--r--Tests/RunCMake/block/Scope/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/block/Workflows.cmake78
-rw-r--r--Tests/RunCMake/block/WrongArgument-result.txt1
-rw-r--r--Tests/RunCMake/block/WrongArgument-stderr.txt4
-rw-r--r--Tests/RunCMake/block/WrongArgument.cmake2
-rw-r--r--Tests/RunCMake/block/WrongScope-result.txt1
-rw-r--r--Tests/RunCMake/block/WrongScope-stderr.txt4
-rw-r--r--Tests/RunCMake/block/WrongScope.cmake2
-rw-r--r--Tests/RunCMake/cmake_host_system_information/Registry_BadQuery2-stderr.txt6
-rw-r--r--Tests/RunCMake/cmake_host_system_information/Registry_BadView1-stderr.txt6
-rw-r--r--Tests/RunCMake/cmake_language/RunCMakeTest.cmake60
-rw-r--r--Tests/RunCMake/cmake_language/get_message_log_level.cmake5
-rw-r--r--Tests/RunCMake/cmake_language/get_message_log_level_cache-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_language/get_message_log_level_cli-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_language/get_message_log_level_cli_and_cache-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_language/get_message_log_level_cli_and_var-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_language/get_message_log_level_none-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_language/get_message_log_level_var-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_language/get_message_log_level_var_and_cache-stdout.txt1
-rw-r--r--Tests/RunCMake/cmake_path/BASE_DIRECTORY-no-arg-stderr.txt4
-rw-r--r--Tests/RunCMake/cmake_path/OUTPUT_VARIABLE-empty-stderr.txt4
-rw-r--r--Tests/RunCMake/cmake_path/OUTPUT_VARIABLE-no-arg-stderr.txt4
-rw-r--r--Tests/RunCMake/cmake_path/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-prop-result.txt1
-rw-r--r--Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-prop-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-prop.cmake9
-rw-r--r--Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-system-result.txt1
-rw-r--r--Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-system-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-system.cmake9
-rw-r--r--Tests/RunCMake/ctest_environment/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake9
-rw-r--r--Tests/RunCMake/execute_process/EchoCommand3-stderr.txt4
-rw-r--r--Tests/RunCMake/execute_process/EncodingMissing-stderr.txt5
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-all-perms-stderr.txt5
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-all-perms.cmake6
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-invalid-path-stderr.txt6
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-invalid-path.cmake4
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-invalid-perms-stderr.txt4
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-invalid-perms.cmake5
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-no-keyword-stderr.txt4
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-no-keyword.cmake5
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-no-perms-stderr.txt4
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-no-perms.cmake5
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-ok.cmake5
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-override.cmake6
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-write-only-stderr.txt6
-rw-r--r--Tests/RunCMake/file-CHMOD/CHMOD-write-only.cmake6
-rw-r--r--Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake18
-rw-r--r--Tests/RunCMake/file-CHMOD/all-perms-result.txt1
-rw-r--r--Tests/RunCMake/file-CHMOD/all-perms-stderr.txt4
-rw-r--r--Tests/RunCMake/file-CHMOD/all-perms.cmake3
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-path-result.txt1
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt6
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-path.cmake1
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-perms-result.txt1
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt3
-rw-r--r--Tests/RunCMake/file-CHMOD/invalid-perms.cmake2
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-dir-perms-result.txt1
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-dir-perms-stderr.txt5
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-dir-perms.cmake2
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-file-perms-result.txt1
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-file-perms-stderr.txt5
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-file-perms.cmake2
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-perms-result.txt1
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-perms-stderr.txt5
-rw-r--r--Tests/RunCMake/file-CHMOD/missing-perms.cmake2
-rw-r--r--Tests/RunCMake/file-CHMOD/no-perms-result.txt1
-rw-r--r--Tests/RunCMake/file-CHMOD/no-perms-stderr.txt3
-rw-r--r--Tests/RunCMake/file-CHMOD/no-perms.cmake2
-rw-r--r--Tests/RunCMake/file-CHMOD/ok.cmake2
-rw-r--r--Tests/RunCMake/file-CHMOD/override.cmake3
-rw-r--r--Tests/RunCMake/file-CHMOD/write-only-result.txt1
-rw-r--r--Tests/RunCMake/file-CHMOD/write-only-stderr.txt6
-rw-r--r--Tests/RunCMake/file-CHMOD/write-only.cmake3
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt20
-rw-r--r--Tests/RunCMake/file/REAL_PATH-no-base-dir-stderr.txt9
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/file/TIMESTAMP-stdout.txt1
-rw-r--r--Tests/RunCMake/file/TIMESTAMP.cmake2
-rw-r--r--Tests/RunCMake/find_file/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-no-function-result.txt1
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-no-function-stderr.txt4
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-no-function.cmake2
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-specify-macro-result.txt1
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-specify-macro-stderr.txt4
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-specify-macro.cmake5
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-stderr.txt3
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-stdout.txt3
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-undefined-function-result.txt1
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-undefined-function-stderr.txt4
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR-undefined-function.cmake2
-rw-r--r--Tests/RunCMake/find_file/VALIDATOR.cmake39
-rw-r--r--Tests/RunCMake/find_library/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-no-function-result.txt1
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-no-function-stderr.txt4
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-no-function.cmake2
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-specify-macro-result.txt1
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-specify-macro-stderr.txt4
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-specify-macro.cmake5
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-stderr.txt3
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-stdout.txt3
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-undefined-function-result.txt1
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-undefined-function-stderr.txt4
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR-undefined-function.cmake2
-rw-r--r--Tests/RunCMake/find_library/VALIDATOR.cmake41
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/find_package/SearchPaths.cmake2
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_cmake/cmake/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_lib_cmake_pkg/lib/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_lib_pkg/lib/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_lib_pkg_cmake/lib/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake_pkg/SearchPaths-1.2.3/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg_lib_cmake_pkg/SearchPaths-1.2.3/lib/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg_lib_pkg/SearchPaths-1.2.3/lib/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg_lib_pkg_cmake/SearchPaths-1.2.3/lib/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg_share_cmake_pkg/SearchPaths-1.2.3/share/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg_share_pkg/SearchPaths-1.2.3/share/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_pkg_share_pkg_cmake/SearchPaths-1.2.3/share/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_share_cmake_pkg/share/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_share_pkg/share/SearchPaths-1.2.3/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths/prefix_share_pkg_cmake/share/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix-stderr.txt10
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_cmake-stderr.txt12
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_cmake.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_lib_cmake_pkg-stderr.txt12
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_lib_cmake_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_lib_pkg-stderr.txt12
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_lib_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_lib_pkg_cmake-stderr.txt12
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_lib_pkg_cmake.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg-stderr.txt12
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake-stderr.txt14
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake_pkg-stderr.txt14
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_cmake_pkg-stderr.txt14
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_cmake_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_pkg-stderr.txt14
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_pkg_cmake-stderr.txt14
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_pkg_cmake.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_cmake_pkg-stderr.txt14
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_cmake_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_pkg-stderr.txt14
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_pkg_cmake-stderr.txt14
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_pkg_cmake.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_share_cmake_pkg-stderr.txt12
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_share_cmake_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_share_pkg-stderr.txt12
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_share_pkg.cmake1
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_share_pkg_cmake-stderr.txt12
-rw-r--r--Tests/RunCMake/find_package/SearchPaths_prefix_share_pkg_cmake.cmake1
-rw-r--r--Tests/RunCMake/find_path/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-no-function-result.txt1
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-no-function-stderr.txt4
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-no-function.cmake2
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-specify-macro-result.txt1
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-specify-macro-stderr.txt4
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-specify-macro.cmake5
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-stderr.txt3
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-stdout.txt3
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-undefined-function-result.txt1
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-undefined-function-stderr.txt4
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR-undefined-function.cmake2
-rw-r--r--Tests/RunCMake/find_path/VALIDATOR.cmake39
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-no-function-result.txt1
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-no-function-stderr.txt4
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-no-function.cmake2
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-specify-macro-result.txt1
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-specify-macro-stderr.txt4
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-specify-macro.cmake5
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-stderr.txt3
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-stdout.txt3
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-undefined-function-result.txt1
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-undefined-function-stderr.txt4
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR-undefined-function.cmake2
-rw-r--r--Tests/RunCMake/find_program/VALIDATOR.cmake39
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt1
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt12
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt12
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake11
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/project/LanguagesDuplicate-check.cmake10
-rw-r--r--Tests/RunCMake/project/LanguagesDuplicate.cmake11
-rw-r--r--Tests/RunCMake/project/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/pseudo_tidy.c10
-rw-r--r--Tests/RunCMake/return/CMP0140-NEW.cmake13
-rw-r--r--Tests/RunCMake/return/CMP0140-OLD.cmake8
-rw-r--r--Tests/RunCMake/return/CMP0140-WARN-result.txt1
-rw-r--r--Tests/RunCMake/return/CMP0140-WARN-stderr.txt12
-rw-r--r--Tests/RunCMake/return/CMP0140-WARN.cmake8
-rw-r--r--Tests/RunCMake/return/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/return/PropagateFromDirectory.cmake10
-rw-r--r--Tests/RunCMake/return/PropagateFromFunction.cmake142
-rw-r--r--Tests/RunCMake/return/PropagateNothing.cmake2
-rw-r--r--Tests/RunCMake/return/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/return/WrongArgument-result.txt1
-rw-r--r--Tests/RunCMake/return/WrongArgument-stderr.txt4
-rw-r--r--Tests/RunCMake/return/WrongArgument.cmake2
-rw-r--r--Tests/RunCMake/return/subdir/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/showIncludes.c33
-rw-r--r--Tests/RunCMake/string/JSON.cmake6
-rw-r--r--Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-stderr.txt10
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/apple_framework.cmake30
-rw-r--r--Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-result.txt1
-rw-r--r--Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-stderr.txt12
-rw-r--r--Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake6
-rw-r--r--Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-result.txt1
-rw-r--r--Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-stderr.txt12
-rw-r--r--Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake6
-rw-r--r--Tests/RunCMake/target_sources/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/BadLinkLibraries.cmake6
-rw-r--r--Tests/RunCMake/try_compile/BadSources1-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/BadSources1.cmake4
-rw-r--r--Tests/RunCMake/try_compile/BadSources2-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/BadSources2.cmake7
-rw-r--r--Tests/RunCMake/try_compile/BinDirEmpty-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/BinDirEmpty-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/BinDirEmpty.cmake1
-rw-r--r--Tests/RunCMake/try_compile/BinDirRelative-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/BinDirRelative-stderr.txt6
-rw-r--r--Tests/RunCMake/try_compile/BinDirRelative.cmake1
-rw-r--r--Tests/RunCMake/try_compile/BuildType.cmake8
-rw-r--r--Tests/RunCMake/try_compile/BuildTypeAsFlag.cmake9
-rw-r--r--Tests/RunCMake/try_compile/CStandard-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/CStandard.cmake8
-rw-r--r--Tests/RunCMake/try_compile/CStandardGNU.cmake15
-rw-r--r--Tests/RunCMake/try_compile/CStandardNoDefault.cmake8
-rw-r--r--Tests/RunCMake/try_compile/CopyFileConfig.cmake8
-rw-r--r--Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile.cmake4
-rw-r--r--Tests/RunCMake/try_compile/CudaStandard-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/CudaStandard.cmake8
-rw-r--r--Tests/RunCMake/try_compile/CxxStandard-stderr.txt15
-rw-r--r--Tests/RunCMake/try_compile/CxxStandard.cmake8
-rw-r--r--Tests/RunCMake/try_compile/CxxStandardGNU.cmake15
-rw-r--r--Tests/RunCMake/try_compile/CxxStandardNoDefault.cmake8
-rw-r--r--Tests/RunCMake/try_compile/EmptyListArgs.cmake11
-rw-r--r--Tests/RunCMake/try_compile/EmptyValueArgs-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt9
-rw-r--r--Tests/RunCMake/try_compile/EmptyValueArgs.cmake7
-rw-r--r--Tests/RunCMake/try_compile/EnvConfig.cmake6
-rw-r--r--Tests/RunCMake/try_compile/ISPCDuplicateTarget.cmake12
-rw-r--r--Tests/RunCMake/try_compile/ISPCDuplicateTargetNinja.cmake13
-rw-r--r--Tests/RunCMake/try_compile/ISPCInvalidTarget.cmake9
-rw-r--r--Tests/RunCMake/try_compile/ISPCTargets.cmake9
-rw-r--r--Tests/RunCMake/try_compile/NoArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/NoCStandard-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/NoCStandard-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/NoCStandard.cmake4
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFile-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFile.cmake4
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFile2.cmake4
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFileError-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFileError.cmake4
-rw-r--r--Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/NoOutputVariable.cmake4
-rw-r--r--Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/NoOutputVariable2.cmake4
-rw-r--r--Tests/RunCMake/try_compile/NoSources-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/ObjCStandard-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/ObjCStandard.cmake8
-rw-r--r--Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/ObjCxxStandard.cmake8
-rw-r--r--Tests/RunCMake/try_compile/OldProjectBinDirEmpty-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/OldProjectBinDirEmpty-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/OldProjectBinDirEmpty.cmake1
-rw-r--r--Tests/RunCMake/try_compile/OldProjectSrcDirEmpty-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/OldProjectSrcDirEmpty-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/OldProjectSrcDirEmpty.cmake1
-rw-r--r--Tests/RunCMake/try_compile/OneArg-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/OutputDirAsFlag.cmake9
-rw-r--r--Tests/RunCMake/try_compile/PlatformVariables-stderr.txt11
-rw-r--r--Tests/RunCMake/try_compile/ProjectBinDirEmpty-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/ProjectBinDirEmpty-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/ProjectBinDirEmpty.cmake4
-rw-r--r--Tests/RunCMake/try_compile/ProjectCopyFile-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/ProjectCopyFile-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/ProjectCopyFile.cmake4
-rw-r--r--Tests/RunCMake/try_compile/ProjectSrcDirEmpty-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/ProjectSrcDirEmpty-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/ProjectSrcDirEmpty.cmake1
-rw-r--r--Tests/RunCMake/try_compile/ProjectSrcDirMissing-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/ProjectSrcDirMissing-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/ProjectSrcDirMissing.cmake1
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake72
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadFile-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadFile.cmake1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadName-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadName-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/SourceFromBadName.cmake1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromOneArg-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromOneArg-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/SourceFromOneArg.cmake1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromThreeArgs-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/SourceFromThreeArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/SourceFromThreeArgs.cmake1
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeExe.cmake10
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeInvalid-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeInvalid.cmake6
-rw-r--r--Tests/RunCMake/try_compile/TargetTypeStatic.cmake10
-rw-r--r--Tests/RunCMake/try_compile/TryRunArgs-stderr.txt18
-rw-r--r--Tests/RunCMake/try_compile/TryRunArgs.cmake14
-rw-r--r--Tests/RunCMake/try_compile/TwoArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/WarnDeprecated-stderr.txt11
-rw-r--r--Tests/RunCMake/try_compile/new_signature.cmake2
-rw-r--r--Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake67
-rw-r--r--Tests/RunCMake/try_compile/old_signature.cmake2
-rw-r--r--Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt2
-rw-r--r--Tests/RunCMake/try_run/BadLinkLibraries.cmake7
-rw-r--r--Tests/RunCMake/try_run/BinDirEmpty-result.txt1
-rw-r--r--Tests/RunCMake/try_run/BinDirEmpty-stderr.txt4
-rw-r--r--Tests/RunCMake/try_run/BinDirEmpty.cmake1
-rw-r--r--Tests/RunCMake/try_run/BinDirRelative-result.txt1
-rw-r--r--Tests/RunCMake/try_run/BinDirRelative-stderr.txt6
-rw-r--r--Tests/RunCMake/try_run/BinDirRelative.cmake1
-rw-r--r--Tests/RunCMake/try_run/NoCompileOutputVariable-result.txt1
-rw-r--r--Tests/RunCMake/try_run/NoCompileOutputVariable-stderr.txt7
-rw-r--r--Tests/RunCMake/try_run/NoCompileOutputVariable.cmake6
-rw-r--r--Tests/RunCMake/try_run/NoOutputCompileVariable-result.txt1
-rw-r--r--Tests/RunCMake/try_run/NoOutputVariable-result.txt1
-rw-r--r--Tests/RunCMake/try_run/NoOutputVariable-stderr.txt7
-rw-r--r--Tests/RunCMake/try_run/NoOutputVariable.cmake4
-rw-r--r--Tests/RunCMake/try_run/NoRunOutputVariable-result.txt1
-rw-r--r--Tests/RunCMake/try_run/NoRunOutputVariable-stderr.txt7
-rw-r--r--Tests/RunCMake/try_run/NoRunOutputVariable.cmake6
-rw-r--r--Tests/RunCMake/try_run/NoRunStdErrVariable-result.txt1
-rw-r--r--Tests/RunCMake/try_run/NoRunStdErrVariable-stderr.txt7
-rw-r--r--Tests/RunCMake/try_run/NoRunStdErrVariable.cmake7
-rw-r--r--Tests/RunCMake/try_run/NoRunStdOutVariable-result.txt1
-rw-r--r--Tests/RunCMake/try_run/NoRunStdOutVariable-stderr.txt7
-rw-r--r--Tests/RunCMake/try_run/NoRunStdOutVariable.cmake7
-rw-r--r--Tests/RunCMake/try_run/NoWorkingDirectory-result.txt1
-rw-r--r--Tests/RunCMake/try_run/NoWorkingDirectory-stderr.txt7
-rw-r--r--Tests/RunCMake/try_run/NoWorkingDirectory.cmake6
-rw-r--r--Tests/RunCMake/try_run/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/try_run/WorkingDirArg.cmake8
-rw-r--r--Tests/RunCMake/try_run/new_signature.cmake2
-rw-r--r--Tests/RunCMake/try_run/old_and_new_signature_tests.cmake20
-rw-r--r--Tests/RunCMake/try_run/old_signature.cmake2
-rw-r--r--Tests/SwiftMix/CMain.c13
-rw-r--r--Tests/SwiftMix/CMakeLists.txt1
-rw-r--r--Tests/SwiftMix/SwiftMain.swift20
-rw-r--r--Tests/SwiftMixLib/CMakeLists.txt6
-rw-r--r--Tests/SwiftMixLib/lib.c4
-rw-r--r--Tests/SwiftMixLib/lib.cpp4
-rw-r--r--Tests/SwiftMixLib/lib.swift3
-rw-r--r--Tests/SwiftMixLib/main.swift3
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt4
-rw-r--r--Tests/SwiftOnly/SubA/CMakeLists.txt2
-rw-r--r--Tests/SwiftOnly/SubA/SubA.swift0
-rw-r--r--Tests/SwiftOnly/SubB/CMakeLists.txt2
-rw-r--r--Tests/SwiftOnly/SubB/SubB.swift1
-rw-r--r--Tests/SwiftOnly/main.swift6
-rw-r--r--Tests/TryCompile/CMakeLists.txt457
-rw-r--r--Tests/TryCompile/exit_with_error.c2
-rw-r--r--Tests/TryCompile/old_and_new_signature_tests.cmake276
-rw-r--r--Tests/TryCompile/stdout_and_stderr.c8
-rw-r--r--Tests/VSGNUFortran/CMakeLists.txt2
-rw-r--r--Tests/VSWinStorePhone/VerifyAppPackage.cmake2
-rw-r--r--Utilities/Doxygen/CMakeLists.txt2
-rw-r--r--Utilities/IWYU/mapping.imp2
-rw-r--r--Utilities/Release/WiX/CustomAction/CMakeLists.txt4
-rw-r--r--Utilities/Release/linux/aarch64/Dockerfile2
-rw-r--r--Utilities/Release/linux/x86_64/Dockerfile2
-rwxr-xr-xUtilities/Scripts/update-curl.bash2
-rwxr-xr-xUtilities/Scripts/update-libuv.bash2
-rw-r--r--Utilities/Sphinx/CMakeLists.txt18
-rw-r--r--Utilities/Sphinx/cmake.py18
-rw-r--r--Utilities/Sphinx/static/cmake.css11
-rw-r--r--Utilities/cmThirdPartyChecks.cmake8
-rw-r--r--Utilities/cmcurl/CMake/CMakeConfigurableFile.in4
-rw-r--r--Utilities/cmcurl/CMake/CurlSymbolHiding.cmake4
-rw-r--r--Utilities/cmcurl/CMake/CurlTests.c60
-rw-r--r--Utilities/cmcurl/CMake/FindBearSSL.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindBrotli.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindCARES.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindGSS.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindLibPSL.cmake45
-rw-r--r--Utilities/cmcurl/CMake/FindLibSSH2.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindMSH3.cmake2
-rw-r--r--Utilities/cmcurl/CMake/FindMbedTLS.cmake2
-rw-r--r--Utilities/cmcurl/CMake/FindNGHTTP2.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindNGHTTP3.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindNGTCP2.cmake6
-rw-r--r--Utilities/cmcurl/CMake/FindNSS.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindQUICHE.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindWolfSSL.cmake4
-rw-r--r--Utilities/cmcurl/CMake/FindZstd.cmake4
-rw-r--r--Utilities/cmcurl/CMake/Macros.cmake4
-rw-r--r--Utilities/cmcurl/CMake/OtherTests.cmake171
-rw-r--r--Utilities/cmcurl/CMake/Platforms/WindowsCache.cmake41
-rw-r--r--Utilities/cmcurl/CMake/Utilities.cmake4
-rw-r--r--Utilities/cmcurl/CMake/cmake_uninstall.cmake.in4
-rw-r--r--Utilities/cmcurl/CMake/curl-config.cmake.in4
-rw-r--r--Utilities/cmcurl/CMakeLists.txt328
-rw-r--r--Utilities/cmcurl/include/curl/curl.h77
-rw-r--r--Utilities/cmcurl/include/curl/curlver.h10
-rw-r--r--Utilities/cmcurl/include/curl/easy.h4
-rw-r--r--Utilities/cmcurl/include/curl/header.h10
-rw-r--r--Utilities/cmcurl/include/curl/mprintf.h4
-rw-r--r--Utilities/cmcurl/include/curl/multi.h7
-rw-r--r--Utilities/cmcurl/include/curl/options.h4
-rw-r--r--Utilities/cmcurl/include/curl/stdcheaders.h4
-rw-r--r--Utilities/cmcurl/include/curl/system.h2
-rw-r--r--Utilities/cmcurl/include/curl/typecheck-gcc.h17
-rw-r--r--Utilities/cmcurl/include/curl/urlapi.h4
-rw-r--r--Utilities/cmcurl/include/curl/websockets.h83
-rw-r--r--Utilities/cmcurl/lib/CMakeLists.txt30
-rw-r--r--Utilities/cmcurl/lib/Makefile.inc17
-rw-r--r--Utilities/cmcurl/lib/altsvc.c62
-rw-r--r--Utilities/cmcurl/lib/altsvc.h4
-rw-r--r--Utilities/cmcurl/lib/amigaos.c212
-rw-r--r--Utilities/cmcurl/lib/amigaos.h18
-rw-r--r--Utilities/cmcurl/lib/arpa_telnet.h4
-rw-r--r--Utilities/cmcurl/lib/asyn-ares.c49
-rw-r--r--Utilities/cmcurl/lib/asyn-thread.c21
-rw-r--r--Utilities/cmcurl/lib/asyn.h6
-rw-r--r--Utilities/cmcurl/lib/base64.c80
-rw-r--r--Utilities/cmcurl/lib/bufref.c4
-rw-r--r--Utilities/cmcurl/lib/bufref.h4
-rw-r--r--Utilities/cmcurl/lib/c-hyper.c69
-rw-r--r--Utilities/cmcurl/lib/c-hyper.h5
-rw-r--r--Utilities/cmcurl/lib/conncache.c4
-rw-r--r--Utilities/cmcurl/lib/conncache.h3
-rw-r--r--Utilities/cmcurl/lib/connect.c85
-rw-r--r--Utilities/cmcurl/lib/connect.h4
-rw-r--r--Utilities/cmcurl/lib/content_encoding.c85
-rw-r--r--Utilities/cmcurl/lib/content_encoding.h7
-rw-r--r--Utilities/cmcurl/lib/cookie.c204
-rw-r--r--Utilities/cmcurl/lib/cookie.h25
-rw-r--r--Utilities/cmcurl/lib/curl_addrinfo.c6
-rw-r--r--Utilities/cmcurl/lib/curl_addrinfo.h4
-rw-r--r--Utilities/cmcurl/lib/curl_base64.h2
-rw-r--r--Utilities/cmcurl/lib/curl_config.h.cmake260
-rw-r--r--Utilities/cmcurl/lib/curl_ctype.c130
-rw-r--r--Utilities/cmcurl/lib/curl_ctype.h42
-rw-r--r--Utilities/cmcurl/lib/curl_des.c4
-rw-r--r--Utilities/cmcurl/lib/curl_des.h2
-rw-r--r--Utilities/cmcurl/lib/curl_endian.c4
-rw-r--r--Utilities/cmcurl/lib/curl_endian.h4
-rw-r--r--Utilities/cmcurl/lib/curl_fnmatch.c4
-rw-r--r--Utilities/cmcurl/lib/curl_fnmatch.h4
-rw-r--r--Utilities/cmcurl/lib/curl_get_line.c10
-rw-r--r--Utilities/cmcurl/lib/curl_get_line.h4
-rw-r--r--Utilities/cmcurl/lib/curl_gethostname.c4
-rw-r--r--Utilities/cmcurl/lib/curl_gethostname.h4
-rw-r--r--Utilities/cmcurl/lib/curl_gssapi.c14
-rw-r--r--Utilities/cmcurl/lib/curl_gssapi.h4
-rw-r--r--Utilities/cmcurl/lib/curl_hmac.h6
-rw-r--r--Utilities/cmcurl/lib/curl_krb5.h4
-rw-r--r--Utilities/cmcurl/lib/curl_ldap.h4
-rw-r--r--Utilities/cmcurl/lib/curl_md4.h4
-rw-r--r--Utilities/cmcurl/lib/curl_md5.h4
-rw-r--r--Utilities/cmcurl/lib/curl_memory.h4
-rw-r--r--Utilities/cmcurl/lib/curl_memrchr.c4
-rw-r--r--Utilities/cmcurl/lib/curl_memrchr.h4
-rw-r--r--Utilities/cmcurl/lib/curl_multibyte.c2
-rw-r--r--Utilities/cmcurl/lib/curl_multibyte.h4
-rw-r--r--Utilities/cmcurl/lib/curl_ntlm_core.c17
-rw-r--r--Utilities/cmcurl/lib/curl_ntlm_core.h6
-rw-r--r--Utilities/cmcurl/lib/curl_ntlm_wb.c6
-rw-r--r--Utilities/cmcurl/lib/curl_ntlm_wb.h4
-rw-r--r--Utilities/cmcurl/lib/curl_path.c5
-rw-r--r--Utilities/cmcurl/lib/curl_path.h4
-rw-r--r--Utilities/cmcurl/lib/curl_printf.h4
-rw-r--r--Utilities/cmcurl/lib/curl_range.c6
-rw-r--r--Utilities/cmcurl/lib/curl_range.h4
-rw-r--r--Utilities/cmcurl/lib/curl_rtmp.c6
-rw-r--r--Utilities/cmcurl/lib/curl_rtmp.h4
-rw-r--r--Utilities/cmcurl/lib/curl_sasl.c2
-rw-r--r--Utilities/cmcurl/lib/curl_sasl.h2
-rw-r--r--Utilities/cmcurl/lib/curl_setup.h58
-rw-r--r--Utilities/cmcurl/lib/curl_setup_once.h79
-rw-r--r--Utilities/cmcurl/lib/curl_sha256.h3
-rw-r--r--Utilities/cmcurl/lib/curl_sspi.c4
-rw-r--r--Utilities/cmcurl/lib/curl_sspi.h4
-rw-r--r--Utilities/cmcurl/lib/curl_threads.c4
-rw-r--r--Utilities/cmcurl/lib/curl_threads.h4
-rw-r--r--Utilities/cmcurl/lib/curlx.h4
-rw-r--r--Utilities/cmcurl/lib/dict.c2
-rw-r--r--Utilities/cmcurl/lib/dict.h4
-rw-r--r--Utilities/cmcurl/lib/doh.c21
-rw-r--r--Utilities/cmcurl/lib/doh.h51
-rw-r--r--Utilities/cmcurl/lib/dotdot.c182
-rw-r--r--Utilities/cmcurl/lib/dynbuf.c21
-rw-r--r--Utilities/cmcurl/lib/dynbuf.h10
-rw-r--r--Utilities/cmcurl/lib/easy.c136
-rw-r--r--Utilities/cmcurl/lib/easy_lock.h105
-rw-r--r--Utilities/cmcurl/lib/easygetopt.c4
-rw-r--r--Utilities/cmcurl/lib/easyif.h7
-rw-r--r--Utilities/cmcurl/lib/easyoptions.c20
-rw-r--r--Utilities/cmcurl/lib/easyoptions.h4
-rw-r--r--Utilities/cmcurl/lib/escape.c8
-rw-r--r--Utilities/cmcurl/lib/escape.h2
-rw-r--r--Utilities/cmcurl/lib/file.c31
-rw-r--r--Utilities/cmcurl/lib/file.h4
-rw-r--r--Utilities/cmcurl/lib/fileinfo.c4
-rw-r--r--Utilities/cmcurl/lib/fileinfo.h4
-rw-r--r--Utilities/cmcurl/lib/fopen.c113
-rw-r--r--Utilities/cmcurl/lib/fopen.h (renamed from Utilities/cmcurl/lib/vssh/wolfssh.h)13
-rw-r--r--Utilities/cmcurl/lib/formdata.c8
-rw-r--r--Utilities/cmcurl/lib/formdata.h4
-rw-r--r--Utilities/cmcurl/lib/ftp.c42
-rw-r--r--Utilities/cmcurl/lib/ftp.h7
-rw-r--r--Utilities/cmcurl/lib/ftplistparser.c8
-rw-r--r--Utilities/cmcurl/lib/ftplistparser.h4
-rw-r--r--Utilities/cmcurl/lib/functypes.h115
-rw-r--r--Utilities/cmcurl/lib/getenv.c4
-rw-r--r--Utilities/cmcurl/lib/getinfo.c22
-rw-r--r--Utilities/cmcurl/lib/getinfo.h4
-rw-r--r--Utilities/cmcurl/lib/gopher.c2
-rw-r--r--Utilities/cmcurl/lib/gopher.h4
-rw-r--r--Utilities/cmcurl/lib/h2h3.c7
-rw-r--r--Utilities/cmcurl/lib/h2h3.h2
-rw-r--r--Utilities/cmcurl/lib/hash.c4
-rw-r--r--Utilities/cmcurl/lib/hash.h4
-rw-r--r--Utilities/cmcurl/lib/headers.c72
-rw-r--r--Utilities/cmcurl/lib/headers.h4
-rw-r--r--Utilities/cmcurl/lib/hmac.c2
-rw-r--r--Utilities/cmcurl/lib/hostasyn.c4
-rw-r--r--Utilities/cmcurl/lib/hostip.c75
-rw-r--r--Utilities/cmcurl/lib/hostip.h6
-rw-r--r--Utilities/cmcurl/lib/hostip4.c10
-rw-r--r--Utilities/cmcurl/lib/hostip6.c10
-rw-r--r--Utilities/cmcurl/lib/hostsyn.c4
-rw-r--r--Utilities/cmcurl/lib/hsts.c33
-rw-r--r--Utilities/cmcurl/lib/hsts.h4
-rw-r--r--Utilities/cmcurl/lib/http.c201
-rw-r--r--Utilities/cmcurl/lib/http.h27
-rw-r--r--Utilities/cmcurl/lib/http2.c67
-rw-r--r--Utilities/cmcurl/lib/http2.h4
-rw-r--r--Utilities/cmcurl/lib/http_aws_sigv4.c542
-rw-r--r--Utilities/cmcurl/lib/http_aws_sigv4.h4
-rw-r--r--Utilities/cmcurl/lib/http_chunks.c7
-rw-r--r--Utilities/cmcurl/lib/http_chunks.h4
-rw-r--r--Utilities/cmcurl/lib/http_digest.c8
-rw-r--r--Utilities/cmcurl/lib/http_digest.h4
-rw-r--r--Utilities/cmcurl/lib/http_negotiate.c4
-rw-r--r--Utilities/cmcurl/lib/http_negotiate.h4
-rw-r--r--Utilities/cmcurl/lib/http_ntlm.c4
-rw-r--r--Utilities/cmcurl/lib/http_ntlm.h4
-rw-r--r--Utilities/cmcurl/lib/http_proxy.c12
-rw-r--r--Utilities/cmcurl/lib/http_proxy.h2
-rw-r--r--Utilities/cmcurl/lib/idn_win32.c10
-rw-r--r--Utilities/cmcurl/lib/if2ip.c2
-rw-r--r--Utilities/cmcurl/lib/if2ip.h2
-rw-r--r--Utilities/cmcurl/lib/imap.c20
-rw-r--r--Utilities/cmcurl/lib/imap.h4
-rw-r--r--Utilities/cmcurl/lib/inet_ntop.c4
-rw-r--r--Utilities/cmcurl/lib/inet_ntop.h4
-rw-r--r--Utilities/cmcurl/lib/inet_pton.c4
-rw-r--r--Utilities/cmcurl/lib/inet_pton.h4
-rw-r--r--Utilities/cmcurl/lib/krb5.c20
-rw-r--r--Utilities/cmcurl/lib/ldap.c28
-rw-r--r--Utilities/cmcurl/lib/libcurl.rc4
-rw-r--r--Utilities/cmcurl/lib/llist.c4
-rw-r--r--Utilities/cmcurl/lib/llist.h4
-rw-r--r--Utilities/cmcurl/lib/md4.c15
-rw-r--r--Utilities/cmcurl/lib/md5.c4
-rw-r--r--Utilities/cmcurl/lib/memdebug.c25
-rw-r--r--Utilities/cmcurl/lib/memdebug.h49
-rw-r--r--Utilities/cmcurl/lib/mime.c11
-rw-r--r--Utilities/cmcurl/lib/mime.h7
-rw-r--r--Utilities/cmcurl/lib/mprintf.c35
-rw-r--r--Utilities/cmcurl/lib/mqtt.c28
-rw-r--r--Utilities/cmcurl/lib/mqtt.h4
-rw-r--r--Utilities/cmcurl/lib/multi.c90
-rw-r--r--Utilities/cmcurl/lib/multihandle.h14
-rw-r--r--Utilities/cmcurl/lib/multiif.h7
-rw-r--r--Utilities/cmcurl/lib/netrc.c124
-rw-r--r--Utilities/cmcurl/lib/netrc.h12
-rw-r--r--Utilities/cmcurl/lib/nonblock.c2
-rw-r--r--Utilities/cmcurl/lib/nonblock.h4
-rw-r--r--Utilities/cmcurl/lib/noproxy.c222
-rw-r--r--Utilities/cmcurl/lib/noproxy.h (renamed from Utilities/cmcurl/lib/dotdot.h)29
-rw-r--r--Utilities/cmcurl/lib/openldap.c6
-rw-r--r--Utilities/cmcurl/lib/parsedate.c4
-rw-r--r--Utilities/cmcurl/lib/parsedate.h4
-rw-r--r--Utilities/cmcurl/lib/pingpong.c7
-rw-r--r--Utilities/cmcurl/lib/pingpong.h4
-rw-r--r--Utilities/cmcurl/lib/pop3.c2
-rw-r--r--Utilities/cmcurl/lib/pop3.h4
-rw-r--r--Utilities/cmcurl/lib/progress.c4
-rw-r--r--Utilities/cmcurl/lib/progress.h4
-rw-r--r--Utilities/cmcurl/lib/psl.c4
-rw-r--r--Utilities/cmcurl/lib/psl.h4
-rw-r--r--Utilities/cmcurl/lib/quic.h3
-rw-r--r--Utilities/cmcurl/lib/rand.c77
-rw-r--r--Utilities/cmcurl/lib/rand.h12
-rw-r--r--Utilities/cmcurl/lib/rename.c4
-rw-r--r--Utilities/cmcurl/lib/rename.h4
-rw-r--r--Utilities/cmcurl/lib/rtsp.c4
-rw-r--r--Utilities/cmcurl/lib/rtsp.h4
-rw-r--r--Utilities/cmcurl/lib/select.c14
-rw-r--r--Utilities/cmcurl/lib/select.h5
-rw-r--r--Utilities/cmcurl/lib/sendf.c75
-rw-r--r--Utilities/cmcurl/lib/sendf.h6
-rw-r--r--Utilities/cmcurl/lib/setopt.c245
-rw-r--r--Utilities/cmcurl/lib/setopt.h4
-rw-r--r--Utilities/cmcurl/lib/setup-os400.h4
-rw-r--r--Utilities/cmcurl/lib/setup-vms.h4
-rw-r--r--Utilities/cmcurl/lib/setup-win32.h19
-rw-r--r--Utilities/cmcurl/lib/sha256.c2
-rw-r--r--Utilities/cmcurl/lib/share.c6
-rw-r--r--Utilities/cmcurl/lib/share.h4
-rw-r--r--Utilities/cmcurl/lib/sigpipe.h4
-rw-r--r--Utilities/cmcurl/lib/slist.c4
-rw-r--r--Utilities/cmcurl/lib/slist.h4
-rw-r--r--Utilities/cmcurl/lib/smb.c4
-rw-r--r--Utilities/cmcurl/lib/smb.h6
-rw-r--r--Utilities/cmcurl/lib/smtp.c10
-rw-r--r--Utilities/cmcurl/lib/smtp.h8
-rw-r--r--Utilities/cmcurl/lib/sockaddr.h4
-rw-r--r--Utilities/cmcurl/lib/socketpair.c4
-rw-r--r--Utilities/cmcurl/lib/socketpair.h6
-rw-r--r--Utilities/cmcurl/lib/socks.c2
-rw-r--r--Utilities/cmcurl/lib/socks.h2
-rw-r--r--Utilities/cmcurl/lib/socks_gssapi.c8
-rw-r--r--Utilities/cmcurl/lib/socks_sspi.c6
-rw-r--r--Utilities/cmcurl/lib/speedcheck.c4
-rw-r--r--Utilities/cmcurl/lib/speedcheck.h4
-rw-r--r--Utilities/cmcurl/lib/splay.c8
-rw-r--r--Utilities/cmcurl/lib/splay.h4
-rw-r--r--Utilities/cmcurl/lib/strcase.c86
-rw-r--r--Utilities/cmcurl/lib/strcase.h4
-rw-r--r--Utilities/cmcurl/lib/strdup.c4
-rw-r--r--Utilities/cmcurl/lib/strdup.h4
-rw-r--r--Utilities/cmcurl/lib/strerror.c16
-rw-r--r--Utilities/cmcurl/lib/strerror.h4
-rw-r--r--Utilities/cmcurl/lib/strtok.c4
-rw-r--r--Utilities/cmcurl/lib/strtok.h4
-rw-r--r--Utilities/cmcurl/lib/strtoofft.c10
-rw-r--r--Utilities/cmcurl/lib/strtoofft.h4
-rw-r--r--Utilities/cmcurl/lib/system_win32.c4
-rw-r--r--Utilities/cmcurl/lib/system_win32.h4
-rw-r--r--Utilities/cmcurl/lib/telnet.c2
-rw-r--r--Utilities/cmcurl/lib/telnet.h4
-rw-r--r--Utilities/cmcurl/lib/tftp.c2
-rw-r--r--Utilities/cmcurl/lib/tftp.h4
-rw-r--r--Utilities/cmcurl/lib/timediff.c4
-rw-r--r--Utilities/cmcurl/lib/timediff.h2
-rw-r--r--Utilities/cmcurl/lib/timeval.c4
-rw-r--r--Utilities/cmcurl/lib/timeval.h2
-rw-r--r--Utilities/cmcurl/lib/transfer.c112
-rw-r--r--Utilities/cmcurl/lib/transfer.h2
-rw-r--r--Utilities/cmcurl/lib/url.c740
-rw-r--r--Utilities/cmcurl/lib/url.h5
-rw-r--r--Utilities/cmcurl/lib/urlapi-int.h10
-rw-r--r--Utilities/cmcurl/lib/urlapi.c904
-rw-r--r--Utilities/cmcurl/lib/urldata.h298
-rw-r--r--Utilities/cmcurl/lib/vauth/cleartext.c4
-rw-r--r--Utilities/cmcurl/lib/vauth/cram.c4
-rw-r--r--Utilities/cmcurl/lib/vauth/digest.c185
-rw-r--r--Utilities/cmcurl/lib/vauth/digest.h13
-rw-r--r--Utilities/cmcurl/lib/vauth/digest_sspi.c16
-rw-r--r--Utilities/cmcurl/lib/vauth/gsasl.c7
-rw-r--r--Utilities/cmcurl/lib/vauth/krb5_gssapi.c4
-rw-r--r--Utilities/cmcurl/lib/vauth/krb5_sspi.c4
-rw-r--r--Utilities/cmcurl/lib/vauth/ntlm.c17
-rw-r--r--Utilities/cmcurl/lib/vauth/ntlm.h7
-rw-r--r--Utilities/cmcurl/lib/vauth/ntlm_sspi.c4
-rw-r--r--Utilities/cmcurl/lib/vauth/oauth2.c4
-rw-r--r--Utilities/cmcurl/lib/vauth/spnego_gssapi.c2
-rw-r--r--Utilities/cmcurl/lib/vauth/spnego_sspi.c2
-rw-r--r--Utilities/cmcurl/lib/vauth/vauth.c21
-rw-r--r--Utilities/cmcurl/lib/vauth/vauth.h10
-rw-r--r--Utilities/cmcurl/lib/version.c21
-rw-r--r--Utilities/cmcurl/lib/version_win32.c2
-rw-r--r--Utilities/cmcurl/lib/version_win32.h4
-rw-r--r--Utilities/cmcurl/lib/vquic/msh3.c58
-rw-r--r--Utilities/cmcurl/lib/vquic/msh3.h2
-rw-r--r--Utilities/cmcurl/lib/vquic/ngtcp2.c855
-rw-r--r--Utilities/cmcurl/lib/vquic/ngtcp2.h36
-rw-r--r--Utilities/cmcurl/lib/vquic/quiche.c68
-rw-r--r--Utilities/cmcurl/lib/vquic/quiche.h4
-rw-r--r--Utilities/cmcurl/lib/vquic/vquic.c2
-rw-r--r--Utilities/cmcurl/lib/vquic/vquic.h2
-rw-r--r--Utilities/cmcurl/lib/vssh/libssh.c60
-rw-r--r--Utilities/cmcurl/lib/vssh/libssh2.c127
-rw-r--r--Utilities/cmcurl/lib/vssh/ssh.h12
-rw-r--r--Utilities/cmcurl/lib/vssh/wolfssh.c2
-rw-r--r--Utilities/cmcurl/lib/vtls/bearssl.c34
-rw-r--r--Utilities/cmcurl/lib/vtls/bearssl.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/gskit.c2
-rw-r--r--Utilities/cmcurl/lib/vtls/gskit.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/gtls.c11
-rw-r--r--Utilities/cmcurl/lib/vtls/gtls.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/hostcheck.c2
-rw-r--r--Utilities/cmcurl/lib/vtls/hostcheck.h2
-rw-r--r--Utilities/cmcurl/lib/vtls/keylog.c5
-rw-r--r--Utilities/cmcurl/lib/vtls/keylog.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/mbedtls.c8
-rw-r--r--Utilities/cmcurl/lib/vtls/mbedtls.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/mbedtls_threadlock.c4
-rw-r--r--Utilities/cmcurl/lib/vtls/mbedtls_threadlock.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/nss.c32
-rw-r--r--Utilities/cmcurl/lib/vtls/nssg.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/openssl.c840
-rw-r--r--Utilities/cmcurl/lib/vtls/openssl.h5
-rw-r--r--Utilities/cmcurl/lib/vtls/rustls.c8
-rw-r--r--Utilities/cmcurl/lib/vtls/rustls.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/schannel.c518
-rw-r--r--Utilities/cmcurl/lib/vtls/schannel.h94
-rw-r--r--Utilities/cmcurl/lib/vtls/schannel_verify.c2
-rw-r--r--Utilities/cmcurl/lib/vtls/sectransp.c10
-rw-r--r--Utilities/cmcurl/lib/vtls/sectransp.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/vtls.c28
-rw-r--r--Utilities/cmcurl/lib/vtls/vtls.h7
-rw-r--r--Utilities/cmcurl/lib/vtls/wolfssl.c26
-rw-r--r--Utilities/cmcurl/lib/vtls/wolfssl.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/x509asn1.c7
-rw-r--r--Utilities/cmcurl/lib/vtls/x509asn1.h2
-rw-r--r--Utilities/cmcurl/lib/warnless.c4
-rw-r--r--Utilities/cmcurl/lib/warnless.h2
-rw-r--r--Utilities/cmcurl/lib/wildcard.c4
-rw-r--r--Utilities/cmcurl/lib/wildcard.h5
-rw-r--r--Utilities/cmcurl/lib/ws.c757
-rw-r--r--Utilities/cmcurl/lib/ws.h69
-rw-r--r--Utilities/cmjsoncpp/CMakeLists.txt2
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt2
-rw-r--r--Utilities/cmlibuv/CMakeLists.txt2
-rw-r--r--Utilities/cmlibuv/include/uv.h5
-rw-r--r--Utilities/cmlibuv/include/uv/version.h8
-rw-r--r--Utilities/cmlibuv/include/uv/win.h8
-rw-r--r--Utilities/cmlibuv/src/fs-poll.c2
-rw-r--r--Utilities/cmlibuv/src/idna.c11
-rw-r--r--Utilities/cmlibuv/src/strscpy.h2
-rw-r--r--Utilities/cmlibuv/src/strtok.c52
-rw-r--r--Utilities/cmlibuv/src/strtok.h27
-rw-r--r--Utilities/cmlibuv/src/unix/atomic-ops.h15
-rw-r--r--Utilities/cmlibuv/src/unix/bsd-ifaddrs.c8
-rw-r--r--Utilities/cmlibuv/src/unix/bsd-proctitle.c1
-rw-r--r--Utilities/cmlibuv/src/unix/cmake-bootstrap.c2
-rw-r--r--Utilities/cmlibuv/src/unix/core.c244
-rw-r--r--Utilities/cmlibuv/src/unix/freebsd.c15
-rw-r--r--Utilities/cmlibuv/src/unix/fs.c18
-rw-r--r--Utilities/cmlibuv/src/unix/hurd.c167
-rw-r--r--Utilities/cmlibuv/src/unix/internal.h25
-rw-r--r--Utilities/cmlibuv/src/unix/kqueue.c23
-rw-r--r--Utilities/cmlibuv/src/unix/linux-core.c29
-rw-r--r--Utilities/cmlibuv/src/unix/os390-syscalls.c36
-rw-r--r--Utilities/cmlibuv/src/unix/os390.c289
-rw-r--r--Utilities/cmlibuv/src/unix/pipe.c8
-rw-r--r--Utilities/cmlibuv/src/unix/process.c786
-rw-r--r--Utilities/cmlibuv/src/unix/stream.c99
-rw-r--r--Utilities/cmlibuv/src/unix/sunos.c36
-rw-r--r--Utilities/cmlibuv/src/unix/tcp.c19
-rw-r--r--Utilities/cmlibuv/src/unix/thread.c86
-rw-r--r--Utilities/cmlibuv/src/unix/tty.c84
-rw-r--r--Utilities/cmlibuv/src/unix/udp.c28
-rw-r--r--Utilities/cmlibuv/src/uv-common.c4
-rw-r--r--Utilities/cmlibuv/src/uv-common.h5
-rw-r--r--Utilities/cmlibuv/src/win/async.c10
-rw-r--r--Utilities/cmlibuv/src/win/core.c90
-rw-r--r--Utilities/cmlibuv/src/win/fs-event.c36
-rw-r--r--Utilities/cmlibuv/src/win/fs.c24
-rw-r--r--Utilities/cmlibuv/src/win/handle-inl.h26
-rw-r--r--Utilities/cmlibuv/src/win/handle.c26
-rw-r--r--Utilities/cmlibuv/src/win/internal.h145
-rw-r--r--Utilities/cmlibuv/src/win/loop-watcher.c4
-rw-r--r--Utilities/cmlibuv/src/win/pipe.c556
-rw-r--r--Utilities/cmlibuv/src/win/poll.c36
-rw-r--r--Utilities/cmlibuv/src/win/process.c20
-rw-r--r--Utilities/cmlibuv/src/win/req-inl.h43
-rw-r--r--Utilities/cmlibuv/src/win/signal.c12
-rw-r--r--Utilities/cmlibuv/src/win/stream-inl.h8
-rw-r--r--Utilities/cmlibuv/src/win/stream.c31
-rw-r--r--Utilities/cmlibuv/src/win/tcp.c255
-rw-r--r--Utilities/cmlibuv/src/win/thread.c3
-rw-r--r--Utilities/cmlibuv/src/win/tty.c221
-rw-r--r--Utilities/cmlibuv/src/win/udp.c103
-rw-r--r--Utilities/cmlibuv/src/win/util.c106
-rw-r--r--Utilities/cmlibuv/src/win/winapi.c8
-rw-r--r--Utilities/cmlibuv/src/win/winsock.c28
-rw-r--r--Utilities/std/cmext/enum_set13
-rwxr-xr-xbootstrap8
2085 files changed, 38260 insertions, 14756 deletions
diff --git a/.gitignore b/.gitignore
index 5bd9113..f57271f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@ out/
# Visual Studio Code
.vscode/
+.cache/
# CLion work directory
.idea/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 65bcd5f..712ebd1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -275,6 +275,26 @@ t:hip4.2-radeon:
variables:
CMAKE_CI_NO_MR: "true"
+t:linux-gcc-cxx-modules-ninja:
+ extends:
+ - .gcc_cxx_modules_ninja
+ - .cmake_test_linux_release
+ - .linux_builder_tags
+ - .run_dependent
+ - .needs_centos6_x86_64
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "true"
+
+t:linux-gcc-cxx-modules-ninja-multi:
+ extends:
+ - .gcc_cxx_modules_ninja_multi
+ - .cmake_test_linux_release
+ - .linux_builder_tags
+ - .run_dependent
+ - .needs_centos6_x86_64
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "true"
+
b:fedora36-ninja:
extends:
- .fedora36_ninja
@@ -294,6 +314,33 @@ b:debian10-makefiles-inplace:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
+b:debian10-extdeps:
+ extends:
+ - .debian10_extdeps
+ - .cmake_build_linux_standalone
+ - .linux_builder_tags
+ - .run_manually
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "true"
+
+b:debian10-aarch64-extdeps:
+ extends:
+ - .debian10_aarch64_extdeps
+ - .cmake_build_linux_standalone
+ - .linux_builder_tags_aarch64
+ - .run_manually
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "true"
+
+b:fedora36-extdeps:
+ extends:
+ - .fedora36_extdeps
+ - .cmake_build_linux_standalone
+ - .linux_builder_tags
+ - .run_manually
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "true"
+
t:fedora36-ninja:
extends:
- .fedora36_ninja
@@ -544,6 +591,13 @@ t:intel2021.6.0-makefiles:
CMAKE_CI_BUILD_NAME: intel2021.6.0_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2022.1.0-el8
+t:intel2021.7.0-makefiles:
+ extends:
+ - .cmake_test_linux_intelclassic_makefiles
+ variables:
+ CMAKE_CI_BUILD_NAME: intel2021.7.0_makefiles
+ CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2022.2.0-el8
+
t:oneapi2021.1.1-makefiles:
extends:
- .cmake_test_linux_inteloneapi_makefiles
@@ -593,6 +647,13 @@ t:oneapi2022.1.0-makefiles:
CMAKE_CI_BUILD_NAME: oneapi2022.1.0_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2022.1.0-el8
+t:oneapi2022.2.0-makefiles:
+ extends:
+ - .cmake_test_linux_inteloneapi_makefiles
+ variables:
+ CMAKE_CI_BUILD_NAME: oneapi2022.2.0_makefiles
+ CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2022.2.0-el8
+
b:linux-x86_64-package:
extends:
- .linux_package
@@ -939,10 +1000,10 @@ t:windows-borland5.8:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:windows-clang13.0-cl-ninja:
+t:windows-clang15.0-cl-ninja:
extends:
- .windows_clang_ninja
- - .cmake_test_windows_clang
+ - .cmake_test_windows_external
- .windows_tags_concurrent
- .cmake_junit_artifacts
- .run_dependent
@@ -951,13 +1012,13 @@ t:windows-clang13.0-cl-ninja:
needs:
- t:windows-vs2022-x64-ninja
variables:
- CMAKE_CI_BUILD_NAME: windows_clang13.0_cl_ninja
+ CMAKE_CI_BUILD_NAME: windows_clang15.0_cl_ninja
CMAKE_CI_JOB_NIGHTLY: "true"
-t:windows-clang13.0-cl-nmake:
+t:windows-clang15.0-cl-nmake:
extends:
- .windows_clang_nmake
- - .cmake_test_windows_clang
+ - .cmake_test_windows_external
- .windows_tags_concurrent
- .cmake_junit_artifacts
- .run_dependent
@@ -966,13 +1027,13 @@ t:windows-clang13.0-cl-nmake:
needs:
- t:windows-vs2022-x64-ninja
variables:
- CMAKE_CI_BUILD_NAME: windows_clang13.0_cl_nmake
+ CMAKE_CI_BUILD_NAME: windows_clang15.0_cl_nmake
CMAKE_CI_JOB_NIGHTLY: "true"
-t:windows-clang13.0-gnu-ninja:
+t:windows-clang15.0-gnu-ninja:
extends:
- .windows_clang_ninja
- - .cmake_test_windows_clang
+ - .cmake_test_windows_external
- .windows_tags_concurrent
- .cmake_junit_artifacts
- .run_dependent
@@ -981,13 +1042,13 @@ t:windows-clang13.0-gnu-ninja:
needs:
- t:windows-vs2022-x64-ninja
variables:
- CMAKE_CI_BUILD_NAME: windows_clang13.0_gnu_ninja
+ CMAKE_CI_BUILD_NAME: windows_clang15.0_gnu_ninja
CMAKE_CI_JOB_NIGHTLY: "true"
-t:windows-clang13.0-gnu-nmake:
+t:windows-clang15.0-gnu-nmake:
extends:
- .windows_clang_nmake
- - .cmake_test_windows_clang
+ - .cmake_test_windows_external
- .windows_tags_concurrent
- .cmake_junit_artifacts
- .run_dependent
@@ -996,7 +1057,7 @@ t:windows-clang13.0-gnu-nmake:
needs:
- t:windows-vs2022-x64-ninja
variables:
- CMAKE_CI_BUILD_NAME: windows_clang13.0_gnu_nmake
+ CMAKE_CI_BUILD_NAME: windows_clang15.0_gnu_nmake
CMAKE_CI_JOB_NIGHTLY: "true"
t:windows-msvc-v71-nmake:
@@ -1032,7 +1093,7 @@ b:windows-x86_64-package:
- .windows_x86_64_package
- .cmake_build_windows
- .cmake_build_package_artifacts
- - .windows_tags_x86_64_package
+ - .windows_tags_nonconcurrent_vs2022
- .run_only_for_package
dependencies:
- p:doc-package
@@ -1046,7 +1107,7 @@ k:windows-x86_64-package:
- .windows_x86_64_package
- .cmake_package_windows
- .cmake_release_artifacts
- - .windows_tags_x86_64_package
+ - .windows_tags_nonconcurrent_vs2022
- .run_only_for_package
dependencies:
- b:windows-x86_64-package
@@ -1069,7 +1130,7 @@ b:windows-i386-package:
- .windows_i386_package
- .cmake_build_windows
- .cmake_build_package_artifacts
- - .windows_tags_x86_64_package
+ - .windows_tags_nonconcurrent_vs2022
- .run_only_for_package
dependencies:
- p:doc-package
@@ -1083,7 +1144,7 @@ k:windows-i386-package:
- .windows_i386_package
- .cmake_package_windows
- .cmake_release_artifacts
- - .windows_tags_x86_64_package
+ - .windows_tags_nonconcurrent_vs2022
- .run_only_for_package
dependencies:
- b:windows-i386-package
@@ -1106,7 +1167,7 @@ b:windows-arm64-package:
- .windows_arm64_package
- .cmake_build_windows
- .cmake_build_package_artifacts
- - .windows_tags_arm64_package
+ - .windows_tags_nonconcurrent_vs2022_arm64
- .run_only_for_package
dependencies:
- p:doc-package
@@ -1120,7 +1181,7 @@ k:windows-arm64-package:
- .windows_arm64_package
- .cmake_package_windows
- .cmake_release_artifacts
- - .windows_tags_arm64_package
+ - .windows_tags_nonconcurrent_vs2022_arm64
- .run_only_for_package
dependencies:
- b:windows-arm64-package
diff --git a/.gitlab/.gitignore b/.gitlab/.gitignore
new file mode 100644
index 0000000..d62e477
--- /dev/null
+++ b/.gitlab/.gitignore
@@ -0,0 +1,16 @@
+# Ignore files known to be downloaded by CI jobs.
+/5.15.1-0-202009071110*
+/bcc*
+/cmake*
+/ispc*
+/jom
+/llvm*
+/msvc*
+/ninja*
+/open-watcom*
+/python*
+/qt*
+/sccache*
+/unstable-jom*
+/watcom
+/wix*
diff --git a/.gitlab/ci/clang-env.ps1 b/.gitlab/ci/clang-env.ps1
new file mode 100755
index 0000000..451fca3
--- /dev/null
+++ b/.gitlab/ci/clang-env.ps1
@@ -0,0 +1,15 @@
+Invoke-Expression -Command .gitlab/ci/clang.ps1
+Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
+
+$pwdpath = $pwd.Path
+Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\llvm\bin;$env:PATH"
+
+if ("$env:CMAKE_CI_BUILD_NAME" -match "(^|_)gnu(_|$)") {
+ $env:CC = "clang"
+ $env:CXX = "clang++"
+ clang --version
+} else {
+ $env:CC = "clang-cl"
+ $env:CXX = "clang-cl"
+ clang-cl --version
+}
diff --git a/.gitlab/ci/clang.ps1 b/.gitlab/ci/clang.ps1
index 25d64ba..29db93d 100755
--- a/.gitlab/ci/clang.ps1
+++ b/.gitlab/ci/clang.ps1
@@ -1,10 +1,10 @@
$erroractionpreference = "stop"
-if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang13.0")) {
- # LLVM/Clang 13.0
- # https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.0
- $filename = "llvm-13.0.0-win-x86_64-1"
- $sha256sum = "F1B7CE360DACBC9776D7F84BE714766D60CF3D47492AFE34C45D574D1C597264"
+if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang15.0")) {
+ # LLVM/Clang 15.0
+ # https://github.com/llvm/llvm-project/releases/tag/llvmorg-15.0.4
+ $filename = "llvm-15.0.4-win-x86_64-1"
+ $sha256sum = "9AA305084C20C27972E103E7B18AAC3F755E0534542AF62FC2F2BF5DDD3C4E1F"
} else {
throw ('unknown CMAKE_CI_BUILD_NAME: ' + "$env:CMAKE_CI_BUILD_NAME")
}
@@ -25,6 +25,7 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem
Move-Item -Path "$outdir\$filename" -Destination "$outdir\llvm"
$bin = "$outdir\llvm\bin"
+$lib = "$outdir\llvm\lib"
$null = New-Item -ItemType HardLink -Path "$bin\clang++.exe" -Target "$bin\clang.exe"
$null = New-Item -ItemType HardLink -Path "$bin\clang-cl.exe" -Target "$bin\clang.exe"
$null = New-Item -ItemType HardLink -Path "$bin\clang-cpp.exe" -Target "$bin\clang.exe"
@@ -34,4 +35,7 @@ $null = New-Item -ItemType HardLink -Path "$bin\lld-link.exe" -Target "$bin\
$null = New-Item -ItemType HardLink -Path "$bin\llvm-lib.exe" -Target "$bin\llvm-ar.exe"
$null = New-Item -ItemType HardLink -Path "$bin\llvm-ranlib.exe" -Target "$bin\llvm-ar.exe"
$null = New-Item -ItemType HardLink -Path "$bin\llvm-objcopy.exe" -Target "$bin\llvm-strip.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\libiomp5md.dll" -Target "$bin\libomp.dll"
+$null = New-Item -ItemType HardLink -Path "$lib\libiomp5md.lib" -Target "$lib\libomp.lib"
Clear-Variable -Name bin
+Clear-Variable -Name lib
diff --git a/.gitlab/ci/configure_debian10_aarch64_extdeps.cmake b/.gitlab/ci/configure_debian10_aarch64_extdeps.cmake
new file mode 100644
index 0000000..8e545f5
--- /dev/null
+++ b/.gitlab/ci/configure_debian10_aarch64_extdeps.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_extdeps_common.cmake")
diff --git a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake b/.gitlab/ci/configure_debian10_aarch64_ninja.cmake
index bbccbcf..605f6ba 100644
--- a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake
+++ b/.gitlab/ci/configure_debian10_aarch64_ninja.cmake
@@ -44,11 +44,13 @@ set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI "ON" CACHE BOOL "")
set(CMake_TEST_FindODBC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenAL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenSP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "")
set(CMake_TEST_FindPatch "ON" CACHE BOOL "")
set(CMake_TEST_FindPNG "ON" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_debian10_extdeps.cmake b/.gitlab/ci/configure_debian10_extdeps.cmake
new file mode 100644
index 0000000..8e545f5
--- /dev/null
+++ b/.gitlab/ci/configure_debian10_extdeps.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_extdeps_common.cmake")
diff --git a/.gitlab/ci/configure_debian10_ninja.cmake b/.gitlab/ci/configure_debian10_ninja.cmake
index 2fcff7a..214828a 100644
--- a/.gitlab/ci/configure_debian10_ninja.cmake
+++ b/.gitlab/ci/configure_debian10_ninja.cmake
@@ -48,11 +48,13 @@ set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI "ON" CACHE BOOL "")
set(CMake_TEST_FindODBC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenAL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenSP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "")
set(CMake_TEST_FindPatch "ON" CACHE BOOL "")
set(CMake_TEST_FindPNG "ON" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_extdeps_common.cmake b/.gitlab/ci/configure_extdeps_common.cmake
new file mode 100644
index 0000000..2c7d328
--- /dev/null
+++ b/.gitlab/ci/configure_extdeps_common.cmake
@@ -0,0 +1,5 @@
+set(CMAKE_USE_SYSTEM_LIBRARIES ON CACHE BOOL "")
+set(CMAKE_SKIP_BOOTSTRAP_TEST ON CACHE BOOL "")
+set(CMake_TEST_Qt6 OFF CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_fedora36_extdeps.cmake b/.gitlab/ci/configure_fedora36_extdeps.cmake
new file mode 100644
index 0000000..8e545f5
--- /dev/null
+++ b/.gitlab/ci/configure_fedora36_extdeps.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_extdeps_common.cmake")
diff --git a/.gitlab/ci/configure_fedora36_makefiles.cmake b/.gitlab/ci/configure_fedora36_makefiles.cmake
index c5b5190..11d1a08 100644
--- a/.gitlab/ci/configure_fedora36_makefiles.cmake
+++ b/.gitlab/ci/configure_fedora36_makefiles.cmake
@@ -47,11 +47,13 @@ set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI "ON" CACHE BOOL "")
set(CMake_TEST_FindODBC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenAL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenSP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "")
set(CMake_TEST_FindPatch "ON" CACHE BOOL "")
set(CMake_TEST_FindPNG "ON" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake
new file mode 100644
index 0000000..2b04e89
--- /dev/null
+++ b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake
@@ -0,0 +1,4 @@
+set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,export_bmi,install_bmi" CACHE STRING "")
+set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_gcc.cmake" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake
new file mode 100644
index 0000000..2b04e89
--- /dev/null
+++ b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake
@@ -0,0 +1,4 @@
+set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,export_bmi,install_bmi" CACHE STRING "")
+set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_gcc.cmake" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake b/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake
new file mode 100644
index 0000000..8570196
--- /dev/null
+++ b/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake
@@ -0,0 +1,2 @@
+set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,shared,export_bmi,install_bmi" CACHE STRING "")
+set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_msvc.cmake" CACHE STRING "")
diff --git a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake
index 7f57181..f5a6d80 100644
--- a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake
+++ b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake
@@ -2,4 +2,5 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
+include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common_ninja.cmake")
diff --git a/.gitlab/ci/configure_windows_vs2022_x64_ninja_multi.cmake b/.gitlab/ci/configure_windows_vs2022_x64_ninja_multi.cmake
index 5b2f0b7..2b0c76d 100644
--- a/.gitlab/ci/configure_windows_vs2022_x64_ninja_multi.cmake
+++ b/.gitlab/ci/configure_windows_vs2022_x64_ninja_multi.cmake
@@ -2,4 +2,5 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
+include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_common.cmake")
diff --git a/.gitlab/ci/ctest_standalone.cmake b/.gitlab/ci/ctest_standalone.cmake
index 9199693..36ba71c 100644
--- a/.gitlab/ci/ctest_standalone.cmake
+++ b/.gitlab/ci/ctest_standalone.cmake
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.8)
include("${CMAKE_CURRENT_LIST_DIR}/gitlab_ci.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/env_$ENV{CMAKE_CONFIGURATION}.cmake" OPTIONAL)
-set(cmake_args
- -C "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
+set(initial_cache "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
+set(cmake_args -C "${initial_cache}")
include(ProcessorCount)
ProcessorCount(nproc)
@@ -25,6 +25,8 @@ ctest_update()
if("$ENV{CMAKE_CI_BOOTSTRAP}")
set(CTEST_CONFIGURE_COMMAND "\"${CTEST_SOURCE_DIRECTORY}/bootstrap\" --parallel=${nproc}")
+elseif("$ENV{CMAKE_CONFIGURATION}" MATCHES "extdeps")
+ set(CTEST_CONFIGURE_COMMAND "/opt/extdeps/bin/cmake -C \"${initial_cache}\" -G \"${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"")
endif()
# Configure the project.
diff --git a/.gitlab/ci/cxx_modules_rules_gcc.cmake b/.gitlab/ci/cxx_modules_rules_gcc.cmake
new file mode 100644
index 0000000..d800099
--- /dev/null
+++ b/.gitlab/ci/cxx_modules_rules_gcc.cmake
@@ -0,0 +1,10 @@
+set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3")
+
+set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
+string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE
+ "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E -x c++ <SOURCE>"
+ " -MT <DYNDEP_FILE> -MD -MF <DEP_FILE>"
+ " -fmodules-ts -fdep-file=<DYNDEP_FILE> -fdep-output=<OBJECT> -fdep-format=trtbd"
+ " -o <PREPROCESSED_SOURCE>")
+set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc")
+set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "-fmodules-ts -fmodule-mapper=<MODULE_MAP_FILE> -fdep-format=trtbd -x c++")
diff --git a/.gitlab/ci/cxx_modules_rules_msvc.cmake b/.gitlab/ci/cxx_modules_rules_msvc.cmake
new file mode 100644
index 0000000..2b09b0e
--- /dev/null
+++ b/.gitlab/ci/cxx_modules_rules_msvc.cmake
@@ -0,0 +1 @@
+set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3")
diff --git a/.gitlab/ci/docker/debian10-aarch64/install_deps.sh b/.gitlab/ci/docker/debian10-aarch64/install_deps.sh
index 3dd814d..8b5a001 100755
--- a/.gitlab/ci/docker/debian10-aarch64/install_deps.sh
+++ b/.gitlab/ci/docker/debian10-aarch64/install_deps.sh
@@ -14,6 +14,20 @@ apt-get install -y \
curl \
git
+# Install optional external build dependencies.
+apt-get install -y \
+ libarchive-dev \
+ libbz2-dev \
+ libcurl4-gnutls-dev \
+ libexpat1-dev \
+ libjsoncpp-dev \
+ liblzma-dev \
+ libncurses-dev \
+ librhash-dev \
+ libuv1-dev \
+ libzstd-dev \
+ zlib1g-dev
+
# Install iwyu runtime deps.
apt-get install -y \
clang-6.0 \
@@ -66,6 +80,7 @@ apt-get install -y \
liblzma-dev \
libopenal-dev \
libopenmpi-dev openmpi-bin \
+ libosp-dev \
libpng-dev \
libpq-dev postgresql-server-dev-11 \
libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler protobuf-compiler-grpc \
diff --git a/.gitlab/ci/docker/debian10/install_deps.sh b/.gitlab/ci/docker/debian10/install_deps.sh
index f796816..486b2f7 100755
--- a/.gitlab/ci/docker/debian10/install_deps.sh
+++ b/.gitlab/ci/docker/debian10/install_deps.sh
@@ -14,6 +14,20 @@ apt-get install -y \
curl \
git
+# Install optional external build dependencies.
+apt-get install -y \
+ libarchive-dev \
+ libbz2-dev \
+ libcurl4-gnutls-dev \
+ libexpat1-dev \
+ libjsoncpp-dev \
+ liblzma-dev \
+ libncurses-dev \
+ librhash-dev \
+ libuv1-dev \
+ libzstd-dev \
+ zlib1g-dev
+
# Install iwyu runtime deps.
apt-get install -y \
clang-6.0 \
@@ -70,6 +84,7 @@ apt-get install -y \
liblzma-dev \
libopenal-dev \
libopenmpi-dev openmpi-bin \
+ libosp-dev \
libpng-dev \
libpq-dev postgresql-server-dev-11 \
libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler protobuf-compiler-grpc \
diff --git a/.gitlab/ci/docker/fedora36/Dockerfile b/.gitlab/ci/docker/fedora36/Dockerfile
index 26f8e3e..ea42561 100644
--- a/.gitlab/ci/docker/fedora36/Dockerfile
+++ b/.gitlab/ci/docker/fedora36/Dockerfile
@@ -4,6 +4,18 @@ MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_rvm.sh /root/install_rvm.sh
RUN sh /root/install_rvm.sh
+FROM fedora:36 AS clang-tidy-headers
+MAINTAINER Kyle Edwards <kyle.edwards@kitware.com>
+
+COPY install_clang_tidy_headers.sh /root/install_clang_tidy_headers.sh
+RUN sh /root/install_clang_tidy_headers.sh
+
+FROM fedora:36 AS iwyu
+MAINTAINER Kyle Edwards <kyle.edwards@kitware.com>
+
+COPY install_iwyu.sh /root/install_iwyu.sh
+RUN sh /root/install_iwyu.sh
+
FROM fedora:36
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
@@ -13,3 +25,9 @@ RUN sh /root/install_deps.sh
COPY --from=rvm-build /root/rvm.tar /root/rvm.tar
RUN tar -C /usr/local -xf /root/rvm.tar \
&& rm /root/rvm.tar
+COPY --from=clang-tidy-headers /root/clang-tidy-headers.tar /root/clang-tidy-headers.tar
+RUN tar -C /usr/include -xf /root/clang-tidy-headers.tar \
+ && rm /root/clang-tidy-headers.tar
+COPY --from=iwyu /root/iwyu.tar /root/iwyu.tar
+RUN tar -C / -xf /root/iwyu.tar \
+ && rm /root/iwyu.tar
diff --git a/.gitlab/ci/docker/fedora36/install_clang_tidy_headers.sh b/.gitlab/ci/docker/fedora36/install_clang_tidy_headers.sh
new file mode 100755
index 0000000..b9883f4
--- /dev/null
+++ b/.gitlab/ci/docker/fedora36/install_clang_tidy_headers.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+# Packages for building the clang-tidy plugin.
+# TODO: Upstream this as a proper Fedora package.
+dnf install --setopt=install_weak_deps=False -y \
+ 'dnf-command(download)' \
+ rpm-build \
+ python3-devel \
+ clang-tools-extra
+clang_source_rpm=$(rpm -q --queryformat '%{SOURCERPM}' clang-tools-extra)
+clang_version=$(rpm -q --queryformat '%{VERSION}' clang-tools-extra)
+dnf download --source -y clang
+rpm -i "$clang_source_rpm"
+rpmbuild -bp /root/rpmbuild/SPECS/clang.spec
+cd "/root/rpmbuild/BUILD/clang-tools-extra-$clang_version.src"
+find clang-tidy -name '*.h' | tar -cf /root/clang-tidy-headers.tar -T -
diff --git a/.gitlab/ci/docker/fedora36/install_deps.sh b/.gitlab/ci/docker/fedora36/install_deps.sh
index b8ddfb9..f117888 100755
--- a/.gitlab/ci/docker/fedora36/install_deps.sh
+++ b/.gitlab/ci/docker/fedora36/install_deps.sh
@@ -17,6 +17,20 @@ dnf install --setopt=install_weak_deps=False -y \
git-core \
make
+# Install optional external build dependencies.
+dnf install --setopt=install_weak_deps=False -y \
+ bzip2-devel \
+ expat-devel \
+ jsoncpp-devel \
+ libarchive-devel \
+ libcurl-devel \
+ libuv-devel \
+ libuv-devel \
+ libzstd-devel \
+ rhash-devel \
+ xz-devel \
+ zlib-devel
+
# Install documentation tools.
dnf install --setopt=install_weak_deps=False -y \
python3-sphinx \
@@ -78,6 +92,7 @@ dnf install --setopt=install_weak_deps=False -y \
libinput-devel systemd-devel \
libjpeg-turbo-devel \
libpng-devel \
+ opensp-devel \
postgresql-server-devel \
libtiff-devel \
libuv-devel \
diff --git a/.gitlab/ci/docker/fedora36/install_iwyu.sh b/.gitlab/ci/docker/fedora36/install_iwyu.sh
new file mode 100755
index 0000000..714bcc0
--- /dev/null
+++ b/.gitlab/ci/docker/fedora36/install_iwyu.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+set -e
+
+# Install development tools.
+dnf install --setopt=install_weak_deps=False -y \
+ clang-devel \
+ llvm-devel \
+ zlib-devel \
+ g++ \
+ cmake \
+ ninja-build \
+ git
+
+cd /root
+git clone "https://github.com/include-what-you-use/include-what-you-use.git"
+cd include-what-you-use
+readonly llvm_full_version="$( clang --version | head -n1 | cut -d' ' -f3 )"
+readonly llvm_version="$( echo "$llvm_full_version" | cut -d. -f-1 )"
+git checkout "clang_$llvm_version"
+git apply <<EOF
+diff --git a/iwyu_driver.cc b/iwyu_driver.cc
+index 42fea35..fbb77a9 100644
+--- a/iwyu_driver.cc
++++ b/iwyu_driver.cc
+@@ -167,6 +167,7 @@ CompilerInstance* CreateCompilerInstance(int argc, const char **argv) {
+ DiagnosticsEngine diagnostics(diagnostic_id, &*diagnostic_options,
+ diagnostic_client);
+ Driver driver(path, getDefaultTargetTriple(), diagnostics);
++ driver.ResourceDir = "/usr/lib64/clang/$llvm_full_version";
+ driver.setTitle("include what you use");
+
+ // Expand out any response files passed on the command line
+EOF
+mkdir build
+cd build
+
+cmake -GNinja \
+ -DCMAKE_BUILD_TYPE=Release \
+ "-DCMAKE_INSTALL_PREFIX=/usr/local/lib64/llvm-$llvm_version" \
+ ..
+ninja
+DESTDIR=/root/iwyu-destdir ninja install
+tar -C /root/iwyu-destdir -cf /root/iwyu.tar .
diff --git a/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile b/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile
new file mode 100644
index 0000000..e0af0b9
--- /dev/null
+++ b/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile
@@ -0,0 +1,9 @@
+FROM fedora:36
+MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
+
+# Install build dependencies for packages.
+COPY install_deps.sh /root/install_deps.sh
+RUN sh /root/install_deps.sh
+
+COPY install_gcc.sh /root/install_gcc.sh
+RUN sh /root/install_gcc.sh
diff --git a/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh b/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh
new file mode 100755
index 0000000..b8b706b
--- /dev/null
+++ b/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+dnf install -y --setopt=install_weak_deps=False \
+ gcc-c++ mpfr-devel libmpc-devel isl-devel flex bison file findutils diffutils git-core
+dnf clean all
diff --git a/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh
new file mode 100755
index 0000000..20ea35f
--- /dev/null
+++ b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+readonly revision="p1689r5-cmake-ci-20220614" # 3075e510e3d29583f8886b95aff044c0474c84a5
+readonly tarball="https://github.com/mathstuf/gcc/archive/$revision.tar.gz"
+
+readonly workdir="$HOME/gcc"
+readonly srcdir="$workdir/gcc"
+readonly builddir="$workdir/build"
+readonly njobs="$( nproc )"
+
+mkdir -p "$workdir"
+cd "$workdir"
+curl -L "$tarball" > "gcc-$revision.tar.gz"
+tar xf "gcc-$revision.tar.gz"
+mv "gcc-$revision" "$srcdir"
+mkdir -p "$builddir"
+cd "$builddir"
+"$srcdir/configure" \
+ --disable-multilib \
+ --enable-languages=c,c++ \
+ --prefix="/opt/gcc-p1689"
+make "-j$njobs"
+make "-j$njobs" install-strip
+rm -rf "$workdir"
diff --git a/.gitlab/ci/env.ps1 b/.gitlab/ci/env.ps1
index e24bc37..72a8cb8 100755
--- a/.gitlab/ci/env.ps1
+++ b/.gitlab/ci/env.ps1
@@ -1,3 +1,4 @@
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName
if (Test-Path -Path ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) {
- Invoke-Expression ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1"
+ . ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1"
}
diff --git a/.gitlab/ci/env_debian10_aarch64_extdeps.sh b/.gitlab/ci/env_debian10_aarch64_extdeps.sh
new file mode 100644
index 0000000..7076e18
--- /dev/null
+++ b/.gitlab/ci/env_debian10_aarch64_extdeps.sh
@@ -0,0 +1 @@
+source .gitlab/ci/env_extdeps_common.sh
diff --git a/.gitlab/ci/env_debian10_extdeps.sh b/.gitlab/ci/env_debian10_extdeps.sh
new file mode 100644
index 0000000..7076e18
--- /dev/null
+++ b/.gitlab/ci/env_debian10_extdeps.sh
@@ -0,0 +1 @@
+source .gitlab/ci/env_extdeps_common.sh
diff --git a/.gitlab/ci/env_debian10_ninja.sh b/.gitlab/ci/env_debian10_ninja.sh
index 67d900c..ba8ad47 100644
--- a/.gitlab/ci/env_debian10_ninja.sh
+++ b/.gitlab/ci/env_debian10_ninja.sh
@@ -1,11 +1,11 @@
export MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-2.7.0"
if test -z "$CI_MERGE_REQUEST_ID"; then
- curl -L -O "https://download.swift.org/swift-5.5.3-release/ubuntu1804/swift-5.5.3-RELEASE/swift-5.5.3-RELEASE-ubuntu18.04.tar.gz"
- echo '910634e2d97e14c43ed1f29caeb57fd01d10c2ff88cebb79baee1016b52c7492 swift-5.5.3-RELEASE-ubuntu18.04.tar.gz' > swift.sha256sum
+ curl -L -O "https://download.swift.org/swift-5.7.1-release/ubuntu1804/swift-5.7.1-RELEASE/swift-5.7.1-RELEASE-ubuntu18.04.tar.gz"
+ echo '2b30f9efc969d9e96f0836d0871130dffb369822a3823ee6f3db44c29c1698e3 swift-5.7.1-RELEASE-ubuntu18.04.tar.gz' > swift.sha256sum
sha256sum --check swift.sha256sum
mkdir /opt/swift
- tar xzf swift-5.5.3-RELEASE-ubuntu18.04.tar.gz -C /opt/swift --strip-components=2
- rm swift-5.5.3-RELEASE-ubuntu18.04.tar.gz swift.sha256sum
+ tar xzf swift-5.7.1-RELEASE-ubuntu18.04.tar.gz -C /opt/swift --strip-components=2
+ rm swift-5.7.1-RELEASE-ubuntu18.04.tar.gz swift.sha256sum
export SWIFTC="/opt/swift/bin/swiftc"
fi
diff --git a/.gitlab/ci/env_extdeps_common.sh b/.gitlab/ci/env_extdeps_common.sh
new file mode 100644
index 0000000..8cabc05
--- /dev/null
+++ b/.gitlab/ci/env_extdeps_common.sh
@@ -0,0 +1,5 @@
+.gitlab/ci/extdeps-linux.sh
+
+export CMAKE_PREFIX_PATH=/opt/extdeps
+export PATH=/opt/extdeps/bin:$PATH
+export LD_LIBRARY_PATH=/opt/extdeps/lib
diff --git a/.gitlab/ci/env_fedora36_extdeps.sh b/.gitlab/ci/env_fedora36_extdeps.sh
new file mode 100644
index 0000000..7076e18
--- /dev/null
+++ b/.gitlab/ci/env_fedora36_extdeps.sh
@@ -0,0 +1 @@
+source .gitlab/ci/env_extdeps_common.sh
diff --git a/.gitlab/ci/env_windows_clang_common.cmake b/.gitlab/ci/env_windows_clang_common.cmake
deleted file mode 100644
index fdd668f..0000000
--- a/.gitlab/ci/env_windows_clang_common.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if("$ENV{CMAKE_CI_BUILD_NAME}" MATCHES "(^|_)gnu(_|$)")
- set(ENV{CC} clang)
- set(ENV{CXX} clang++)
-else()
- set(ENV{CC} clang-cl)
- set(ENV{CXX} clang-cl)
-endif()
diff --git a/.gitlab/ci/env_windows_clang_ninja.cmake b/.gitlab/ci/env_windows_clang_ninja.cmake
deleted file mode 100644
index f3834a2..0000000
--- a/.gitlab/ci/env_windows_clang_ninja.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/env_windows_clang_common.cmake")
diff --git a/.gitlab/ci/env_windows_clang_ninja.ps1 b/.gitlab/ci/env_windows_clang_ninja.ps1
new file mode 100755
index 0000000..17002ef
--- /dev/null
+++ b/.gitlab/ci/env_windows_clang_ninja.ps1
@@ -0,0 +1,2 @@
+. .gitlab/ci/ninja-env.ps1
+. .gitlab/ci/clang-env.ps1
diff --git a/.gitlab/ci/env_windows_clang_nmake.cmake b/.gitlab/ci/env_windows_clang_nmake.cmake
deleted file mode 100644
index f3834a2..0000000
--- a/.gitlab/ci/env_windows_clang_nmake.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/env_windows_clang_common.cmake")
diff --git a/.gitlab/ci/env_windows_clang_nmake.ps1 b/.gitlab/ci/env_windows_clang_nmake.ps1
new file mode 100755
index 0000000..89fa360
--- /dev/null
+++ b/.gitlab/ci/env_windows_clang_nmake.ps1
@@ -0,0 +1 @@
+. .gitlab/ci/clang-env.ps1
diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1
index f8a86c4..a96658d 100755
--- a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1
+++ b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1
@@ -1,3 +1,3 @@
if ("$env:CMAKE_CI_NIGHTLY" -eq "true") {
- Invoke-Expression ".gitlab/ci/ispc-env.ps1"
+ . ".gitlab/ci/ispc-env.ps1"
}
diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
index e8d242c..44bb090 100755
--- a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
+++ b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
@@ -1,10 +1,7 @@
if ("$env:CMAKE_CI_NIGHTLY" -eq "true") {
- Invoke-Expression -Command ".gitlab/ci/ispc-env.ps1"
+ . ".gitlab/ci/ispc-env.ps1"
}
-$pwdpath = $pwd.Path
-powershell -File ".gitlab/ci/ninja.ps1"
-Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
-ninja --version
+. .gitlab/ci/ninja-env.ps1
Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
diff --git a/.gitlab/ci/extdeps-linux.sh b/.gitlab/ci/extdeps-linux.sh
new file mode 100755
index 0000000..f0d4c0d
--- /dev/null
+++ b/.gitlab/ci/extdeps-linux.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+set -e
+
+mkdir -p /opt/extdeps/src
+cd /opt/extdeps/src
+export PATH=/opt/extdeps/bin:$PATH
+
+#----------------------------------------------------------------------------
+# cmake
+
+case "$(uname -s)-$(uname -m)" in
+ Linux-x86_64)
+ cmake_version="3.13.5"
+ cmake_sha256sum="e2fd0080a6f0fc1ec84647acdcd8e0b4019770f48d83509e6a5b0b6ea27e5864"
+ cmake_platform="Linux-x86_64"
+ ;;
+ Linux-aarch64)
+ cmake_version="3.19.8"
+ cmake_sha256sum="807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1"
+ cmake_platform="Linux-aarch64"
+ ;;
+ *)
+ echo "Unrecognized platform $(uname -s)-$(uname -m)"
+ exit 1
+ ;;
+esac
+readonly shatool
+readonly cmake_sha256sum
+readonly cmake_platform
+
+readonly cmake_filename="cmake-$cmake_version-$cmake_platform"
+readonly cmake_tarball="$cmake_filename.tar.gz"
+
+echo "$cmake_sha256sum $cmake_tarball" > cmake.sha256sum
+curl -OL "https://github.com/Kitware/CMake/releases/download/v$cmake_version/$cmake_tarball"
+sha256sum --check cmake.sha256sum
+tar xzf "$cmake_tarball" -C /opt/extdeps --strip-components=1
+rm -f "$cmake_tarball" cmake.sha256sum
+
+#----------------------------------------------------------------------------
+# libuv
+
+curl -L -o libuv-1.28.0.tar.gz https://github.com/libuv/libuv/archive/refs/tags/v1.28.0.tar.gz
+tar xzf libuv-1.28.0.tar.gz
+cmake -S libuv-1.28.0 -B libuv-1.28.0-build \
+ -DCMAKE_INSTALL_PREFIX=/opt/extdeps
+cmake --build libuv-1.28.0-build --target install
+rm -rf libuv-1.28.0*
+
+#----------------------------------------------------------------------------
+# jsoncpp
+
+curl -L -o jsoncpp-1.6.0.tar.gz https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.6.0.tar.gz
+tar xzf jsoncpp-1.6.0.tar.gz
+cmake -S jsoncpp-1.6.0 -B jsoncpp-1.6.0-build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DJSONCPP_LIB_BUILD_STATIC=ON \
+ -DJSONCPP_LIB_BUILD_SHARED=ON \
+ -DCMAKE_INSTALL_PREFIX=/opt/extdeps
+cmake --build jsoncpp-1.6.0-build --target install
+rm -rf jsoncpp-1.6.0*
diff --git a/.gitlab/ci/ispc-env.ps1 b/.gitlab/ci/ispc-env.ps1
index 1baea31..816c485 100755
--- a/.gitlab/ci/ispc-env.ps1
+++ b/.gitlab/ci/ispc-env.ps1
@@ -1,4 +1,4 @@
$pwdpath = $pwd.Path
-powershell -File ".gitlab/ci/ispc.ps1"
+& "$pwsh" -File ".gitlab/ci/ispc.ps1"
Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\ispc\bin;$env:PATH"
ispc --version
diff --git a/.gitlab/ci/ninja-env.ps1 b/.gitlab/ci/ninja-env.ps1
new file mode 100755
index 0000000..67c7036
--- /dev/null
+++ b/.gitlab/ci/ninja-env.ps1
@@ -0,0 +1,4 @@
+$pwdpath = $pwd.Path
+& "$pwsh" -File ".gitlab/ci/ninja.ps1"
+Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
+Write-Host "ninja version: $(ninja --version)"
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml
index 12fbc1e..84950d2 100644
--- a/.gitlab/os-linux.yml
+++ b/.gitlab/os-linux.yml
@@ -45,7 +45,7 @@
### Debian
.debian10:
- image: "kitware/cmake:ci-debian10-x86_64-2022-06-21"
+ image: "kitware/cmake:ci-debian10-x86_64-2022-08-30"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -60,7 +60,7 @@
CMAKE_CI_NO_INSTALL: 1
.debian10_aarch64:
- image: "kitware/cmake:ci-debian10-aarch64-2022-06-21"
+ image: "kitware/cmake:ci-debian10-aarch64-2022-08-30"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -69,7 +69,7 @@
### Fedora
.fedora36:
- image: "kitware/cmake:ci-fedora36-x86_64-2022-06-21"
+ image: "kitware/cmake:ci-fedora36-x86_64-2022-10-04"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"
@@ -137,6 +137,30 @@
CMAKE_CI_NO_INSTALL: 1
CTEST_NO_WARNINGS_ALLOWED: 1
+.debian10_extdeps:
+ extends: .debian10
+
+ variables:
+ CMAKE_CONFIGURATION: debian10_extdeps
+ CMAKE_CI_BUILD_TYPE: Release
+ CTEST_NO_WARNINGS_ALLOWED: 1
+
+.debian10_aarch64_extdeps:
+ extends: .debian10_aarch64
+
+ variables:
+ CMAKE_CONFIGURATION: debian10_aarch64_extdeps
+ CMAKE_CI_BUILD_TYPE: Release
+ CTEST_NO_WARNINGS_ALLOWED: 1
+
+.fedora36_extdeps:
+ extends: .fedora36
+
+ variables:
+ CMAKE_CONFIGURATION: fedora36_extdeps
+ CMAKE_CI_BUILD_TYPE: Release
+ CTEST_NO_WARNINGS_ALLOWED: 1
+
.fedora36_ninja:
extends: .fedora36
@@ -299,6 +323,30 @@
CMAKE_CONFIGURATION: hip4.2_radeon
CMAKE_GENERATOR: "Ninja Multi-Config"
+### C++ modules
+
+.gcc_cxx_modules_x86_64:
+ image: "kitware/cmake:ci-gcc_cxx_modules-x86_64-2022-06-21"
+
+ variables:
+ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
+ CMAKE_ARCH: x86_64
+ CC: "/opt/gcc-p1689/bin/gcc"
+ CXX: "/opt/gcc-p1689/bin/g++"
+
+.gcc_cxx_modules_ninja:
+ extends: .gcc_cxx_modules_x86_64
+
+ variables:
+ CMAKE_CONFIGURATION: linux_gcc_cxx_modules_ninja
+
+.gcc_cxx_modules_ninja_multi:
+ extends: .gcc_cxx_modules_x86_64
+
+ variables:
+ CMAKE_CONFIGURATION: linux_gcc_cxx_modules_ninja_multi
+ CMAKE_GENERATOR: "Ninja Multi-Config"
+
## Tags
.linux_builder_tags:
@@ -457,7 +505,7 @@
# use the scripts here.
- "$LAUNCHER make -j$(nproc)"
# NOTE: This regex matches that used in the release build.
- - "$LAUNCHER bin/ctest --output-on-failure -j$(nproc) -R '^(CMake\\.|CMakeLib\\.|CMakeServerLib\\.|RunCMake\\.ctest_memcheck)'"
+ - "$LAUNCHER bin/ctest --output-on-failure -j$(nproc) -R '^(CMake\\.|CMakeLib\\.|RunCMake\\.ctest_memcheck)'"
# Make a package.
- bin/cpack -G TGZ
- bin/cpack -G STGZ
diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml
index 282cf1e..eeed640 100644
--- a/.gitlab/os-windows.yml
+++ b/.gitlab/os-windows.yml
@@ -35,31 +35,19 @@
variables:
VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
VCVARSPLATFORM: "x64"
- VCVARSVERSION: "14.33.31629"
+ VCVARSVERSION: "14.34.31933"
.windows_vcvarsall_vs2022_x86:
variables:
VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
VCVARSPLATFORM: "x86"
- VCVARSVERSION: "14.33.31629"
+ VCVARSVERSION: "14.34.31933"
-.windows_vcvarsall_vs2022_x64_package:
- variables:
- VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
- VCVARSPLATFORM: "x64"
- VCVARSVERSION: "14.32.31326"
-
-.windows_vcvarsall_vs2022_x86_package:
- variables:
- VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
- VCVARSPLATFORM: "x86"
- VCVARSVERSION: "14.32.31326"
-
-.windows_vcvarsall_vs2022_x64_arm64_package:
+.windows_vcvarsall_vs2022_x64_arm64:
variables:
VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
VCVARSPLATFORM: "x64_arm64"
- VCVARSVERSION: "14.32.31326"
+ VCVARSVERSION: "14.34.31933"
.windows_vs2022_x64_ninja:
extends:
@@ -80,7 +68,7 @@
.windows_x86_64_package:
extends:
- .windows_package
- - .windows_vcvarsall_vs2022_x64_package
+ - .windows_vcvarsall_vs2022_x64
variables:
CMAKE_CONFIGURATION: windows_x86_64_package
@@ -88,7 +76,7 @@
.windows_i386_package:
extends:
- .windows_package
- - .windows_vcvarsall_vs2022_x86_package
+ - .windows_vcvarsall_vs2022_x86
variables:
CMAKE_CONFIGURATION: windows_i386_package
@@ -96,7 +84,7 @@
.windows_arm64_package:
extends:
- .windows_package
- - .windows_vcvarsall_vs2022_x64_arm64_package
+ - .windows_vcvarsall_vs2022_x64_arm64
variables:
CMAKE_CONFIGURATION: windows_arm64_package
@@ -110,7 +98,7 @@
CMAKE_CONFIGURATION: windows_vs2022_x64
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM: "x64"
- CMAKE_GENERATOR_TOOLSET: "v143,version=14.33.31629"
+ CMAKE_GENERATOR_TOOLSET: "v143,version=14.34.31933"
CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
.windows_vs2019_x64:
@@ -244,7 +232,16 @@
- windows
- shell
- vs2022
- - msvc-19.33
+ - msvc-19.34
+ - nonconcurrent
+
+.windows_tags_nonconcurrent_vs2022_arm64:
+ tags:
+ - cmake # Since this is a bare runner, pin to a project.
+ - windows
+ - shell
+ - vs2022
+ - msvc-19.34-arm64
- nonconcurrent
.windows_tags_concurrent_vs2022:
@@ -253,7 +250,7 @@
- windows
- shell
- vs2022
- - msvc-19.33
+ - msvc-19.34
- concurrent
.windows_tags_concurrent_vs2019:
@@ -272,38 +269,18 @@
- shell
- concurrent
-.windows_tags_x86_64_package:
- tags:
- - cmake # Since this is a bare runner, pin to a project.
- - windows
- - shell
- - vs2022
- - msvc-19.32
- - nonconcurrent
-
-.windows_tags_arm64_package:
- tags:
- - cmake # Since this is a bare runner, pin to a project.
- - windows
- - shell
- - vs2022
- - msvc-19.32-arm64
- - nonconcurrent
-
## Windows-specific scripts
.before_script_windows: &before_script_windows
- - Invoke-Expression -Command .gitlab/ci/env.ps1
+ - . .gitlab/ci/env.ps1
- $pwdpath = $pwd.Path
- - powershell -File ".gitlab/ci/wix.ps1"
+ - (& "$pwsh" -File ".gitlab/ci/wix.ps1")
- Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix"
- - powershell -File ".gitlab/ci/cmake.ps1"
+ - (& "$pwsh" -File ".gitlab/ci/cmake.ps1")
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH"
- - powershell -File ".gitlab/ci/ninja.ps1"
- - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
+ - . .gitlab/ci/ninja-env.ps1
- (& "$env:WIX\bin\light.exe" -help) | Select -First 1
- cmake --version
- - ninja --version
- cmake -P .gitlab/ci/download_qt.cmake
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\qt\bin;$env:PATH"
- cmake -P .gitlab/ci/download_python3.cmake
@@ -352,7 +329,7 @@
stage: test-ext
script:
- - Invoke-Expression -Command .gitlab/ci/env.ps1
+ - . .gitlab/ci/env.ps1
- build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake
interruptible: true
@@ -361,6 +338,7 @@
stage: test-ext
script:
+ - . .gitlab/ci/env.ps1
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake
@@ -370,6 +348,7 @@
stage: test-ext
script:
+ - . .gitlab/ci/env.ps1
- Invoke-Expression -Command .gitlab/ci/jom.ps1
- $pwdpath = $pwd.Path
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\jom;$env:PATH"
@@ -382,6 +361,7 @@
stage: test-ext
script:
+ - . .gitlab/ci/env.ps1
- Invoke-Expression -Command .gitlab/ci/borland.ps1
- $pwdpath = $pwd.Path
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\bcc\bin;$env:PATH"
@@ -389,24 +369,11 @@
interruptible: true
-.cmake_test_windows_clang:
- stage: test-ext
-
- script:
- - $pwdpath = $pwd.Path
- - powershell -File ".gitlab/ci/ninja.ps1"
- - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
- - Invoke-Expression -Command .gitlab/ci/clang.ps1
- - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\llvm\bin;$env:PATH"
- - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake
-
- interruptible: true
-
.cmake_test_windows_msvc:
stage: test-ext
script:
+ - . .gitlab/ci/env.ps1
- Invoke-Expression -Command .gitlab/ci/msvc.ps1
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake
@@ -417,6 +384,7 @@
stage: test-ext
script:
+ - . .gitlab/ci/env.ps1
- Invoke-Expression -Command .gitlab/ci/openwatcom.ps1
- $pwdpath = $pwd.Path
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\watcom\binnt;$pwdpath\.gitlab\watcom\binw;$env:PATH"
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 8224d9e..a11becb 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -41,8 +41,8 @@ set the path with these commands:
:group 'cmake)
;; Keywords
-(defconst cmake-keywords-block-open '("IF" "MACRO" "FOREACH" "ELSE" "ELSEIF" "WHILE" "FUNCTION"))
-(defconst cmake-keywords-block-close '("ENDIF" "ENDFOREACH" "ENDMACRO" "ELSE" "ELSEIF" "ENDWHILE" "ENDFUNCTION"))
+(defconst cmake-keywords-block-open '("BLOCK" "IF" "MACRO" "FOREACH" "ELSE" "ELSEIF" "WHILE" "FUNCTION"))
+(defconst cmake-keywords-block-close '("ENDBLOCK" "ENDIF" "ENDFOREACH" "ENDMACRO" "ELSE" "ELSEIF" "ENDWHILE" "ENDFUNCTION"))
(defconst cmake-keywords
(let ((kwds (append cmake-keywords-block-open cmake-keywords-block-close nil)))
(delete-dups kwds)))
@@ -288,6 +288,39 @@ This puts the mark at the end, and point at the beginning."
;------------------------------------------------------------------------------
+(defun cmake--syntax-propertize-until-bracket-close (syntax)
+ ;; This function assumes that a previous search has matched the
+ ;; beginning of a bracket_comment or bracket_argument and that the
+ ;; second capture group has matched the equal signs between the two
+ ;; opening brackets
+ (let* ((mb (match-beginning 2))
+ (me (match-end 2))
+ (cb (format "]%s]" (buffer-substring mb me))))
+ (save-match-data
+ (if (search-forward cb end 'move)
+ (progn
+ (setq me (match-end 0))
+ (put-text-property
+ (1- me)
+ me
+ 'syntax-table
+ (string-to-syntax syntax)))
+ (setq me end)))
+ (put-text-property
+ (match-beginning 1)
+ me
+ 'syntax-multiline
+ t)))
+
+(defconst cmake--syntax-propertize-function
+ (syntax-propertize-rules
+ ("\\(#\\)\\[\\(=*\\)\\["
+ (1
+ (prog1 "!" (cmake--syntax-propertize-until-bracket-close "!"))))
+ ("\\(\\[\\)\\(=*\\)\\["
+ (1
+ (prog1 "|" (cmake--syntax-propertize-until-bracket-close "|"))))))
+
;; Syntax table for this mode.
(defvar cmake-mode-syntax-table nil
"Syntax table for CMake mode.")
@@ -318,7 +351,10 @@ This puts the mark at the end, and point at the beginning."
; Setup indentation function.
(set (make-local-variable 'indent-line-function) 'cmake-indent)
; Setup comment syntax.
- (set (make-local-variable 'comment-start) "#"))
+ (set (make-local-variable 'comment-start) "#")
+ ;; Setup syntax propertization
+ (set (make-local-variable 'syntax-propertize-function) cmake--syntax-propertize-function)
+ (add-hook 'syntax-propertize-extend-region-functions #'syntax-propertize-multiline nil t))
;; Default cmake-mode key bindings
(define-key cmake-mode-map "\e\C-a" #'cmake-beginning-of-defun)
diff --git a/Auxiliary/vim/indent/cmake.vim b/Auxiliary/vim/indent/cmake.vim
index 672bdcc..0c662fa 100644
--- a/Auxiliary/vim/indent/cmake.vim
+++ b/Auxiliary/vim/indent/cmake.vim
@@ -59,8 +59,8 @@ fun! CMakeGetIndent(lnum)
let cmake_closing_parens_line = '^\s*\()\+\)\s*$'
- let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\|ELSEIF\|WHILE\|FUNCTION\)\s*('
- let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ELSEIF\|ENDWHILE\|ENDFUNCTION\)\s*('
+ let cmake_indent_begin_regex = '^\s*\(BLOCK\|IF\|MACRO\|FOREACH\|ELSE\|ELSEIF\|WHILE\|FUNCTION\)\s*('
+ let cmake_indent_end_regex = '^\s*\(ENDBLOCK\|ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ELSEIF\|ENDWHILE\|ENDFUNCTION\)\s*('
if this_line =~? cmake_closing_parens_line
if previous_line !~? cmake_indent_open_regex
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index e1a2885..9eb993a 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -436,6 +436,7 @@ syn keyword cmakeProperty contained
\ XCODE_SCHEME_ENVIRONMENT
\ XCODE_SCHEME_EXECUTABLE
\ XCODE_SCHEME_GUARD_MALLOC
+ \ XCODE_SCHEME_LAUNCH_MODE
\ XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
\ XCODE_SCHEME_MALLOC_GUARD_EDGES
\ XCODE_SCHEME_MALLOC_SCRIBBLE
@@ -444,6 +445,9 @@ syn keyword cmakeProperty contained
\ XCODE_SCHEME_THREAD_SANITIZER_STOP
\ XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
\ XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
+ \ XCODE_SCHEME_ENABLE_GPU_API_VALIDATION
+ \ XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION
+ \ XCODE_SCHEME_LAUNCH_CONFIGURATION
\ XCODE_SCHEME_WORKING_DIRECTORY
\ XCODE_SCHEME_ZOMBIE_OBJECTS
\ XCTEST
@@ -1537,6 +1541,7 @@ syn keyword cmakeVariable contained
\ CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
\ CMAKE_XCODE_SCHEME_ENVIRONMENT
\ CMAKE_XCODE_SCHEME_GUARD_MALLOC
+ \ CMAKE_XCODE_SCHEME_LAUNCH_MODE
\ CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
\ CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
\ CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE
@@ -1545,6 +1550,9 @@ syn keyword cmakeVariable contained
\ CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP
\ CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
\ CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
+ \ CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION
+ \ CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION
+ \ CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION
\ CMAKE_XCODE_SCHEME_WORKING_DIRECTORY
\ CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS
\ CPACK_ABSOLUTE_DESTINATION_FILES
@@ -3830,6 +3838,7 @@ syn keyword cmakeCommand
\ add_subdirectory
\ add_test
\ aux_source_directory
+ \ block
\ break
\ build_command
\ cmake_host_system_information
@@ -3857,6 +3866,7 @@ syn keyword cmakeCommand
\ define_property
\ enable_language
\ enable_testing
+ \ endblock
\ endfunction
\ endmacro
\ execute_process
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9de5338..2b9eb2d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
# 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 3.13...3.22 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.23 FATAL_ERROR)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake)
@@ -17,8 +17,8 @@ unset(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
if(MSVC AND NOT CMAKE_VERSION VERSION_LESS 3.15)
# Filter out MSVC runtime library flags that may have come from
# the cache of an existing build tree or from scripts.
- foreach(l C CXX)
- foreach(c DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
+ foreach(l IN ITEMS C CXX)
+ foreach(c IN ITEMS DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
string(REGEX REPLACE "[-/]M[DT]d?( |$)" "" "CMAKE_${l}_FLAGS_${c}" "${CMAKE_${l}_FLAGS_${c}}")
endforeach()
endforeach()
@@ -60,17 +60,6 @@ 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)
- if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
- message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
- else()
- _TRY_RUN(${ARGV})
- endif()
- endmacro()
-endif()
-
# Use most-recent available language dialects with GNU and Clang
if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
include(${CMake_SOURCE_DIR}/Source/Checks/cm_c11_thread_local.cmake)
@@ -81,7 +70,7 @@ if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
endif()
endif()
if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
- if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
+ if(CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
set(CMAKE_CXX_STANDARD 98)
else()
if(NOT CMAKE_VERSION VERSION_LESS 3.8)
@@ -114,9 +103,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()
# Inform STL library header wrappers whether to use system versions.
-configure_file(${CMake_SOURCE_DIR}/Utilities/std/cmSTL.hxx.in
- ${CMake_BINARY_DIR}/Utilities/cmSTL.hxx
- @ONLY)
+configure_file(Utilities/std/cmSTL.hxx.in Utilities/cmSTL.hxx @ONLY)
# set the internal encoding of CMake to UTF-8
set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
@@ -143,7 +130,7 @@ option(CMake_BUILD_DEVELOPER_REFERENCE
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)
# option to build using interprocedural optimizations (IPO/LTO)
-if (NOT CMAKE_VERSION VERSION_LESS 3.12.2)
+if(NOT CMAKE_VERSION VERSION_LESS 3.12.2)
option(CMake_BUILD_LTO "Compile CMake with link-time optimization if supported" OFF)
if(CMake_BUILD_LTO)
include(CheckIPOSupported)
@@ -165,7 +152,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 LIBRHASH LIBUV NGHTTP2 ZLIB ZSTD)
- foreach(util ${UTILITIES})
+ foreach(util IN LISTS UTILITIES)
if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
set(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
@@ -215,16 +202,14 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
mark_as_advanced(CMAKE_USE_SYSTEM_KWIML)
# Mention to the user what system libraries are being used.
- foreach(util ${UTILITIES} KWIML)
+ foreach(util IN LISTS UTILITIES ITEMS KWIML)
if(CMAKE_USE_SYSTEM_${util})
message(STATUS "Using system-installed ${util}")
endif()
endforeach()
# Inform utility library header wrappers whether to use system versions.
- configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
- ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
- @ONLY)
+ configure_file(Utilities/cmThirdParty.h.in Utilities/cmThirdParty.h @ONLY)
endmacro()
@@ -235,7 +220,7 @@ endmacro()
macro(CMAKE_SETUP_TESTING)
if(BUILD_TESTING)
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
- foreach(util CURL EXPAT ZLIB)
+ foreach(util IN ITEMS CURL EXPAT ZLIB)
if(CMAKE_USE_SYSTEM_${util})
set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
endif()
@@ -250,7 +235,7 @@ macro(CMAKE_SETUP_TESTING)
set(CMAKE_CTEST_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/ctest")
set(CMAKE_CMAKE_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cpack")
- foreach(exe cmake ctest cpack)
+ foreach(exe IN ITEMS cmake ctest cpack)
add_executable(${exe} IMPORTED)
set_property(TARGET ${exe} PROPERTY IMPORTED_LOCATION ${CMake_TEST_EXTERNAL_CMAKE}/${exe})
endforeach()
@@ -262,18 +247,12 @@ macro(CMAKE_SETUP_TESTING)
endif()
# configure some files for testing
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
- @ONLY)
- configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
- ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
- configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
- ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
- configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
- ${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
+ configure_file(Templates/CTestScript.cmake.in CTestScript.cmake @ONLY)
+ configure_file(Tests/.NoDartCoverage Tests/.NoDartCoverage)
+ configure_file(Tests/.NoDartCoverage Modules/.NoDartCoverage)
+ configure_file(CTestCustom.cmake.in CTestCustom.cmake @ONLY)
if(BUILD_TESTING AND DART_ROOT)
- configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
- ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
+ configure_file(CMakeLogo.gif Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
endif()
mark_as_advanced(DART_ROOT)
endmacro()
@@ -339,390 +318,6 @@ macro(CMAKE_SET_TARGET_FOLDER tgt folder)
endif()
endmacro()
-
-#-----------------------------------------------------------------------
-# a macro to build the utilities used by CMake
-# Simply to improve readability of the main script.
-#-----------------------------------------------------------------------
-macro (CMAKE_BUILD_UTILITIES)
- find_package(Threads)
-
- # Suppress unnecessary checks in third-party code.
- include(Utilities/cmThirdPartyChecks.cmake)
-
- #---------------------------------------------------------------------
- # Create the kwsys library for CMake.
- set(KWSYS_NAMESPACE cmsys)
- set(KWSYS_USE_SystemTools 1)
- set(KWSYS_USE_Directory 1)
- set(KWSYS_USE_RegularExpression 1)
- set(KWSYS_USE_Base64 1)
- set(KWSYS_USE_MD5 1)
- set(KWSYS_USE_Process 1)
- set(KWSYS_USE_CommandLineArguments 1)
- set(KWSYS_USE_ConsoleBuf 1)
- set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
- set(KWSYS_INSTALL_DOC_DIR "${CMAKE_DOC_DIR}")
- if(CMake_NO_CXX_STANDARD)
- set(KWSYS_CXX_STANDARD "")
- endif()
- if(CMake_NO_SELF_BACKTRACE)
- set(KWSYS_NO_EXECINFO 1)
- endif()
- if(WIN32)
- # FIXME: Teach KWSys to hard-code these checks on Windows.
- set(KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC_COMPILED 0)
- set(KWSYS_C_HAS_PTRDIFF_T_COMPILED 1)
- set(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H_COMPILED 1)
- set(KWSYS_CXX_HAS_RLIMIT64_COMPILED 0)
- set(KWSYS_CXX_HAS_SETENV_COMPILED 0)
- set(KWSYS_CXX_HAS_UNSETENV_COMPILED 0)
- set(KWSYS_CXX_HAS_UTIMENSAT_COMPILED 0)
- set(KWSYS_CXX_HAS_UTIMES_COMPILED 0)
- set(KWSYS_CXX_STAT_HAS_ST_MTIM_COMPILED 0)
- set(KWSYS_CXX_STAT_HAS_ST_MTIMESPEC_COMPILED 0)
- set(KWSYS_STL_HAS_WSTRING_COMPILED 1)
- set(KWSYS_SYS_HAS_IFADDRS_H 0)
- endif()
- add_subdirectory(Source/kwsys)
- set(kwsys_folder "Utilities/KWSys")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
- if(BUILD_TESTING)
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsC "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsCxx "${kwsys_folder}")
- CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestSharedForward "${kwsys_folder}")
- endif()
-
- #---------------------------------------------------------------------
- # Setup third-party libraries.
- # Everything in the tree should be able to include files from the
- # Utilities directory.
- if ((CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # using -isystem option generate error "template with C linkage"
- include_directories("${CMake_SOURCE_DIR}/Utilities/std")
- else()
- include_directories(SYSTEM "${CMake_SOURCE_DIR}/Utilities/std")
- endif()
-
- include_directories("${CMake_BINARY_DIR}/Utilities")
- if ((CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- # using -isystem option generate error "template with C linkage"
- include_directories("${CMake_SOURCE_DIR}/Utilities")
- else()
- include_directories(SYSTEM "${CMake_SOURCE_DIR}/Utilities")
- endif()
-
- #---------------------------------------------------------------------
- # Build CMake std library for CMake and CTest.
- set(CMAKE_STD_LIBRARY cmstd)
- add_subdirectory(Utilities/std)
- CMAKE_SET_TARGET_FOLDER(cmstd "Utilities/std")
-
- # check for the use of system libraries versus builtin ones
- # (a macro defined in this file)
- CMAKE_HANDLE_SYSTEM_LIBRARIES()
-
- if(CMAKE_USE_SYSTEM_KWIML)
- find_package(KWIML 1.0)
- if(NOT KWIML_FOUND)
- message(FATAL_ERROR "CMAKE_USE_SYSTEM_KWIML is ON but KWIML is not found!")
- endif()
- set(CMake_KWIML_LIBRARIES kwiml::kwiml)
- else()
- set(CMake_KWIML_LIBRARIES "")
- if(BUILD_TESTING)
- set(KWIML_TEST_ENABLE 1)
- endif()
- add_subdirectory(Utilities/KWIML)
- endif()
-
- if(CMAKE_USE_SYSTEM_LIBRHASH)
- find_package(LibRHash)
- if(NOT LibRHash_FOUND)
- message(FATAL_ERROR
- "CMAKE_USE_SYSTEM_LIBRHASH is ON but LibRHash is not found!")
- endif()
- set(CMAKE_LIBRHASH_LIBRARIES LibRHash::LibRHash)
- else()
- set(CMAKE_LIBRHASH_LIBRARIES cmlibrhash)
- add_subdirectory(Utilities/cmlibrhash)
- CMAKE_SET_TARGET_FOLDER(cmlibrhash "Utilities/3rdParty")
- endif()
-
- #---------------------------------------------------------------------
- # Build zlib library for Curl, CMake, and CTest.
- set(CMAKE_ZLIB_HEADER "cm_zlib.h")
- if(CMAKE_USE_SYSTEM_ZLIB)
- find_package(ZLIB)
- if(NOT ZLIB_FOUND)
- message(FATAL_ERROR
- "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
- endif()
- set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
- set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
- else()
- set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
- set(CMAKE_ZLIB_LIBRARIES cmzlib)
- set(WITHOUT_ZLIB_DLL "")
- set(WITHOUT_ZLIB_DLL_WITH_LIB cmzlib)
- set(ZLIB_DLL "")
- set(ZLIB_DLL_WITH_LIB cmzlib)
- set(ZLIB_WINAPI "")
- set(ZLIB_WINAPI_COMPILED 0)
- set(ZLIB_WINAPI_WITH_LIB cmzlib)
- add_subdirectory(Utilities/cmzlib)
- CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
- endif()
-
- #---------------------------------------------------------------------
- # Build Curl library for CTest.
- if(CMAKE_USE_SYSTEM_CURL)
- find_package(CURL)
- if(NOT CURL_FOUND)
- message(FATAL_ERROR
- "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
- endif()
- set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
- set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
- else()
- set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
- set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
- set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
- set(CMAKE_CURL_INCLUDES)
- set(CMAKE_CURL_LIBRARIES cmcurl)
- if(CMAKE_TESTS_CDASH_SERVER)
- set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
- endif()
- set(_CMAKE_USE_OPENSSL_DEFAULT OFF)
- if(NOT DEFINED CMAKE_USE_OPENSSL AND NOT WIN32 AND NOT APPLE
- AND CMAKE_SYSTEM_NAME MATCHES "(Linux|FreeBSD)")
- set(_CMAKE_USE_OPENSSL_DEFAULT ON)
- endif()
- option(CMAKE_USE_OPENSSL "Use OpenSSL." ${_CMAKE_USE_OPENSSL_DEFAULT})
- mark_as_advanced(CMAKE_USE_OPENSSL)
- if(CMAKE_USE_OPENSSL)
- set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle")
- set(CURL_CA_PATH "" CACHE PATH "Path to SSL CA Certificate Directory")
- mark_as_advanced(CURL_CA_BUNDLE CURL_CA_PATH)
- endif()
- if(NOT CMAKE_USE_SYSTEM_NGHTTP2)
- # Tell curl's FindNGHTTP2 module to use our library.
- set(NGHTTP2_LIBRARY cmnghttp2)
- set(NGHTTP2_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmnghttp2/lib/includes)
- endif()
- add_subdirectory(Utilities/cmcurl)
- CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
- CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
- if(NOT CMAKE_USE_SYSTEM_NGHTTP2)
- # Configure after curl to re-use some check results.
- add_subdirectory(Utilities/cmnghttp2)
- CMAKE_SET_TARGET_FOLDER(cmnghttp2 "Utilities/3rdParty")
- endif()
- endif()
-
- #---------------------------------------------------------------------
- # Build expat library for CMake, CTest, and libarchive.
- if(CMAKE_USE_SYSTEM_EXPAT)
- find_package(EXPAT)
- if(NOT EXPAT_FOUND)
- message(FATAL_ERROR
- "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
- endif()
- set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
- set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
- else()
- set(CMAKE_EXPAT_INCLUDES)
- set(CMAKE_EXPAT_LIBRARIES cmexpat)
- add_subdirectory(Utilities/cmexpat)
- CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
- endif()
-
- #---------------------------------------------------------------------
- # Build or use system libbz2 for libarchive.
- if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
- if(CMAKE_USE_SYSTEM_BZIP2)
- find_package(BZip2)
- else()
- set(BZIP2_INCLUDE_DIR
- "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
- set(BZIP2_LIBRARIES cmbzip2)
- set(BZIP2_NEED_PREFIX "")
- set(USE_BZIP2_DLL "")
- set(USE_BZIP2_DLL_WITH_LIB cmbzip2)
- set(USE_BZIP2_STATIC "")
- set(USE_BZIP2_STATIC_WITH_LIB cmbzip2)
- add_subdirectory(Utilities/cmbzip2)
- CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
- endif()
- endif()
-
- #---------------------------------------------------------------------
- # Build or use system zstd for libarchive.
- if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
- if(NOT CMAKE_USE_SYSTEM_ZSTD)
- set(ZSTD_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmzstd")
- set(ZSTD_LIBRARY cmzstd)
- add_subdirectory(Utilities/cmzstd)
- CMAKE_SET_TARGET_FOLDER(cmzstd "Utilities/3rdParty")
- endif()
- endif()
-
- #---------------------------------------------------------------------
- # Build or use system liblzma for libarchive.
- if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
- if(CMAKE_USE_SYSTEM_LIBLZMA)
- find_package(LibLZMA)
- if(NOT LIBLZMA_FOUND)
- message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBLZMA is ON but LibLZMA is not found!")
- endif()
- else()
- add_subdirectory(Utilities/cmliblzma)
- CMAKE_SET_TARGET_FOLDER(cmliblzma "Utilities/3rdParty")
- set(LIBLZMA_HAS_AUTO_DECODER 1)
- set(LIBLZMA_HAS_EASY_ENCODER 1)
- set(LIBLZMA_HAS_LZMA_PRESET 1)
- set(LIBLZMA_INCLUDE_DIR
- "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api")
- set(LIBLZMA_LIBRARY cmliblzma)
- set(HAVE_LZMA_STREAM_ENCODER_MT 1)
- endif()
- endif()
-
- #---------------------------------------------------------------------
- # Build or use system libarchive for CMake and CTest.
- if(CMAKE_USE_SYSTEM_LIBARCHIVE)
- find_package(LibArchive 3.3.3)
- if(NOT LibArchive_FOUND)
- message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
- endif()
- set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
- set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
- else()
- set(EXPAT_INCLUDE_DIR ${CMAKE_EXPAT_INCLUDES})
- set(EXPAT_LIBRARY ${CMAKE_EXPAT_LIBRARIES})
- set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
- set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
- add_definitions(-DLIBARCHIVE_STATIC)
- set(ENABLE_MBEDTLS OFF)
- set(ENABLE_NETTLE OFF)
- if(DEFINED CMAKE_USE_OPENSSL)
- set(ENABLE_OPENSSL "${CMAKE_USE_OPENSSL}")
- else()
- set(ENABLE_OPENSSL OFF)
- endif()
- set(ENABLE_LIBB2 OFF)
- set(ENABLE_LZ4 OFF)
- set(ENABLE_LZO OFF)
- set(ENABLE_LZMA ON)
- set(ENABLE_ZSTD ON)
- set(ENABLE_ZLIB ON)
- set(ENABLE_BZip2 ON)
- set(ENABLE_LIBXML2 OFF)
- set(ENABLE_EXPAT OFF)
- set(ENABLE_PCREPOSIX OFF)
- set(ENABLE_LibGCC OFF)
- set(ENABLE_CNG OFF)
- set(ENABLE_TAR OFF)
- set(ENABLE_TAR_SHARED OFF)
- set(ENABLE_CPIO OFF)
- set(ENABLE_CPIO_SHARED OFF)
- set(ENABLE_CAT OFF)
- set(ENABLE_CAT_SHARED OFF)
- set(ENABLE_XATTR OFF)
- set(ENABLE_ACL OFF)
- set(ENABLE_ICONV OFF)
- set(ENABLE_TEST OFF)
- set(ENABLE_COVERAGE OFF)
- set(ENABLE_INSTALL OFF)
- set(POSIX_REGEX_LIB "" CACHE INTERNAL "libarchive: No POSIX regular expression support")
- set(ENABLE_SAFESEH "" CACHE INTERNAL "libarchive: No /SAFESEH linker flag")
- set(WINDOWS_VERSION "WIN7" CACHE INTERNAL "libarchive: Set Windows version to use (Windows only)")
- add_subdirectory(Utilities/cmlibarchive)
- CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
- set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
- endif()
-
- #---------------------------------------------------------------------
- # Build jsoncpp library.
- if(CMAKE_USE_SYSTEM_JSONCPP)
- find_package(JsonCpp 1.4.1)
- if(NOT JsonCpp_FOUND)
- message(FATAL_ERROR
- "CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!")
- endif()
- if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|LCC|Clang")
- set_property(TARGET JsonCpp::JsonCpp APPEND PROPERTY
- INTERFACE_COMPILE_OPTIONS -Wno-deprecated-declarations)
- endif()
- set(CMAKE_JSONCPP_LIBRARIES JsonCpp::JsonCpp)
- else()
- set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp)
- add_subdirectory(Utilities/cmjsoncpp)
- CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
- endif()
-
- #---------------------------------------------------------------------
- # Build libuv library.
- if(CMAKE_USE_SYSTEM_LIBUV)
- if(WIN32)
- find_package(LibUV 1.38.0)
- else()
- find_package(LibUV 1.28.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()
-
- #---------------------------------------------------------------------
- # Use curses?
- if(NOT DEFINED BUILD_CursesDialog)
- if (UNIX)
- include(${CMake_SOURCE_DIR}/Source/Checks/Curses.cmake)
- set(BUILD_CursesDialog_DEFAULT "${CMakeCheckCurses_COMPILED}")
- elseif(WIN32)
- set(BUILD_CursesDialog_DEFAULT "OFF")
- endif()
- option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" "${BUILD_CursesDialog_DEFAULT}")
- endif ()
- if(BUILD_CursesDialog)
- if(UNIX)
- set(CURSES_NEED_NCURSES TRUE)
- find_package(Curses)
- if(NOT CURSES_FOUND)
- message(WARNING
- "'ccmake' will not be built because Curses was not found.\n"
- "Turn off BUILD_CursesDialog to suppress this message."
- )
- set(BUILD_CursesDialog 0)
- endif()
- elseif(WIN32)
- # FIXME: Add support for system-provided pdcurses.
- add_subdirectory(Utilities/cmpdcurses)
- set(CURSES_LIBRARY cmpdcurses)
- set(CURSES_INCLUDE_PATH "") # cmpdcurses has usage requirements
- set(CMAKE_USE_SYSTEM_FORM 0)
- set(HAVE_CURSES_USE_DEFAULT_COLORS 1)
- endif()
- endif()
- if(BUILD_CursesDialog)
- if(NOT CMAKE_USE_SYSTEM_FORM)
- add_subdirectory(Source/CursesDialog/form)
- elseif(NOT CURSES_FORM_LIBRARY)
- message( FATAL_ERROR "CMAKE_USE_SYSTEM_FORM in ON but CURSES_FORM_LIBRARY is not set!" )
- endif()
- endif()
-endmacro ()
-
#-----------------------------------------------------------------------
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
@@ -749,7 +344,7 @@ include(Source/CMakeVersion.cmake)
# Include the standard Dart testing module
enable_testing()
-include (${CMAKE_ROOT}/Modules/Dart.cmake)
+include(${CMAKE_ROOT}/Modules/Dart.cmake)
# Set up test-time configuration.
set_directory_properties(PROPERTIES
@@ -803,8 +398,9 @@ if(CMake_TEST_EXTERNAL_CMAKE)
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
- # build the utilities (a macro defined in this file)
- CMAKE_BUILD_UTILITIES()
+ find_package(Threads)
+ # build the utilities
+ include(CMakeBuildUtilities)
if(BUILD_QtDialog)
if(APPLE)
@@ -813,10 +409,9 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
# make sure CMAKE_INSTALL_PREFIX ends in /
if(NOT CMAKE_INSTALL_PREFIX MATCHES "/$")
- set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
+ string(APPEND CMAKE_INSTALL_PREFIX "/")
endif()
- set(CMAKE_INSTALL_PREFIX
- "${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
+ string(APPEND CMAKE_INSTALL_PREFIX "CMake.app/Contents")
endif()
endif()
@@ -829,14 +424,11 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()
# add the uninstall support
- configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- @ONLY)
+ configure_file(cmake_uninstall.cmake.in cmake_uninstall.cmake @ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
- include (CMakeCPack.cmake)
+ include(CMakeCPack.cmake)
endif()
@@ -860,10 +452,10 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
-Wshadow -Wpointer-arith -Wformat-security -Wundef
)
- foreach(FLAG_LANG C CXX)
- foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST})
+ foreach(FLAG_LANG IN ITEMS C CXX)
+ foreach(FLAG IN LISTS ${FLAG_LANG}_FLAGS_LIST)
if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ")
- set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}")
+ string(APPEND CMAKE_${FLAG_LANG}_FLAGS " ${FLAG}")
endif()
endforeach()
endforeach()
@@ -883,9 +475,6 @@ add_subdirectory(Tests)
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(BUILD_TESTING)
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
- IF(TARGET CMakeServerLibTests)
- CMAKE_SET_TARGET_FOLDER(CMakeServerLibTests "Tests")
- ENDIF()
endif()
if(TARGET documentation)
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
@@ -894,7 +483,8 @@ endif()
if(BUILD_TESTING)
add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
- --system-information -G "${CMAKE_GENERATOR}" )
+ --system-information -G "${CMAKE_GENERATOR}"
+ )
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index 49026a3..85af8ed 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -74,6 +74,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"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
+ "cmFindPackageCommand.cxx.*: warning #177-D: parameter .* was declared but never referenced"
"IPA warning: function.*multiply defined in"
"LICENSE WARNING" # PGI license expiry. Not useful in nightly testing.
@@ -83,6 +84,11 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"compilation completed with warnings" # PGI
"[0-9]+ Warning\\(s\\) detected" # SunPro
+ # Ignore false positive on `cm::optional` usage from GCC
+ "cmGlobalNinjaGenerator.cxx:[0-9]*:[0-9]*: warning: '.*cm::optional<CxxModuleMapFormat>::_mem\\)\\)' may be used uninitialized \\[-Wmaybe-uninitialized\\]"
+ "cmGlobalNinjaGenerator.cxx:[0-9]*:[0-9]*: note: '.*cm::optional<CxxModuleMapFormat>::_mem\\)\\)' was declared here"
+ "cmGlobalNinjaGenerator.cxx:[0-9]*:[0-9]*: warning: '\\*\\(\\(void\\*\\)& modmap_fmt \\+4\\)' may be used uninitialized in this function \\[-Wmaybe-uninitialized\\]"
+
# clang-analyzer exceptions
"cmListFileLexer.c:[0-9]+:[0-9]+: warning: Array subscript is undefined"
"jsoncpp/src/.*:[0-9]+:[0-9]+: warning: Value stored to .* is never read"
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index e6fb20b..bf8a082 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -18,12 +18,12 @@ endif()
# not hurt other versions, and this will work into the
# future
if(MSVC OR _INTEL_WINDOWS OR _CLANG_MSVC_WINDOWS)
- add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
+ add_compile_definitions(_CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE)
else()
endif()
if(MSVC)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_CXX_LINKER_WRAPPER_FLAG}-stack:10000000")
endif()
# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it.
@@ -62,7 +62,7 @@ endif()
# Use 64-bit off_t on 32-bit Linux
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
# ensure 64bit offsets are used for filesystem accesses for 32bit compilation
- add_definitions(-D_FILE_OFFSET_BITS=64)
+ add_compile_definitions(_FILE_OFFSET_BITS=64)
endif()
# Workaround for TOC Overflow on ppc64
@@ -98,7 +98,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND
endif()
endif()
-foreach(lang C CXX)
+foreach(lang IN ITEMS C CXX)
# Suppress warnings from PGI compiler.
if (CMAKE_${lang}_COMPILER_ID STREQUAL "PGI")
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w")
@@ -136,3 +136,12 @@ OFF to disable /MP completely." )
endif()
endif()
endif()
+
+# Get rid of excess -Wunused-but-set-variable on release builds with LCC >= 1.26
+foreach(l IN ITEMS C CXX)
+ if(CMAKE_${l}_COMPILER_ID STREQUAL "LCC" AND NOT CMAKE_${l}_COMPILER_VERSION VERSION_LESS 1.26)
+ foreach(c IN ITEMS MINSIZEREL RELEASE RELWITHDEBINFO)
+ string(APPEND "CMAKE_${l}_FLAGS_${c}" " -Wno-unused-but-set-variable")
+ endforeach()
+ endif()
+endforeach()
diff --git a/Copyright.txt b/Copyright.txt
index 2cf1769..bd45dd1 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -53,6 +53,7 @@ The following individuals and institutions are among the Contributors:
* Clement Creusot <creusot@cs.york.ac.uk>
* Daniel Blezek <blezek@gmail.com>
* Daniel Pfeifer <daniel@pfeifer-mail.de>
+* Dawid Wróbel <me@dawidwrobel.com>
* Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
* Eran Ifrah <eran.ifrah@gmail.com>
* Esben Mose Hansen, Ange Optimization ApS
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index cd3c78b..bd55e24 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -15,6 +15,7 @@ The general signature is:
[PATHS [path | ENV var]... ]
[REGISTRY_VIEW (64|32|64_32|32_64|HOST|TARGET|BOTH)]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
+ [VALIDATOR function]
[DOC "cache documentation string"]
[NO_CACHE]
[REQUIRED]
@@ -66,6 +67,31 @@ Options include:
Specify additional subdirectories to check below each directory
location otherwise considered.
+``VALIDATOR``
+ .. versionadded:: 3.25
+
+ Specify a :command:`function` to be called for each candidate item found
+ (a :command:`macro` cannot be provided, that will result in an error).
+ Two arguments will be passed to the validator function: the name of a
+ result variable, and the absolute path to the candidate item. The item
+ will be accepted and the search will end unless the function sets the
+ value in the result variable to false in the calling scope. The result
+ variable will hold a true value when the validator function is entered.
+
+ .. parsed-literal::
+
+ function(my_check validator_result_var item)
+ if(NOT item MATCHES ...)
+ set(${validator_result_var} FALSE PARENT_SCOPE)
+ endif()
+ endfunction()
+
+ |FIND_XXX| (result NAMES ... VALIDATOR my_check)
+
+ Note that if a cached result is used, the search is skipped and any
+ ``VALIDATOR`` is ignored. The cached result is not required to pass the
+ validation function.
+
``DOC``
Specify the documentation string for the ``<VAR>`` cache entry.
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 9e60d2d..99adc85 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -67,6 +67,8 @@ The options are:
Each byproduct file will be marked with the :prop_sf:`GENERATED`
source file property automatically.
+ *See policy* :policy:`CMP0058` *for the motivation behind this feature.*
+
Explicit specification of byproducts is supported by the
:generator:`Ninja` generator to tell the ``ninja`` build tool
how to regenerate byproducts when they are missing. It is
@@ -434,7 +436,7 @@ one of the keywords to make clear the behavior they expect.
Because generator expressions can be used in custom commands,
it is possible to define ``COMMAND`` lines or whole custom commands
which evaluate to empty strings for certain configurations.
- For **Visual Studio 2010 (and newer)** generators these command
+ For **Visual Studio 11 2012 (and newer)** generators these command
lines or custom commands will be omitted for the specific
configuration and no "empty-string-command" will be added.
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index def23fa..d8882ca 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -42,6 +42,8 @@ The options are:
Each byproduct file will be marked with the :prop_sf:`GENERATED`
source file property automatically.
+ *See policy* :policy:`CMP0058` *for the motivation behind this feature.*
+
Explicit specification of byproducts is supported by the
:generator:`Ninja` generator to tell the ``ninja`` build tool
how to regenerate byproducts when they are missing. It is
diff --git a/Help/command/add_subdirectory.rst b/Help/command/add_subdirectory.rst
index 8dba986..13cae10 100644
--- a/Help/command/add_subdirectory.rst
+++ b/Help/command/add_subdirectory.rst
@@ -5,7 +5,7 @@ Add a subdirectory to the build.
.. code-block:: cmake
- add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])
+ add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL] [SYSTEM])
Adds a subdirectory to the build. The source_dir specifies the
directory in which the source CMakeLists.txt and code files are
@@ -33,3 +33,10 @@ dependencies supersede this exclusion. If a target built by the
parent project depends on a target in the subdirectory, the dependee
target will be included in the parent project build system to satisfy
the dependency.
+
+If the ``SYSTEM`` argument is provided, the :prop_dir:`SYSTEM` directory
+property of the subdirectory will be set to true. This property is
+used to initialize the :prop_tgt:`SYSTEM` property of each target
+created in that subdirectory. The include directories of targets with
+:prop_tgt:`SYSTEM` set to true will be treated as ``SYSTEM`` when
+compiling consumers.
diff --git a/Help/command/block.rst b/Help/command/block.rst
new file mode 100644
index 0000000..dfd60d4
--- /dev/null
+++ b/Help/command/block.rst
@@ -0,0 +1,76 @@
+block
+-----
+
+.. versionadded:: 3.25
+
+Evaluate a group of commands with a dedicated variable and/or policy scope.
+
+.. code-block:: cmake
+
+ block([SCOPE_FOR [POLICIES] [VARIABLES] ] [PROPAGATE <var-name>...])
+ <commands>
+ endblock()
+
+All commands between ``block()`` and the matching :command:`endblock` are
+recorded without being invoked. Once the :command:`endblock` is evaluated, the
+recorded list of commands is invoked inside the requested scopes, then the
+scopes created by the ``block()`` command are removed.
+
+``SCOPE_FOR``
+ Specify which scopes must be created.
+
+ ``POLICIES``
+ Create a new policy scope. This is equivalent to
+ :command:`cmake_policy(PUSH)`.
+
+ ``VARIABLES``
+ Create a new variable scope.
+
+ If ``SCOPE_FOR`` is not specified, this is equivalent to:
+
+ .. code-block:: cmake
+
+ block(SCOPE_FOR VARIABLES POLICIES)
+
+``PROPAGATE``
+ When a variable scope is created by the :command:`block` command, this
+ option sets or unsets the specified variables in the parent scope. This is
+ equivalent to :command:`set(PARENT_SCOPE)` or :command:`unset(PARENT_SCOPE)`
+ commands.
+
+ .. code-block:: cmake
+
+ set(var1 "INIT1")
+ set(var2 "INIT2")
+
+ block(PROPAGATE var1 var2)
+ set(var1 "VALUE1")
+ unset(var2)
+ endblock()
+
+ # Now var1 holds VALUE1, and var2 is unset
+
+ This option is only allowed when a variable scope is created. An error will
+ be raised in the other cases.
+
+When the ``block()`` is inside a :command:`foreach` or :command:`while`
+command, the :command:`break` and :command:`continue` commands can be used
+inside the block.
+
+.. code-block:: cmake
+
+ while(TRUE)
+ block()
+ ...
+ # the break() command will terminate the while() command
+ break()
+ endblock()
+ endwhile()
+
+
+See Also
+^^^^^^^^
+
+ * :command:`endblock`
+ * :command:`return`
+ * :command:`cmake_policy`
diff --git a/Help/command/build_command.rst b/Help/command/build_command.rst
index a03979d..3d86a2e 100644
--- a/Help/command/build_command.rst
+++ b/Help/command/build_command.rst
@@ -24,12 +24,12 @@ options, if any. The trailing ``-- -i`` option is added for
:ref:`Makefile Generators` if policy :policy:`CMP0061` is not set to
``NEW``.
-When invoked, this ``cmake --build`` command line will launch the
+When invoked, this :option:`cmake --build` command line will launch the
underlying build system tool.
.. versionadded:: 3.21
- The ``PARALLEL_LEVEL`` argument can be used to set the ``--parallel``
- flag.
+ The ``PARALLEL_LEVEL`` argument can be used to set the
+ :option:`--parallel <cmake--build --parallel>` flag.
.. code-block:: cmake
@@ -39,7 +39,7 @@ This second signature is deprecated, but still available for backwards
compatibility. Use the first signature instead.
It sets the given ``<cachevariable>`` to a command-line string as
-above but without the ``--target`` option.
+above but without the :option:`--target <cmake--build --target>` option.
The ``<makecommand>`` is ignored but should be the full path to
devenv, nmake, make or one of the end user build tools
for legacy invocations.
diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst
index cb8d60b..8801a9f 100644
--- a/Help/command/cmake_language.rst
+++ b/Help/command/cmake_language.rst
@@ -14,6 +14,7 @@ Synopsis
cmake_language(`EVAL`_ CODE <code>...)
cmake_language(`DEFER`_ <options>... CALL <command> [<arg>...])
cmake_language(`SET_DEPENDENCY_PROVIDER`_ <command> SUPPORTED_METHODS <methods>...)
+ cmake_language(`GET_MESSAGE_LOG_LEVEL`_ <out-var>)
Introduction
^^^^^^^^^^^^
@@ -50,6 +51,7 @@ is equivalent to
To ensure consistency of the code, the following commands are not allowed:
* ``if`` / ``elseif`` / ``else`` / ``endif``
+ * ``block`` / ``endblock``
* ``while`` / ``endwhile``
* ``foreach`` / ``endforeach``
* ``function`` / ``endfunction``
@@ -491,3 +493,29 @@ calling the provider command recursively for the same dependency.
SET_DEPENDENCY_PROVIDER mycomp_provide_dependency
SUPPORTED_METHODS FIND_PACKAGE
)
+
+Getting current message log level
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.25
+
+.. _GET_MESSAGE_LOG_LEVEL:
+.. _query_message_log_level:
+
+.. code-block:: cmake
+
+ cmake_language(GET_MESSAGE_LOG_LEVEL <output_variable>)
+
+Writes the current :command:`message` logging level
+into the given ``<output_variable>``.
+
+See :command:`message` for the possible logging levels.
+
+The current message logging level can be set either using the
+:option:`--log-level <cmake --log-level>`
+command line option of the :manual:`cmake(1)` program or using
+the :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable.
+
+If both the command line option and the variable are set, the command line
+option takes precedence. If neither are set, the default logging level
+is returned.
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index 94060d9..54fc548 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -103,6 +103,47 @@ Calls to the :command:`cmake_minimum_required(VERSION)`,
``cmake_policy(VERSION)``, or ``cmake_policy(SET)`` commands
influence only the current top of the policy stack.
+.. versionadded:: 3.25
+ The :command:`block` and :command:`endblock` commands offer a more flexible
+ and more secure way to manage the policy stack. The pop action is done
+ automatically when the :command:`endblock` command is executed, so it avoid
+ to call the :command:`cmake_policy(POP)` command before each
+ :command:`return` command.
+
+ .. code-block:: cmake
+
+ # stack management with cmake_policy()
+ function(my_func)
+ cmake_policy(PUSH)
+ cmake_policy(SET ...)
+ if (<cond1>)
+ ...
+ cmake_policy(POP)
+ return()
+ elseif(<cond2>)
+ ...
+ cmake_policy(POP)
+ return()
+ endif()
+ ...
+ cmake_policy(POP)
+ endfunction()
+
+ # stack management with block()/endblock()
+ function(my_func)
+ block(SCOPE_FOR POLICIES)
+ cmake_policy(SET ...)
+ if (<cond1>)
+ ...
+ return()
+ elseif(<cond2>)
+ ...
+ return()
+ endif()
+ ...
+ endblock()
+ endfunction()
+
Commands created by the :command:`function` and :command:`macro`
commands record policy settings when they are created and
use the pre-record policies when they are invoked. If the function or
diff --git a/Help/command/continue.rst b/Help/command/continue.rst
index f62802e..e8012ee 100644
--- a/Help/command/continue.rst
+++ b/Help/command/continue.rst
@@ -9,8 +9,8 @@ Continue to the top of enclosing foreach or while loop.
continue()
-The ``continue`` command allows a cmake script to abort the rest of a block
-in a :command:`foreach` or :command:`while` loop, and start at the top of
-the next iteration.
+The ``continue()`` command allows a cmake script to abort the rest of the
+current iteration of a :command:`foreach` or :command:`while` loop, and start
+at the top of the next iteration.
See also the :command:`break` command.
diff --git a/Help/command/ctest_build.rst b/Help/command/ctest_build.rst
index e05df1a..8c81f2d 100644
--- a/Help/command/ctest_build.rst
+++ b/Help/command/ctest_build.rst
@@ -40,8 +40,8 @@ The options are:
``CONFIGURATION <config>``
Specify the build configuration (e.g. ``Debug``). If not
specified the ``CTEST_BUILD_CONFIGURATION`` variable will be checked.
- Otherwise the ``-C <cfg>`` option given to the :manual:`ctest(1)`
- command will be used, if any.
+ Otherwise the :option:`-C \<cfg\> <ctest -C>` option given to the
+ :manual:`ctest(1)` command will be used, if any.
``PARALLEL_LEVEL <parallel>``
.. versionadded:: 3.21
@@ -54,7 +54,7 @@ The options are:
Pass additional arguments to the underlying build command.
If not specified the ``CTEST_BUILD_FLAGS`` variable will be checked.
This can, e.g., be used to trigger a parallel build using the
- ``-j`` option of make. See the :module:`ProcessorCount` module
+ ``-j`` option of ``make``. See the :module:`ProcessorCount` module
for an example.
``PROJECT_NAME <project-name>``
diff --git a/Help/command/ctest_run_script.rst b/Help/command/ctest_run_script.rst
index 5ec543e..a2b348f 100644
--- a/Help/command/ctest_run_script.rst
+++ b/Help/command/ctest_run_script.rst
@@ -1,15 +1,15 @@
ctest_run_script
----------------
-runs a ctest -S script
+runs a :option:`ctest -S` script
::
ctest_run_script([NEW_PROCESS] script_file_name script_file_name1
script_file_name2 ... [RETURN_VALUE var])
-Runs a script or scripts much like if it was run from ctest -S. If no
-argument is provided then the current script is run using the current
+Runs a script or scripts much like if it was run from :option:`ctest -S`.
+If no argument is provided then the current script is run using the current
settings of the variables. If ``NEW_PROCESS`` is specified then each
script will be run in a separate process.If ``RETURN_VALUE`` is specified
the return value of the last script run will be put into ``var``.
diff --git a/Help/command/ctest_start.rst b/Help/command/ctest_start.rst
index c0f3c6d..921279a 100644
--- a/Help/command/ctest_start.rst
+++ b/Help/command/ctest_start.rst
@@ -45,7 +45,7 @@ The parameters are as follows:
ctest_start(Experimental GROUP GroupExperimental)
- Later, in another ``ctest -S`` script:
+ Later, in another :option:`ctest -S` script:
.. code-block:: cmake
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index 65f82d7..4f9f891 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -109,8 +109,9 @@ The options are:
While running tests in parallel, try not to start tests when they
may cause the CPU load to pass above a given threshold. If not
specified the :variable:`CTEST_TEST_LOAD` variable will be checked,
- and then the ``--test-load`` command-line argument to :manual:`ctest(1)`.
- See also the ``TestLoad`` setting in the :ref:`CTest Test Step`.
+ and then the :option:`--test-load <ctest --test-load>` command-line
+ argument to :manual:`ctest(1)`. See also the ``TestLoad`` setting
+ in the :ref:`CTest Test Step`.
``REPEAT <mode>:<n>``
.. versionadded:: 3.17
@@ -176,8 +177,9 @@ See also the :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`,
:variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE` and
:variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variables, along with their
corresponding :manual:`ctest(1)` command line options
-``--test-output-size-passed``, ``--test-output-size-failed``, and
-``--test-output-truncation``.
+:option:`--test-output-size-passed <ctest --test-output-size-passed>`,
+:option:`--test-output-size-failed <ctest --test-output-size-failed>`, and
+:option:`--test-output-truncation <ctest --test-output-truncation>`.
.. _`Additional Test Measurements`:
diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst
index d2acbc8..d9103b8 100644
--- a/Help/command/enable_language.rst
+++ b/Help/command/enable_language.rst
@@ -1,13 +1,14 @@
enable_language
---------------
-Enable a language (CXX/C/OBJC/OBJCXX/Fortran/etc)
+
+Enable languages (CXX/C/OBJC/OBJCXX/Fortran/etc)
.. code-block:: cmake
- enable_language(<lang> [OPTIONAL] )
+ enable_language(<lang>... [OPTIONAL])
-Enables support for the named language in CMake. This is
-the same as the :command:`project` command but does not create any of the extra
+Enables support for the named languages in CMake. This is the same as
+the :command:`project` command but does not create any of the extra
variables that are created by the project command. Example languages
are ``CXX``, ``C``, ``CUDA``, ``OBJC``, ``OBJCXX``, ``Fortran``,
``HIP``, ``ISPC``, and ``ASM``.
diff --git a/Help/command/endblock.rst b/Help/command/endblock.rst
new file mode 100644
index 0000000..3b21c12
--- /dev/null
+++ b/Help/command/endblock.rst
@@ -0,0 +1,11 @@
+endblock
+--------
+
+.. versionadded:: 3.25
+
+Ends a list of commands in a :command:`block` and removes the scopes
+created by the :command:`block` command.
+
+.. code-block:: cmake
+
+ endblock()
diff --git a/Help/command/export.rst b/Help/command/export.rst
index dc69645..0f79f63 100644
--- a/Help/command/export.rst
+++ b/Help/command/export.rst
@@ -25,7 +25,8 @@ Exporting Targets
.. code-block:: cmake
export(TARGETS <target>... [NAMESPACE <namespace>]
- [APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES])
+ [APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES]
+ [CXX_MODULES_DIRECTORY <directory>])
Creates a file ``<filename>`` that may be included by outside projects to
import targets named by ``<target>...`` from the current project's build tree.
@@ -52,6 +53,16 @@ The options are:
in the export, even when policy :policy:`CMP0022` is NEW. This is useful
to support consumers using CMake versions older than 2.8.12.
+``CXX_MODULES_DIRECTORY <directory>``
+
+ .. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+ Export C++ module properties to files under the given directory. Each file
+ will be named according to the target's export name (without any namespace).
+ These files will automatically be included from the export file.
+
This signature requires all targets to be listed explicitly. If a library
target is included in the export, but a target to which it links is not
included, the behavior is unspecified. See the `export(EXPORT)`_ signature
@@ -95,7 +106,8 @@ Exporting Targets matching install(EXPORT)
.. code-block:: cmake
- export(EXPORT <export-name> [NAMESPACE <namespace>] [FILE <filename>])
+ export(EXPORT <export-name> [NAMESPACE <namespace>] [FILE <filename>]
+ [CXX_MODULES_DIRECTORY <directory>])
Creates a file ``<filename>`` that may be included by outside projects to
import targets from the current project's build tree. This is the same
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 3374d2d..fbe2a81 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -1121,8 +1121,11 @@ Additional options to ``DOWNLOAD`` are:
Verify that the downloaded content hash matches the expected value, where
``ALGO`` is one of the algorithms supported by ``file(<HASH>)``.
- If it does not match, the operation fails with an error. It is an error to
- specify this if ``DOWNLOAD`` is not given a ``<file>``.
+ If the file already exists and matches the hash, the download is skipped.
+ If the file already exists and does not match the hash, the file is
+ downloaded again. If after download the file does not match the hash, the
+ operation fails with an error. It is an error to specify this option if
+ ``DOWNLOAD`` is not given a ``<file>``.
``EXPECTED_MD5 <value>``
Historical short-hand for ``EXPECTED_HASH MD5=<value>``. It is an error to
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index c96d84e..c99c73d 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -285,29 +285,40 @@ CMake constructs a set of possible installation prefixes for the
package. Under each prefix several directories are searched for a
configuration file. The tables below show the directories searched.
Each entry is meant for installation trees following Windows (``W``), UNIX
-(``U``), or Apple (``A``) conventions::
-
- <prefix>/ (W)
- <prefix>/(cmake|CMake)/ (W)
- <prefix>/<name>*/ (W)
- <prefix>/<name>*/(cmake|CMake)/ (W)
- <prefix>/(lib/<arch>|lib*|share)/cmake/<name>*/ (U)
- <prefix>/(lib/<arch>|lib*|share)/<name>*/ (U)
- <prefix>/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/ (U)
- <prefix>/<name>*/(lib/<arch>|lib*|share)/cmake/<name>*/ (W/U)
- <prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/ (W/U)
- <prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/ (W/U)
+(``U``), or Apple (``A``) conventions:
+
+==================================================================== ==========
+ Entry Convention
+==================================================================== ==========
+ ``<prefix>/`` W
+ ``<prefix>/(cmake|CMake)/`` W
+ ``<prefix>/<name>*/`` W
+ ``<prefix>/<name>*/(cmake|CMake)/`` W
+ ``<prefix>/<name>*/(cmake|CMake)/<name>*/`` [#]_ W
+ ``<prefix>/(lib/<arch>|lib*|share)/cmake/<name>*/`` U
+ ``<prefix>/(lib/<arch>|lib*|share)/<name>*/`` U
+ ``<prefix>/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/`` U
+ ``<prefix>/<name>*/(lib/<arch>|lib*|share)/cmake/<name>*/`` W/U
+ ``<prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/`` W/U
+ ``<prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/`` W/U
+==================================================================== ==========
+
+.. [#] .. versionadded:: 3.25
On systems supporting macOS :prop_tgt:`FRAMEWORK` and :prop_tgt:`BUNDLE`, the
following directories are searched for Frameworks or Application Bundles
-containing a configuration file::
-
- <prefix>/<name>.framework/Resources/ (A)
- <prefix>/<name>.framework/Resources/CMake/ (A)
- <prefix>/<name>.framework/Versions/*/Resources/ (A)
- <prefix>/<name>.framework/Versions/*/Resources/CMake/ (A)
- <prefix>/<name>.app/Contents/Resources/ (A)
- <prefix>/<name>.app/Contents/Resources/CMake/ (A)
+containing a configuration file:
+
+=========================================================== ==========
+ Entry Convention
+=========================================================== ==========
+ ``<prefix>/<name>.framework/Resources/`` A
+ ``<prefix>/<name>.framework/Resources/CMake/`` A
+ ``<prefix>/<name>.framework/Versions/*/Resources/`` A
+ ``<prefix>/<name>.framework/Versions/*/Resources/CMake/`` A
+ ``<prefix>/<name>.app/Contents/Resources/`` A
+ ``<prefix>/<name>.app/Contents/Resources/CMake/`` A
+=========================================================== ==========
In all cases the ``<name>`` is treated as case-insensitive and corresponds
to any of the names specified (``<PackageName>`` or names given by ``NAMES``).
@@ -368,7 +379,7 @@ enabled.
See policy :policy:`CMP0074`.
2. Search paths specified in cmake-specific cache variables. These
- are intended to be used on the command line with a ``-DVAR=value``.
+ are intended to be used on the command line with a :option:`-DVAR=VALUE <cmake -D>`.
The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the
:variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``:
diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst
index d9f54ca..ddf8dfa 100644
--- a/Help/command/foreach.rst
+++ b/Help/command/foreach.rst
@@ -130,3 +130,11 @@ yields
-- en=two, ba=dua
-- en=three, ba=tiga
-- en=four, ba=
+
+See Also
+^^^^^^^^
+
+* :command:`break`
+* :command:`continue`
+* :command:`endforeach`
+* :command:`while`
diff --git a/Help/command/function.rst b/Help/command/function.rst
index 3d25aa4..fc55c03 100644
--- a/Help/command/function.rst
+++ b/Help/command/function.rst
@@ -73,3 +73,9 @@ argument. Referencing to ``ARGV#`` arguments beyond ``ARGC`` have
undefined behavior. Checking that ``ARGC`` is greater than ``#`` is
the only way to ensure that ``ARGV#`` was passed to the function as an
extra argument.
+
+See Also
+^^^^^^^^
+
+* :command:`endfunction`
+* :command:`return`
diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst
index e02b9bc..6bcc1ef 100644
--- a/Help/command/get_test_property.rst
+++ b/Help/command/get_test_property.rst
@@ -16,6 +16,7 @@ relevant parent scope as described for the :command:`define_property`
command and if still unable to find the property, ``VAR`` will be set to
an empty string.
-For a list of standard properties you can type ``cmake --help-property-list``.
+For a list of standard properties you can type
+:option:`cmake --help-property-list`.
See also the more general :command:`get_property` command.
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 301cdce..b72769f 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -424,3 +424,10 @@ There is no automatic evaluation for environment or cache
:ref:`Variable References`. Their values must be referenced as
``$ENV{<name>}`` or ``$CACHE{<name>}`` wherever the above-documented
condition syntax accepts ``<variable|string>``.
+
+See also
+^^^^^^^^
+
+ * :command:`else`
+ * :command:`elseif`
+ * :command:`endif`
diff --git a/Help/command/install.rst b/Help/command/install.rst
index 973aa31..feff436 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -132,7 +132,7 @@ Installing Targets
install(TARGETS targets... [EXPORT <export-name>]
[RUNTIME_DEPENDENCIES args...|RUNTIME_DEPENDENCY_SET <set-name>]
[[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE|
- PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE|FILE_SET <set-name>]
+ PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE|FILE_SET <set-name>|CXX_MODULES_BMI]
[DESTINATION <dir>]
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
@@ -215,11 +215,21 @@ that may be installed:
``/blah/include/myproj/here.h`` with a base directory ``/blah/include``
would be installed to ``myproj/here.h`` below the destination.
+``CXX_MODULES_BMI``
+
+ .. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+ Any module files from C++ modules from ``PUBLIC`` sources in a file set of
+ type ``CXX_MODULES`` will be installed to the given ``DESTINATION``. All
+ modules are placed directly in the destination as no directory structure is
+ derived from the names of the modules. An empty ``DESTINATION`` may be used
+ to suppress installing these files (for use in generic code).
+
For each of these arguments given, the arguments following them only apply
to the target or file type specified in the argument. If none is given, the
-installation properties apply to all target types. If only one is given then
-only targets of that type will be installed (which can be used to install
-just a DLL or just an import library.)
+installation properties apply to all target types.
For regular executables, static libraries and shared libraries, the
``DESTINATION`` argument is not required. For these target types, when
@@ -233,6 +243,14 @@ Apple bundles and frameworks. A destination can be omitted for interface and
object libraries, but they are handled differently (see the discussion of this
topic toward the end of this section).
+For shared libraries on DLL platforms, if neither ``RUNTIME`` nor ``ARCHIVE``
+destinations are specified, both the ``RUNTIME`` and ``ARCHIVE`` components are
+installed to their default destinations. If either a ``RUNTIME`` or ``ARCHIVE``
+destination is specified, the component is installed to that destination, and
+the other component is not installed. If both ``RUNTIME`` and ``ARCHIVE``
+destinations are specified, then both components are installed to their
+respective destinations.
+
The following table shows the target types with their associated variables and
built-in defaults that apply when no destination is given:
@@ -778,9 +796,10 @@ Installing Exports
.. code-block:: cmake
install(EXPORT <export-name> DESTINATION <dir>
- [NAMESPACE <namespace>] [[FILE <name>.cmake]|
+ [NAMESPACE <namespace>] [FILE <name>.cmake]
[PERMISSIONS permissions...]
- [CONFIGURATIONS [Debug|Release|...]]
+ [CONFIGURATIONS [Debug|Release|...]
+ [CXX_MODULES_DIRECTORY <directory>]
[EXPORT_LINK_INTERFACE_LIBRARIES]
[COMPONENT <component>]
[EXCLUDE_FROM_ALL])
@@ -836,6 +855,18 @@ library is always installed if the headers and CMake export file are present.
to an ndk build system complete with transitive dependencies, include flags
and defines required to use the libraries.
+``CXX_MODULES_DIRECTORY``
+
+ .. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+ Specify a subdirectory to store C++ module information for targets in the
+ export set. This directory will be populated with files which add the
+ necessary target property information to the relevant targets. Note that
+ without this information, none of the C++ modules which are part of the
+ targets in the export set will support being imported in consuming targets.
+
The ``EXPORT`` form is useful to help outside projects use targets built
and installed by the current project. For example, the code
@@ -932,12 +963,12 @@ Generated Installation Script
.. note::
Use of this feature is not recommended. Please consider using the
- ``--install`` argument of :manual:`cmake(1)` instead.
+ :option:`cmake --install` instead.
The ``install()`` command generates a file, ``cmake_install.cmake``, inside
the build directory, which is used internally by the generated install target
-and by CPack. You can also invoke this script manually with ``cmake -P``. This
-script accepts several variables:
+and by CPack. You can also invoke this script manually with
+:option:`cmake -P`. This script accepts several variables:
``COMPONENT``
Set this variable to install only a single CPack component as opposed to all
diff --git a/Help/command/message.rst b/Help/command/message.rst
index ca4f5c1..77d21c8 100644
--- a/Help/command/message.rst
+++ b/Help/command/message.rst
@@ -83,8 +83,9 @@ are sent to stderr and are not prefixed with hyphens. The
:manual:`CMake GUI <cmake-gui(1)>` displays all messages in its log area.
The :manual:`curses interface <ccmake(1)>` shows ``STATUS`` to ``TRACE``
messages one at a time on a status line and other messages in an
-interactive pop-up box. The ``--log-level`` command-line option to each of
-these tools can be used to control which messages will be shown.
+interactive pop-up box. The :option:`--log-level <cmake --log-level>`
+command-line option to each of these tools can be used to control which
+messages will be shown.
.. versionadded:: 3.17
To make a log level persist between CMake runs, the
@@ -104,7 +105,7 @@ these tools can be used to control which messages will be shown.
list variable to a dot-separated string. The message context will always
appear before any indenting content but after any automatically added leading
hyphens. By default, message context is not shown, it has to be explicitly
- enabled by giving the :manual:`cmake <cmake(1)>` ``--log-context``
+ enabled by giving the :option:`cmake --log-context`
command-line option or by setting the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW`
variable to true. See the :variable:`CMAKE_MESSAGE_CONTEXT` documentation for
usage examples.
diff --git a/Help/command/return.rst b/Help/command/return.rst
index ec009d8..3013b52 100644
--- a/Help/command/return.rst
+++ b/Help/command/return.rst
@@ -5,16 +5,87 @@ Return from a file, directory or function.
.. code-block:: cmake
- return()
+ return([PROPAGATE <var-name>...])
-Returns from a file, directory or function. When this command is
-encountered in an included file (via :command:`include` or
+When this command is encountered in an included file (via :command:`include` or
:command:`find_package`), it causes processing of the current file to stop
and control is returned to the including file. If it is encountered in a
-file which is not included by another file, e.g. a ``CMakeLists.txt``,
+file which is not included by another file, e.g. a ``CMakeLists.txt``,
deferred calls scheduled by :command:`cmake_language(DEFER)` are invoked and
-control is returned to the parent directory if there is one. If return is
-called in a function, control is returned to the caller of the function.
+control is returned to the parent directory if there is one.
-Note that a :command:`macro <macro>`, unlike a :command:`function <function>`,
+If ``return()`` is called in a function, control is returned to the caller
+of that function. Note that a :command:`macro`, unlike a :command:`function`,
is expanded in place and therefore cannot handle ``return()``.
+
+Policy :policy:`CMP0140` controls the behavior regarding the arguments of the
+command. All arguments are ignored unless that policy is set to ``NEW``.
+
+``PROPAGATE``
+ .. versionadded:: 3.25
+
+ This option sets or unsets the specified variables in the parent directory or
+ function caller scope. This is equivalent to :command:`set(PARENT_SCOPE)` or
+ :command:`unset(PARENT_SCOPE)` commands, except for the way it interacts
+ with the :command:`block` command, as described below.
+
+ The ``PROPAGATE`` option can be very useful in conjunction with the
+ :command:`block` command. A :command:`return` will propagate the
+ specified variables through any enclosing block scopes created by the
+ :command:`block` commands. Inside a function, this ensures the variables
+ are propagated to the function's caller, regardless of any blocks within
+ the function. If not inside a function, it ensures the variables are
+ propagated to the parent file or directory scope. For example:
+
+ .. code-block:: cmake
+ :caption: CMakeLists.txt
+
+ cmake_version_required(VERSION 3.25)
+ project(example)
+
+ set(var1 "top-value")
+
+ block(SCOPE_FOR VARIABLES)
+ add_subdirectory(subDir)
+ # var1 has the value "block-nested"
+ endblock()
+
+ # var1 has the value "top-value"
+
+ .. code-block:: cmake
+ :caption: subDir/CMakeLists.txt
+
+ function(multi_scopes result_var1 result_var2)
+ block(SCOPE_FOR VARIABLES)
+ # This would only propagate out of the immediate block, not to
+ # the caller of the function.
+ #set(${result_var1} "new-value" PARENT_SCOPE)
+ #unset(${result_var2} PARENT_SCOPE)
+
+ # This propagates the variables through the enclosing block and
+ # out to the caller of the function.
+ set(${result_var1} "new-value")
+ unset(${result_var2})
+ return(PROPAGATE ${result_var1} ${result_var2})
+ endblock()
+ endfunction()
+
+ set(var1 "some-value")
+ set(var2 "another-value")
+
+ multi_scopes(var1 var2)
+ # Now var1 will hold "new-value" and var2 will be unset
+
+ block(SCOPE_FOR VARIABLES)
+ # This return() will set var1 in the directory scope that included us
+ # via add_subdirectory(). The surrounding block() here does not limit
+ # propagation to the current file, but the block() in the parent
+ # directory scope does prevent propagation going any further.
+ set(var1 "block-nested")
+ return(PROPAGATE var1)
+ endblock()
+
+See Also
+^^^^^^^^
+
+ * :command:`block`
diff --git a/Help/command/set.rst b/Help/command/set.rst
index af862e4..90b57d2 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -22,12 +22,17 @@ Set Normal Variable
Sets the given ``<variable>`` in the current function or directory scope.
If the ``PARENT_SCOPE`` option is given the variable will be set in
-the scope above the current scope. Each new directory or function
-creates a new scope. This command will set the value of a variable
-into the parent directory or calling function (whichever is applicable
-to the case at hand). The previous state of the variable's value stays the
-same in the current scope (e.g., if it was undefined before, it is still
-undefined and if it had a value, it is still that value).
+the scope above the current scope. Each new directory or :command:`function`
+command creates a new scope. A scope can also be created with the
+:command:`block` command. This command will set the value of a variable into
+the parent directory, calling function or encompassing scope (whichever is
+applicable to the case at hand). The previous state of the variable's value
+stays the same in the current scope (e.g., if it was undefined before, it is
+still undefined and if it had a value, it is still that value).
+
+The :command:`block(PROPAGATE)` and :command:`return(PROPAGATE)` commands can
+be used as an alternate method to the :command:`set(PARENT_SCOPE)` and
+:command:`unset(PARENT_SCOPE)` commands to update the parent scope.
Set Cache Entry
^^^^^^^^^^^^^^^
@@ -78,7 +83,7 @@ option is given then the cache entry will be set to the given value.
It is possible for the cache entry to exist prior to the call but
have no type set if it was created on the :manual:`cmake(1)` command
-line by a user through the ``-D<var>=<value>`` option without
+line by a user through the :option:`-D\<var\>=\<value\> <cmake -D>` option without
specifying a type. In this case the ``set`` command will add the
type. Furthermore, if the ``<type>`` is ``PATH`` or ``FILEPATH``
and the ``<value>`` provided on the command line is a relative path,
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index 3fb113a..2d292af 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -15,9 +15,9 @@ named ``<target>`` must have been created by a command such as
:ref:`ALIAS target <Alias Targets>`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
-items will populate the :prop_tgt:`COMPILE_DEFINITIONS` property of
-``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
+specify the :ref:`scope <Target Usage Requirements>` of the following arguments.
+``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`COMPILE_DEFINITIONS`
+property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` property of ``<target>``.
The following arguments specify compile definitions. Repeated calls for the
same ``<target>`` append items in the order called.
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index e45b209..0d86c91 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -22,9 +22,9 @@ If ``BEFORE`` is specified, the content will be prepended to the property
instead of being appended.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
-items will populate the :prop_tgt:`COMPILE_OPTIONS` property of
-``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
+specify the :ref:`scope <Target Usage Requirements>` of the following arguments.
+``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`COMPILE_OPTIONS`
+property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_COMPILE_OPTIONS` property of ``<target>``.
The following arguments specify compile options. Repeated calls for the same
``<target>`` append items in the order called.
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index 9a99a7d..f13ff29 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -18,9 +18,9 @@ By using ``AFTER`` or ``BEFORE`` explicitly, you can select between appending
and prepending, independent of the default.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to specify
-the scope of the following arguments. ``PRIVATE`` and ``PUBLIC`` items will
-populate the :prop_tgt:`INCLUDE_DIRECTORIES` property of ``<target>``.
-``PUBLIC`` and ``INTERFACE`` items will populate the
+the :ref:`scope <Target Usage Requirements>` of the following arguments.
+``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`INCLUDE_DIRECTORIES`
+property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` property of ``<target>``.
The following arguments specify include directories.
diff --git a/Help/command/target_link_directories.rst b/Help/command/target_link_directories.rst
index bb75a3d..b72f746 100644
--- a/Help/command/target_link_directories.rst
+++ b/Help/command/target_link_directories.rst
@@ -21,11 +21,12 @@ The named ``<target>`` must have been created by a command such as
:ref:`ALIAS target <Alias Targets>`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the scope of the items that follow them. ``PRIVATE`` and
-``PUBLIC`` items will populate the :prop_tgt:`LINK_DIRECTORIES` property
-of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
-:prop_tgt:`INTERFACE_LINK_DIRECTORIES` property of ``<target>``
-(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items).
+specify the :ref:`scope <Target Usage Requirements>` of the items that follow
+them. ``PRIVATE`` and ``PUBLIC`` items will populate the
+:prop_tgt:`LINK_DIRECTORIES` property of ``<target>``. ``PUBLIC`` and
+``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_LINK_DIRECTORIES`
+property of ``<target>`` (:ref:`IMPORTED targets <Imported Targets>` only
+support ``INTERFACE`` items).
Each item specifies a link directory and will be converted to an absolute
path if necessary before adding it to the relevant property. Repeated
calls for the same ``<target>`` append items in the order called.
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index c85094a..bb7b5cc 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -146,8 +146,10 @@ Libraries for a Target and/or its Dependents
<PRIVATE|PUBLIC|INTERFACE> <item>...
[<PRIVATE|PUBLIC|INTERFACE> <item>...]...)
-The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to
+The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE``
+:ref:`scope <Target Usage Requirements>` keywords can be used to
specify both the link dependencies and the link interface in one command.
+
Libraries and targets following ``PUBLIC`` are linked to, and are made
part of the link interface. Libraries and targets following ``PRIVATE``
are linked to, but are not made part of the link interface. Libraries
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index 87dff39..3cd0e64 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -32,9 +32,9 @@ If ``BEFORE`` is specified, the content will be prepended to the property
instead of being appended.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
-items will populate the :prop_tgt:`LINK_OPTIONS` property of
-``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
+specify the :ref:`scope <Target Usage Requirements>` of the following arguments.
+``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`LINK_OPTIONS`
+property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_LINK_OPTIONS` property of ``<target>``.
The following arguments specify link options. Repeated calls for the same
``<target>`` append items in the order called.
diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst
index 9f7dabb..84f5d12 100644
--- a/Help/command/target_precompile_headers.rst
+++ b/Help/command/target_precompile_headers.rst
@@ -25,9 +25,9 @@ The named ``<target>`` must have been created by a command such as
:ref:`ALIAS target <Alias Targets>`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
-items will populate the :prop_tgt:`PRECOMPILE_HEADERS` property of
-``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
+specify the :ref:`scope <Target Usage Requirements>` of the following arguments.
+``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`PRECOMPILE_HEADERS`
+property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_PRECOMPILE_HEADERS` property of ``<target>``
(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items).
Repeated calls for the same ``<target>`` will append items in the order called.
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
index 72119f6..461175a 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -22,10 +22,10 @@ The named ``<target>`` must have been created by a command such as
``<target>`` can be a custom target.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the scope of the source file paths (``<items>``) that follow
-them. ``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`SOURCES`
-property of ``<target>``, which are used when building the target itself.
-``PUBLIC`` and ``INTERFACE`` items will populate the
+specify the :ref:`scope <Target Usage Requirements>` of the source file paths
+(``<items>``) that follow them. ``PRIVATE`` and ``PUBLIC`` items will
+populate the :prop_tgt:`SOURCES` property of ``<target>``, which are used when
+building the target itself. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_SOURCES` property of ``<target>``, which are used
when building dependents. A target created by :command:`add_custom_target`
can only have ``PRIVATE`` scope.
@@ -75,9 +75,33 @@ File Sets
Adds a file set to a target, or adds files to an existing file set. Targets
have zero or more named file sets. Each file set has a name, a type, a scope of
``INTERFACE``, ``PUBLIC``, or ``PRIVATE``, one or more base directories, and
-files within those directories. The only acceptable type is ``HEADERS``. The
-optional default file sets are named after their type. The target may not be a
-custom target or :prop_tgt:`FRAMEWORK` target.
+files within those directories. The acceptable types include:
+
+``HEADERS``
+
+ Sources intended to be used via a language's ``#include`` mechanism.
+
+``CXX_MODULES``
+
+ .. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+ Sources which contain C++ interface module or partition units (i.e., those
+ using the ``export`` keyword). This file set type may not have an
+ ``INTERFACE`` scope except on ``IMPORTED`` targets.
+
+``CXX_MODULE_HEADER_UNITS``
+
+ .. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+ C++ header sources which may be imported by other C++ source code. This file
+ set type may not have an ``INTERFACE`` scope except on ``IMPORTED`` targets.
+
+The optional default file sets are named after their type. The target may not
+be a custom target or :prop_tgt:`FRAMEWORK` target.
Files in a ``PRIVATE`` or ``PUBLIC`` file set are marked as source files for
the purposes of IDE integration. Additionally, files in ``HEADERS`` file sets
@@ -93,16 +117,17 @@ Each ``target_sources(FILE_SET)`` entry starts with ``INTERFACE``, ``PUBLIC``, o
The name of the file set to create or add to. It must contain only letters,
numbers and underscores. Names starting with a capital letter are reserved
- for built-in file sets predefined by CMake. The only predefined set name is
- ``HEADERS``. All other set names must not start with a capital letter or
+ for built-in file sets predefined by CMake. The only predefined set names
+ are those matching the acceptable types. All other set names must not start
+ with a capital letter or
underscore.
``TYPE <type>``
- Every file set is associated with a particular type of file. ``HEADERS``
- is currently the only defined type and it is an error to specify anything
- else. As a special case, if the name of the file set is ``HEADERS``, the
- type does not need to be specified and the ``TYPE <type>`` arguments can be
+ Every file set is associated with a particular type of file. Only types
+ specified above may be used and it is an error to specify anything else. As
+ a special case, if the name of the file set is one of the types, the type
+ does not need to be specified and the ``TYPE <type>`` arguments can be
omitted. For all other file set names, ``TYPE`` is required.
``BASE_DIRS <dirs>...``
@@ -134,6 +159,8 @@ Each ``target_sources(FILE_SET)`` entry starts with ``INTERFACE``, ``PUBLIC``, o
The following target properties are set by ``target_sources(FILE_SET)``,
but they should not generally be manipulated directly:
+For file sets of type ``HEADERS``:
+
* :prop_tgt:`HEADER_SETS`
* :prop_tgt:`INTERFACE_HEADER_SETS`
* :prop_tgt:`HEADER_SET`
@@ -141,17 +168,37 @@ but they should not generally be manipulated directly:
* :prop_tgt:`HEADER_DIRS`
* :prop_tgt:`HEADER_DIRS_<NAME>`
+For file sets of type ``CXX_MODULES``:
+
+* :prop_tgt:`CXX_MODULE_SETS`
+* :prop_tgt:`INTERFACE_CXX_MODULE_SETS`
+* :prop_tgt:`CXX_MODULE_SET`
+* :prop_tgt:`CXX_MODULE_SET_<NAME>`
+* :prop_tgt:`CXX_MODULE_DIRS`
+* :prop_tgt:`CXX_MODULE_DIRS_<NAME>`
+
+For file sets of type ``CXX_MODULE_HEADER_UNITS``:
+
+* :prop_tgt:`CXX_MODULE_HEADER_UNIT_SETS`
+* :prop_tgt:`INTERFACE_CXX_MODULE_HEADER_UNIT_SETS`
+* :prop_tgt:`CXX_MODULE_HEADER_UNIT_SET`
+* :prop_tgt:`CXX_MODULE_HEADER_UNIT_SET_<NAME>`
+* :prop_tgt:`CXX_MODULE_HEADER_UNIT_DIRS`
+* :prop_tgt:`CXX_MODULE_HEADER_UNIT_DIRS_<NAME>`
+
Target properties related to include directories are also modified by
``target_sources(FILE_SET)`` as follows:
:prop_tgt:`INCLUDE_DIRECTORIES`
- If the ``TYPE`` is ``HEADERS``, and the scope of the file set is ``PRIVATE``
- or ``PUBLIC``, all of the ``BASE_DIRS`` of the file set are wrapped in
- :genex:`$<BUILD_INTERFACE>` and appended to this property.
+ If the ``TYPE`` is ``HEADERS`` or ``CXX_MODULE_HEADER_UNITS``, and the scope
+ of the file set is ``PRIVATE`` or ``PUBLIC``, all of the ``BASE_DIRS`` of
+ the file set are wrapped in :genex:`$<BUILD_INTERFACE>` and appended to this
+ property.
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
- If the ``TYPE`` is ``HEADERS``, and the scope of the file set is
- ``INTERFACE`` or ``PUBLIC``, all of the ``BASE_DIRS`` of the file set are
- wrapped in :genex:`$<BUILD_INTERFACE>` and appended to this property.
+ If the ``TYPE`` is ``HEADERS`` or ``CXX_MODULE_HEADER_UNITS``, and the scope
+ of the file set is ``INTERFACE`` or ``PUBLIC``, all of the ``BASE_DIRS`` of
+ the file set are wrapped in :genex:`$<BUILD_INTERFACE>` and appended to this
+ property.
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 806a98d..9e9f39f 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -14,10 +14,16 @@ Try Compiling Whole Projects
.. code-block:: cmake
- try_compile(<resultVar> <bindir> <srcdir>
- <projectName> [<targetName>] [CMAKE_FLAGS <flags>...]
+ try_compile(<resultVar> PROJECT <projectName>
+ SOURCE_DIR <srcdir>
+ [BINARY_DIR <bindir>]
+ [TARGET <targetName>]
+ [NO_CACHE]
+ [CMAKE_FLAGS <flags>...]
[OUTPUT_VARIABLE <var>])
+.. versionadded:: 3.25
+
Try building a project. The success or failure of the ``try_compile``,
i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``<resultVar>``.
@@ -34,6 +40,17 @@ below for the meaning of other options.
Previously this was only done by the
:ref:`source file <Try Compiling Source Files>` signature.
+This command also supports an alternate signature
+which was present in older versions of CMake:
+
+.. code-block:: cmake
+
+ try_compile(<resultVar> <bindir> <srcdir>
+ <projectName> [<targetName>]
+ [NO_CACHE]
+ [CMAKE_FLAGS <flags>...]
+ [OUTPUT_VARIABLE <var>])
+
.. _`Try Compiling Source Files`:
Try Compiling Source Files
@@ -41,7 +58,12 @@ Try Compiling Source Files
.. code-block:: cmake
- try_compile(<resultVar> <bindir> <srcfile|SOURCES srcfile...>
+ try_compile(<resultVar>
+ <SOURCES <srcfile...> |
+ SOURCE_FROM_CONTENT <name> <content> |
+ SOURCE_FROM_VAR <name> <var> |
+ SOURCE_FROM_FILE <name> <path> >...
+ [NO_CACHE]
[CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
@@ -53,15 +75,19 @@ Try Compiling Source Files
[<LANG>_EXTENSIONS <bool>]
)
+.. versionadded:: 3.25
+
Try building an executable or static library from one or more source files
(which one is determined by the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE`
variable). The success or failure of the ``try_compile``, i.e. ``TRUE`` or
``FALSE`` respectively, is returned in ``<resultVar>``.
-In this form, one or more source files must be provided. If
-:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is unset or is set to ``EXECUTABLE``,
-the sources must include a definition for ``main`` and CMake will create a
-``CMakeLists.txt`` file to build the source(s) as an executable.
+In this form, one or more source files must be provided. Additionally, one of
+``SOURCES`` and/or ``SOURCE_FROM_*`` must precede other keywords.
+
+If :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is unset or is set to
+``EXECUTABLE``, the sources must include a definition for ``main`` and CMake
+will create a ``CMakeLists.txt`` file to build the source(s) as an executable.
If :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``STATIC_LIBRARY``,
a static library will be built instead and no definition for ``main`` is
required. For an executable, the generated ``CMakeLists.txt`` file would
@@ -76,11 +102,45 @@ contain something like the following:
target_link_options(cmTryCompileExec PRIVATE <LINK_OPTIONS from caller>)
target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES})
+CMake automatically generates, for each ``try_compile`` operation, a
+unique directory under ``${CMAKE_BINARY_DIR}/CMakeFiles/CMakeScratch``
+with an unspecified name. These directories are cleaned automatically unless
+:option:`--debug-trycompile <cmake --debug-trycompile>` is passed to ``cmake``.
+Such directories from previous runs are also unconditionally cleaned at the
+beginning of any ``cmake`` execution.
+
+This command also supports an alternate signature
+which was present in older versions of CMake:
+
+.. code-block:: cmake
+
+ try_compile(<resultVar> <bindir> <srcfile|SOURCES srcfile...>
+ [NO_CACHE]
+ [CMAKE_FLAGS <flags>...]
+ [COMPILE_DEFINITIONS <defs>...]
+ [LINK_OPTIONS <options>...]
+ [LINK_LIBRARIES <libs>...]
+ [OUTPUT_VARIABLE <var>]
+ [COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
+ [<LANG>_STANDARD <std>]
+ [<LANG>_STANDARD_REQUIRED <bool>]
+ [<LANG>_EXTENSIONS <bool>]
+ )
+
+In this version, ``try_compile`` will use ``<bindir>/CMakeFiles/CMakeTmp`` for
+its operation, and all such files will be cleaned automatically.
+For debugging, :option:`--debug-trycompile <cmake --debug-trycompile>` can be
+passed to ``cmake`` to avoid this clean. However, multiple sequential
+``try_compile`` operations, if given the same ``<bindir>``, will reuse this
+single output directory, such that you can only debug one such ``try_compile``
+call at a time. Use of the newer signature is recommended to simplify
+debugging of multiple ``try_compile`` operations.
+
The options are:
``CMAKE_FLAGS <flags>...``
- Specify flags of the form ``-DVAR:TYPE=VALUE`` to be passed to
- the ``cmake`` command-line used to drive the test build.
+ Specify flags of the form :option:`-DVAR:TYPE=VALUE <cmake -D>` to be passed
+ to the :manual:`cmake(1)` command-line used to drive the test build.
The above example shows how values for variables
``INCLUDE_DIRECTORIES``, ``LINK_DIRECTORIES``, and ``LINK_LIBRARIES``
are used.
@@ -111,9 +171,61 @@ The options are:
set the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated
project, depending on the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable.
+``NO_CACHE``
+ .. versionadded:: 3.25
+
+ The result will be stored in a normal variable rather than a cache entry.
+
+ The result variable is normally cached so that a simple pattern can be used
+ to avoid repeating the test on subsequent executions of CMake:
+
+ .. code-block:: cmake
+
+ if(NOT DEFINED RESULTVAR)
+ # ...(check-specific setup code)...
+ try_compile(RESULTVAR ...)
+ # ...(check-specific logging and cleanup code)...
+ endif()
+
+ If the guard variable and result variable are not the same (for example, if
+ the test is part of a larger inspection), ``NO_CACHE`` may be useful to avoid
+ leaking the intermediate result variable into the cache.
+
``OUTPUT_VARIABLE <var>``
Store the output from the build process in the given variable.
+``SOURCE_FROM_CONTENT <name> <content>``
+ .. versionadded:: 3.25
+
+ Write ``<content>`` to a file named ``<name>`` in the operation directory.
+ This can be used to bypass the need to separately write a source file when
+ the contents of the file are dynamically specified. The specified ``<name>``
+ is not allowed to contain path components.
+
+ ``SOURCE_FROM_CONTENT`` may be specified multiple times.
+
+``SOURCE_FROM_FILE <name> <path>``
+ .. versionadded:: 3.25
+
+ Copy ``<path>`` to a file named ``<name>`` in the operation directory. This
+ can be used to consolidate files into the operation directory, which may be
+ useful if a source which already exists (i.e. as a stand-alone file in a
+ project's source repository) needs to refer to other file(s) created by
+ ``SOURCE_FROM_*``. (Otherwise, ``SOURCES`` is usually more convenient.) The
+ specified ``<name>`` is not allowed to contain path components.
+
+``SOURCE_FROM_VAR <name> <var>``
+ .. versionadded:: 3.25
+
+ Write the contents of ``<var>`` to a file named ``<name>`` in the operation
+ directory. This is the same as ``SOURCE_FROM_CONTENT``, but takes the
+ contents from the specified CMake variable, rather than directly, which may
+ be useful when passing arguments through a function which wraps
+ ``try_compile``. The specified ``<name>`` is not allowed to contain path
+ components.
+
+ ``SOURCE_FROM_VAR`` may be specified multiple times.
+
``<LANG>_STANDARD <std>``
.. versionadded:: 3.8
@@ -136,17 +248,6 @@ The options are:
:prop_tgt:`OBJC_EXTENSIONS`, :prop_tgt:`OBJCXX_EXTENSIONS`,
or :prop_tgt:`CUDA_EXTENSIONS` target property of the generated project.
-In this version all files in ``<bindir>/CMakeFiles/CMakeTmp`` will be
-cleaned automatically. For debugging, ``--debug-trycompile`` can be
-passed to ``cmake`` to avoid this clean. However, multiple sequential
-``try_compile`` operations reuse this single output directory. If you use
-``--debug-trycompile``, you can only debug one ``try_compile`` call at a time.
-The recommended procedure is to protect all ``try_compile`` calls in your
-project by ``if(NOT DEFINED <resultVar>)`` logic, configure with cmake
-all the way through once, then delete the cache entry associated with
-the try_compile call of interest, and then re-run cmake again with
-``--debug-trycompile``.
-
Other Behavior Settings
^^^^^^^^^^^^^^^^^^^^^^^
@@ -214,9 +315,15 @@ a build configuration.
the generated project (unless overridden by an explicit option).
.. versionchanged:: 3.14
- For the :generator:`Green Hills MULTI` generator the GHS toolset and target
- system customization cache variables are also propagated into the test project.
+ For the :generator:`Green Hills MULTI` generator, the GHS toolset and target
+ system customization cache variables are also propagated into the test
+ project.
.. versionadded:: 3.24
The :variable:`CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable may be
set to disable passing platform variables into the test project.
+
+.. versionadded:: 3.25
+ If :policy:`CMP0141` is set to ``NEW``, one can use
+ :variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` to specify the MSVC debug
+ information format.
diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst
index fc41cdd..cd41a4b 100644
--- a/Help/command/try_run.rst
+++ b/Help/command/try_run.rst
@@ -13,68 +13,99 @@ Try Compiling and Running Source Files
.. code-block:: cmake
try_run(<runResultVar> <compileResultVar>
- <bindir> <srcfile> [CMAKE_FLAGS <flags>...]
+ <SOURCES <srcfile...> |
+ SOURCE_FROM_CONTENT <name> <content> |
+ SOURCE_FROM_VAR <name> <var> |
+ SOURCE_FROM_FILE <name> <path> >...
+ [NO_CACHE]
+ [CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
[COMPILE_OUTPUT_VARIABLE <var>]
+ [COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
+ [<LANG>_STANDARD <std>]
+ [<LANG>_STANDARD_REQUIRED <bool>]
+ [<LANG>_EXTENSIONS <bool>]
[RUN_OUTPUT_VARIABLE <var>]
+ [RUN_OUTPUT_STDOUT_VARIABLE <var>]
+ [RUN_OUTPUT_STDERR_VARIABLE <var>]
[OUTPUT_VARIABLE <var>]
[WORKING_DIRECTORY <var>]
- [ARGS <args>...])
+ [ARGS <args>...]
+ )
+
+.. versionadded:: 3.25
Try compiling a ``<srcfile>``. Returns ``TRUE`` or ``FALSE`` for success
or failure in ``<compileResultVar>``. If the compile succeeded, runs the
executable and returns its exit code in ``<runResultVar>``. If the
executable was built, but failed to run, then ``<runResultVar>`` will be
set to ``FAILED_TO_RUN``. See the :command:`try_compile` command for
-information on how the test project is constructed to build the source file.
-
-The options are:
-
-``CMAKE_FLAGS <flags>...``
- Specify flags of the form ``-DVAR:TYPE=VALUE`` to be passed to
- the ``cmake`` command-line used to drive the test build.
- The example in :command:`try_compile` shows how values for variables
- ``INCLUDE_DIRECTORIES``, ``LINK_DIRECTORIES``, and ``LINK_LIBRARIES``
- are used.
+documentation of options common to both commands, and for information on how
+the test project is constructed to build the source file.
-``COMPILE_DEFINITIONS <defs>...``
- Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions`
- in the generated test project.
-
-``COMPILE_OUTPUT_VARIABLE <var>``
- Report the compile step build output in a given variable.
+One or more source files must be provided. Additionally, one of ``SOURCES``
+and/or ``SOURCE_FROM_*`` must precede other keywords.
-``LINK_LIBRARIES <libs>...``
- .. versionadded:: 3.2
+This command also supports an alternate signature
+which was present in older versions of CMake:
- Specify libraries to be linked in the generated project.
- The list of libraries may refer to system libraries and to
- :ref:`Imported Targets <Imported Targets>` from the calling project.
+.. code-block:: cmake
- If this option is specified, any ``-DLINK_LIBRARIES=...`` value
- given to the ``CMAKE_FLAGS`` option will be ignored.
+ try_run(<runResultVar> <compileResultVar>
+ <bindir> <srcfile|SOURCES srcfile...>
+ [NO_CACHE]
+ [CMAKE_FLAGS <flags>...]
+ [COMPILE_DEFINITIONS <defs>...]
+ [LINK_OPTIONS <options>...]
+ [LINK_LIBRARIES <libs>...]
+ [COMPILE_OUTPUT_VARIABLE <var>]
+ [COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
+ [<LANG>_STANDARD <std>]
+ [<LANG>_STANDARD_REQUIRED <bool>]
+ [<LANG>_EXTENSIONS <bool>]
+ [RUN_OUTPUT_VARIABLE <var>]
+ [RUN_OUTPUT_STDOUT_VARIABLE <var>]
+ [RUN_OUTPUT_STDERR_VARIABLE <var>]
+ [OUTPUT_VARIABLE <var>]
+ [WORKING_DIRECTORY <var>]
+ [ARGS <args>...]
+ )
-``LINK_OPTIONS <options>...``
- .. versionadded:: 3.14
+The options specific to ``try_run`` are:
- Specify link step options to pass to :command:`target_link_options` in the
- generated project.
+``COMPILE_OUTPUT_VARIABLE <var>``
+ Report the compile step build output in a given variable.
``OUTPUT_VARIABLE <var>``
Report the compile build output and the output from running the executable
- in the given variable. This option exists for legacy reasons. Prefer
- ``COMPILE_OUTPUT_VARIABLE`` and ``RUN_OUTPUT_VARIABLE`` instead.
+ in the given variable. This option exists for legacy reasons and is only
+ supported by the old ``try_run`` signature.
+ Prefer ``COMPILE_OUTPUT_VARIABLE`` and ``RUN_OUTPUT_VARIABLE`` instead.
``RUN_OUTPUT_VARIABLE <var>``
Report the output from running the executable in a given variable.
+``RUN_OUTPUT_STDOUT_VARIABLE <var>``
+ .. versionadded:: 3.25
+
+ Report the output of stdout from running the executable in a given variable.
+
+``RUN_OUTPUT_STDERR_VARIABLE <var>``
+ .. versionadded:: 3.25
+
+ Report the output of stderr from running the executable in a given variable.
+
``WORKING_DIRECTORY <var>``
.. versionadded:: 3.20
Run the executable in the given directory. If no ``WORKING_DIRECTORY`` is
- specified, the executable will run in ``<bindir>``.
+ specified, the executable will run in ``<bindir>`` or the current build
+ directory.
+
+``ARGS <args>...``
+ Additional arguments to pass to the executable when running it.
Other Behavior Settings
^^^^^^^^^^^^^^^^^^^^^^^
@@ -110,6 +141,7 @@ These cache entries are:
In order to make cross compiling your project easier, use ``try_run``
only if really required. If you use ``try_run``, use the
+``RUN_OUTPUT_STDOUT_VARIABLE``, ``RUN_OUTPUT_STDERR_VARIABLE``,
``RUN_OUTPUT_VARIABLE`` or ``OUTPUT_VARIABLE`` options only if really
required. Using them will require that when cross-compiling, the cache
variables will have to be set manually to the output of the executable.
diff --git a/Help/command/while.rst b/Help/command/while.rst
index a4957c1..0bafae5 100644
--- a/Help/command/while.rst
+++ b/Help/command/while.rst
@@ -23,3 +23,11 @@ Per legacy, the :command:`endwhile` command admits
an optional ``<condition>`` argument.
If used, it must be a verbatim repeat of the argument of the opening
``while`` command.
+
+See Also
+^^^^^^^^
+
+ * :command:`break`
+ * :command:`continue`
+ * :command:`foreach`
+ * :command:`endwhile`
diff --git a/Help/cpack_gen/archive.rst b/Help/cpack_gen/archive.rst
index a77b615..9df3cc4 100644
--- a/Help/cpack_gen/archive.rst
+++ b/Help/cpack_gen/archive.rst
@@ -57,6 +57,12 @@ Variables specific to CPack Archive generator
.. versionadded:: 3.9
Per-component ``CPACK_ARCHIVE_<component>_FILE_NAME`` variables.
+.. variable:: CPACK_ARCHIVE_FILE_EXTENSION
+
+ .. versionadded:: 3.25
+
+ Package file extension. Default values are given in the list above.
+
.. variable:: CPACK_ARCHIVE_COMPONENT_INSTALL
Enable component packaging. If enabled (ON), then the archive generator
diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst
index f96ca32..1514dbc 100644
--- a/Help/cpack_gen/deb.rst
+++ b/Help/cpack_gen/deb.rst
@@ -57,7 +57,7 @@ List of CPack DEB generator specific variables:
.. versionadded:: 3.5
Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME`` variables.
- See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
+ See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source
.. variable:: CPACK_DEBIAN_FILE_NAME
CPACK_DEBIAN_<COMPONENT>_FILE_NAME
@@ -399,7 +399,7 @@ List of CPack DEB generator specific variables:
.. versionadded:: 3.4
Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS`` variables.
- See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
+ See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_ENHANCES
CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES
@@ -419,7 +419,7 @@ List of CPack DEB generator specific variables:
.. versionadded:: 3.4
Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES`` variables.
- See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
+ See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_BREAKS
CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS
@@ -508,7 +508,7 @@ List of CPack DEB generator specific variables:
.. versionadded:: 3.4
Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES`` variables.
- See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
+ See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_RECOMMENDS
CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS
@@ -527,7 +527,7 @@ List of CPack DEB generator specific variables:
.. versionadded:: 3.4
Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS`` variables.
- See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
+ See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_SUGGESTS
CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS
@@ -545,7 +545,7 @@ List of CPack DEB generator specific variables:
.. versionadded:: 3.4
Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS`` variables.
- See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
+ See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
.. variable:: CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS
@@ -639,7 +639,7 @@ List of CPack DEB generator specific variables:
- :variable:`CPACK_DEBIAN_PACKAGE_SOURCE` for component-based
installations.
- See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
+ See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source
.. note::
diff --git a/Help/cpack_gen/external.rst b/Help/cpack_gen/external.rst
index 4c083f0..b511319 100644
--- a/Help/cpack_gen/external.rst
+++ b/Help/cpack_gen/external.rst
@@ -207,8 +207,8 @@ following fields in the root:
set.
``buildConfig``
- The build configuration given to CPack with the ``-C`` option. Only present
- if this option is set.
+ The build configuration given to CPack with the :option:`cpack -C` option.
+ Only present if this option is set.
``defaultDirectoryPermissions``
The default directory permissions given in
diff --git a/Help/cpack_gen/freebsd.rst b/Help/cpack_gen/freebsd.rst
index f429bc5..faf8c74 100644
--- a/Help/cpack_gen/freebsd.rst
+++ b/Help/cpack_gen/freebsd.rst
@@ -62,8 +62,6 @@ the RPM information (e.g. package license).
- :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` (this is always set
by CPack itself, if nothing else sets it explicitly).
- - :variable:`PROJECT_DESCRIPTION` (this can be set with the DESCRIPTION
- parameter for :command:`project`).
.. variable:: CPACK_FREEBSD_PACKAGE_DESCRIPTION
@@ -75,6 +73,10 @@ the RPM information (e.g. package license).
- :variable:`CPACK_DEBIAN_PACKAGE_DESCRIPTION` (this may be set already
for Debian packaging, so it is used as a fallback).
+ - :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` (this is always set
+ by CPack itself, if nothing else sets it explicitly).
+ - :variable:`PROJECT_DESCRIPTION` (this can be set with the DESCRIPTION
+ parameter for :command:`project`).
.. variable:: CPACK_FREEBSD_PACKAGE_WWW
@@ -85,12 +87,12 @@ the RPM information (e.g. package license).
* Mandatory: YES
* Default:
- - :variable:`CMAKE_PROJECT_HOMEPAGE_URL`, or if that is not set,
- :variable:`CPACK_DEBIAN_PACKAGE_HOMEPAGE` (this may be set already
+ - :variable:`CPACK_PACKAGE_HOMEPAGE_URL`, or if that is not set,
+ - :variable:`CPACK_DEBIAN_PACKAGE_HOMEPAGE` (this may be set already
for Debian packaging, so it is used as a fallback).
.. versionadded:: 3.12
- The ``CMAKE_PROJECT_HOMEPAGE_URL`` variable.
+ The ``CPACK_PACKAGE_HOMEPAGE_URL`` variable.
.. variable:: CPACK_FREEBSD_PACKAGE_LICENSE
diff --git a/Help/cpack_gen/ifw.rst b/Help/cpack_gen/ifw.rst
index c23bab4..c252095 100644
--- a/Help/cpack_gen/ifw.rst
+++ b/Help/cpack_gen/ifw.rst
@@ -14,7 +14,7 @@ Overview
This :manual:`cpack generator <cpack-generators(7)>` generates
configuration and meta information for the `Qt Installer Framework
-<http://doc.qt.io/qtinstallerframework/index.html>`_ (QtIFW),
+<https://doc.qt.io/qtinstallerframework/index.html>`_ (QtIFW),
and runs QtIFW tools to generate a Qt installer.
QtIFW provides tools and utilities to create installers for
diff --git a/Help/cpack_gen/nsis.rst b/Help/cpack_gen/nsis.rst
index 299cfec..df306c2 100644
--- a/Help/cpack_gen/nsis.rst
+++ b/Help/cpack_gen/nsis.rst
@@ -207,3 +207,34 @@ on Windows Nullsoft Scriptable Install System.
.. versionadded:: 3.22
If set, do not display the page containing the license during installation.
+
+.. variable:: CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS
+
+ .. versionadded:: 3.25
+
+ This variable is a :ref:`semicolon-separated list <CMake Language Lists>` of
+ arguments to prepend to the nsis script to run.
+ If the arguments do not start with a ``/`` or a ``-``, it will add one
+ automatically to the corresponding arguments.
+ The command that will be run is::
+
+ makensis.exe <preArgs>... "nsisFileName.nsi" <postArgs>...
+
+ where ``<preArgs>...`` is constructed from ``CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS``
+ and ``<postArgs>...`` is constructed from ``CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS``.
+
+
+.. variable:: CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS
+
+ .. versionadded:: 3.25
+
+ This variable is a :ref:`semicolon-separated list <CMake Language Lists>` of
+ arguments to append to the nsis script to run.
+ If the arguments do not start with a ``/`` or a ``-``, it will add one
+ automatically to the corresponding arguments.
+ The command that will be run is::
+
+ makensis.exe <preArgs>... "nsisFileName.nsi" <postArgs>...
+
+ where ``<preArgs>...`` is constructed from ``CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS``
+ and ``<postArgs>...`` is constructed from ``CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS``.
diff --git a/Help/cpack_gen/nuget.rst b/Help/cpack_gen/nuget.rst
index c980dd6..3bf7f84 100644
--- a/Help/cpack_gen/nuget.rst
+++ b/Help/cpack_gen/nuget.rst
@@ -110,7 +110,7 @@ List of CPack NuGet generator specific variables:
.. deprecated:: 3.20
Use a local license file
(:variable:`CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME`)
- or a `(SPDX) license identifier`_
+ or a `SPDX license identifier`_
(:variable:`CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION`) instead.
An URL for the package's license, often shown in UI displays as well
@@ -124,7 +124,7 @@ List of CPack NuGet generator specific variables:
.. versionadded:: 3.20
- A Software Package Data Exchange `(SPDX) license identifier`_ such as
+ A Software Package Data Exchange `SPDX license identifier`_ such as
``MIT``, ``BSD-3-Clause``, or ``LGPL-3.0-or-later``. In the case of a
choice of licenses or more complex restrictions, compound license
expressions may be formed using boolean operators, for example
@@ -162,6 +162,14 @@ List of CPack NuGet generator specific variables:
* Mandatory : NO
* Default : -
+.. variable:: CPACK_NUGET_PACKAGE_REQUIRE_LICENSE_ACCEPTANCE
+
+ When set to a true value, the user will be prompted to accept the license
+ before installing the package.
+
+ * Mandatory : NO
+ * Default : -
+
.. variable:: CPACK_NUGET_PACKAGE_ICON
CPACK_NUGET_<compName>_PACKAGE_ICON
@@ -247,9 +255,9 @@ List of CPack NuGet generator specific variables:
* Default : OFF
-.. _nuget.org: http://nuget.org
-.. _version specification: https://docs.microsoft.com/en-us/nuget/reference/package-versioning#version-ranges-and-wildcards
-.. _(SPDX) license identifier: https://spdx.org/licenses/
-.. _SPDX specification: https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/
+.. _nuget.org: https://www.nuget.org
+.. _version specification: https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges
+.. _SPDX license identifier: https://spdx.github.io/spdx-spec/SPDX-license-list
+.. _SPDX specification: https://spdx.github.io/spdx-spec/SPDX-license-expressions
.. NuGet spec docs https://docs.microsoft.com/en-us/nuget/reference/nuspec
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index 0d287fc..b1e0077 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -18,7 +18,7 @@ The CPack RPM generator has specific features which are controlled by the specif
**grouping name** written in upper case. It may be either a component name or
a component GROUP name. Usually those variables correspond to RPM spec file
entities. One may find information about spec files here
-http://www.rpm.org/wiki/Docs
+https://rpm.org/documentation
.. versionchanged:: 3.6
@@ -972,7 +972,7 @@ For CMake projects SRPM package would be produced by executing::
Produced SRPM package is expected to be built with :manual:`cmake(1)` executable
and packaged with :manual:`cpack(1)` executable so CMakeLists.txt has to be
located in root source directory and must be able to generate binary rpm
- packages by executing ``cpack -G`` command. The two executables as well as
+ packages by executing :option:`cpack -G` command. The two executables as well as
rpmbuild must also be present when generating binary rpm packages from the
produced SRPM package.
diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst
index a3d43fc..c880049 100644
--- a/Help/cpack_gen/wix.rst
+++ b/Help/cpack_gen/wix.rst
@@ -111,7 +111,7 @@ Windows using WiX.
simply provide the name of the culture. If you specify more than one
culture identifier in a comma or semicolon delimited list, the first one
that is found will be used. You can find a list of supported languages at:
- http://wix.sourceforge.net/manual-wix3/WixUI_localization.htm
+ https://wixtoolset.org//documentation/manual/v3/wixui/wixui_localization.html
.. variable:: CPACK_WIX_TEMPLATE
diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst
index 7638d22..78770f7 100644
--- a/Help/dev/experimental.rst
+++ b/Help/dev/experimental.rst
@@ -7,6 +7,23 @@ See documentation on `CMake Development`_ for more information.
.. _`CMake Development`: README.rst
+Features are gated behind ``CMAKE_EXPERIMENTAL_`` variables which must be set
+to specific values in order to enable their gated behaviors. Note that the
+specific values will change over time to reinforce their experimental nature.
+When used, a warning will be generated to indicate that an experimental
+feature is in use and that the affected behavior in the project is not part of
+CMake's stability guarantees.
+
+C++20 Module APIs
+=================
+
+Variable: ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+Value: ``3c375311-a3c9-4396-a187-3227ef642046``
+
+In order to support C++20 modules, there are a number of behaviors that have
+CMake APIs to provide the required features to build and export them from a
+project.
+
C++20 Module Dependencies
=========================
@@ -22,6 +39,10 @@ they can use it to develop and test their dependency scanning tool.
The ``CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE`` variable must also be set
to tell CMake how to invoke the C++20 module dependency scanning tool.
+MSVC 19.34 (provided with Visual Studio 17.4) and above contains the support
+that CMake needs and has these variables already set up as required and only
+the UUID variable needs to be set.
+
For example, add code like the following to a test project:
.. code-block:: cmake
@@ -40,13 +61,8 @@ dependencies to the file specified by the ``<DYNDEP_FILE>`` placeholder. The
``CMAKE_EXPERIMENTAL_CXX_SCANDEP_DEPFILE_FORMAT`` file may be set to ``msvc``
for scandep rules which use ``msvc``-style dependency reporting.
-For tools which need to know the file set the source belongs to, the
-``CMAKE_EXPERIMENTAL_CXX_MODULE_SOURCE_TYPE_FLAG_<FILE_SET_TYPE>`` flag may
-be provided so that different source types can be distinguished prior to
-scanning.
-
The module dependencies should be written in the format described
-by the `P1689r4`_ paper.
+by the `P1689r5`_ paper.
Compiler writers may try out their scanning functionality using
the `cxx-modules-sandbox`_ test project, modified to set variables
@@ -60,8 +76,9 @@ For compilers that generate module maps, tell CMake as follows:
set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG
"${compiler_flags_for_module_map} -fmodule-mapper=<MODULE_MAP_FILE>")
-Currently, the only supported format is ``gcc``. The format is described in
-the GCC documentation, but the relevant section for the purposes of CMake is:
+Currently, the only supported formats are ``gcc`` and ``msvc``. The ``gcc``
+format is described in the GCC documentation, but the relevant section for the
+purposes of CMake is:
A mapping file consisting of space-separated module-name, filename
pairs, one per line. Only the mappings for the direct imports and any
@@ -72,6 +89,10 @@ the GCC documentation, but the relevant section for the purposes of CMake is:
-- GCC module mapper documentation
+The ``msvc`` format is a response file containing flags required to compile
+any module interfaces properly as well as find any required files to satisfy
+``import`` statements as required for Microsoft's Visual Studio toolchains.
+
.. _`D1483r1`: https://mathstuf.fedorapeople.org/fortran-modules/fortran-modules.html
-.. _`P1689r4`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1689r4.html
+.. _`P1689r5`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html
.. _`cxx-modules-sandbox`: https://github.com/mathstuf/cxx-modules-sandbox
diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst
index 2e1c6d2..2af4b58 100644
--- a/Help/envvar/ASM_DIALECTFLAGS.rst
+++ b/Help/envvar/ASM_DIALECTFLAGS.rst
@@ -3,13 +3,16 @@ ASM<DIALECT>FLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling a specific dialect of an
-assembly language. ``ASM<DIALECT>FLAGS`` can be ``ASMFLAGS``, ``ASM_NASMFLAGS``,
-``ASM_MASMFLAGS`` or ``ASM-ATTFLAGS``. Will only be used by CMake on the
-first configuration to determine ``ASM_<DIALECT>`` default compilation
-flags, after which the value for ``ASM<DIALECT>FLAGS`` is stored in the cache
-as ``CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>``. For any configuration
-run (including the first), the environment variable will be ignored, if the
-``CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>`` variable is defined.
+Add default compilation flags to be used when compiling a specific dialect
+of an assembly language. ``ASM<DIALECT>FLAGS`` can be one of:
+
+* ``ASMFLAGS``
+* ``ASM_NASMFLAGS``
+* ``ASM_MASMFLAGS``
+* ``ASM-ATTFLAGS``
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``ASM<DIALECT>``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_ASM<DIALECT>_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CFLAGS.rst b/Help/envvar/CFLAGS.rst
index 190b4f4..a6b2452 100644
--- a/Help/envvar/CFLAGS.rst
+++ b/Help/envvar/CFLAGS.rst
@@ -3,11 +3,10 @@ CFLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling ``C`` files. Will only be
-used by CMake on the first configuration to determine ``CC`` default compilation
-flags, after which the value for ``CFLAGS`` is stored in the cache
-as :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run
-(including the first), the environment variable will be ignored if the
-:variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+Add default compilation flags to be used when compiling ``C`` files.
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``C``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_C_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CMAKE_GENERATOR.rst b/Help/envvar/CMAKE_GENERATOR.rst
index 3488b04..596e8f3 100644
--- a/Help/envvar/CMAKE_GENERATOR.rst
+++ b/Help/envvar/CMAKE_GENERATOR.rst
@@ -6,9 +6,9 @@ CMAKE_GENERATOR
.. include:: ENV_VAR.txt
Specifies the CMake default generator to use when no generator is supplied
-with ``-G``. If the provided value doesn't name a generator known by CMake,
-the internal default is used. Either way the resulting generator selection
-is stored in the :variable:`CMAKE_GENERATOR` variable.
+with :option:`-G <cmake -G>`. If the provided value doesn't name a generator
+known by CMake, the internal default is used. Either way the resulting
+generator selection is stored in the :variable:`CMAKE_GENERATOR` variable.
Some generators may be additionally configured using the environment
variables:
diff --git a/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst b/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
index b039845..e657904 100644
--- a/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
+++ b/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
@@ -6,5 +6,5 @@ CMAKE_GENERATOR_PLATFORM
.. include:: ENV_VAR.txt
Default value for :variable:`CMAKE_GENERATOR_PLATFORM` if no Cache entry
-is present and no value is specified by :manual:`cmake(1)` ``-A`` option.
+is present and no value is specified by :option:`cmake -A` option.
This value is only applied if :envvar:`CMAKE_GENERATOR` is set.
diff --git a/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst b/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
index 394dd88..03208e7 100644
--- a/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
@@ -6,5 +6,5 @@ CMAKE_GENERATOR_TOOLSET
.. include:: ENV_VAR.txt
Default value for :variable:`CMAKE_GENERATOR_TOOLSET` if no Cache entry
-is present and no value is specified by :manual:`cmake(1)` ``-T`` option.
+is present and no value is specified by :option:`cmake -T` option.
This value is only applied if :envvar:`CMAKE_GENERATOR` is set.
diff --git a/Help/envvar/CSFLAGS.rst b/Help/envvar/CSFLAGS.rst
index 784328a..6e909fe 100644
--- a/Help/envvar/CSFLAGS.rst
+++ b/Help/envvar/CSFLAGS.rst
@@ -5,11 +5,10 @@ CSFLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling ``CSharp`` files. Will only be
-used by CMake on the first configuration to determine ``CSharp`` default
-compilation flags, after which the value for ``CSFLAGS`` is stored in the cache
-as :variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration
-run (including the first), the environment variable will be ignored if the
-:variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+Add default compilation flags to be used when compiling ``CSharp`` files.
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``CSharp``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_CSharp_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
index 8c29d7d..348acc6 100644
--- a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
+++ b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
@@ -14,5 +14,5 @@ variable is not set or has a value that evaluates to false, output is reported
normally with each test having its own start and end lines logged to the
output.
-The ``--progress`` option to :manual:`ctest <ctest(1)>` overrides this
-environment variable if both are given.
+The :option:`--progress <ctest --progress>` option to :manual:`ctest <ctest(1)>`
+overrides this environment variable if both are given.
diff --git a/Help/envvar/CUDAFLAGS.rst b/Help/envvar/CUDAFLAGS.rst
index af577a0..46a91df 100644
--- a/Help/envvar/CUDAFLAGS.rst
+++ b/Help/envvar/CUDAFLAGS.rst
@@ -5,11 +5,10 @@ CUDAFLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling ``CUDA`` files. Will only be
-used by CMake on the first configuration to determine ``CUDA`` default
-compilation flags, after which the value for ``CUDAFLAGS`` is stored in the
-cache as :variable:`CMAKE_CUDA_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration
-run (including the first), the environment variable will be ignored if
-the :variable:`CMAKE_CUDA_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+Add default compilation flags to be used when compiling ``CUDA`` files.
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CUDA_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``CUDA``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_CUDA_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CXXFLAGS.rst b/Help/envvar/CXXFLAGS.rst
index 460a347..f67431f 100644
--- a/Help/envvar/CXXFLAGS.rst
+++ b/Help/envvar/CXXFLAGS.rst
@@ -3,11 +3,10 @@ CXXFLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling ``CXX`` (C++) files. Will
-only be used by CMake on the first configuration to determine ``CXX`` default
-compilation flags, after which the value for ``CXXFLAGS`` is stored in the cache
-as :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run (
-including the first), the environment variable will be ignored if
-the :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+Add default compilation flags to be used when compiling ``CXX`` (C++) files.
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``CXX``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_CXX_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/DESTDIR.rst b/Help/envvar/DESTDIR.rst
index 94cae4a..dec8430 100644
--- a/Help/envvar/DESTDIR.rst
+++ b/Help/envvar/DESTDIR.rst
@@ -20,8 +20,9 @@ The packaging tool may then construct the package from the content of the
See the :variable:`CMAKE_INSTALL_PREFIX` variable to control the
installation prefix when configuring a build tree. Or, when using
-the :manual:`cmake(1)` command-line tool's ``--install`` mode,
-one may specify a different prefix using the ``--prefix`` option.
+the :manual:`cmake(1)` command-line tool's :option:`--install <cmake --install>`
+mode, one may specify a different prefix using the
+:option:`--prefix <cmake--install --prefix>` option.
.. note::
diff --git a/Help/envvar/FFLAGS.rst b/Help/envvar/FFLAGS.rst
index 53bffb6..23bc8d2 100644
--- a/Help/envvar/FFLAGS.rst
+++ b/Help/envvar/FFLAGS.rst
@@ -3,11 +3,10 @@ FFLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling ``Fortran`` files. Will only
-be used by CMake on the first configuration to determine ``Fortran`` default
-compilation flags, after which the value for ``FFLAGS`` is stored in the cache
-as :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration
-run (including the first), the environment variable will be ignored if
-the :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+Add default compilation flags to be used when compiling ``Fortran`` files.
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``Fortran``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_Fortran_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/HIPFLAGS.rst b/Help/envvar/HIPFLAGS.rst
index 0df3416..31e2390 100644
--- a/Help/envvar/HIPFLAGS.rst
+++ b/Help/envvar/HIPFLAGS.rst
@@ -5,11 +5,10 @@ HIPFLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling ``HIP`` files. Will only be
-used by CMake on the first configuration to determine ``HIP`` default
-compilation flags, after which the value for ``HIPFLAGS`` is stored in the
-cache as :variable:`CMAKE_HIP_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration
-run (including the first), the environment variable will be ignored if
-the :variable:`CMAKE_HIP_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+Add default compilation flags to be used when compiling ``HIP`` files.
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_HIP_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``HIP``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_HIP_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/ISPCFLAGS.rst b/Help/envvar/ISPCFLAGS.rst
index 21df037..b7a2bd5 100644
--- a/Help/envvar/ISPCFLAGS.rst
+++ b/Help/envvar/ISPCFLAGS.rst
@@ -5,11 +5,10 @@ ISPCFLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling ``ISPC`` files. Will only be
-used by CMake on the first configuration to determine ``ISPC`` default
-compilation flags, after which the value for ``ISPCFLAGS`` is stored in the
-cache as :variable:`CMAKE_ISPC_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration
-run (including the first), the environment variable will be ignored if
-the :variable:`CMAKE_ISPC_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+Add default compilation flags to be used when compiling ``ISPC`` files.
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_ISPC_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``ISPC``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_ISPC_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/LANG_FLAGS.txt b/Help/envvar/LANG_FLAGS.txt
new file mode 100644
index 0000000..d01a56d
--- /dev/null
+++ b/Help/envvar/LANG_FLAGS.txt
@@ -0,0 +1,6 @@
+CMake uses this environment variable value, in combination with its own
+builtin default flags for the toolchain, to initialize and store the
+|CMAKE_LANG_FLAGS| cache entry.
+This occurs the first time a build tree is configured for language |LANG|.
+For any configuration run (including the first), the environment variable
+will be ignored if the |CMAKE_LANG_FLAGS| variable is already defined.
diff --git a/Help/envvar/RCFLAGS.rst b/Help/envvar/RCFLAGS.rst
index bc43cb2..7df83a7 100644
--- a/Help/envvar/RCFLAGS.rst
+++ b/Help/envvar/RCFLAGS.rst
@@ -3,11 +3,10 @@ RCFLAGS
.. include:: ENV_VAR.txt
-Default compilation flags to be used when compiling ``resource`` files. Will
-only be used by CMake on the first configuration to determine ``resource``
-default compilation flags, after which the value for ``RCFLAGS`` is stored in
-the cache as :variable:`CMAKE_RC_FLAGS <CMAKE_<LANG>_FLAGS>`. For any
-configuration run (including the first), the environment variable will be ignored
-if the :variable:`CMAKE_RC_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined.
+Add default compilation flags to be used when compiling ``RC`` (resource) files.
+
+.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_RC_FLAGS <CMAKE_<LANG>_FLAGS>`
+.. |LANG| replace:: ``RC``
+.. include:: LANG_FLAGS.txt
See also :variable:`CMAKE_RC_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/SSL_CERT_DIR.rst b/Help/envvar/SSL_CERT_DIR.rst
new file mode 100644
index 0000000..1e678e4
--- /dev/null
+++ b/Help/envvar/SSL_CERT_DIR.rst
@@ -0,0 +1,9 @@
+SSL_CERT_DIR
+------------
+
+.. versionadded:: 3.25
+
+.. include:: ENV_VAR.txt
+
+Specify default directory containing CA certificates. It overrides
+the default CA directory used.
diff --git a/Help/envvar/SSL_CERT_FILE.rst b/Help/envvar/SSL_CERT_FILE.rst
new file mode 100644
index 0000000..23216c0
--- /dev/null
+++ b/Help/envvar/SSL_CERT_FILE.rst
@@ -0,0 +1,9 @@
+SSL_CERT_FILE
+-------------
+
+.. versionadded:: 3.25
+
+.. include:: ENV_VAR.txt
+
+Specify the file name containing CA certificates. It overrides the
+default, os-specific CA file used.
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index 1b4739b..7a5993a 100644
--- a/Help/generator/Green Hills MULTI.rst
+++ b/Help/generator/Green Hills MULTI.rst
@@ -28,12 +28,12 @@ Otherwise the ``primaryTarget`` will be composed from the values of :variable:`C
and ``GHS_TARGET_PLATFORM``. Defaulting to the value of ``arm_integrity.tgt``
* The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
- via the :manual:`cmake(1)` ``-A`` option.
+ via the :option:`cmake -A` option.
| Typical values of ``arm``, ``ppc``, ``86``, etcetera, are used.
-* The variable ``GHS_TARGET_PLATFORM`` may be set, perhaps via the :manual:`cmake(1)`
- ``-D`` option.
+* The variable ``GHS_TARGET_PLATFORM`` may be set, perhaps via the :option:`cmake -D`
+ option.
| Defaults to ``integrity``.
| Usual values are ``integrity``, ``threadx``, ``uvelosity``, ``velosity``,
@@ -55,11 +55,11 @@ The generator searches for the latest compiler or can be given a location to use
``GHS_TOOLSET_ROOT`` is the directory that is checked for the latest compiler.
* The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
- via the :manual:`cmake(1)` ``-T`` option, to specify the location of the toolset.
+ via the :option:`cmake -T` option, to specify the location of the toolset.
Both absolute and relative paths are valid. Paths are relative to ``GHS_TOOLSET_ROOT``.
-* The variable ``GHS_TOOLSET_ROOT`` may be set, perhaps via the :manual:`cmake(1)`
- ``-D`` option.
+* The variable ``GHS_TOOLSET_ROOT`` may be set, perhaps via the :option:`cmake -D`
+ option.
| Root path for toolset searches and relative paths.
| Defaults to ``C:/ghs`` in Windows or ``/usr/ghs`` in Linux.
diff --git a/Help/generator/Ninja Multi-Config.rst b/Help/generator/Ninja Multi-Config.rst
index e5ce4f5..2cf823a 100644
--- a/Help/generator/Ninja Multi-Config.rst
+++ b/Help/generator/Ninja Multi-Config.rst
@@ -20,8 +20,8 @@ are intended to be run with ``ninja -f build-<Config>.ninja``. A
:variable:`CMAKE_CONFIGURATION_TYPES`.
``cmake --build . --config <Config>`` will always use ``build-<Config>.ninja``
-to build. If no ``--config`` argument is specified, ``cmake --build .`` will
-use ``build.ninja``.
+to build. If no :option:`--config <cmake--build --config>` argument is
+specified, :option:`cmake --build . <cmake --build>` will use ``build.ninja``.
Each ``build-<Config>.ninja`` file contains ``<target>`` targets as well as
``<target>:<Config>`` targets, where ``<Config>`` is the same as the
diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst
index 9ec33c3..888164f 100644
--- a/Help/generator/Visual Studio 10 2010.rst
+++ b/Help/generator/Visual Studio 10 2010.rst
@@ -1,52 +1,8 @@
Visual Studio 10 2010
---------------------
-Deprecated. Generates Visual Studio 10 (VS 2010) project files.
-
-.. note::
- This generator is deprecated and will be removed in a future version
- of CMake. It will still be possible to build with VS 10 2010 tools
- using the :generator:`Visual Studio 11 2012` (or above) generator
- with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v100``, or by
- using the :generator:`NMake Makefiles` generator.
-
-For compatibility with CMake versions prior to 3.0, one may specify this
-generator using the name ``Visual Studio 10`` without the year component.
-
-Project Types
-^^^^^^^^^^^^^
-
-Only Visual C++ and C# projects may be generated (and Fortran with
-Intel compiler integration). Other types of projects (Database,
-Website, etc.) are not supported.
-
-Platform Selection
-^^^^^^^^^^^^^^^^^^
-
-The default target platform name (architecture) is ``Win32``.
-
-.. versionadded:: 3.1
- The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
- via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
- name (architecture). For example:
-
- * ``cmake -G "Visual Studio 10 2010" -A Win32``
- * ``cmake -G "Visual Studio 10 2010" -A x64``
- * ``cmake -G "Visual Studio 10 2010" -A Itanium``
-
-For compatibility with CMake versions prior to 3.1, one may specify
-a target platform name optionally at the end of the generator name.
-This is supported only for:
-
-``Visual Studio 10 2010 Win64``
- Specify target platform ``x64``.
-
-``Visual Studio 10 2010 IA64``
- Specify target platform ``Itanium``.
-
-Toolset Selection
-^^^^^^^^^^^^^^^^^
-
-The ``v100`` toolset that comes with Visual Studio 10 2010 is selected by
-default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
-via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+Removed. This once generated Visual Studio 10 2010 project files, but
+the generator has been removed since CMake 3.25. It is still possible
+to build with VS 10 2010 tools using the :generator:`Visual Studio 12 2013`
+(or above) generator with :variable:`CMAKE_GENERATOR_TOOLSET` set to
+``v100``, or by using the :generator:`NMake Makefiles` generator.
diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst
index 3952228..4e7195c 100644
--- a/Help/generator/Visual Studio 11 2012.rst
+++ b/Help/generator/Visual Studio 11 2012.rst
@@ -1,7 +1,14 @@
Visual Studio 11 2012
---------------------
-Generates Visual Studio 11 (VS 2012) project files.
+Deprecated. Generates Visual Studio 11 (VS 2012) project files.
+
+.. note::
+ This generator is deprecated and will be removed in a future version
+ of CMake. It will still be possible to build with VS 11 2012 tools
+ using the :generator:`Visual Studio 12 2013` (or above) generator
+ with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v110``, or by
+ using the :generator:`NMake Makefiles` generator.
For compatibility with CMake versions prior to 3.0, one may specify this
generator using the name "Visual Studio 11" without the year component.
@@ -20,7 +27,7 @@ The default target platform name (architecture) is ``Win32``.
.. versionadded:: 3.1
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
- via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+ via the :option:`cmake -A` option, to specify a target platform
name (architecture). For example:
* ``cmake -G "Visual Studio 11 2012" -A Win32``
@@ -47,4 +54,4 @@ Toolset Selection
The ``v110`` toolset that comes with Visual Studio 11 2012 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
-via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+via the :option:`cmake -T` option, to specify another toolset.
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
index 54a4d7e..3dbcfe6 100644
--- a/Help/generator/Visual Studio 12 2013.rst
+++ b/Help/generator/Visual Studio 12 2013.rst
@@ -20,7 +20,7 @@ The default target platform name (architecture) is ``Win32``.
.. versionadded:: 3.1
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
- via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+ via the :option:`cmake -A` option, to specify a target platform
name (architecture). For example:
* ``cmake -G "Visual Studio 12 2013" -A Win32``
@@ -42,7 +42,7 @@ Toolset Selection
The ``v120`` toolset that comes with Visual Studio 12 2013 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
-via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+via the :option:`cmake -T` option, to specify another toolset.
.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
By default this generator uses the 32-bit variant even on a 64-bit host.
diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst
index d704ab2..af7dfaa 100644
--- a/Help/generator/Visual Studio 14 2015.rst
+++ b/Help/generator/Visual Studio 14 2015.rst
@@ -18,7 +18,7 @@ Platform Selection
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
-via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+via the :option:`cmake -A` option, to specify a target platform
name (architecture). For example:
* ``cmake -G "Visual Studio 14 2015" -A Win32``
@@ -40,7 +40,7 @@ Toolset Selection
The ``v140`` toolset that comes with Visual Studio 14 2015 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
-via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+via the :option:`cmake -T` option, to specify another toolset.
.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
By default this generator uses the 32-bit variant even on a 64-bit host.
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index 912afad..6bcc033 100644
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@ -26,7 +26,7 @@ Platform Selection
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
-via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+via the :option:`cmake -A` option, to specify a target platform
name (architecture). For example:
* ``cmake -G "Visual Studio 15 2017" -A Win32``
@@ -49,7 +49,7 @@ Toolset Selection
The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
-via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+via the :option:`cmake -T` option, to specify another toolset.
.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
By default this generator uses the 32-bit variant even on a 64-bit host.
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
index 6cefe6d..2918a6e 100644
--- a/Help/generator/Visual Studio 16 2019.rst
+++ b/Help/generator/Visual Studio 16 2019.rst
@@ -25,7 +25,7 @@ The default target platform name (architecture) is that of the host
and is provided in the :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
-via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+via the :option:`cmake -A` option, to specify a target platform
name (architecture). For example:
* ``cmake -G "Visual Studio 16 2019" -A Win32``
@@ -38,7 +38,7 @@ Toolset Selection
The ``v142`` toolset that comes with Visual Studio 16 2019 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
-via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+via the :option:`cmake -T` option, to specify another toolset.
.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
By default this generator uses the 64-bit variant on x64 hosts and
diff --git a/Help/generator/Visual Studio 17 2022.rst b/Help/generator/Visual Studio 17 2022.rst
index edf9d60..ab101ac 100644
--- a/Help/generator/Visual Studio 17 2022.rst
+++ b/Help/generator/Visual Studio 17 2022.rst
@@ -25,7 +25,7 @@ The default target platform name (architecture) is that of the host
and is provided in the :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
-via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+via the :option:`cmake -A` option, to specify a target platform
name (architecture). For example:
* ``cmake -G "Visual Studio 17 2022" -A Win32``
@@ -38,7 +38,7 @@ Toolset Selection
The ``v143`` toolset that comes with VS 17 2022 is selected by default.
The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
-via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+via the :option:`cmake -T` option, to specify another toolset.
.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
By default this generator uses the 64-bit variant on x64 hosts and
diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst
index 644f936..3434956 100644
--- a/Help/generator/Visual Studio 9 2008.rst
+++ b/Help/generator/Visual Studio 9 2008.rst
@@ -10,7 +10,7 @@ The default target platform name (architecture) is ``Win32``.
.. versionadded:: 3.1
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
- via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+ via the :option:`cmake -A` option, to specify a target platform
name (architecture). For example:
* ``cmake -G "Visual Studio 9 2008" -A Win32``
diff --git a/Help/generator/Xcode.rst b/Help/generator/Xcode.rst
index e4900a1..9dd5015 100644
--- a/Help/generator/Xcode.rst
+++ b/Help/generator/Xcode.rst
@@ -13,7 +13,7 @@ Toolset and Build System Selection
By default Xcode is allowed to select its own default toolchain.
The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
-via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+via the :option:`cmake -T` option, to specify another toolset.
.. versionadded:: 3.19
This generator supports toolset specification using one of these forms:
@@ -34,7 +34,7 @@ Supported pairs are:
See the :variable:`CMAKE_XCODE_BUILD_SYSTEM` variable for allowed values.
For example, to select the original build system under Xcode 12,
- run :manual:`cmake(1)` with the option ``-T buildsystem=1``.
+ run :manual:`cmake(1)` with the option :option:`-T buildsystem=1 <cmake -T>`.
Swift Support
^^^^^^^^^^^^^
@@ -44,3 +44,13 @@ Swift Support
When using the :generator:`Xcode` generator with Xcode 6.1 or higher,
one may enable the ``Swift`` language with the :command:`enable_language`
command or the :command:`project`.
+
+Limitations
+^^^^^^^^^^^
+
+The Xcode generator does not support per-configuration sources.
+Code like the following will result in a generation error:
+
+.. code-block:: cmake
+
+ add_executable(MyApp mymain-$<CONFIG>.cpp)
diff --git a/Help/guide/ide-integration/index.rst b/Help/guide/ide-integration/index.rst
index 8473481..e198789 100644
--- a/Help/guide/ide-integration/index.rst
+++ b/Help/guide/ide-integration/index.rst
@@ -47,8 +47,9 @@ does, and present the user with the presets listed in the file. Users should be
able to see (and possibly edit) the CMake cache variables, environment
variables, and command line options that are defined for a given preset. The
IDE should then construct the list of appropriate :manual:`cmake(1)` command
-line arguments based on these settings, rather than using the ``--preset=``
-option directly. The ``--preset=`` option is intended only as a convenient
+line arguments based on these settings, rather than using the
+:option:`--preset= <cmake --preset>` option directly. The
+:option:`--preset= <cmake --preset>` option is intended only as a convenient
frontend for command line users, and should not be used by the IDE.
For example, if a preset named ``ninja`` specifies ``Ninja`` as the generator
@@ -66,10 +67,9 @@ run:
cmake -S /path/to/source -B /path/to/source/build -G Ninja
In cases where a preset contains lots of cache variables, and passing all of
-them as ``-D`` flags would cause the command line length limit of the platform
-to be exceeded, the IDE should instead construct a temporary cache script and
-pass it with the ``-C`` flag. See :ref:`CMake Options` for details on how the
-``-C`` flag is used.
+them as :option:`-D <cmake -D>` flags would cause the command line length limit
+of the platform to be exceeded, the IDE should instead construct a temporary
+cache script and pass it with the :option:`-C <cmake -C>` flag.
While reading, parsing, and evaluating the contents of ``CMakePresets.json`` is
straightforward, it is not trivial. In addition to the documentation, IDE
@@ -110,8 +110,9 @@ Building
If a Makefile or Ninja generator is used to generate the build tree, it is not
recommended to invoke ``make`` or ``ninja`` directly. Instead, it is
-recommended that the IDE invoke :manual:`cmake(1)` with the ``--build``
-argument, which will in turn invoke the appropriate build tool.
+recommended that the IDE invoke :manual:`cmake(1)` with the
+:option:`--build <cmake --build>` argument, which will in turn invoke the
+appropriate build tool.
If an IDE project generator is used, such as :generator:`Xcode` or one of the
Visual Studio generators, and the IDE understands the project format used, the
diff --git a/Help/guide/tutorial/A Basic Starting Point.rst b/Help/guide/tutorial/A Basic Starting Point.rst
index cf1ec01..3dac68a 100644
--- a/Help/guide/tutorial/A Basic Starting Point.rst
+++ b/Help/guide/tutorial/A Basic Starting Point.rst
@@ -1,34 +1,81 @@
Step 1: A Basic Starting Point
==============================
-The most basic project is an executable built from source code files.
-For simple projects, a three line ``CMakeLists.txt`` file is all that is
-required. This will be the starting point for our tutorial. Create a
-``CMakeLists.txt`` file in the ``Step1`` directory that looks like:
-
-.. code-block:: cmake
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-start
-
- cmake_minimum_required(VERSION 3.10)
+Where do I start with CMake? This step will provide an introduction to some of
+CMake's basic syntax, commands, and variables. As these concepts are
+introduced, we will work through three exercises and create a simple CMake
+project.
+
+Each exercise in this step will start with some background information. Then, a
+goal and list of helpful resources are provided. Each file in the
+``Files to Edit`` section is in the ``Step1`` directory and contains one or
+more ``TODO`` comments. Each ``TODO`` represents a line or two of code to
+change or add. The ``TODO`` s are intended to be completed in numerical order,
+first complete ``TODO 1`` then ``TODO 2``, etc. The ``Getting Started``
+section will give some helpful hints and guide you through the exercise. Then
+the ``Build and Run`` section will walk step-by-step through how to build and
+test the exercise. Finally, at the end of each exercise the intended solution
+is discussed.
+
+Also note that each step in the tutorial builds on the next. So, for example,
+the starting code for ``Step2`` is the complete solution to ``Step1``.
+
+Exercise 1 - Building a Basic Project
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The most basic CMake project is an executable built from a single source code
+file. For simple projects like this, a ``CMakeLists.txt`` file with three
+commands is all that is required.
+
+**Note:** Although upper, lower and mixed case commands are supported by CMake,
+lower case commands are preferred and will be used throughout the tutorial.
+
+Any project's top most CMakeLists.txt must start by specifying a minimum CMake
+version using the :command:`cmake_minimum_required` command. This establishes
+policy settings and ensures that the following CMake functions are run with a
+compatible version of CMake.
+
+To start a project, we use the :command:`project` command to set the project
+name. This call is required with every project and should be called soon after
+:command:`cmake_minimum_required`. As we will see later, this command can
+also be used to specify other project level information such as the language
+or version number.
+
+Finally, the :command:`add_executable` command tells CMake to create an
+executable using the specified source code files.
+
+Goal
+----
+
+Understand how to create a simple CMake project.
+
+Helpful Resources
+-----------------
+
+* :command:`add_executable`
+* :command:`cmake_minimum_required`
+* :command:`project`
+
+Files to Edit
+-------------
- # set the project name
- project(Tutorial)
+* ``CMakeLists.txt``
- # add the executable
- add_executable(Tutorial tutorial.cxx)
+Getting Started
+----------------
+The source code for ``tutorial.cxx`` is provided in the
+``Help/guide/tutorial/Step1`` directory and can be used to compute the square
+root of a number. This file does not need to be edited in this step.
-Note that this example uses lower case commands in the ``CMakeLists.txt`` file.
-Upper, lower, and mixed case commands are supported by CMake. The source
-code for ``tutorial.cxx`` is provided in the ``Step1`` directory and can be
-used to compute the square root of a number.
+In the same directory is a ``CMakeLists.txt`` file which you will complete.
+Start with ``TODO 1`` and work through ``TODO 3``.
Build and Run
-------------
-That's all that is needed - we can build and run our project now! First, run
-the :manual:`cmake <cmake(1)>` executable or the
+Once ``TODO 1`` through ``TODO 3`` have been completed, we are ready to build
+and run our project! First, run the :manual:`cmake <cmake(1)>` executable or the
:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
with your chosen build tool.
@@ -40,8 +87,9 @@ build directory:
mkdir Step1_build
-Next, navigate to the build directory and run CMake to configure the project
-and generate a native build system:
+Next, navigate to that build directory and run
+:manual:`cmake <cmake(1)>` to configure the project and generate a native build
+system:
.. code-block:: console
@@ -62,114 +110,352 @@ Finally, try to use the newly built ``Tutorial`` with these commands:
Tutorial 10
Tutorial
+Solution
+--------
-Adding a Version Number and Configured Header File
---------------------------------------------------
+As mentioned above, a three line ``CMakeLists.txt`` is all that we need to get
+up and running. The first line is to use :command:`cmake_minimum_required` to
+set the CMake version as follows:
-The first feature we will add is to provide our executable and project with a
-version number. While we could do this exclusively in the source code, using
-``CMakeLists.txt`` provides more flexibility.
+.. raw:: html
-First, modify the ``CMakeLists.txt`` file to use the :command:`project` command
-to set the project name and version number.
+ <details><summary>TODO 1: Click to show/hide answer</summary>
.. literalinclude:: Step2/CMakeLists.txt
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-project-VERSION
+ :caption: TODO 1: CMakeLists.txt
+ :name: CMakeLists.txt-cmake_minimum_required
:language: cmake
- :end-before: # specify the C++ standard
+ :end-before: # set the project name and version
-Then, configure a header file to pass the version number to the source
-code:
+.. raw:: html
-.. literalinclude:: Step2/CMakeLists.txt
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-configure_file
- :language: cmake
- :start-after: # to the source code
- :end-before: # add the executable
+ </details>
+
+The next step to make a basic project is to use the :command:`project`
+command as follows to set the project name:
+
+.. raw:: html
+
+ <details><summary>TODO 2: Click to show/hide answer</summary>
+
+.. code-block:: cmake
+ :caption: TODO 2: CMakeLists.txt
+ :name: CMakeLists.txt-project
+
+ project(Tutorial)
+
+.. raw:: html
-Since the configured file will be written into the binary tree, we
-must add that directory to the list of paths to search for include
-files. Add the following lines to the end of the ``CMakeLists.txt`` file:
+ </details>
+
+The last command to call for a basic project is
+:command:`add_executable`. We call it as follows:
+
+.. raw:: html
+
+ <details><summary>TODO 3: Click to show/hide answer</summary>
.. literalinclude:: Step2/CMakeLists.txt
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-target_include_directories
+ :caption: TODO 3: CMakeLists.txt
+ :name: CMakeLists.txt-add_executable
:language: cmake
- :start-after: # so that we will find TutorialConfig.h
+ :start-after: # add the executable
+ :end-before: # TODO 9:
-Using your favorite editor, create ``TutorialConfig.h.in`` in the source
-directory with the following contents:
+.. raw:: html
-.. literalinclude:: Step2/TutorialConfig.h.in
- :caption: TutorialConfig.h.in
- :name: TutorialConfig.h.in
- :language: c++
+ </details>
-When CMake configures this header file the values for
-``@Tutorial_VERSION_MAJOR@`` and ``@Tutorial_VERSION_MINOR@`` will be
-replaced.
+Exercise 2 - Specifying the C++ Standard
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Next modify ``tutorial.cxx`` to include the configured header file,
-``TutorialConfig.h``.
+CMake has some special variables that are either created behind the scenes or
+have meaning to CMake when set by project code. Many of these variables start
+with ``CMAKE_``. Avoid this naming convention when creating variables for your
+projects. Two of these special user settable variables are
+:variable:`CMAKE_CXX_STANDARD` and :variable:`CMAKE_CXX_STANDARD_REQUIRED`.
+These may be used together to specify the C++ standard needed to build the
+project.
-Finally, let's print out the executable name and version number by updating
-``tutorial.cxx`` as follows:
+Goal
+----
-.. literalinclude:: Step2/tutorial.cxx
- :caption: tutorial.cxx
- :name: tutorial.cxx-print-version
- :language: c++
- :start-after: {
- :end-before: // convert input to double
+Add a feature that requires C++11.
+
+Helpful Resources
+-----------------
+
+* :variable:`CMAKE_CXX_STANDARD`
+* :variable:`CMAKE_CXX_STANDARD_REQUIRED`
+* :command:`set`
+
+Files to Edit
+-------------
-Specify the C++ Standard
--------------------------
+* ``CMakeLists.txt``
+* ``tutorial.cxx``
-Next let's add some C++11 features to our project by replacing ``atof`` with
-``std::stod`` in ``tutorial.cxx``. At the same time, remove
-``#include <cstdlib>``.
+Getting Started
+---------------
+
+Continue editing files in the ``Step1`` directory. Start with ``TODO 4`` and
+complete through ``TODO 6``.
+
+First, edit ``tutorial.cxx`` by adding a feature that requires C++11. Then
+update ``CMakeLists.txt`` to require C++11.
+
+Build and Run
+-------------
+
+Let's build our project again. Since we already created a build directory and
+ran CMake for Exercise 1, we can skip to the build step:
+
+.. code-block:: console
+
+ cd Step1_build
+ cmake --build .
+
+Now we can try to use the newly built ``Tutorial`` with same commands as
+before:
+
+.. code-block:: console
+
+ Tutorial 4294967296
+ Tutorial 10
+ Tutorial
+
+Solution
+--------
+
+We start by adding some C++11 features to our project by replacing
+``atof`` with ``std::stod`` in ``tutorial.cxx``. This looks like
+the following:
+
+.. raw:: html
+
+ <details><summary>TODO 4: Click to show/hide answer</summary>
.. literalinclude:: Step2/tutorial.cxx
- :caption: tutorial.cxx
+ :caption: TODO 4: tutorial.cxx
:name: tutorial.cxx-cxx11
:language: c++
:start-after: // convert input to double
- :end-before: // calculate square root
+ :end-before: // TODO 12:
+
+.. raw:: html
+
+ </details>
+
+To complete ``TODO 5``, simply remove ``#include <cstdlib>``.
We will need to explicitly state in the CMake code that it should use the
-correct flags. The easiest way to enable support for a specific C++ standard
-in CMake is by using the :variable:`CMAKE_CXX_STANDARD` variable. For this
-tutorial, set the :variable:`CMAKE_CXX_STANDARD` variable in the
-``CMakeLists.txt`` file to ``11`` and :variable:`CMAKE_CXX_STANDARD_REQUIRED`
-to ``True``. Make sure to add the ``CMAKE_CXX_STANDARD`` declarations above the
-call to ``add_executable``.
+correct flags. One way to enable support for a specific C++ standard in CMake
+is by using the :variable:`CMAKE_CXX_STANDARD` variable. For this tutorial, set
+the :variable:`CMAKE_CXX_STANDARD` variable in the ``CMakeLists.txt`` file to
+``11`` and :variable:`CMAKE_CXX_STANDARD_REQUIRED` to ``True``. Make sure to
+add the :variable:`CMAKE_CXX_STANDARD` declarations above the call to
+:command:`add_executable`.
+
+.. raw:: html
+
+ <details><summary>TODO 6: Click to show/hide answer</summary>
.. literalinclude:: Step2/CMakeLists.txt
- :caption: CMakeLists.txt
+ :caption: TODO 6: CMakeLists.txt
:name: CMakeLists.txt-CXX_STANDARD
:language: cmake
- :end-before: # configure a header file to pass some of the CMake settings
+ :start-after: # specify the C++ standard
+ :end-before: # TODO 7:
+
+.. raw:: html
-Rebuild
--------
+ </details>
-Let's build our project again. We already created a build directory and ran
-CMake, so we can skip to the build step:
+Exercise 3 - Adding a Version Number and Configured Header File
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Sometimes it may be useful to have a variable that is defined in your
+``CMakelists.txt`` file also be available in your source code. In this case, we
+would like to print the project version.
+
+One way to accomplish this is by using a configured header file. We create an
+input file with one or more variables to replace. These variables have special
+syntax which looks like ``@VAR@``.
+Then, we use the :command:`configure_file` command to copy the input file to a
+given output file and replace these variables with the current value of ``VAR``
+in the ``CMakelists.txt`` file.
+
+While we could edit the version directly in the source code, using this
+feature is preferred since it creates a single source of truth and avoids
+duplication.
+
+Goal
+----
+
+Define and report the project's version number.
+
+Helpful Resources
+-----------------
+
+* :variable:`<PROJECT-NAME>_VERSION_MAJOR`
+* :variable:`<PROJECT-NAME>_VERSION_MINOR`
+* :command:`configure_file`
+* :command:`target_include_directories`
+
+Files to Edit
+-------------
+
+* ``CMakeLists.txt``
+* ``tutorial.cxx``
+
+Getting Started
+---------------
+
+Continue to edit files from ``Step1``. Start on ``TODO 7`` and complete through
+``TODO 12``. In this exercise, we start by adding a project version number in
+``CMakeLists.txt``. In that same file, use :command:`configure_file` to copy a
+given input file to an output file and substitute some variable values in the
+input file content.
+
+Next, create an input header file ``TutorialConfig.h.in`` defining version
+numbers which will accept variables passed from :command:`configure_file`.
+
+Finally, update ``tutorial.cxx`` to print out its version number.
+
+Build and Run
+-------------
+
+Let's build our project again. As before, we already created a build directory
+and ran CMake so we can skip to the build step:
.. code-block:: console
cd Step1_build
cmake --build .
-Now we can try to use the newly built ``Tutorial`` with same commands as before:
+Verify that the version number is now reported when running the executable
+without any arguments.
-.. code-block:: console
+Solution
+--------
- Tutorial 4294967296
- Tutorial 10
- Tutorial
+In this exercise, we improve our executable by printing a version number.
+While we could do this exclusively in the source code, using ``CMakeLists.txt``
+lets us maintain a single source of data for the version number.
+
+First, we modify the ``CMakeLists.txt`` file to use the
+:command:`project` command to set both the project name and version number.
+When the :command:`project` command is called, CMake defines
+``Tutorial_VERSION_MAJOR`` and ``Tutorial_VERSION_MINOR`` behind the scenes.
+
+.. raw:: html
+
+ <details><summary>TODO 7: Click to show/hide answer</summary>
+
+.. literalinclude:: Step2/CMakeLists.txt
+ :caption: TODO 7: CMakeLists.txt
+ :name: CMakeLists.txt-project-VERSION
+ :language: cmake
+ :start-after: # set the project name and version
+ :end-before: # specify the C++ standard
+
+.. raw:: html
+
+ </details>
+
+Then we used :command:`configure_file` to copy the input file with the
+specified CMake variables replaced:
+
+.. raw:: html
+
+ <details><summary>TODO 8: Click to show/hide answer</summary>
+
+.. literalinclude:: Step2/CMakeLists.txt
+ :caption: TODO 8: CMakeLists.txt
+ :name: CMakeLists.txt-configure_file
+ :language: cmake
+ :start-after: # to the source code
+ :end-before: # TODO 8:
+
+.. raw:: html
+
+ </details>
+
+Since the configured file will be written into the project binary
+directory, we must add that directory to the list of paths to search for
+include files.
+
+**Note:** Throughout this tutorial, we will refer to the project build and
+the project binary directory interchangeably. These are the same and are not
+meant to refer to a `bin/` directory.
+
+We used :command:`target_include_directories` to specify
+where the executable target should look for include files.
+
+.. raw:: html
+
+ <details><summary>TODO 9: Click to show/hide answer</summary>
+
+.. literalinclude:: Step2/CMakeLists.txt
+ :caption: TODO 9: CMakeLists.txt
+ :name: CMakeLists.txt-target_include_directories
+ :language: cmake
+ :start-after: # so that we will find TutorialConfig.h
+
+.. raw:: html
+
+ </details>
+
+``TutorialConfig.h.in`` is the input header file to be configured.
+When :command:`configure_file` is called from our ``CMakeLists.txt``, the
+values for ``@Tutorial_VERSION_MAJOR@`` and ``@Tutorial_VERSION_MINOR@`` will
+be replaced with the corresponding version numbers from the project in
+``TutorialConfig.h``.
+
+.. raw:: html
+
+ <details><summary>TODO 10: Click to show/hide answer</summary>
+
+.. literalinclude:: Step2/TutorialConfig.h.in
+ :caption: TODO 10: TutorialConfig.h.in
+ :name: TutorialConfig.h.in
+ :language: c++
+ :end-before: // TODO 13:
+
+.. raw:: html
+
+ </details>
+
+Next, we need to modify ``tutorial.cxx`` to include the configured header file,
+``TutorialConfig.h``.
+
+.. raw:: html
+
+ <details><summary>TODO 11: Click to show/hide answer</summary>
+
+.. code-block:: c++
+ :caption: TODO 11: tutorial.cxx
+
+ #include "TutorialConfig.h"
+
+.. raw:: html
+
+ </details>
+
+Finally, we print out the executable name and version number by updating
+``tutorial.cxx`` as follows:
+
+.. raw:: html
+
+ <details><summary>TODO 12: Click to show/hide answer</summary>
+
+.. literalinclude:: Step2/tutorial.cxx
+ :caption: TODO 12 : tutorial.cxx
+ :name: tutorial.cxx-print-version
+ :language: c++
+ :start-after: {
+ :end-before: // convert input to double
+
+.. raw:: html
-Check that the version number is now reported when running the executable without
-any arguments.
+ </details>
diff --git a/Help/guide/tutorial/Adding Export Configuration.rst b/Help/guide/tutorial/Adding Export Configuration.rst
index 3bd6d64..eb14f42 100644
--- a/Help/guide/tutorial/Adding Export Configuration.rst
+++ b/Help/guide/tutorial/Adding Export Configuration.rst
@@ -21,7 +21,7 @@ in ``MathFunctions/CMakeLists.txt`` to look like:
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-install-TARGETS-EXPORT
:language: cmake
- :start-after: # install rules
+ :start-after: # install libs
Now that we have ``MathFunctions`` being exported, we also need to explicitly
install the generated ``MathFunctionsTargets.cmake`` file. This is done by
diff --git a/Help/guide/tutorial/Adding Generator Expressions.rst b/Help/guide/tutorial/Adding Generator Expressions.rst
index 7fcc97f..6f9714e 100644
--- a/Help/guide/tutorial/Adding Generator Expressions.rst
+++ b/Help/guide/tutorial/Adding Generator Expressions.rst
@@ -1,4 +1,4 @@
-Step 10: Adding Generator Expressions
+Step 4: Adding Generator Expressions
=====================================
:manual:`Generator expressions <cmake-generator-expressions(7)>` are evaluated
@@ -27,58 +27,280 @@ expressions are the ``0`` and ``1`` expressions. A ``$<0:...>`` results in the
empty string, and ``<1:...>`` results in the content of ``...``. They can also
be nested.
+Exercise 1 - Setting the C++ Standard with Interface Libraries
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Before we use :manual:`generator expressions <cmake-generator-expressions(7)>`
+let's refactor our existing code to use an ``INTERFACE`` library. We will
+use that library in the next step to demonstrate a common use for
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+Goal
+----
+
+Add an ``INTERFACE`` library target to specify the required C++ standard.
+
+Helpful Resources
+-----------------
+
+* :command:`add_library`
+* :command:`target_compile_features`
+* :command:`target_link_libraries`
+
+Files to Edit
+-------------
+
+* ``CMakeLists.txt``
+* ``MathFunctions/CMakeLists.txt``
+
+Getting Started
+---------------
+
+In this exercise, we will refactor our code to use an ``INTERFACE`` library to
+specify the C++ standard.
+
+The starting source code is provided in the ``Step4`` directory. In this
+exercise, complete ``TODO 1`` through ``TODO 3``.
+
+Start by editing the top level ``CMakeLists.txt`` file. Construct an
+``INTERFACE`` library target called ``tutorial_compiler_flags`` and
+specify ``cxx_std_11`` as a target compiler feature.
+
+Modify ``CMakeLists.txt`` and ``MathFunctions/CMakeLists.txt`` so that all
+targets have a :command:`target_link_libraries` call to
+``tutorial_compiler_flags``.
+
+Build and Run
+-------------
+
+Make a new directory called ``Step4_build``, run the :manual:`cmake <cmake(1)>`
+executable or the :manual:`cmake-gui <cmake-gui(1)>` to configure the project
+and then build it with your chosen build tool or by using ``cmake --build .``
+from the build directory.
+
+Here's a refresher of what that looks like from the command line:
+
+.. code-block:: console
+
+ mkdir Step4_build
+ cd Step4_build
+ cmake ../Step4
+ cmake --build .
+
+Next, use the newly built ``Tutorial`` and verify that it is working as
+expected.
+
+Solution
+--------
+
+Let's update our code from the previous step to use interface libraries
+to set our C++ requirements.
+
+To start, we need to remove the two :command:`set` calls on the variables
+:variable:`CMAKE_CXX_STANDARD` and :variable:`CMAKE_CXX_STANDARD_REQUIRED`.
+The specific lines to remove are as follows:
+
+.. literalinclude:: Step4/CMakeLists.txt
+ :caption: CMakeLists.txt
+ :name: CMakeLists.txt-CXX_STANDARD-variable-remove
+ :language: cmake
+ :start-after: # specify the C++ standard
+ :end-before: # TODO 5: Create helper variables
+
+Next, we need to create an interface library, ``tutorial_compiler_flags``. And
+then use :command:`target_compile_features` to add the compiler feature
+``cxx_std_11``.
+
+
+.. raw:: html
+
+ <details><summary>TODO 1: Click to show/hide answer</summary>
+
+.. literalinclude:: Step5/CMakeLists.txt
+ :caption: TODO 1: CMakeLists.txt
+ :name: CMakeLists.txt-cxx_std-feature
+ :language: cmake
+ :start-after: # specify the C++ standard
+ :end-before: # add compiler warning flags just
+
+.. raw:: html
+
+ </details>
+
+Finally, with our interface library set up, we need to link our
+executable ``Target`` and our ``MathFunctions`` library to our new
+``tutorial_compiler_flags`` library. Respectively, the code will look like
+this:
+
+.. raw:: html
+
+ <details><summary>TODO 2: Click to show/hide answer</summary>
+
+.. literalinclude:: Step5/CMakeLists.txt
+ :caption: TODO 2: CMakeLists.txt
+ :name: CMakeLists.txt-target_link_libraries-step4
+ :language: cmake
+ :start-after: add_executable(Tutorial tutorial.cxx)
+ :end-before: # add the binary tree to the search path for include file
+
+.. raw:: html
+
+ </details>
+
+and this:
+
+.. raw:: html
+
+ <details><summary>TODO 3: Click to show/hide answer</summary>
+
+.. literalinclude:: Step5/MathFunctions/CMakeLists.txt
+ :caption: TODO 3: MathFunctions/CMakeLists.txt
+ :name: MathFunctions-CMakeLists.txt-target_link_libraries-step4
+ :language: cmake
+ :start-after: # link our compiler flags interface library
+ :end-before: # TODO 1
+
+.. raw:: html
+
+ </details>
+
+With this, all of our code still requires C++ 11 to build. Notice
+though that with this method, it gives us the ability to be specific about
+which targets get specific requirements. In addition, we create a single
+source of truth in our interface library.
+
+Exercise 2 - Adding Compiler Warning Flags with Generator Expressions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
A common usage of
:manual:`generator expressions <cmake-generator-expressions(7)>` is to
conditionally add compiler flags, such as those for language levels or
warnings. A nice pattern is to associate this information to an ``INTERFACE``
-target allowing this information to propagate. Let's start by constructing an
-``INTERFACE`` target and specifying the required C++ standard level of ``11``
-instead of using :variable:`CMAKE_CXX_STANDARD`.
+target allowing this information to propagate.
-So the following code:
+Goal
+----
-.. literalinclude:: Step10/CMakeLists.txt
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-CXX_STANDARD-variable-remove
+Add compiler warning flags when building but not for installed versions.
+
+Helpful Resources
+-----------------
+
+* :manual:`cmake-generator-expressions(7)`
+* :command:`cmake_minimum_required`
+* :command:`set`
+* :command:`target_compile_options`
+
+Files to Edit
+-------------
+
+* ``CMakeLists.txt``
+
+Getting Started
+---------------
+
+Start with the resulting files from Exercise 1. Complete ``TODO 4`` through
+``TODO 7``.
+
+First, in the top level ``CMakeLists.txt`` file, we need to set the
+:command:`cmake_minimum_required` to ``3.15``. In this exercise we are going
+to use a generator expression which was introduced in CMake 3.15.
+
+Next we add the desired compiler warning flags that we want for our project.
+As warning flags vary based on the compiler, we use the
+``COMPILE_LANG_AND_ID`` generator expression to control which flags to apply
+given a language and a set of compiler ids.
+
+Build and Run
+-------------
+
+Since we have our build directory already configured from Exercise 1, simply
+rebuild our code by calling the following:
+
+.. code-block:: console
+
+ cd Step4_build
+ cmake --build .
+
+Solution
+--------
+
+Update the :command:`cmake_minimum_required` to require at least CMake
+version ``3.15``:
+
+.. raw:: html
+
+ <details><summary>TODO 4: Click to show/hide answer</summary>
+
+.. literalinclude:: Step5/CMakeLists.txt
+ :caption: TODO 4: CMakeLists.txt
+ :name: MathFunctions-CMakeLists.txt-minimum-required-step4
:language: cmake
- :start-after: project(Tutorial VERSION 1.0)
- :end-before: # control where the static and shared libraries are built so that on windows
+ :end-before: # set the project name and version
-Would be replaced with:
+.. raw:: html
-.. literalinclude:: Step11/CMakeLists.txt
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-cxx_std-feature
+ </details>
+
+Next we determine which compiler our system is currently using to build
+since warning flags vary based on the compiler we use. This is done with
+the ``COMPILE_LANG_AND_ID`` generator expression. We set the result in the
+variables ``gcc_like_cxx`` and ``msvc_cxx`` as follows:
+
+.. raw:: html
+
+ <details><summary>TODO 5: Click to show/hide answer</summary>
+
+.. literalinclude:: Step5/CMakeLists.txt
+ :caption: TODO 5: CMakeLists.txt
+ :name: CMakeLists.txt-compile_lang_and_id
:language: cmake
- :start-after: project(Tutorial VERSION 1.0)
- :end-before: # add compiler warning flags just when building this project via
+ :start-after: # the BUILD_INTERFACE genex
+ :end-before: target_compile_options(tutorial_compiler_flags INTERFACE
-**Note**: This upcoming section will require a change to the
-:command:`cmake_minimum_required` usage in the code. The Generator Expression
-that is about to be used was introduced in `3.15`. Update the call to require
-that more recent version:
+.. raw:: html
+
+ </details>
+
+Next we add the desired compiler warning flags that we want for our project.
+Using our variables ``gcc_like_cxx`` and ``msvc_cxx``, we can use another
+generator expression to apply the respective flags only when the variables are
+true. We use :command:`target_compile_options` to apply these flags to our
+interface library.
+
+.. raw:: html
+
+ <details><summary>TODO 6: Click to show/hide answer</summary>
.. code-block:: cmake
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-version-update
+ :caption: TODO 6: CMakeLists.txt
+ :name: CMakeLists.txt-compile_flags
- cmake_minimum_required(VERSION 3.15)
+ target_compile_options(tutorial_compiler_flags INTERFACE
+ "$<${gcc_like_cxx}:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>"
+ "$<${msvc_cxx}:-W3>"
+ )
-Next we add the desired compiler warning flags that we want for our project. As
-warning flags vary based on the compiler we use the ``COMPILE_LANG_AND_ID``
-generator expression to control which flags to apply given a language and a set
-of compiler ids as seen below:
+.. raw:: html
-.. literalinclude:: Step11/CMakeLists.txt
- :caption: CMakeLists.txt
+ </details>
+
+Lastly, we only want these warning flags to be used during builds. Consumers
+of our installed project should not inherit our warning flags. To specify
+this, we wrap our flags in a generator expression using the ``BUILD_INTERFACE``
+condition. The resulting full code looks like the following:
+
+.. raw:: html
+
+ <details><summary>TODO 7: Click to show/hide answer</summary>
+
+.. literalinclude:: Step5/CMakeLists.txt
+ :caption: TODO 7: CMakeLists.txt
:name: CMakeLists.txt-target_compile_options-genex
:language: cmake
- :start-after: # the BUILD_INTERFACE genex
- :end-before: # control where the static and shared libraries are built so that on windows
+ :start-after: set(msvc_cxx "$<COMPILE_LANG_AND_ID:CXX,MSVC>")
+ :end-before: # should we use our own math functions
-Looking at this we see that the warning flags are encapsulated inside a
-``BUILD_INTERFACE`` condition. This is done so that consumers of our installed
-project will not inherit our warning flags.
+.. raw:: html
-**Exercise**: Modify ``MathFunctions/CMakeLists.txt`` so that all targets have
-a :command:`target_link_libraries` call to ``tutorial_compiler_flags``.
+ </details>
diff --git a/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst b/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst
index c6e0fd0..45d5976 100644
--- a/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst
+++ b/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst
@@ -1,4 +1,4 @@
-Step 8: Adding Support for a Testing Dashboard
+Step 6: Adding Support for a Testing Dashboard
==============================================
Adding support for submitting our test results to a dashboard is simple. We
@@ -9,21 +9,21 @@ we include the :module:`CTest` module in our top-level ``CMakeLists.txt``.
Replace:
-.. code-block:: cmake
+.. literalinclude:: Step6/CMakeLists.txt
:caption: CMakeLists.txt
:name: CMakeLists.txt-enable_testing-remove
-
- # enable testing
- enable_testing()
+ :language: cmake
+ :start-after: # enable testing
+ :end-before: # does the application run
With:
-.. code-block:: cmake
+.. literalinclude:: Step7/CMakeLists.txt
:caption: CMakeLists.txt
:name: CMakeLists.txt-include-CTest
-
- # enable dashboard scripting
- include(CTest)
+ :language: cmake
+ :start-after: # enable testing
+ :end-before: # does the application run
The :module:`CTest` module will automatically call ``enable_testing()``, so we
can remove it from our CMake files.
@@ -46,7 +46,7 @@ downloaded from the ``Settings`` page of the project on the CDash
instance that will host and display the test results. Once downloaded from
CDash, the file should not be modified locally.
-.. literalinclude:: Step9/CTestConfig.cmake
+.. literalinclude:: Step7/CTestConfig.cmake
:caption: CTestConfig.cmake
:name: CTestConfig.cmake
:language: cmake
diff --git a/Help/guide/tutorial/Adding System Introspection.rst b/Help/guide/tutorial/Adding System Introspection.rst
index 8db0cb8..ba91df4 100644
--- a/Help/guide/tutorial/Adding System Introspection.rst
+++ b/Help/guide/tutorial/Adding System Introspection.rst
@@ -1,4 +1,4 @@
-Step 5: Adding System Introspection
+Step 7: Adding System Introspection
===================================
Let us consider adding some code to our project that depends on features the
@@ -15,7 +15,7 @@ these functions using the :module:`CheckCXXSourceCompiles` module in
Add the checks for ``log`` and ``exp`` to ``MathFunctions/CMakeLists.txt``,
after the call to :command:`target_include_directories`:
-.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
+.. literalinclude:: Step8/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-check_cxx_source_compiles
:language: cmake
@@ -25,19 +25,19 @@ after the call to :command:`target_include_directories`:
If available, use :command:`target_compile_definitions` to specify
``HAVE_LOG`` and ``HAVE_EXP`` as ``PRIVATE`` compile definitions.
-.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
+.. literalinclude:: Step8/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-target_compile_definitions
:language: cmake
:start-after: # add compile definitions
- :end-before: # install rules
+ :end-before: # install libs
If ``log`` and ``exp`` are available on the system, then we will use them to
compute the square root in the ``mysqrt`` function. Add the following code to
the ``mysqrt`` function in ``MathFunctions/mysqrt.cxx`` (don't forget the
``#endif`` before returning the result!):
-.. literalinclude:: Step6/MathFunctions/mysqrt.cxx
+.. literalinclude:: Step8/MathFunctions/mysqrt.cxx
:caption: MathFunctions/mysqrt.cxx
:name: MathFunctions/mysqrt.cxx-ifdef
:language: c++
@@ -46,7 +46,7 @@ the ``mysqrt`` function in ``MathFunctions/mysqrt.cxx`` (don't forget the
We will also need to modify ``mysqrt.cxx`` to include ``cmath``.
-.. literalinclude:: Step6/MathFunctions/mysqrt.cxx
+.. literalinclude:: Step8/MathFunctions/mysqrt.cxx
:caption: MathFunctions/mysqrt.cxx
:name: MathFunctions/mysqrt.cxx-include-cmath
:language: c++
diff --git a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst
index a8e914e..4aef050 100644
--- a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst
+++ b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst
@@ -1,52 +1,147 @@
Step 3: Adding Usage Requirements for a Library
===============================================
-Usage requirements allow for far better control over a library or executable's
-link and include line while also giving more control over the transitive
-property of targets inside CMake. The primary commands that leverage usage
-requirements are:
-
- - :command:`target_compile_definitions`
- - :command:`target_compile_options`
- - :command:`target_include_directories`
- - :command:`target_link_libraries`
-
-Let's refactor our code from :guide:`tutorial/Adding a Library` to use the
-modern CMake approach of usage requirements. We first state that anybody
-linking to ``MathFunctions`` needs to include the current source directory,
-while ``MathFunctions`` itself doesn't. So this can become an ``INTERFACE``
-usage requirement.
-
-Remember ``INTERFACE`` means things that consumers require but the producer
-doesn't. Add the following lines to the end of
-``MathFunctions/CMakeLists.txt``:
+Exercise 1 - Adding Usage Requirements for a Library
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+:ref:`Usage requirements <Target Usage Requirements>` of a target parameters
+allow for far better control over a library or executable's link and include
+line while also giving more control over the transitive property of targets
+inside CMake. The primary commands that
+leverage usage requirements are:
+
+* :command:`target_compile_definitions`
+* :command:`target_compile_options`
+* :command:`target_include_directories`
+* :command:`target_link_directories`
+* :command:`target_link_options`
+* :command:`target_precompile_headers`
+* :command:`target_sources`
+
+
+Goal
+----
+
+Add usage requirements for a library.
+
+Helpful Materials
+-----------------
+
+* :variable:`CMAKE_CURRENT_SOURCE_DIR`
+
+Files to Edit
+-------------
+
+* ``MathFunctions/CMakeLists.txt``
+* ``CMakeLists.txt``
+
+Getting Started
+---------------
+
+In this exercise, we will refactor our code from
+:guide:`tutorial/Adding a Library` to use the modern CMake approach. We will
+let our library define its own usage requirements so they are passed
+transitively to other targets as necessary. In this case, ``MathFunctions``
+will specify any needed include directories itself. Then, the consuming target
+``Tutorial`` simply needs to link to ``MathFunctions`` and not worry about
+any additional include directories.
+
+The starting source code is provided in the ``Step3`` directory. In this
+exercise, complete ``TODO 1`` through ``TODO 3``.
+
+First, add a call to :command:`target_include_directories` in
+``MathFunctions/CMakeLists``. Remember that
+:variable:`CMAKE_CURRENT_SOURCE_DIR` is the path to the source directory
+currently being processed.
+
+Then, update (and simplify!) the call to
+:command:`target_include_directories` in the top-level ``CMakeLists.txt``.
+
+Build and Run
+-------------
+
+Make a new directory called ``Step3_build``, run the :manual:`cmake
+<cmake(1)>` executable or the :manual:`cmake-gui <cmake-gui(1)>` to
+configure the project and then build it with your chosen build tool or by
+using :option:`cmake --build . <cmake --build>` from the build directory.
+Here's a refresher of what that looks like from the command line:
+
+.. code-block:: console
+
+ mkdir Step3_build
+ cd Step3_build
+ cmake ../Step3
+ cmake --build .
+
+Next, use the newly built ``Tutorial`` and verify that it is working as
+expected.
+
+Solution
+--------
+
+Let's update the code from the previous step to use the modern CMake
+approach of usage requirements.
+
+We want to state that anybody linking to ``MathFunctions`` needs to include
+the current source directory, while ``MathFunctions`` itself doesn't. This
+can be expressed with an ``INTERFACE`` usage requirement. Remember
+``INTERFACE`` means things that consumers require but the producer doesn't.
+
+At the end of ``MathFunctions/CMakeLists.txt``, use
+:command:`target_include_directories` with the ``INTERFACE`` keyword, as
+follows:
+
+.. raw:: html
+
+ <details><summary>TODO 1: Click to show/hide answer</summary>
.. literalinclude:: Step4/MathFunctions/CMakeLists.txt
- :caption: MathFunctions/CMakeLists.txt
+ :caption: TODO 1: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-target_include_directories-INTERFACE
:language: cmake
:start-after: # to find MathFunctions.h
+ :end-before: # TODO 3: Link to
+
+.. raw:: html
+
+ </details>
-Now that we've specified usage requirements for ``MathFunctions`` we can safely
-remove our uses of the ``EXTRA_INCLUDES`` variable from the top-level
+Now that we've specified usage requirements for ``MathFunctions`` we can
+safely remove our uses of the ``EXTRA_INCLUDES`` variable from the top-level
``CMakeLists.txt``, here:
+.. raw:: html
+
+ <details><summary>TODO 2: Click to show/hide answer</summary>
+
.. literalinclude:: Step4/CMakeLists.txt
- :caption: CMakeLists.txt
+ :caption: TODO 2: CMakeLists.txt
:name: CMakeLists.txt-remove-EXTRA_INCLUDES
:language: cmake
:start-after: # add the MathFunctions library
:end-before: # add the executable
+.. raw:: html
+
+ </details>
+
And here:
+.. raw:: html
+
+ <details><summary>TODO 3: Click to show/hide answer</summary>
+
.. literalinclude:: Step4/CMakeLists.txt
- :caption: CMakeLists.txt
+ :caption: TODO 3: CMakeLists.txt
:name: CMakeLists.txt-target_include_directories-remove-EXTRA_INCLUDES
:language: cmake
:start-after: # so that we will find TutorialConfig.h
-Once this is done, run the :manual:`cmake <cmake(1)>` executable or the
-:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
-with your chosen build tool or by using ``cmake --build .`` from the build
-directory.
+.. raw:: html
+
+ </details>
+
+Notice that with this technique, the only thing our executable target does to
+use our library is call :command:`target_link_libraries` with the name
+of the library target. In larger projects, the classic method of specifying
+library dependencies manually becomes very complicated very quickly.
diff --git a/Help/guide/tutorial/Adding a Custom Command and Generated File.rst b/Help/guide/tutorial/Adding a Custom Command and Generated File.rst
index 70c6695..b1f9840 100644
--- a/Help/guide/tutorial/Adding a Custom Command and Generated File.rst
+++ b/Help/guide/tutorial/Adding a Custom Command and Generated File.rst
@@ -1,4 +1,4 @@
-Step 6: Adding a Custom Command and Generated File
+Step 8: Adding a Custom Command and Generated File
==================================================
Suppose, for the purpose of this tutorial, we decide that we never want to use
@@ -26,7 +26,7 @@ accomplish this.
First, at the top of ``MathFunctions/CMakeLists.txt``, the executable for
``MakeTable`` is added as any other executable would be added.
-.. literalinclude:: Step7/MathFunctions/CMakeLists.txt
+.. literalinclude:: Step9/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-add_executable-MakeTable
:language: cmake
@@ -36,7 +36,7 @@ First, at the top of ``MathFunctions/CMakeLists.txt``, the executable for
Then we add a custom command that specifies how to produce ``Table.h``
by running MakeTable.
-.. literalinclude:: Step7/MathFunctions/CMakeLists.txt
+.. literalinclude:: Step9/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-add_custom_command-Table.h
:language: cmake
@@ -47,7 +47,7 @@ Next we have to let CMake know that ``mysqrt.cxx`` depends on the generated
file ``Table.h``. This is done by adding the generated ``Table.h`` to the list
of sources for the library MathFunctions.
-.. literalinclude:: Step7/MathFunctions/CMakeLists.txt
+.. literalinclude:: Step9/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-add_library-Table.h
:language: cmake
@@ -57,17 +57,17 @@ of sources for the library MathFunctions.
We also have to add the current binary directory to the list of include
directories so that ``Table.h`` can be found and included by ``mysqrt.cxx``.
-.. literalinclude:: Step7/MathFunctions/CMakeLists.txt
+.. literalinclude:: Step9/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-target_include_directories-Table.h
:language: cmake
:start-after: # state that we depend on our bin
- :end-before: # install rules
+ :end-before: # install libs
Now let's use the generated table. First, modify ``mysqrt.cxx`` to include
``Table.h``. Next, we can rewrite the ``mysqrt`` function to use the table:
-.. literalinclude:: Step7/MathFunctions/mysqrt.cxx
+.. literalinclude:: Step9/MathFunctions/mysqrt.cxx
:caption: MathFunctions/mysqrt.cxx
:name: MathFunctions/mysqrt.cxx
:language: c++
diff --git a/Help/guide/tutorial/Adding a Library.rst b/Help/guide/tutorial/Adding a Library.rst
index 71755be..a56c327 100644
--- a/Help/guide/tutorial/Adding a Library.rst
+++ b/Help/guide/tutorial/Adding a Library.rst
@@ -1,136 +1,459 @@
Step 2: Adding a Library
========================
-Now we will add a library to our project. This library will contain our own
+At this point, we have seen how to create a basic project using CMake. In this
+step, we will learn how to create and use a library in our project. We will
+also see how to make the use of our library optional.
+
+Exercise 1 - Creating a Library
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To add a library in CMake, use the :command:`add_library` command and specify
+which source files should make up the library.
+
+Rather than placing all of the source files in one directory, we can organize
+our project with one or more subdirectories. In this case, we will create a
+subdirectory specifically for our library. Here, we can add a new
+``CMakeLists.txt`` file and one or more source files. In the top level
+``CMakeLists.txt`` file, we will use the :command:`add_subdirectory` command
+to add the subdirectory to the build.
+
+Once the library is created, it is connected to our executable target with
+:command:`target_include_directories` and :command:`target_link_libraries`.
+
+Goal
+----
+
+Add and use a library.
+
+Helpful Resources
+-----------------
+
+* :command:`add_library`
+* :command:`add_subdirectory`
+* :command:`target_include_directories`
+* :command:`target_link_libraries`
+* :variable:`PROJECT_SOURCE_DIR`
+
+Files to Edit
+-------------
+
+* ``CMakeLists.txt``
+* ``tutorial.cxx``
+* ``MathFunctions/CMakeLists.txt``
+
+Getting Started
+---------------
+
+In this exercise, we will add a library to our project that contains our own
implementation for computing the square root of a number. The executable can
then use this library instead of the standard square root function provided by
the compiler.
-For this tutorial we will put the library into a subdirectory
-called ``MathFunctions``. This directory already contains a header file,
-``MathFunctions.h``, and a source file ``mysqrt.cxx``. The source file has one
-function called ``mysqrt`` that provides similar functionality to the
-compiler's ``sqrt`` function.
+For this tutorial we will put the library into a subdirectory called
+``MathFunctions``. This directory already contains a header file,
+``MathFunctions.h``, and a source file ``mysqrt.cxx``. We will not need to
+modify either of these files. The source file has one function called
+``mysqrt`` that provides similar functionality to the compiler's ``sqrt``
+function.
+
+From the ``Help/guide/tutorial/Step2`` directory, start with ``TODO 1`` and
+complete through ``TODO 6``.
+
+First, fill in the one line ``CMakeLists.txt`` in the ``MathFunctions``
+subdirectory.
+
+Next, edit the top level ``CMakeLists.txt``.
+
+Finally, use the newly created ``MathFunctions`` library in ``tutorial.cxx``
+
+Build and Run
+-------------
+
+Run the :manual:`cmake <cmake(1)>` executable or the
+:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
+with your chosen build tool.
+
+Below is a refresher of what that looks like from the command line:
+
+.. code-block:: console
+
+ mkdir Step2_build
+ cd Step2_build
+ cmake ../Step2
+ cmake --build .
+
+Try to use the newly built ``Tutorial`` and ensure that it is still
+producing accurate square root values.
+
+Solution
+--------
+
+In the ``CMakeLists.txt`` file in the ``MathFunctions`` directory, we create
+a library target called ``MathFunctions`` with :command:`add_library`. The
+source file for the library is passed as an argument to
+:command:`add_library`. This looks like the following line:
-Add the following one line ``CMakeLists.txt`` file to the ``MathFunctions``
-directory:
+.. raw:: html
+
+ <details><summary>TODO 1: Click to show/hide answer</summary>
.. literalinclude:: Step3/MathFunctions/CMakeLists.txt
- :caption: MathFunctions/CMakeLists.txt
- :name: MathFunctions/CMakeLists.txt
+ :caption: TODO 1: MathFunctions/CMakeLists.txt
+ :name: MathFunctions/CMakeLists.txt-add_library
:language: cmake
+ :end-before: # TODO 1
+
+.. raw:: html
+
+ </details>
To make use of the new library we will add an :command:`add_subdirectory`
call in the top-level ``CMakeLists.txt`` file so that the library will get
-built. We add the new library to the executable, and add ``MathFunctions`` as
-an include directory so that the ``MathFunctions.h`` header file can be found.
-The last few lines of the top-level ``CMakeLists.txt`` file should now look
-like:
+built.
+
+.. raw:: html
+
+ <details><summary>TODO 2: Click to show/hide answer</summary>
+
+.. code-block:: cmake
+ :caption: TODO 2: CMakeLists.txt
+ :name: CMakeLists.txt-add_subdirectory
+
+ add_subdirectory(MathFunctions)
+
+.. raw:: html
+
+ </details>
+
+Next, the new library target is linked to the executable target using
+:command:`target_link_libraries`.
+
+.. raw:: html
+
+ <details><summary>TODO 3: Click to show/hide answer</summary>
+
+.. code-block:: cmake
+ :caption: TODO 3: CMakeLists.txt
+ :name: CMakeLists.txt-target_link_libraries
+
+ target_link_libraries(Tutorial PUBLIC MathFunctions)
+
+.. raw:: html
+
+ </details>
+
+Finally we need to specify the library's header file location. Modify
+:command:`target_include_directories` to add the ``MathFunctions`` subdirectory
+as an include directory so that the ``MathFunctions.h`` header file can be
+found.
+
+.. raw:: html
+
+ <details><summary>TODO 4: Click to show/hide answer</summary>
.. code-block:: cmake
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-add_subdirectory
+ :caption: TODO 4: CMakeLists.txt
+ :name: CMakeLists.txt-target_include_directories-step2
+
+ target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ "${PROJECT_SOURCE_DIR}/MathFunctions"
+ )
+
+.. raw:: html
+
+ </details>
+
+Now let's use our library. In ``tutorial.cxx``, include ``MathFunctions.h``:
+
+.. raw:: html
+
+ <details><summary>TODO 5: Click to show/hide answer</summary>
- # add the MathFunctions library
- add_subdirectory(MathFunctions)
+.. code-block:: c++
+ :caption: TODO 5 : tutorial.cxx
+ :name: tutorial.cxx-include_MathFunctions.h
- # add the executable
- add_executable(Tutorial tutorial.cxx)
+ #include "MathFunctions.h"
- target_link_libraries(Tutorial PUBLIC MathFunctions)
+.. raw:: html
- # add the binary tree to the search path for include files
- # so that we will find TutorialConfig.h
- target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- "${PROJECT_SOURCE_DIR}/MathFunctions"
- )
+ </details>
-Now let us make the ``MathFunctions`` library optional. While for the tutorial
+Lastly, replace ``sqrt`` with our library function ``mysqrt``.
+
+.. raw:: html
+
+ <details><summary>TODO 6: Click to show/hide answer</summary>
+
+.. code-block:: c++
+ :caption: TODO 6 : tutorial.cxx
+ :name: tutorial.cxx-call_mysqrt
+
+ const double outputValue = mysqrt(inputValue);
+
+.. raw:: html
+
+ </details>
+
+Exercise 2 - Making Our Library Optional
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Now let us make the MathFunctions library optional. While for the tutorial
there really isn't any need to do so, for larger projects this is a common
-occurrence. The first step is to add an option to the top-level
-``CMakeLists.txt`` file.
+occurrence.
+
+CMake can do this using the :command:`option` command. This gives users a
+variable which they can change when configuring their cmake build. This
+setting will be stored in the cache so that the user does not need to set
+the value each time they run CMake on a build directory.
+
+Goal
+----
+
+Add the option to build without ``MathFunctions``.
+
+
+Helpful Resources
+-----------------
+
+* :command:`if`
+* :command:`list`
+* :command:`option`
+* :command:`cmakedefine <configure_file>`
+
+Files to Edit
+-------------
+
+* ``CMakeLists.txt``
+* ``tutorial.cxx``
+* ``TutorialConfig.h.in``
+
+Getting Started
+---------------
+
+Start with the resulting files from Exercise 1. Complete ``TODO 7`` through
+``TODO 13``.
+
+First create a variable ``USE_MYMATH`` using the :command:`option` command
+in the top-level ``CMakeLists.txt`` file. In that same file, use that option
+to determine whether to build and use the ``MathFunctions`` library.
+
+Then, update ``tutorial.cxx`` and ``TutorialConfig.h.in`` to use
+``USE_MYMATH``.
+
+Build and Run
+-------------
+
+Since we have our build directory already configured from Exercise 1, we can
+rebuild by simply calling the following:
+
+.. code-block:: console
+
+ cd ../Step2_build
+ cmake --build .
+
+Next, run the ``Tutorial`` executable on a few numbers to verify that it's
+still correct.
+
+Now let's update the value of ``USE_MYMATH`` to ``OFF``. The easiest way is to
+use the :manual:`cmake-gui <cmake-gui(1)>` or :manual:`ccmake <ccmake(1)>`
+if you're in the terminal. Or, alternatively, if you want to change the
+option from the command-line, try:
+
+.. code-block:: console
+
+ cmake ../Step2 -DUSE_MYMATH=OFF
+
+Now, rebuild the code with the following:
+
+.. code-block:: console
+
+ cmake --build .
+
+Then, run the executable again to ensure that it still works with
+``USE_MYMATH`` set to ``OFF``. Which function gives better results, ``sqrt``
+or ``mysqrt``?
+
+Solution
+--------
+
+The first step is to add an option to the top-level ``CMakeLists.txt`` file.
+This option will be displayed in the :manual:`cmake-gui <cmake-gui(1)>` and
+:manual:`ccmake <ccmake(1)>` with a default value of ``ON`` that can be
+changed by the user.
+
+.. raw:: html
+
+ <details><summary>TODO 7: Click to show/hide answer</summary>
.. literalinclude:: Step3/CMakeLists.txt
- :caption: CMakeLists.txt
+ :caption: TODO 7: CMakeLists.txt
:name: CMakeLists.txt-option
:language: cmake
:start-after: # should we use our own math functions
- :end-before: # add the MathFunctions library
+ :end-before: # configure a header file to pass some of the CMake settings
-This option will be displayed in the :manual:`cmake-gui <cmake-gui(1)>` and
-:manual:`ccmake <ccmake(1)>`
-with a default value of ``ON`` that can be changed by the user. This setting
-will be stored in the cache so that the user does not need to set the value
-each time they run CMake on a build directory.
-
-The next change is to make building and linking the ``MathFunctions`` library
-conditional. To do this, we will create an ``if`` statement which checks the
-value of the option. Inside the ``if`` block, put the
-:command:`add_subdirectory` command from above with some additional list
-commands to store information needed to link to the library and add the
-subdirectory as an include directory in the ``Tutorial`` target.
-The end of the top-level ``CMakeLists.txt`` file will now look like the
-following:
+.. raw:: html
+
+ </details>
+
+Next, make building and linking the ``MathFunctions`` library
+conditional.
+
+Start by creating a :command:`list` of the optional library targets for our
+project. At the moment, it is just ``MathFunctions``. Let's name our list
+``EXTRA_LIBS``.
+
+Similarly, we need to make a :command:`list` for the optional includes which
+we will call ``EXTRA_INCLUDES``. In this list, we will ``APPEND`` the path of
+the header file needed for our library.
+
+Next, create an :command:`if` statement which checks the value of
+``USE_MYMATH``. Inside the :command:`if` block, put the
+:command:`add_subdirectory` command from Exercise 1 with the additional
+:command:`list` commands.
+
+When ``USE_MYMATH`` is ``ON``, the lists will be generated and will be added to
+our project. When ``USE_MYMATH`` is ``OFF``, the lists stay empty. With this
+strategy, we allow users to toggle ``USE_MYMATH`` to manipulate what library is
+used in the build.
+
+The top-level CMakeLists.txt file will now look like the following:
+
+.. raw:: html
+
+ <details><summary>TODO 8: Click to show/hide answer</summary>
.. literalinclude:: Step3/CMakeLists.txt
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-target_link_libraries-EXTRA_LIBS
+ :caption: TODO 8: CMakeLists.txt
+ :name: CMakeLists.txt-USE_MYMATH
:language: cmake
:start-after: # add the MathFunctions library
+ :end-before: # add the executable
+
+.. raw:: html
+
+ </details>
-Note the use of the variable ``EXTRA_LIBS`` to collect up any optional
-libraries to later be linked into the executable. The variable
-``EXTRA_INCLUDES`` is used similarly for optional header files. This is a
-classic approach when dealing with many optional components, we will cover
-the modern approach in the next step.
+Now that we have these two lists, we need to update
+:command:`target_link_libraries` and :command:`target_include_directories` to
+use them. Changing them is fairly straightforward.
+
+For :command:`target_link_libraries`, we replace the written out
+library names with ``EXTRA_LIBS``. This looks like the following:
+
+.. raw:: html
+
+ <details><summary>TODO 9: Click to show/hide answer</summary>
+
+.. literalinclude:: Step3/CMakeLists.txt
+ :caption: TODO 9: CMakeLists.txt
+ :name: CMakeLists.txt-target_link_libraries-EXTRA_LIBS
+ :language: cmake
+ :start-after: add_executable(Tutorial tutorial.cxx)
+ :end-before: # TODO 3
+
+.. raw:: html
+
+ </details>
+
+Then, we do the same thing with :command:`target_include_directories` and
+``EXTRA_INCLUDES``.
+
+.. raw:: html
+
+ <details><summary>TODO 10: Click to show/hide answer</summary>
+
+.. literalinclude:: Step3/CMakeLists.txt
+ :caption: TODO 10 : CMakeLists.txt
+ :name: CMakeLists.txt-target_link_libraries-EXTRA_INCLUDES
+ :language: cmake
+ :start-after: # so that we will find TutorialConfig.h
+
+.. raw:: html
+
+ </details>
+
+Note that this is a classic approach when dealing with many components. We
+will cover the modern approach in the Step 3 of the tutorial.
The corresponding changes to the source code are fairly straightforward.
-First, in ``tutorial.cxx``, include the ``MathFunctions.h`` header if we
-need it:
+First, in ``tutorial.cxx``, we include the ``MathFunctions.h`` header if
+``USE_MYMATH`` is defined.
+
+.. raw:: html
+
+ <details><summary>TODO 11: Click to show/hide answer</summary>
.. literalinclude:: Step3/tutorial.cxx
- :caption: tutorial.cxx
+ :caption: TODO 11 : tutorial.cxx
:name: tutorial.cxx-ifdef-include
:language: c++
:start-after: // should we include the MathFunctions header
:end-before: int main
-Then, in the same file, make ``USE_MYMATH`` control which square root
+.. raw:: html
+
+ </details>
+
+Then, in the same file, we make ``USE_MYMATH`` control which square root
function is used:
+.. raw:: html
+
+ <details><summary>TODO 12: Click to show/hide answer</summary>
+
.. literalinclude:: Step3/tutorial.cxx
- :caption: tutorial.cxx
+ :caption: TODO 12 : tutorial.cxx
:name: tutorial.cxx-ifdef-const
:language: c++
:start-after: // which square root function should we use?
:end-before: std::cout << "The square root of
+.. raw:: html
+
+ </details>
+
Since the source code now requires ``USE_MYMATH`` we can add it to
``TutorialConfig.h.in`` with the following line:
+.. raw:: html
+
+ <details><summary>TODO 13: Click to show/hide answer</summary>
+
.. literalinclude:: Step3/TutorialConfig.h.in
- :caption: TutorialConfig.h.in
+ :caption: TODO 13 : TutorialConfig.h.in
:name: TutorialConfig.h.in-cmakedefine
:language: c++
:lines: 4
-**Exercise**: Why is it important that we configure ``TutorialConfig.h.in``
+.. raw:: html
+
+ </details>
+
+With these changes, our library is now completely optional to whoever is
+building and using it.
+
+Bonus Question
+--------------
+
+Why is it important that we configure ``TutorialConfig.h.in``
after the option for ``USE_MYMATH``? What would happen if we inverted the two?
-Run the :manual:`cmake <cmake(1)>` executable or the
-:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
-with your chosen build tool. Then run the built Tutorial executable.
+Answer
+------
-Now let's update the value of ``USE_MYMATH``. The easiest way is to use the
-:manual:`cmake-gui <cmake-gui(1)>` or :manual:`ccmake <ccmake(1)>` if you're
-in the terminal. Or, alternatively, if you want to change the option from the
-command-line, try:
+.. raw:: html
-.. code-block:: console
+ <details><summary>Click to show/hide answer</summary>
- cmake ../Step2 -DUSE_MYMATH=OFF
+We configure after because ``TutorialConfig.h.in`` uses the value of
+``USE_MYMATH``. If we configure the file before
+calling :command:`option`, we won't be using the expected value of
+``USE_MYMATH``.
-Rebuild and run the tutorial again.
+.. raw:: html
-Which function gives better results, ``sqrt`` or ``mysqrt``?
+ </details>
diff --git a/Help/guide/tutorial/Complete/CMakeLists.txt b/Help/guide/tutorial/Complete/CMakeLists.txt
index 41baf64..3cdaaae 100644
--- a/Help/guide/tutorial/Complete/CMakeLists.txt
+++ b/Help/guide/tutorial/Complete/CMakeLists.txt
@@ -41,7 +41,7 @@ add_subdirectory(MathFunctions)
add_executable(Tutorial tutorial.cxx)
set_target_properties(Tutorial PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
-target_link_libraries(Tutorial PUBLIC MathFunctions)
+target_link_libraries(Tutorial PUBLIC MathFunctions tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -84,6 +84,7 @@ do_test(Tutorial 25 "25 is 5")
do_test(Tutorial -25 "-25 is (-nan|nan|0)")
do_test(Tutorial 0.0001 "0.0001 is 0.01")
+# setup installer
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
diff --git a/Help/guide/tutorial/Complete/License.txt b/Help/guide/tutorial/Complete/License.txt
index c62d00b..85760e5 100644
--- a/Help/guide/tutorial/Complete/License.txt
+++ b/Help/guide/tutorial/Complete/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
+CMake/Tutorial/Step9...
diff --git a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
index 40b9fd2..d256db2 100644
--- a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
@@ -56,7 +56,7 @@ target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
-# install rules
+# install libs
set(installable_libs MathFunctions tutorial_compiler_flags)
if(TARGET SqrtLibrary)
list(APPEND installable_libs SqrtLibrary)
@@ -64,4 +64,5 @@ endif()
install(TARGETS ${installable_libs}
EXPORT MathFunctionsTargets
DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Installing and Testing.rst b/Help/guide/tutorial/Installing and Testing.rst
index 394c986..fa13040 100644
--- a/Help/guide/tutorial/Installing and Testing.rst
+++ b/Help/guide/tutorial/Installing and Testing.rst
@@ -1,95 +1,311 @@
-Step 4: Installing and Testing
+Step 5: Installing and Testing
==============================
-Now we can start adding install rules and testing support to our project.
+.. _`Tutorial Testing Support`:
+
+Exercise 1 - Install Rules
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Often, it is not enough to only build an executable, it should also be
+installable. With CMake, we can specify install rules using the
+:command:`install` command. Supporting local installations for your builds in
+CMake is often as simple as specifying an install location and the targets and
+files to be installed.
+
+Goal
+----
+
+Install the ``Tutorial`` executable and the ``MathFunctions`` library.
+
+Helpful Materials
+-----------------
+
+* :command:`install`
-Install Rules
+Files to Edit
-------------
-The install rules are fairly simple: for ``MathFunctions`` we want to install
-the library and header file and for the application we want to install the
-executable and configured header.
+* ``MathFunctions/CMakeLists.txt``
+* ``CMakeLists.txt``
-So to the end of ``MathFunctions/CMakeLists.txt`` we add:
+Getting Started
+---------------
-.. literalinclude:: Step5/MathFunctions/CMakeLists.txt
- :caption: MathFunctions/CMakeLists.txt
- :name: MathFunctions/CMakeLists.txt-install-TARGETS
- :language: cmake
- :start-after: # install rules
+The starting code is provided in the ``Step5`` directory. In this
+exercise, complete ``TODO 1`` through ``TODO 4``.
-And to the end of the top-level ``CMakeLists.txt`` we add:
+First, update ``MathFunctions/CMakeLists.txt`` to install the
+``MathFunctions`` and ``tutorial_compiler_flags`` libraries to the ``lib``
+directory. In that same file, specify the install rules needed to install
+``MathFunctions.h`` to the ``include`` directory.
-.. literalinclude:: Step5/CMakeLists.txt
- :caption: CMakeLists.txt
- :name: CMakeLists.txt-install-TARGETS
- :language: cmake
- :start-after: # add the install targets
- :end-before: # enable testing
+Then, update the top level ``CMakeLists.txt`` to install
+the ``Tutorial`` executable to the ``bin`` directory. Lastly, any header files
+should be installed to the ``include`` directory. Remember that
+``TutorialConfig.h`` is in the :variable:`PROJECT_BINARY_DIR`.
-That is all that is needed to create a basic local install of the tutorial.
+Build and Run
+-------------
-Now run the :manual:`cmake <cmake(1)>` executable or the
+Make a new directory called ``Step5_build``. Run the
+:manual:`cmake <cmake(1)>` executable or the
:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
with your chosen build tool.
-Then run the install step by using the ``install`` option of the
-:manual:`cmake <cmake(1)>` command (introduced in 3.15, older versions of
-CMake must use ``make install``) from the command line. For
-multi-configuration tools, don't forget to use the ``--config`` argument to
-specify the configuration. If using an IDE, simply build the ``INSTALL``
-target. This step will install the appropriate header files, libraries, and
-executables. For example:
+Then, run the install step by using the :option:`--install <cmake --install>`
+option of the :manual:`cmake <cmake(1)>` command (introduced in 3.15, older
+versions of CMake must use ``make install``) from the command line. This step
+will install the appropriate header files, libraries, and executables.
+For example:
.. code-block:: console
cmake --install .
+For multi-configuration tools, don't forget to use the
+:option:`--config <cmake--build --config>` argument to specify the configuration.
+
+.. code-block:: console
+
+ cmake --install . --config Release
+
+If using an IDE, simply build the ``INSTALL`` target. You can build the same
+install target from the command line like the following:
+
+.. code-block:: console
+
+ cmake --build . --target install --config Debug
+
The CMake variable :variable:`CMAKE_INSTALL_PREFIX` is used to determine the
-root of where the files will be installed. If using the ``cmake --install``
-command, the installation prefix can be overridden via the ``--prefix``
-argument. For example:
+root of where the files will be installed. If using the :option:`cmake --install`
+command, the installation prefix can be overridden via the
+:option:`--prefix <cmake--install --prefix>` argument. For example:
.. code-block:: console
cmake --install . --prefix "/home/myuser/installdir"
-Navigate to the install directory and verify that the installed Tutorial runs.
+Navigate to the install directory and verify that the installed ``Tutorial``
+runs.
-.. _`Tutorial Testing Support`:
+Solution
+--------
-Testing Support
----------------
+The install rules for our project are fairly simple:
-Next let's test our application. At the end of the top-level ``CMakeLists.txt``
-file we can enable testing and then add a number of basic tests to verify that
-the application is working correctly.
+* For ``MathFunctions``, we want to install the libraries and header file to
+ the ``lib`` and ``include`` directories respectively.
-.. literalinclude:: Step5/CMakeLists.txt
+* For the ``Tutorial`` executable, we want to install the executable and
+ configured header file to the ``bin`` and ``include`` directories
+ respectively.
+
+So to the end of ``MathFunctions/CMakeLists.txt`` we add:
+
+.. raw:: html
+
+ <details><summary>TODO 1: Click to show/hide answer</summary>
+
+.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
+ :caption: TODO 1: MathFunctions/CMakeLists.txt
+ :name: MathFunctions/CMakeLists.txt-install-TARGETS
+ :language: cmake
+ :start-after: # install libs
+ :end-before: # install include headers
+
+.. raw:: html
+
+ </details>
+
+and
+
+.. raw:: html
+
+ <details><summary>TODO 2: Click to show/hide answer</summary>
+
+.. literalinclude:: Step6/MathFunctions/CMakeLists.txt
+ :caption: TODO 2: MathFunctions/CMakeLists.txt
+ :name: MathFunctions/CMakeLists.txt-install-headers
+ :language: cmake
+ :start-after: # install include headers
+
+.. raw:: html
+
+ </details>
+
+The install rules for the ``Tutorial`` executable and configured header file
+are similar. To the end of the top-level ``CMakeLists.txt`` we add:
+
+.. raw:: html
+
+ <details><summary>TODO 3,4: Click to show/hide answer</summary>
+
+.. literalinclude:: Step6/CMakeLists.txt
:caption: CMakeLists.txt
- :name: CMakeLists.txt-enable_testing
+ :name: TODO 3,4: CMakeLists.txt-install-TARGETS
:language: cmake
- :start-after: # enable testing
+ :start-after: # add the install targets
+ :end-before: # enable testing
+
+.. raw:: html
+
+ </details>
-The first test simply verifies that the application runs, does not segfault or
-otherwise crash, and has a zero return value. This is the basic form of a
-CTest test.
+That is all that is needed to create a basic local
+install of the tutorial.
-The next test makes use of the :prop_test:`PASS_REGULAR_EXPRESSION` test
-property to verify that the output of the test contains certain strings. In
-this case, verifying that the usage message is printed when an incorrect number
-of arguments are provided.
+Exercise 2 - Testing Support
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Lastly, we have a function called ``do_test`` that runs the application and
-verifies that the computed square root is correct for given input. For each
-invocation of ``do_test``, another test is added to the project with a name,
-input, and expected results based on the passed arguments.
+CTest offers a way to easily manage tests for your project. Tests can be
+added through the :command:`add_test` command. Although it is not
+explicitly covered in this tutorial, there is a lot of compatibility
+between CTest and other testing frameworks such as :module:`GoogleTest`.
-Rebuild the application and then cd to the binary directory and run the
-:manual:`ctest <ctest(1)>` executable: ``ctest -N`` and ``ctest -VV``. For
+Goal
+----
+
+Create unit tests for our executable using CTest.
+
+Helpful Materials
+-----------------
+
+* :command:`enable_testing`
+* :command:`add_test`
+* :command:`function`
+* :command:`set_tests_properties`
+* :manual:`ctest <ctest(1)>`
+
+Files to Edit
+-------------
+
+* ``CMakeLists.txt``
+
+Getting Started
+---------------
+
+The starting source code is provided in the ``Step5`` directory. In this
+exercise, complete ``TODO 5`` through ``TODO 9``.
+
+First, we need to enable testing. Next, begin adding tests to our project
+using :command:`add_test`. We will work through adding 3 simple tests and
+then you can add additional testing as you see fit.
+
+Build and Run
+-------------
+
+Navigate to the build directory and rebuild the application. Then, run the
+``ctest`` executable: :option:`ctest -N` and :option:`ctest -VV`. For
multi-config generators (e.g. Visual Studio), the configuration type must be
-specified with the ``-C <mode>`` flag. For example, to run tests in Debug
-mode use ``ctest -C Debug -VV`` from the binary directory
+specified with the :option:`-C \<mode\> <ctest -C>` flag. For example, to run tests in Debug
+mode use ``ctest -C Debug -VV`` from the build directory
(not the Debug subdirectory!). Release mode would be executed from the same
-location but with a ``-C Release``. Alternatively, build the ``RUN_TESTS``
+location but with a ``-C Release``. Alternatively, build the ``RUN_TESTS``
target from the IDE.
+
+Solution
+--------
+
+Let's test our application. At the end of the top-level ``CMakeLists.txt``
+file we first need to enable testing with the
+:command:`enable_testing` command.
+
+.. raw:: html
+
+ <details><summary>TODO 5: Click to show/hide answer</summary>
+
+.. literalinclude:: Step6/CMakeLists.txt
+ :caption: TODO 5: CMakeLists.txt
+ :name: CMakeLists.txt-enable_testing
+ :language: cmake
+ :start-after: # enable testing
+ :end-before: # does the application run
+
+.. raw:: html
+
+ </details>
+
+With testing enabled, we will add a number of basic tests to verify
+that the application is working correctly. First, we create a test using
+:command:`add_test` which runs the ``Tutorial`` executable with the
+parameter 25 passed in. For this test, we are not going to check the
+executable's computed answer. This test will verify that
+application runs, does not segfault or otherwise crash, and has a zero
+return value. This is the basic form of a CTest test.
+
+.. raw:: html
+
+ <details><summary>TODO 6: Click to show/hide answer</summary>
+
+.. literalinclude:: Step6/CMakeLists.txt
+ :caption: TODO 6: CMakeLists.txt
+ :name: CMakeLists.txt-test-runs
+ :language: cmake
+ :start-after: # does the application run
+ :end-before: # does the usage message work
+
+.. raw:: html
+
+ </details>
+
+Next, let's use the :prop_test:`PASS_REGULAR_EXPRESSION` test property to
+verify that the output of the test contains certain strings. In this case,
+verifying that the usage message is printed when an incorrect number of
+arguments are provided.
+
+.. raw:: html
+
+ <details><summary>TODO 7: Click to show/hide answer</summary>
+
+.. literalinclude:: Step6/CMakeLists.txt
+ :caption: TODO 7: CMakeLists.txt
+ :name: CMakeLists.txt-test-usage
+ :language: cmake
+ :start-after: # does the usage message work?
+ :end-before: # define a function to simplify adding tests
+
+.. raw:: html
+
+ </details>
+
+The next test we will add verifies the computed value is truly the
+square root.
+
+.. raw:: html
+
+ <details><summary>TODO 8: Click to show/hide answer</summary>
+
+.. code-block:: cmake
+ :caption: TODO 8: CMakeLists.txt
+ :name: CMakeLists.txt-test-standard
+
+ add_test(NAME StandardUse COMMAND Tutorial 4)
+ set_tests_properties(StandardUse
+ PROPERTIES PASS_REGULAR_EXPRESSION "4 is 2"
+ )
+
+.. raw:: html
+
+ </details>
+
+This one test is not enough to give us confidence that it will
+work for all values passed in. We should add more tests to verify this.
+To easily add more tests, we make a function called ``do_test`` that runs the
+application and verifies that the computed square root is correct for
+given input. For each invocation of ``do_test``, another test is added to
+the project with a name, input, and expected results based on the passed
+arguments.
+
+.. raw:: html
+
+ <details><summary>TODO 9: Click to show/hide answer</summary>
+
+.. literalinclude:: Step6/CMakeLists.txt
+ :caption: TODO 9: CMakeLists.txt
+ :name: CMakeLists.txt-generalized-tests
+ :language: cmake
+ :start-after: # define a function to simplify adding tests
+
+.. raw:: html
+
+ </details>
diff --git a/Help/guide/tutorial/Packaging Debug and Release.rst b/Help/guide/tutorial/Packaging Debug and Release.rst
index 91b46a7..8c660a3 100644
--- a/Help/guide/tutorial/Packaging Debug and Release.rst
+++ b/Help/guide/tutorial/Packaging Debug and Release.rst
@@ -10,8 +10,8 @@ possible, however, to setup CPack to bundle multiple build directories and
construct a package that contains multiple configurations of the same project.
First, we want to ensure that the debug and release builds use different names
-for the executables and libraries that will be installed. Let's use `d` as the
-postfix for the debug executable and libraries.
+for the libraries that will be installed. Let's use `d` as the
+postfix for the debug libraries.
Set :variable:`CMAKE_DEBUG_POSTFIX` near the beginning of the top-level
``CMakeLists.txt`` file:
@@ -41,10 +41,10 @@ Let's also add version numbering to the ``MathFunctions`` library. In
:name: MathFunctions/CMakeLists.txt-VERSION-properties
:language: cmake
:start-after: # setup the version numbering
- :end-before: # install rules
+ :end-before: # install libs
From the ``Step12`` directory, create ``debug`` and ``release``
-subbdirectories. The layout will look like:
+subdirectories. The layout will look like:
.. code-block:: none
diff --git a/Help/guide/tutorial/Packaging an Installer.rst b/Help/guide/tutorial/Packaging an Installer.rst
index 0ee5db2..11a1952 100644
--- a/Help/guide/tutorial/Packaging an Installer.rst
+++ b/Help/guide/tutorial/Packaging an Installer.rst
@@ -1,4 +1,4 @@
-Step 7: Packaging an Installer
+Step 9: Packaging an Installer
==============================
Next suppose that we want to distribute our project to other people so that
@@ -11,7 +11,7 @@ installations and package management features. To accomplish this we will use
CPack to create platform specific installers. Specifically we need to add a
few lines to the bottom of our top-level ``CMakeLists.txt`` file.
-.. literalinclude:: Step8/CMakeLists.txt
+.. literalinclude:: Step10/CMakeLists.txt
:caption: CMakeLists.txt
:name: CMakeLists.txt-include-CPack
:language: cmake
@@ -38,15 +38,15 @@ binary directory run:
cpack
-To specify the generator, use the ``-G`` option. For multi-config builds, use
-``-C`` to specify the configuration. For example:
+To specify the generator, use the :option:`-G <cpack -G>` option. For multi-config builds,
+use :option:`-C <cpack -C>` to specify the configuration. For example:
.. code-block:: console
cpack -G ZIP -C Debug
For a list of available generators, see :manual:`cpack-generators(7)` or call
-``cpack --help``. An :cpack_gen:`archive generator <CPack Archive Generator>`
+:option:`cpack --help`. An :cpack_gen:`archive generator <CPack Archive Generator>`
like ZIP creates a compressed archive of all *installed* files.
To create an archive of the *full* source tree you would type:
diff --git a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst
index 2d5f70e..1c49c23 100644
--- a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst
+++ b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst
@@ -1,5 +1,5 @@
-Step 9: Selecting Static or Shared Libraries
-============================================
+Step 10: Selecting Static or Shared Libraries
+=============================================
In this section we will show how the :variable:`BUILD_SHARED_LIBS` variable can
be used to control the default behavior of :command:`add_library`,
@@ -19,7 +19,7 @@ library.
The first step is to update the starting section of the top-level
``CMakeLists.txt`` to look like:
-.. literalinclude:: Step10/CMakeLists.txt
+.. literalinclude:: Step11/CMakeLists.txt
:caption: CMakeLists.txt
:name: CMakeLists.txt-option-BUILD_SHARED_LIBS
:language: cmake
@@ -33,7 +33,7 @@ explicitly require that SqrtLibrary is built statically.
The end result is that ``MathFunctions/CMakeLists.txt`` should look like:
-.. literalinclude:: Step10/MathFunctions/CMakeLists.txt
+.. literalinclude:: Step11/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-add_library-STATIC
:language: cmake
@@ -42,7 +42,7 @@ The end result is that ``MathFunctions/CMakeLists.txt`` should look like:
Next, update ``MathFunctions/mysqrt.cxx`` to use the ``mathfunctions`` and
``detail`` namespaces:
-.. literalinclude:: Step10/MathFunctions/mysqrt.cxx
+.. literalinclude:: Step11/MathFunctions/mysqrt.cxx
:caption: MathFunctions/mysqrt.cxx
:name: MathFunctions/mysqrt.cxx-namespace
:language: c++
@@ -56,7 +56,7 @@ uses ``USE_MYMATH``:
Finally, update ``MathFunctions/MathFunctions.h`` to use dll export defines:
-.. literalinclude:: Step10/MathFunctions/MathFunctions.h
+.. literalinclude:: Step11/MathFunctions/MathFunctions.h
:caption: MathFunctions/MathFunctions.h
:name: MathFunctions/MathFunctions.h
:language: c++
@@ -67,7 +67,7 @@ library that has position independent code. The solution to this is to
explicitly set the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property of
SqrtLibrary to be ``True`` no matter the build type.
-.. literalinclude:: Step10/MathFunctions/CMakeLists.txt
+.. literalinclude:: Step11/MathFunctions/CMakeLists.txt
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-POSITION_INDEPENDENT_CODE
:language: cmake
diff --git a/Help/guide/tutorial/Step1/CMakeLists.txt b/Help/guide/tutorial/Step1/CMakeLists.txt
new file mode 100644
index 0000000..6fcce90
--- /dev/null
+++ b/Help/guide/tutorial/Step1/CMakeLists.txt
@@ -0,0 +1,16 @@
+# TODO 1: Set the minimum required version of CMake to be 3.10
+
+# TODO 2: Create a project named Tutorial
+
+# TODO 7: Set the project version number as 1.0 in the above project command
+
+# TODO 6: Set the variable CMAKE_CXX_STANDARD to 11
+# and the variable CMAKE_CXX_STANDARD_REQUIRED to True
+
+# TODO 8: Use configure_file to configure and copy TutorialConfig.h.in to
+# TutorialConfig.h
+
+# TODO 3: Add an executable called Tutorial to the project
+# Hint: Be sure to specify the source file as tutorial.cxx
+
+# TODO 9: Use target_include_directories to include ${PROJECT_BINARY_DIR}
diff --git a/Help/guide/tutorial/Step1/TutorialConfig.h.in b/Help/guide/tutorial/Step1/TutorialConfig.h.in
new file mode 100644
index 0000000..990bfbd
--- /dev/null
+++ b/Help/guide/tutorial/Step1/TutorialConfig.h.in
@@ -0,0 +1,2 @@
+// the configured options and settings for Tutorial
+// TODO 10: Define Tutorial_VERSION_MAJOR and Tutorial_VERSION_MINOR
diff --git a/Help/guide/tutorial/Step1/tutorial.cxx b/Help/guide/tutorial/Step1/tutorial.cxx
index 08323bf..64d0916 100644
--- a/Help/guide/tutorial/Step1/tutorial.cxx
+++ b/Help/guide/tutorial/Step1/tutorial.cxx
@@ -1,17 +1,22 @@
// A simple program that computes the square root of a number
#include <cmath>
-#include <cstdlib>
+#include <cstdlib> // TODO 5: Remove this line
#include <iostream>
#include <string>
+// TODO 11: Include TutorialConfig.h
+
int main(int argc, char* argv[])
{
if (argc < 2) {
+ // TODO 12: Create a print statement using Tutorial_VERSION_MAJOR
+ // and Tutorial_VERSION_MINOR
std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
// convert input to double
+ // TODO 4: Replace atof(argv[1]) with std::stod(argv[1])
const double inputValue = atof(argv[1]);
// calculate square root
diff --git a/Help/guide/tutorial/Step10/CMakeLists.txt b/Help/guide/tutorial/Step10/CMakeLists.txt
index 55dc409..5c661aa 100644
--- a/Help/guide/tutorial/Step10/CMakeLists.txt
+++ b/Help/guide/tutorial/Step10/CMakeLists.txt
@@ -1,29 +1,37 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.15)
# set the project name and version
project(Tutorial VERSION 1.0)
# specify the C++ standard
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
+add_library(tutorial_compiler_flags INTERFACE)
+target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
-# control where the static and shared libraries are built so that on windows
-# we don't need to tinker with the path to run the executable
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+# add compiler warning flags just when building this project via
+# the BUILD_INTERFACE genex
+set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU,LCC>")
+set(msvc_cxx "$<COMPILE_LANG_AND_ID:CXX,MSVC>")
+target_compile_options(tutorial_compiler_flags INTERFACE
+ "$<${gcc_like_cxx}:$<BUILD_INTERFACE:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>>"
+ "$<${msvc_cxx}:$<BUILD_INTERFACE:-W3>>"
+)
-option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
-# configure a header file to pass the version number only
+# configure a header file to pass some of the CMake settings
+# to the source code
configure_file(TutorialConfig.h.in TutorialConfig.h)
# add the MathFunctions library
-add_subdirectory(MathFunctions)
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif()
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC MathFunctions)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS} tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -66,6 +74,7 @@ do_test(Tutorial 25 "25 is 5")
do_test(Tutorial -25 "-25 is (-nan|nan|0)")
do_test(Tutorial 0.0001 "0.0001 is 0.01")
+# setup installer
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
diff --git a/Help/guide/tutorial/Step10/License.txt b/Help/guide/tutorial/Step10/License.txt
index c62d00b..85760e5 100644
--- a/Help/guide/tutorial/Step10/License.txt
+++ b/Help/guide/tutorial/Step10/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
+CMake/Tutorial/Step9...
diff --git a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt
index 0bfe20c..fa73321 100644
--- a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt
@@ -1,55 +1,32 @@
-# add the library that runs
-add_library(MathFunctions MathFunctions.cxx)
+# first we add the executable that generates the table
+add_executable(MakeTable MakeTable.cxx)
+
+# add the command to generate the source code
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+# add the main library
+add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
# state that anybody linking to us needs to include the current source dir
# to find MathFunctions.h, while we don't.
+# state that we depend on our binary dir to find Table.h
target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- )
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
+ )
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-if(USE_MYMATH)
+# link our compiler flags interface library
+target_link_libraries(MathFunctions tutorial_compiler_flags)
- target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
-
- # first we add the executable that generates the table
- add_executable(MakeTable MakeTable.cxx)
-
- # add the command to generate the source code
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
- # library that just does sqrt
- add_library(SqrtLibrary STATIC
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
- # state that we depend on our binary dir to find Table.h
- target_include_directories(SqrtLibrary PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
- # state that SqrtLibrary need PIC when the default is shared libraries
- set_target_properties(SqrtLibrary PROPERTIES
- POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
- )
-
- target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
-endif()
-
-# define the symbol stating we are using the declspec(dllexport) when
-# building on windows
-target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-
-# install rules
-set(installable_libs MathFunctions)
-if(TARGET SqrtLibrary)
- list(APPEND installable_libs SqrtLibrary)
-endif()
+# install libs
+set(installable_libs MathFunctions tutorial_compiler_flags)
install(TARGETS ${installable_libs} DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step10/MathFunctions/MathFunctions.h b/Help/guide/tutorial/Step10/MathFunctions/MathFunctions.h
index 3fb547b..cd36bcc 100644
--- a/Help/guide/tutorial/Step10/MathFunctions/MathFunctions.h
+++ b/Help/guide/tutorial/Step10/MathFunctions/MathFunctions.h
@@ -1,14 +1 @@
-
-#if defined(_WIN32)
-# if defined(EXPORTING_MYMATH)
-# define DECLSPEC __declspec(dllexport)
-# else
-# define DECLSPEC __declspec(dllimport)
-# endif
-#else // non windows
-# define DECLSPEC
-#endif
-
-namespace mathfunctions {
-double DECLSPEC sqrt(double x);
-}
+double mysqrt(double x);
diff --git a/Help/guide/tutorial/Step10/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step10/MathFunctions/mysqrt.cxx
index 8153f18..7d80ee9 100644
--- a/Help/guide/tutorial/Step10/MathFunctions/mysqrt.cxx
+++ b/Help/guide/tutorial/Step10/MathFunctions/mysqrt.cxx
@@ -5,8 +5,6 @@
// include the generated table
#include "Table.h"
-namespace mathfunctions {
-namespace detail {
// a hack square root calculation using simple operations
double mysqrt(double x)
{
@@ -33,5 +31,3 @@ double mysqrt(double x)
return result;
}
-}
-}
diff --git a/Help/guide/tutorial/Step10/TutorialConfig.h.in b/Help/guide/tutorial/Step10/TutorialConfig.h.in
index 7e4d7fa..e23f521 100644
--- a/Help/guide/tutorial/Step10/TutorialConfig.h.in
+++ b/Help/guide/tutorial/Step10/TutorialConfig.h.in
@@ -1,3 +1,4 @@
// the configured options and settings for Tutorial
#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+#cmakedefine USE_MYMATH
diff --git a/Help/guide/tutorial/Step10/tutorial.cxx b/Help/guide/tutorial/Step10/tutorial.cxx
index 37a0333..b3c6a4f 100644
--- a/Help/guide/tutorial/Step10/tutorial.cxx
+++ b/Help/guide/tutorial/Step10/tutorial.cxx
@@ -1,11 +1,15 @@
// A simple program that computes the square root of a number
+#include <cmath>
#include <iostream>
-#include <sstream>
#include <string>
-#include "MathFunctions.h"
#include "TutorialConfig.h"
+// should we include the MathFunctions header?
+#ifdef USE_MYMATH
+# include "MathFunctions.h"
+#endif
+
int main(int argc, char* argv[])
{
if (argc < 2) {
@@ -19,7 +23,12 @@ int main(int argc, char* argv[])
// convert input to double
const double inputValue = std::stod(argv[1]);
- const double outputValue = mathfunctions::sqrt(inputValue);
+ // which square root function should we use?
+#ifdef USE_MYMATH
+ const double outputValue = mysqrt(inputValue);
+#else
+ const double outputValue = sqrt(inputValue);
+#endif
std::cout << "The square root of " << inputValue << " is " << outputValue
<< std::endl;
diff --git a/Help/guide/tutorial/Step11/CMakeLists.txt b/Help/guide/tutorial/Step11/CMakeLists.txt
index 1044748..046bfc9 100644
--- a/Help/guide/tutorial/Step11/CMakeLists.txt
+++ b/Help/guide/tutorial/Step11/CMakeLists.txt
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.15)
# set the project name and version
project(Tutorial VERSION 1.0)
+# specify the C++ standard
add_library(tutorial_compiler_flags INTERFACE)
target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
@@ -31,7 +32,7 @@ add_subdirectory(MathFunctions)
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC MathFunctions)
+target_link_libraries(Tutorial PUBLIC MathFunctions tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -46,7 +47,7 @@ install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
# enable testing
-enable_testing()
+include(CTest)
# does the application run
add_test(NAME Runs COMMAND Tutorial 25)
@@ -74,6 +75,7 @@ do_test(Tutorial 25 "25 is 5")
do_test(Tutorial -25 "-25 is (-nan|nan|0)")
do_test(Tutorial 0.0001 "0.0001 is 0.01")
+# setup installer
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
diff --git a/Help/guide/tutorial/Step11/License.txt b/Help/guide/tutorial/Step11/License.txt
index c62d00b..85760e5 100644
--- a/Help/guide/tutorial/Step11/License.txt
+++ b/Help/guide/tutorial/Step11/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
+CMake/Tutorial/Step9...
diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
index 0d287ca..a60fb63 100644
--- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
@@ -47,13 +47,14 @@ endif()
target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
# define the symbol stating we are using the declspec(dllexport) when
-#building on windows
+# building on windows
target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-# install rules
+# install libs
set(installable_libs MathFunctions tutorial_compiler_flags)
if(TARGET SqrtLibrary)
list(APPEND installable_libs SqrtLibrary)
endif()
install(TARGETS ${installable_libs} DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step11/tutorial.cxx b/Help/guide/tutorial/Step11/tutorial.cxx
index a4f44d5..37a0333 100644
--- a/Help/guide/tutorial/Step11/tutorial.cxx
+++ b/Help/guide/tutorial/Step11/tutorial.cxx
@@ -1,5 +1,6 @@
// A simple program that computes the square root of a number
#include <iostream>
+#include <sstream>
#include <string>
#include "MathFunctions.h"
diff --git a/Help/guide/tutorial/Step12/CMakeLists.txt b/Help/guide/tutorial/Step12/CMakeLists.txt
index 63f9643..220ed4b 100644
--- a/Help/guide/tutorial/Step12/CMakeLists.txt
+++ b/Help/guide/tutorial/Step12/CMakeLists.txt
@@ -37,7 +37,7 @@ add_subdirectory(MathFunctions)
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC MathFunctions)
+target_link_libraries(Tutorial PUBLIC MathFunctions tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -80,6 +80,7 @@ do_test(Tutorial 25 "25 is 5")
do_test(Tutorial -25 "-25 is (-nan|nan|0)")
do_test(Tutorial 0.0001 "0.0001 is 0.01")
+# setup installer
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
diff --git a/Help/guide/tutorial/Step12/License.txt b/Help/guide/tutorial/Step12/License.txt
index c62d00b..85760e5 100644
--- a/Help/guide/tutorial/Step12/License.txt
+++ b/Help/guide/tutorial/Step12/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
+CMake/Tutorial/Step9...
diff --git a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt
index d5961da..a85f3cb 100644
--- a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt
@@ -52,7 +52,7 @@ target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
# building on windows
target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-# install rules
+# install libs
set(installable_libs MathFunctions tutorial_compiler_flags)
if(TARGET SqrtLibrary)
list(APPEND installable_libs SqrtLibrary)
@@ -60,4 +60,5 @@ endif()
install(TARGETS ${installable_libs}
EXPORT MathFunctionsTargets
DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step2/CMakeLists.txt b/Help/guide/tutorial/Step2/CMakeLists.txt
index 7aa59e9..2b96128 100644
--- a/Help/guide/tutorial/Step2/CMakeLists.txt
+++ b/Help/guide/tutorial/Step2/CMakeLists.txt
@@ -7,13 +7,36 @@ project(Tutorial VERSION 1.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
+# TODO 7: Create a variable USE_MYMATH using option and set default to ON
+
# configure a header file to pass some of the CMake settings
# to the source code
configure_file(TutorialConfig.h.in TutorialConfig.h)
+# TODO 8: Use list() and APPEND to create a list of optional libraries
+# called EXTRA_LIBS and a list of optional include directories called
+# EXTRA_INCLUDES. Add the MathFunctions library and source directory to
+# the appropriate lists.
+#
+# Only call add_subdirectory and only add MathFunctions specific values
+# to EXTRA_LIBS and EXTRA_INCLUDES if USE_MYMATH is true.
+
+# TODO 2: Use add_subdirectory() to add MathFunctions to this project
+
# add the executable
add_executable(Tutorial tutorial.cxx)
+# TODO 9: Use EXTRA_LIBS instead of the MathFunctions specific values
+# in target_link_libraries.
+
+# TODO 3: Use target_link_libraries to link the library to our executable
+
+# TODO 4: Add MathFunctions to Tutorial's target_include_directories()
+# Hint: ${PROJECT_SOURCE_DIR} is a path to the project source. AKA This folder!
+
+# TODO 10: Use EXTRA_INCLUDES instead of the MathFunctions specific values
+# in target_include_directories.
+
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
target_include_directories(Tutorial PUBLIC
diff --git a/Help/guide/tutorial/Step2/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step2/MathFunctions/CMakeLists.txt
new file mode 100644
index 0000000..b7779b7
--- /dev/null
+++ b/Help/guide/tutorial/Step2/MathFunctions/CMakeLists.txt
@@ -0,0 +1,2 @@
+# TODO 1: Add a library called MathFunctions
+# Hint: You will need the add_library command
diff --git a/Help/guide/tutorial/Step2/TutorialConfig.h.in b/Help/guide/tutorial/Step2/TutorialConfig.h.in
index 7e4d7fa..6c09e1a 100644
--- a/Help/guide/tutorial/Step2/TutorialConfig.h.in
+++ b/Help/guide/tutorial/Step2/TutorialConfig.h.in
@@ -1,3 +1,5 @@
// the configured options and settings for Tutorial
#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+
+// TODO 13: use cmakedefine to define USE_MYMATH
diff --git a/Help/guide/tutorial/Step2/tutorial.cxx b/Help/guide/tutorial/Step2/tutorial.cxx
index 53b0810..87f5e0f 100644
--- a/Help/guide/tutorial/Step2/tutorial.cxx
+++ b/Help/guide/tutorial/Step2/tutorial.cxx
@@ -5,6 +5,10 @@
#include "TutorialConfig.h"
+// TODO 11: Only include MathFunctions if USE_MYMATH is defined
+
+// TODO 5: Include MathFunctions.h
+
int main(int argc, char* argv[])
{
if (argc < 2) {
@@ -18,6 +22,10 @@ int main(int argc, char* argv[])
// convert input to double
const double inputValue = std::stod(argv[1]);
+ // TODO 12: Use mysqrt if USE_MYMATH is defined and sqrt otherwise
+
+ // TODO 6: Replace sqrt with mysqrt
+
// calculate square root
const double outputValue = sqrt(inputValue);
std::cout << "The square root of " << inputValue << " is " << outputValue
diff --git a/Help/guide/tutorial/Step3/CMakeLists.txt b/Help/guide/tutorial/Step3/CMakeLists.txt
index 1c12816..007770a 100644
--- a/Help/guide/tutorial/Step3/CMakeLists.txt
+++ b/Help/guide/tutorial/Step3/CMakeLists.txt
@@ -14,6 +14,8 @@ option(USE_MYMATH "Use tutorial provided math implementation" ON)
# to the source code
configure_file(TutorialConfig.h.in TutorialConfig.h)
+# TODO 2: Remove EXTRA_INCLUDES list
+
# add the MathFunctions library
if(USE_MYMATH)
add_subdirectory(MathFunctions)
@@ -26,6 +28,8 @@ add_executable(Tutorial tutorial.cxx)
target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+# TODO 3: Remove use of EXTRA_INCLUDES
+
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
target_include_directories(Tutorial PUBLIC
diff --git a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
index 8b443a6..7bf05e0 100644
--- a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
@@ -1 +1,5 @@
add_library(MathFunctions mysqrt.cxx)
+
+# TODO 1: State that anybody linking to MathFunctions needs to include the
+# current source directory, while MathFunctions itself doesn't.
+# Hint: Use target_include_directories with the INTERFACE keyword
diff --git a/Help/guide/tutorial/Step4/CMakeLists.txt b/Help/guide/tutorial/Step4/CMakeLists.txt
index 38e9b1f..fa4aab2 100644
--- a/Help/guide/tutorial/Step4/CMakeLists.txt
+++ b/Help/guide/tutorial/Step4/CMakeLists.txt
@@ -1,12 +1,36 @@
+# TODO 4: Update the minimum required version to 3.15
+
cmake_minimum_required(VERSION 3.10)
# set the project name and version
project(Tutorial VERSION 1.0)
+# TODO 1: Replace the following code by:
+# * Creating an interface library called tutorial_compiler_flags
+# Hint: use add_library() with the INTERFACE signature
+# * Add compiler feature cxx_std_11 to tutorial_compiler_flags
+# Hint: Use target_compile_features()
+
# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
+# TODO 5: Create helper variables to determine which compiler we are using:
+# * Create a new variable gcc_like_cxx that is true if we are using CXX and
+# any of the following compilers: ARMClang, AppleClang, Clang, GNU, LCC
+# * Create a new variable msvc_cxx that is true if we are using CXX and MSVC
+# Hint: Use set() and COMPILE_LANG_AND_ID
+
+# TODO 6: Add warning flag compile options to the interface library
+# tutorial_compiler_flags.
+# * For gcc_like_cxx, add flags -Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused
+# * For msvc_cxx, add flags -W3
+# Hint: Use target_compile_options()
+
+# TODO 7: With nested generator expressions, only use the flags for the
+# build-tree
+# Hint: Use BUILD_INTERFACE
+
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
@@ -23,6 +47,8 @@ endif()
# add the executable
add_executable(Tutorial tutorial.cxx)
+# TODO 2: Link to tutorial_compiler_flags
+
target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
# add the binary tree to the search path for include files
diff --git a/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt
index 0515852..5f7369c 100644
--- a/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt
@@ -5,3 +5,5 @@ add_library(MathFunctions mysqrt.cxx)
target_include_directories(MathFunctions
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
)
+
+# TODO 3: Link to tutorial_compiler_flags
diff --git a/Help/guide/tutorial/Step5/CMakeLists.txt b/Help/guide/tutorial/Step5/CMakeLists.txt
index 82d00c8..a8f241a 100644
--- a/Help/guide/tutorial/Step5/CMakeLists.txt
+++ b/Help/guide/tutorial/Step5/CMakeLists.txt
@@ -1,11 +1,20 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.15)
# set the project name and version
project(Tutorial VERSION 1.0)
# specify the C++ standard
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
+add_library(tutorial_compiler_flags INTERFACE)
+target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
+
+# add compiler warning flags just when building this project via
+# the BUILD_INTERFACE genex
+set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU,LCC>")
+set(msvc_cxx "$<COMPILE_LANG_AND_ID:CXX,MSVC>")
+target_compile_options(tutorial_compiler_flags INTERFACE
+ "$<${gcc_like_cxx}:$<BUILD_INTERFACE:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>>"
+ "$<${msvc_cxx}:$<BUILD_INTERFACE:-W3>>"
+)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
@@ -22,7 +31,7 @@ endif()
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS} tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -30,37 +39,26 @@ target_include_directories(Tutorial PUBLIC
"${PROJECT_BINARY_DIR}"
)
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
+# TODO 3: Install Tutorial in the bin directory
+# Hint: Use the TARGETS and DESTINATION parameters
+
+# TODO 4: Install Tutorial.h to the include directory
+# Hint: Use the FILES and DESTINATION parameters
-# enable testing
-enable_testing()
+# TODO 5: Enable testing
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
+# TODO 6: Add a test called Runs which runs the following command:
+# $ Tutorial 25
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
+# TODO 7: Add a test called Usage which runs the following command:
+# $ Tutorial
+# Make sure the expected output is displayed.
+# Hint: Use the PASS_REGULAR_EXPRESSION property with "Usage.*number"
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction()
+# TODO 8: Add a test which runs the following command:
+# $ Tutorial 4
+# Make sure the result is correct.
+# Hint: Use the PASS_REGULAR_EXPRESSION property with "4 is 2"
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is (-nan|nan|0)")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
+# TODO 9: Add more tests. Create a function called do_test to avoid copy +
+# paste. Test the following values: 4, 9, 5, 7, 25, -25 and 0.00001.
diff --git a/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt
index b12f27d..6cd88d7 100644
--- a/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt
@@ -6,6 +6,13 @@ target_include_directories(MathFunctions
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
)
-# install rules
-install(TARGETS MathFunctions DESTINATION lib)
-install(FILES MathFunctions.h DESTINATION include)
+# link our compiler flags interface library
+target_link_libraries(MathFunctions tutorial_compiler_flags)
+
+# TODO 1: Create a variable called installable_libs that is a list of all
+# libraries we want to install (e.g. MathFunctions and tutorial_compiler_flags)
+# Then install the installable libraries to the lib folder.
+# Hint: Use the TARGETS and DESTINATION parameters
+
+# TODO 2: Install the library headers to the include folder.
+# Hint: Use the FILES and DESTINATION parameters
diff --git a/Help/guide/tutorial/Step6/CMakeLists.txt b/Help/guide/tutorial/Step6/CMakeLists.txt
index 82d00c8..da9e852 100644
--- a/Help/guide/tutorial/Step6/CMakeLists.txt
+++ b/Help/guide/tutorial/Step6/CMakeLists.txt
@@ -1,11 +1,20 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.15)
# set the project name and version
project(Tutorial VERSION 1.0)
# specify the C++ standard
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
+add_library(tutorial_compiler_flags INTERFACE)
+target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
+
+# add compiler warning flags just when building this project via
+# the BUILD_INTERFACE genex
+set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU,LCC>")
+set(msvc_cxx "$<COMPILE_LANG_AND_ID:CXX,MSVC>")
+target_compile_options(tutorial_compiler_flags INTERFACE
+ "$<${gcc_like_cxx}:$<BUILD_INTERFACE:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>>"
+ "$<${msvc_cxx}:$<BUILD_INTERFACE:-W3>>"
+)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
@@ -22,7 +31,7 @@ endif()
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS} tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
diff --git a/Help/guide/tutorial/Step6/CTestConfig.cmake b/Help/guide/tutorial/Step6/CTestConfig.cmake
new file mode 100644
index 0000000..73efdb1
--- /dev/null
+++ b/Help/guide/tutorial/Step6/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set(CTEST_PROJECT_NAME "CMakeTutorial")
+set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt
index 42e098a..b4724c4 100644
--- a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt
@@ -6,29 +6,11 @@ target_include_directories(MathFunctions
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
)
-# does this system provide the log and exp functions?
-include(CheckCXXSourceCompiles)
-check_cxx_source_compiles("
- #include <cmath>
- int main() {
- std::log(1.0);
- return 0;
- }
-" HAVE_LOG)
-check_cxx_source_compiles("
- #include <cmath>
- int main() {
- std::exp(1.0);
- return 0;
- }
-" HAVE_EXP)
+# link our compiler flags interface library
+target_link_libraries(MathFunctions tutorial_compiler_flags)
-# add compile definitions
-if(HAVE_LOG AND HAVE_EXP)
- target_compile_definitions(MathFunctions
- PRIVATE "HAVE_LOG" "HAVE_EXP")
-endif()
-
-# install rules
-install(TARGETS MathFunctions DESTINATION lib)
+# install libs
+set(installable_libs MathFunctions tutorial_compiler_flags)
+install(TARGETS ${installable_libs} DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step6/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step6/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee58556..0000000
--- a/Help/guide/tutorial/Step6/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Help/guide/tutorial/Step6/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step6/MathFunctions/mysqrt.cxx
index 7eecd26..abe767d 100644
--- a/Help/guide/tutorial/Step6/MathFunctions/mysqrt.cxx
+++ b/Help/guide/tutorial/Step6/MathFunctions/mysqrt.cxx
@@ -1,4 +1,3 @@
-#include <cmath>
#include <iostream>
#include "MathFunctions.h"
@@ -10,12 +9,6 @@ double mysqrt(double x)
return 0;
}
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = std::exp(std::log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result
- << " using log and exp" << std::endl;
-#else
double result = x;
// do ten iterations
@@ -27,6 +20,5 @@ double mysqrt(double x)
result = result + 0.5 * delta / result;
std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-#endif
return result;
}
diff --git a/Help/guide/tutorial/Step7/CMakeLists.txt b/Help/guide/tutorial/Step7/CMakeLists.txt
index 82d00c8..d26a90c 100644
--- a/Help/guide/tutorial/Step7/CMakeLists.txt
+++ b/Help/guide/tutorial/Step7/CMakeLists.txt
@@ -1,11 +1,20 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.15)
# set the project name and version
project(Tutorial VERSION 1.0)
# specify the C++ standard
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
+add_library(tutorial_compiler_flags INTERFACE)
+target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
+
+# add compiler warning flags just when building this project via
+# the BUILD_INTERFACE genex
+set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU,LCC>")
+set(msvc_cxx "$<COMPILE_LANG_AND_ID:CXX,MSVC>")
+target_compile_options(tutorial_compiler_flags INTERFACE
+ "$<${gcc_like_cxx}:$<BUILD_INTERFACE:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>>"
+ "$<${msvc_cxx}:$<BUILD_INTERFACE:-W3>>"
+)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
@@ -22,7 +31,7 @@ endif()
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS} tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -37,7 +46,7 @@ install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
# enable testing
-enable_testing()
+include(CTest)
# does the application run
add_test(NAME Runs COMMAND Tutorial 25)
diff --git a/Help/guide/tutorial/Step7/CTestConfig.cmake b/Help/guide/tutorial/Step7/CTestConfig.cmake
new file mode 100644
index 0000000..73efdb1
--- /dev/null
+++ b/Help/guide/tutorial/Step7/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set(CTEST_PROJECT_NAME "CMakeTutorial")
+set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Help/guide/tutorial/Step7/License.txt b/Help/guide/tutorial/Step7/License.txt
deleted file mode 100644
index c62d00b..0000000
--- a/Help/guide/tutorial/Step7/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt
index 9ede4b3..b4724c4 100644
--- a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt
@@ -1,29 +1,16 @@
-# first we add the executable that generates the table
-add_executable(MakeTable MakeTable.cxx)
-
-# add the command to generate the source code
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
-# add the main library
-add_library(MathFunctions
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
+add_library(MathFunctions mysqrt.cxx)
# state that anybody linking to us needs to include the current source dir
# to find MathFunctions.h, while we don't.
-# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
-# TutorialConfig.h include is an implementation detail
-# state that we depend on our binary dir to find Table.h
target_include_directories(MathFunctions
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
)
-# install rules
-install(TARGETS MathFunctions DESTINATION lib)
+# link our compiler flags interface library
+target_link_libraries(MathFunctions tutorial_compiler_flags)
+
+# install libs
+set(installable_libs MathFunctions tutorial_compiler_flags)
+install(TARGETS ${installable_libs} DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step7/MathFunctions/MakeTable.cxx b/Help/guide/tutorial/Step7/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee58556..0000000
--- a/Help/guide/tutorial/Step7/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx
index 7d80ee9..abe767d 100644
--- a/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx
+++ b/Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx
@@ -2,9 +2,6 @@
#include "MathFunctions.h"
-// include the generated table
-#include "Table.h"
-
// a hack square root calculation using simple operations
double mysqrt(double x)
{
@@ -12,12 +9,7 @@ double mysqrt(double x)
return 0;
}
- // use the table to help find an initial value
double result = x;
- if (x >= 1 && x < 10) {
- std::cout << "Use the table to help find an initial value " << std::endl;
- result = sqrtTable[static_cast<int>(x)];
- }
// do ten iterations
for (int i = 0; i < 10; ++i) {
@@ -28,6 +20,5 @@ double mysqrt(double x)
result = result + 0.5 * delta / result;
std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-
return result;
}
diff --git a/Help/guide/tutorial/Step8/CMakeLists.txt b/Help/guide/tutorial/Step8/CMakeLists.txt
index 4c78b94..cb87281 100644
--- a/Help/guide/tutorial/Step8/CMakeLists.txt
+++ b/Help/guide/tutorial/Step8/CMakeLists.txt
@@ -1,11 +1,21 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.15)
# set the project name and version
project(Tutorial VERSION 1.0)
# specify the C++ standard
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
+add_library(tutorial_compiler_flags INTERFACE)
+target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
+
+# add compiler warning flags just when building this project via
+# the BUILD_INTERFACE genex
+set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU,LCC>")
+set(msvc_cxx "$<COMPILE_LANG_AND_ID:CXX,MSVC>")
+target_compile_options(tutorial_compiler_flags INTERFACE
+ "$<${gcc_like_cxx}:$<BUILD_INTERFACE:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>>"
+ "$<${msvc_cxx}:$<BUILD_INTERFACE:-W3>>"
+)
+
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
@@ -22,7 +32,7 @@ endif()
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS} tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -37,7 +47,7 @@ install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
# enable testing
-enable_testing()
+include(CTest)
# does the application run
add_test(NAME Runs COMMAND Tutorial 25)
@@ -64,11 +74,3 @@ do_test(Tutorial 7 "7 is 2.645")
do_test(Tutorial 25 "25 is 5")
do_test(Tutorial -25 "-25 is (-nan|nan|0)")
do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-# setup installer
-include(InstallRequiredSystemLibraries)
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-set(CPACK_SOURCE_GENERATOR "TGZ")
-include(CPack)
diff --git a/Help/guide/tutorial/Step8/License.txt b/Help/guide/tutorial/Step8/License.txt
deleted file mode 100644
index c62d00b..0000000
--- a/Help/guide/tutorial/Step8/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt
index 9ede4b3..f81b563 100644
--- a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt
@@ -1,29 +1,39 @@
-# first we add the executable that generates the table
-add_executable(MakeTable MakeTable.cxx)
-
-# add the command to generate the source code
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
-# add the main library
-add_library(MathFunctions
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
+add_library(MathFunctions mysqrt.cxx)
# state that anybody linking to us needs to include the current source dir
# to find MathFunctions.h, while we don't.
-# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
-# TutorialConfig.h include is an implementation detail
-# state that we depend on our binary dir to find Table.h
target_include_directories(MathFunctions
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
)
-# install rules
-install(TARGETS MathFunctions DESTINATION lib)
+# link our compiler flags interface library
+target_link_libraries(MathFunctions tutorial_compiler_flags)
+
+# does this system provide the log and exp functions?
+include(CheckCXXSourceCompiles)
+check_cxx_source_compiles("
+ #include <cmath>
+ int main() {
+ std::log(1.0);
+ return 0;
+ }
+" HAVE_LOG)
+check_cxx_source_compiles("
+ #include <cmath>
+ int main() {
+ std::exp(1.0);
+ return 0;
+ }
+" HAVE_EXP)
+
+# add compile definitions
+if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(MathFunctions
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+endif()
+
+# install libs
+set(installable_libs MathFunctions tutorial_compiler_flags)
+install(TARGETS ${installable_libs} DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step8/MathFunctions/mysqrt.cxx b/Help/guide/tutorial/Step8/MathFunctions/mysqrt.cxx
index 7d80ee9..7eecd26 100644
--- a/Help/guide/tutorial/Step8/MathFunctions/mysqrt.cxx
+++ b/Help/guide/tutorial/Step8/MathFunctions/mysqrt.cxx
@@ -1,10 +1,8 @@
+#include <cmath>
#include <iostream>
#include "MathFunctions.h"
-// include the generated table
-#include "Table.h"
-
// a hack square root calculation using simple operations
double mysqrt(double x)
{
@@ -12,12 +10,13 @@ double mysqrt(double x)
return 0;
}
- // use the table to help find an initial value
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = std::exp(std::log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result
+ << " using log and exp" << std::endl;
+#else
double result = x;
- if (x >= 1 && x < 10) {
- std::cout << "Use the table to help find an initial value " << std::endl;
- result = sqrtTable[static_cast<int>(x)];
- }
// do ten iterations
for (int i = 0; i < 10; ++i) {
@@ -28,6 +27,6 @@ double mysqrt(double x)
result = result + 0.5 * delta / result;
std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-
+#endif
return result;
}
diff --git a/Help/guide/tutorial/Step9/CMakeLists.txt b/Help/guide/tutorial/Step9/CMakeLists.txt
index 6bae26e..d26a90c 100644
--- a/Help/guide/tutorial/Step9/CMakeLists.txt
+++ b/Help/guide/tutorial/Step9/CMakeLists.txt
@@ -1,11 +1,20 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.15)
# set the project name and version
project(Tutorial VERSION 1.0)
# specify the C++ standard
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
+add_library(tutorial_compiler_flags INTERFACE)
+target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
+
+# add compiler warning flags just when building this project via
+# the BUILD_INTERFACE genex
+set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:CXX,ARMClang,AppleClang,Clang,GNU,LCC>")
+set(msvc_cxx "$<COMPILE_LANG_AND_ID:CXX,MSVC>")
+target_compile_options(tutorial_compiler_flags INTERFACE
+ "$<${gcc_like_cxx}:$<BUILD_INTERFACE:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>>"
+ "$<${msvc_cxx}:$<BUILD_INTERFACE:-W3>>"
+)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
@@ -22,7 +31,7 @@ endif()
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS} tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -64,10 +73,3 @@ do_test(Tutorial 7 "7 is 2.645")
do_test(Tutorial 25 "25 is 5")
do_test(Tutorial -25 "-25 is (-nan|nan|0)")
do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-include(InstallRequiredSystemLibraries)
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-set(CPACK_SOURCE_GENERATOR "TGZ")
-include(CPack)
diff --git a/Help/guide/tutorial/Step9/License.txt b/Help/guide/tutorial/Step9/License.txt
index c62d00b..85760e5 100644
--- a/Help/guide/tutorial/Step9/License.txt
+++ b/Help/guide/tutorial/Step9/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
+CMake/Tutorial/Step9...
diff --git a/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt
index 50f0701..8e04f97 100644
--- a/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt
@@ -16,12 +16,19 @@ add_library(MathFunctions
# state that anybody linking to us needs to include the current source dir
# to find MathFunctions.h, while we don't.
+# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
+# TutorialConfig.h include is an implementation detail
# state that we depend on our binary dir to find Table.h
target_include_directories(MathFunctions
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
)
-# install rules
-install(TARGETS MathFunctions DESTINATION lib)
+# link our compiler flags interface library
+target_link_libraries(MathFunctions tutorial_compiler_flags)
+
+# install libs
+set(installable_libs MathFunctions tutorial_compiler_flags)
+install(TARGETS ${installable_libs} DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step9/MathFunctions/MathFunctions.cxx b/Help/guide/tutorial/Step9/MathFunctions/MathFunctions.cxx
deleted file mode 100644
index 0145300..0000000
--- a/Help/guide/tutorial/Step9/MathFunctions/MathFunctions.cxx
+++ /dev/null
@@ -1,19 +0,0 @@
-
-#include "MathFunctions.h"
-
-#include <cmath>
-
-#ifdef USE_MYMATH
-# include "mysqrt.h"
-#endif
-
-namespace mathfunctions {
-double sqrt(double x)
-{
-#ifdef USE_MYMATH
- return detail::mysqrt(x);
-#else
- return std::sqrt(x);
-#endif
-}
-}
diff --git a/Help/guide/tutorial/Step9/MathFunctions/mysqrt.h b/Help/guide/tutorial/Step9/MathFunctions/mysqrt.h
deleted file mode 100644
index e1c42ef..0000000
--- a/Help/guide/tutorial/Step9/MathFunctions/mysqrt.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-namespace mathfunctions {
-namespace detail {
-double mysqrt(double x);
-}
-}
diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst
index 09553cb..1ab0009 100644
--- a/Help/guide/tutorial/index.rst
+++ b/Help/guide/tutorial/index.rst
@@ -24,13 +24,13 @@ provides the complete solution for the previous step.
A Basic Starting Point
Adding a Library
Adding Usage Requirements for a Library
+ Adding Generator Expressions
Installing and Testing
+ Adding Support for a Testing Dashboard
Adding System Introspection
Adding a Custom Command and Generated File
Packaging an Installer
- Adding Support for a Testing Dashboard
Selecting Static or Shared Libraries
- Adding Generator Expressions
Adding Export Configuration
Packaging Debug and Release
diff --git a/Help/guide/user-interaction/index.rst b/Help/guide/user-interaction/index.rst
index ba8196b..3355992 100644
--- a/Help/guide/user-interaction/index.rst
+++ b/Help/guide/user-interaction/index.rst
@@ -71,8 +71,8 @@ The CMake tooling may report warnings which are intended
for the provider of the software, not intended for the
consumer of the software. Such warnings end with "This
warning is for project developers". Users may disable
-such warnings by passing the ``-Wno-dev`` flag to
-:manual:`cmake(1)`.
+such warnings by passing the :option:`-Wno-dev <cmake -Wno-dev>`
+flag to :manual:`cmake(1)`.
cmake-gui tool
--------------
@@ -153,13 +153,13 @@ platform. Usually, the default generator is sufficient
to allow the user to proceed to build the software.
The user may override the default generator with
-the ``-G`` option:
+the :option:`-G <cmake -G>` option:
.. code-block:: console
$ cmake .. -G Ninja
-The output of ``cmake --help`` includes a list of
+The output of :option:`cmake --help` includes a list of
:manual:`generators <cmake-generators(7)>` available
for the user to choose from. Note that generator
names are case sensitive.
@@ -196,7 +196,8 @@ VisualC++ compiler, or a combination of the two:
$ cmake .. -G "Visual Studio 16 2019"
Visual Studio generators can target different architectures.
-One can specify the target architecture using the `-A` option:
+One can specify the target architecture using the
+:option:`-A <cmake -A>` option:
.. code-block:: console
@@ -214,8 +215,8 @@ generator to use, typically a choice between a ``Makefile``
or a ``Ninja`` based generator.
Note that it is not possible to change the generator
-with ``-G`` after the first invocation of CMake. To
-change the generator, the build directory must be
+with :option:`-G <cmake -G>` after the first invocation of CMake.
+To change the generator, the build directory must be
deleted and the build must be started from scratch.
When generating Visual Studio project and solutions
@@ -223,7 +224,7 @@ files several other options are available to use when
initially running :manual:`cmake(1)`.
The Visual Studio toolset can be specified with the
-``-T`` option:
+:option:`cmake -T` option:
.. code-block:: console
@@ -232,9 +233,9 @@ The Visual Studio toolset can be specified with the
$ # Build targeting Windows XP
$ cmake.exe .. -G "Visual Studio 16 2019" -A x64 -T v120_xp
-Whereas the ``-A`` option specifies the _target_
-architecture, the ``-T`` option can be used to specify
-details of the toolchain used. For example, `-Thost=x64`
+Whereas the :option:`-A <cmake -A>` option specifies the _target_
+architecture, the :option:`-T <cmake -T>` option can be used to specify
+details of the toolchain used. For example, ``-Thost=x64``
can be given to select the 64-bit version of the host
tools. The following demonstrates how to use 64-bit
tools and also build for a 64-bit target architecture:
@@ -337,7 +338,7 @@ or later on a subsequent invocation of
$ cd build
$ cmake . -DCMAKE_BUILD_TYPE=Debug
-The ``-U`` flag may be used to unset variables
+The :option:`-U <cmake -U>` flag may be used to unset variables
on the :manual:`cmake(1)` command line:
.. code-block:: console
@@ -351,7 +352,7 @@ on the command line can be modified using the
The :manual:`cmake(1)` tool allows specifying a
file to use to populate the initial cache using
-the ``-C`` option. This can be useful to simplify
+the :option:`-C <cmake -C>` option. This can be useful to simplify
commands and scripts which repeatedly require the
same cache entries.
@@ -427,10 +428,10 @@ Using presets on the command-line
---------------------------------
When using the :manual:`cmake(1)` command line tool, a
-preset can be invoked by using the ``--preset`` option. If
-``--preset`` is specified, the generator and build
-directory are not required, but can be specified to
-override them. For example, if you have the following
+preset can be invoked by using the :option:`--preset <cmake --preset>`
+option. If :option:`--preset <cmake --preset>` is specified,
+the generator and build directory are not required, but can be
+specified to override them. For example, if you have the following
``CMakePresets.json`` file:
.. code-block:: json
@@ -502,23 +503,25 @@ command may be invoked in the build directory:
$ cmake --build .
-The ``--build`` flag enables a particular mode of
-operation for the :manual:`cmake(1)` tool. It invokes
-the :variable:`CMAKE_MAKE_PROGRAM` command associated
-with the :manual:`generator <cmake-generators(7)>`, or
+The :option:`--build <cmake --build>` flag enables a
+particular mode of operation for the :manual:`cmake(1)`
+tool. It invokes the :variable:`CMAKE_MAKE_PROGRAM`
+command associated with the
+:manual:`generator <cmake-generators(7)>`, or
the build tool configured by the user.
-The ``--build`` mode also accepts the parameter
-``--target`` to specify a particular target to build,
-for example a particular library, executable or
-custom target, or a particular special target like
-``install``:
+The :option:`--build <cmake --build>` mode also accepts
+the parameter :option:`--target <cmake--build --target>` to
+specify a particular target to build, for example a
+particular library, executable or custom target, or a
+particular special target like ``install``:
.. code-block:: console
$ cmake --build . --target myexe
-The ``--build`` mode also accepts a ``--config`` parameter
+The :option:`--build <cmake --build>` mode also accepts a
+:option:`--config <cmake--build --config>` parameter
in the case of multi-config generators to specify which
particular configuration to build:
@@ -526,23 +529,23 @@ particular configuration to build:
$ cmake --build . --target myexe --config Release
-The ``--config`` option has no effect if the generator
-generates a buildsystem specific to a configuration which
-is chosen when invoking cmake with the
-:variable:`CMAKE_BUILD_TYPE` variable.
+The :option:`--config <cmake--build --config>` option has no
+effect if the generator generates a buildsystem specific
+to a configuration which is chosen when invoking cmake
+with the :variable:`CMAKE_BUILD_TYPE` variable.
Some buildsystems omit details of command lines invoked
-during the build. The ``--verbose`` flag can be used to
-cause those command lines to be shown:
+during the build. The :option:`--verbose <cmake--build --verbose>`
+flag can be used to cause those command lines to be shown:
.. code-block:: console
$ cmake --build . --target myexe --verbose
-The ``--build`` mode can also pass particular command
-line options to the underlying build tool by listing
-them after ``--``. This can be useful to specify
-options to the build tool, such as to continue the
+The :option:`--build <cmake --build>` mode can also pass
+particular command line options to the underlying build
+tool by listing them after ``--``. This can be useful
+to specify options to the build tool, such as to continue the
build after a failed job, where CMake does not
provide a high-level user interface.
@@ -638,9 +641,9 @@ building the ``foo.i`` target will preprocess both files.
Specifying a Build Program
--------------------------
-The program invoked by the ``--build`` mode is determined
-by the :variable:`CMAKE_MAKE_PROGRAM` variable. For most
-generators, the particular program does not need to be
+The program invoked by the :option:`--build <cmake --build>`
+mode is determined by the :variable:`CMAKE_MAKE_PROGRAM` variable.
+For most generators, the particular program does not need to be
configured.
===================== =========================== ===========================
@@ -661,7 +664,8 @@ The ``jom`` tool is capable of reading makefiles of the
``NMake`` flavor and building in parallel, while the
``nmake`` tool always builds serially. After generating
with the :generator:`NMake Makefiles` generator a user
-can run ``jom`` instead of ``nmake``. The ``--build``
+can run ``jom`` instead of ``nmake``. The
+:option:`--build <cmake --build>`
mode would also use ``jom`` if the
:variable:`CMAKE_MAKE_PROGRAM` was set to ``jom`` while
using the :generator:`NMake Makefiles` generator, and
@@ -671,7 +675,7 @@ and use it as the :variable:`CMAKE_MAKE_PROGRAM`. For
completeness, ``nmake`` is an alternative tool which
can process the output of the
:generator:`NMake Makefiles JOM` generator, but doing
-so would be a pessimisation.
+so would be a pessimization.
Software Installation
=====================
@@ -745,8 +749,8 @@ run only tests without ``Qt`` in their name:
$ ctest -E Qt
-Tests can be run in parallel by passing ``-j`` arguments
-to :manual:`ctest(1)`:
+Tests can be run in parallel by passing :option:`-j <ctest -j>`
+arguments to :manual:`ctest(1)`:
.. code-block:: console
@@ -754,14 +758,15 @@ to :manual:`ctest(1)`:
The environment variable :envvar:`CTEST_PARALLEL_LEVEL`
can alternatively be set to avoid the need to pass
-``-j``.
+:option:`-j <ctest -j>`.
By default :manual:`ctest(1)` does not print the output
-from the tests. The command line argument ``-V`` (or
-``--verbose``) enables verbose mode to print the
+from the tests. The command line argument :option:`-V <ctest -V>`
+(or ``--verbose``) enables verbose mode to print the
output from all tests.
-The ``--output-on-failure`` option prints the test
-output for failing tests only. The environment variable
-:envvar:`CTEST_OUTPUT_ON_FAILURE`
+The :option:`--output-on-failure <ctest --output-on-failure>`
+option prints the test output for failing tests only.
+The environment variable :envvar:`CTEST_OUTPUT_ON_FAILURE`
can be set to ``1`` as an alternative to passing the
-``--output-on-failure`` option to :manual:`ctest(1)`.
+:option:`--output-on-failure <ctest --output-on-failure>`
+option to :manual:`ctest(1)`.
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index 8e23b77..94adac8 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -1,12 +1,15 @@
-``-S <path-to-source>``
+.. option:: -S <path-to-source>
+
Path to root directory of the CMake project to build.
-``-B <path-to-build>``
+.. option:: -B <path-to-build>
+
Path to directory which CMake will use as the root of build directory.
If the directory doesn't already exist CMake will make it.
-``-C <initial-cache>``
+.. option:: -C <initial-cache>
+
Pre-load a script to populate the cache.
When CMake is first run in an empty build tree, it creates a
@@ -21,7 +24,8 @@
References to :variable:`CMAKE_SOURCE_DIR` and :variable:`CMAKE_BINARY_DIR`
within the script evaluate to the top-level source and build tree.
-``-D <var>:<type>=<value>, -D <var>=<value>``
+.. option:: -D <var>:<type>=<value>, -D <var>=<value>
+
Create or update a CMake ``CACHE`` entry.
When CMake is first run in an empty build tree, it creates a
@@ -41,7 +45,27 @@
This option may also be given as a single argument:
``-D<var>:<type>=<value>`` or ``-D<var>=<value>``.
-``-U <globbing_expr>``
+ It's important to note that the order of ``-C`` and ``-D`` arguments is
+ significant. They will be carried out in the order they are listed, with the
+ last argument taking precedence over the previous ones. For example, if you
+ specify ``-DCMAKE_BUILD_TYPE=Debug``, followed by a ``-C`` argument with a
+ file that calls:
+
+ .. code-block:: cmake
+
+ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
+
+ then the ``-C`` argument will take precedence, and ``CMAKE_BUILD_TYPE`` will
+ be set to ``Release``. However, if the ``-D`` argument comes after the ``-C``
+ argument, it will be set to ``Debug``.
+
+ If a ``set(... CACHE ...)`` call in the ``-C`` file does not use ``FORCE``,
+ and a ``-D`` argument sets the same variable, the ``-D`` argument will take
+ precedence regardless of order because of the nature of non-``FORCE``
+ ``set(... CACHE ...)`` calls.
+
+.. option:: -U <globbing_expr>
+
Remove matching entries from CMake ``CACHE``.
This option may be used to remove one or more variables from the
@@ -51,7 +75,8 @@
Use with care, you can make your ``CMakeCache.txt`` non-working.
-``-G <generator-name>``
+.. option:: -G <generator-name>
+
Specify a build system generator.
CMake may support multiple native build systems on certain
@@ -62,73 +87,85 @@
If not specified, CMake checks the :envvar:`CMAKE_GENERATOR` environment
variable and otherwise falls back to a builtin default selection.
-``-T <toolset-spec>``
+.. option:: -T <toolset-spec>
+
Toolset specification for the generator, if supported.
Some CMake generators support a toolset specification to tell
the native build system how to choose a compiler. See the
:variable:`CMAKE_GENERATOR_TOOLSET` variable for details.
-``-A <platform-name>``
+.. option:: -A <platform-name>
+
Specify platform name if supported by generator.
Some CMake generators support a platform name to be given to the
native build system to choose a compiler or SDK. See the
:variable:`CMAKE_GENERATOR_PLATFORM` variable for details.
-``--toolchain <path-to-file>``
+.. option:: --toolchain <path-to-file>
+
Specify the cross compiling toolchain file, equivalent to setting
:variable:`CMAKE_TOOLCHAIN_FILE` variable.
-``--install-prefix <directory>``
+.. option:: --install-prefix <directory>
+
Specify the installation directory, used by the
:variable:`CMAKE_INSTALL_PREFIX` variable. Must be an absolute path.
-``-Wno-dev``
+.. option:: -Wno-dev
+
Suppress developer warnings.
Suppress warnings that are meant for the author of the
``CMakeLists.txt`` files. By default this will also turn off
deprecation warnings.
-``-Wdev``
+.. option:: -Wdev
+
Enable developer warnings.
Enable warnings that are meant for the author of the ``CMakeLists.txt``
files. By default this will also turn on deprecation warnings.
-``-Werror=dev``
- Make developer warnings errors.
-
- Make warnings that are meant for the author of the ``CMakeLists.txt`` files
- errors. By default this will also turn on deprecated warnings as errors.
+.. option:: -Wdeprecated
-``-Wno-error=dev``
- Make developer warnings not errors.
-
- Make warnings that are meant for the author of the ``CMakeLists.txt`` files not
- errors. By default this will also turn off deprecated warnings as errors.
-
-``-Wdeprecated``
Enable deprecated functionality warnings.
Enable warnings for usage of deprecated functionality, that are meant
for the author of the ``CMakeLists.txt`` files.
-``-Wno-deprecated``
+.. option:: -Wno-deprecated
+
Suppress deprecated functionality warnings.
Suppress warnings for usage of deprecated functionality, that are meant
for the author of the ``CMakeLists.txt`` files.
-``-Werror=deprecated``
- Make deprecated macro and function warnings errors.
+.. option:: -Werror=<what>
+
+ Treat CMake warnings as errors. ``<what>`` must be one of the following:
+
+ ``dev``
+ Make developer warnings errors.
+
+ Make warnings that are meant for the author of the ``CMakeLists.txt`` files
+ errors. By default this will also turn on deprecated warnings as errors.
+
+ ``deprecated``
+ Make deprecated macro and function warnings errors.
+
+ Make warnings for usage of deprecated macros and functions, that are meant
+ for the author of the ``CMakeLists.txt`` files, errors.
+
+.. option:: -Wno-error=<what>
- Make warnings for usage of deprecated macros and functions, that are meant
- for the author of the ``CMakeLists.txt`` files, errors.
+ Do not treat CMake warnings as errors. ``<what>`` must be one of the following:
-``-Wno-error=deprecated``
- Make deprecated macro and function warnings not errors.
+ ``dev``
+ Make warnings that are meant for the author of the ``CMakeLists.txt`` files not
+ errors. By default this will also turn off deprecated warnings as errors.
- Make warnings for usage of deprecated macros and functions, that are meant
- for the author of the ``CMakeLists.txt`` files, not errors.
+ ``deprecated``
+ Make warnings for usage of deprecated macros and functions, that are meant
+ for the author of the ``CMakeLists.txt`` files, not errors.
diff --git a/Help/manual/OPTIONS_HELP.txt b/Help/manual/OPTIONS_HELP.txt
index feeca7d..78ee245 100644
--- a/Help/manual/OPTIONS_HELP.txt
+++ b/Help/manual/OPTIONS_HELP.txt
@@ -1,134 +1,152 @@
-.. |file| replace:: The help is printed to a named <f>ile if given.
+.. |file| replace:: The output is printed to a named ``<file>`` if given.
+
+.. option:: -version [<file>], --version [<file>], /V [<file>]
+
+ Show program name/version banner and exit.
+ |file|
+
+.. option:: -h, -H, --help, -help, -usage, /?
-``--help,-help,-usage,-h,-H,/?``
Print usage information and exit.
Usage describes the basic command line interface and its options.
-``--version,-version,/V [<f>]``
- Show program name/version banner and exit.
+.. option:: --help-full [<file>]
- If a file is specified, the version is written into it.
- |file|
-
-``--help-full [<f>]``
Print all help manuals and exit.
All manuals are printed in a human-readable text format.
|file|
-``--help-manual <man> [<f>]``
+.. option:: --help-manual <man> [<file>]
+
Print one help manual and exit.
The specified manual is printed in a human-readable text format.
|file|
-``--help-manual-list [<f>]``
+.. option:: --help-manual-list [<file>]
+
List help manuals available and exit.
The list contains all manuals for which help may be obtained by
using the ``--help-manual`` option followed by a manual name.
|file|
-``--help-command <cmd> [<f>]``
+.. option:: --help-command <cmd> [<file>]
+
Print help for one command and exit.
The :manual:`cmake-commands(7)` manual entry for ``<cmd>`` is
printed in a human-readable text format.
|file|
-``--help-command-list [<f>]``
+.. option:: --help-command-list [<file>]
+
List commands with help available and exit.
The list contains all commands for which help may be obtained by
using the ``--help-command`` option followed by a command name.
|file|
-``--help-commands [<f>]``
+.. option:: --help-commands [<file>]
+
Print cmake-commands manual and exit.
The :manual:`cmake-commands(7)` manual is printed in a
human-readable text format.
|file|
-``--help-module <mod> [<f>]``
+.. option:: --help-module <mod> [<file>]
+
Print help for one module and exit.
The :manual:`cmake-modules(7)` manual entry for ``<mod>`` is printed
in a human-readable text format.
|file|
-``--help-module-list [<f>]``
+.. option:: --help-module-list [<file>]
+
List modules with help available and exit.
The list contains all modules for which help may be obtained by
using the ``--help-module`` option followed by a module name.
|file|
-``--help-modules [<f>]``
+.. option:: --help-modules [<file>]
+
Print cmake-modules manual and exit.
The :manual:`cmake-modules(7)` manual is printed in a human-readable
text format.
|file|
-``--help-policy <cmp> [<f>]``
+.. option:: --help-policy <cmp> [<file>]
+
Print help for one policy and exit.
The :manual:`cmake-policies(7)` manual entry for ``<cmp>`` is
printed in a human-readable text format.
|file|
-``--help-policy-list [<f>]``
+.. option:: --help-policy-list [<file>]
+
List policies with help available and exit.
The list contains all policies for which help may be obtained by
using the ``--help-policy`` option followed by a policy name.
|file|
-``--help-policies [<f>]``
+.. option:: --help-policies [<file>]
+
Print cmake-policies manual and exit.
The :manual:`cmake-policies(7)` manual is printed in a
human-readable text format.
|file|
-``--help-property <prop> [<f>]``
+.. option:: --help-property <prop> [<file>]
+
Print help for one property and exit.
The :manual:`cmake-properties(7)` manual entries for ``<prop>`` are
printed in a human-readable text format.
|file|
-``--help-property-list [<f>]``
+.. option:: --help-property-list [<file>]
+
List properties with help available and exit.
The list contains all properties for which help may be obtained by
using the ``--help-property`` option followed by a property name.
|file|
-``--help-properties [<f>]``
+.. option:: --help-properties [<file>]
+
Print cmake-properties manual and exit.
The :manual:`cmake-properties(7)` manual is printed in a
human-readable text format.
|file|
-``--help-variable <var> [<f>]``
+.. option:: --help-variable <var> [<file>]
+
Print help for one variable and exit.
The :manual:`cmake-variables(7)` manual entry for ``<var>`` is
printed in a human-readable text format.
|file|
-``--help-variable-list [<f>]``
+.. option:: --help-variable-list [<file>]
+
List variables with help available and exit.
The list contains all variables for which help may be obtained by
using the ``--help-variable`` option followed by a variable name.
|file|
-``--help-variables [<f>]``
+.. option:: --help-variables [<file>]
+
Print cmake-variables manual and exit.
The :manual:`cmake-variables(7)` manual is printed in a
diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst
index 60d45a3..cd66d51 100644
--- a/Help/manual/ccmake.1.rst
+++ b/Help/manual/ccmake.1.rst
@@ -8,7 +8,7 @@ Synopsis
.. parsed-literal::
- ccmake [<options>] {<path-to-source> | <path-to-existing-build>}
+ ccmake [<options>] <path-to-source | path-to-existing-build>
Description
===========
@@ -27,6 +27,8 @@ native tool on their platform.
Options
=======
+.. program:: ccmake
+
.. include:: OPTIONS_BUILD.txt
.. include:: OPTIONS_HELP.txt
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index bceff2d..b14160c 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -257,7 +257,7 @@ targets in multiple different directories convenient through use of the
Transitive Usage Requirements
-----------------------------
-The usage requirements of a target can transitively propagate to dependents.
+The usage requirements of a target can transitively propagate to the dependents.
The :command:`target_link_libraries` command has ``PRIVATE``,
``INTERFACE`` and ``PUBLIC`` keywords to control the propagation.
@@ -279,8 +279,10 @@ The :command:`target_link_libraries` command has ``PRIVATE``,
# consumer is compiled with -DUSING_ARCHIVE_LIB
target_link_libraries(consumer archiveExtras)
-Because ``archive`` is a ``PUBLIC`` dependency of ``archiveExtras``, the
-usage requirements of it are propagated to ``consumer`` too. Because
+Because the ``archive`` is a ``PUBLIC`` dependency of ``archiveExtras``, the
+usage requirements of it are propagated to ``consumer`` too.
+
+Because
``serialization`` is a ``PRIVATE`` dependency of ``archiveExtras``, the usage
requirements of it are not propagated to ``consumer``.
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 036fa8f..0f35632 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -15,6 +15,7 @@ These commands are always available.
.. toctree::
:maxdepth: 1
+ /command/block
/command/break
/command/cmake_host_system_information
/command/cmake_language
@@ -26,6 +27,7 @@ These commands are always available.
/command/continue
/command/else
/command/elseif
+ /command/endblock
/command/endforeach
/command/endfunction
/command/endif
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index 737b22c..50fcf75 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -21,6 +21,8 @@ Environment Variables that Change Behavior
:maxdepth: 1
/envvar/CMAKE_PREFIX_PATH
+ /envvar/SSL_CERT_DIR
+ /envvar/SSL_CERT_FILE
Environment Variables that Control the Build
============================================
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 7a6188a..69e3f20 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -594,6 +594,10 @@ Configuration Expressions
expression when it is evaluated on a property of an :prop_tgt:`IMPORTED`
target.
+ .. versionchanged:: 3.19
+ Multiple configurations can be specified for ``cfgs``.
+ CMake 3.18 and earlier only accepted a single configuration.
+
.. genex:: $<OUTPUT_CONFIG:...>
.. versionadded:: 3.20
@@ -627,9 +631,8 @@ Platform
.. genex:: $<PLATFORM_ID:platform_ids>
- where ``platform_ids`` is a comma-separated list.
``1`` if CMake's platform id matches any one of the entries in
- ``platform_ids``, otherwise ``0``.
+ comma-separated list ``platform_ids``, otherwise ``0``.
See also the :variable:`CMAKE_SYSTEM_NAME` variable.
Compiler Version
@@ -844,10 +847,15 @@ related to most of the expressions in this sub-section.
.. versionadded:: 3.3
- ``1`` when the language used for compilation unit matches any of the entries
- in ``languages``, otherwise ``0``. This expression may be used to specify
- compile options, compile definitions, and include directories for source
- files of a particular language in a target. For example:
+ .. versionchanged:: 3.15
+ Multiple languages can be specified for ``languages``.
+ CMake 3.14 and earlier only accepted a single language.
+
+ ``1`` when the language used for compilation unit matches any of the
+ comma-separated entries in ``languages``, otherwise ``0``. This expression
+ may be used to specify compile options, compile definitions, and include
+ directories for source files of a particular language in a target. For
+ example:
.. code-block:: cmake
@@ -892,8 +900,8 @@ related to most of the expressions in this sub-section.
``1`` when the language used for compilation unit matches ``language`` and
CMake's compiler id of the ``language`` compiler matches any one of the
- entries in ``compiler_ids``, otherwise ``0``. This expression is a short form
- for the combination of ``$<COMPILE_LANGUAGE:language>`` and
+ comma-separated entries in ``compiler_ids``, otherwise ``0``. This expression
+ is a short form for the combination of ``$<COMPILE_LANGUAGE:language>`` and
``$<LANG_COMPILER_ID:compiler_ids>``. This expression may be used to specify
compile options, compile definitions, and include directories for source
files of a particular language and compiler combination in a target.
@@ -967,10 +975,10 @@ Linker Language And ID
.. versionadded:: 3.18
- ``1`` when the language used for link step matches any of the entries
- in ``languages``, otherwise ``0``. This expression may be used to specify
- link libraries, link options, link directories and link dependencies of a
- particular language in a target. For example:
+ ``1`` when the language used for link step matches any of the comma-separated
+ entries in ``languages``, otherwise ``0``. This expression may be used to
+ specify link libraries, link options, link directories and link dependencies
+ of a particular language in a target. For example:
.. code-block:: cmake
@@ -1033,9 +1041,9 @@ Linker Language And ID
.. versionadded:: 3.18
``1`` when the language used for link step matches ``language`` and the
- CMake's compiler id of the language linker matches any one of the entries
- in ``compiler_ids``, otherwise ``0``. This expression is a short form for the
- combination of ``$<LINK_LANGUAGE:language>`` and
+ CMake's compiler id of the language linker matches any one of the comma-separated
+ entries in ``compiler_ids``, otherwise ``0``. This expression is a short form
+ for the combination of ``$<LINK_LANGUAGE:language>`` and
``$<LANG_COMPILER_ID:compiler_ids>``. This expression may be used to specify
link libraries, link options, link directories and link dependencies of a
particular language and linker combination in a target. For example:
diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst
index 034e218..ed5bbbf 100644
--- a/Help/manual/cmake-generators.7.rst
+++ b/Help/manual/cmake-generators.7.rst
@@ -18,11 +18,11 @@ as a variant of some of the `Command-Line Build Tool Generators`_ to
produce project files for an auxiliary IDE.
CMake Generators are platform-specific so each may be available only
-on certain platforms. The :manual:`cmake(1)` command-line tool ``--help``
-output lists available generators on the current platform. Use its ``-G``
-option to specify the generator for a new build tree.
-The :manual:`cmake-gui(1)` offers interactive selection of a generator
-when creating a new build tree.
+on certain platforms. The :manual:`cmake(1)` command-line tool
+:option:`--help <cmake --help>` output lists available generators on the
+current platform. Use its :option:`-G <cmake -G>` option to specify the
+generator for a new build tree. The :manual:`cmake-gui(1)` offers
+interactive selection of a generator when creating a new build tree.
CMake Generators
================
@@ -108,9 +108,9 @@ Extra Generators
================
Some of the `CMake Generators`_ listed in the :manual:`cmake(1)`
-command-line tool ``--help`` output may have variants that specify
-an extra generator for an auxiliary IDE tool. Such generator
-names have the form ``<extra-generator> - <main-generator>``.
+command-line tool :option:`--help <cmake --help>` output may have
+variants that specify an extra generator for an auxiliary IDE tool.
+Such generator names have the form ``<extra-generator> - <main-generator>``.
The following extra generators are known to CMake.
.. toctree::
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index 281986f..dd0eeca 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -9,7 +9,7 @@ Synopsis
.. parsed-literal::
cmake-gui [<options>]
- cmake-gui [<options>] {<path-to-source> | <path-to-existing-build>}
+ cmake-gui [<options>] <path-to-source | path-to-existing-build>
cmake-gui [<options>] -S <path-to-source> -B <path-to-build>
cmake-gui [<options>] --browse-manual
@@ -29,19 +29,25 @@ native tool on their platform.
Options
=======
-``-S <path-to-source>``
+.. program:: cmake-gui
+
+.. option:: -S <path-to-source>
+
Path to root directory of the CMake project to build.
-``-B <path-to-build>``
+.. option:: -B <path-to-build>
+
Path to directory which CMake will use as the root of build directory.
If the directory doesn't already exist CMake will make it.
-``--preset=<preset-name>``
+.. option:: --preset=<preset-name>
+
Name of the preset to use from the project's
:manual:`presets <cmake-presets(7)>` files, if it has them.
-``--browse-manual``
+.. option:: --browse-manual
+
Open the CMake reference manual in a browser and immediately exit.
.. include:: OPTIONS_HELP.txt
diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index 16917ff..0bd561f 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -74,7 +74,7 @@ encoded in UTF-8 on Windows (using UTF-16 to call system APIs).
Furthermore, CMake 3.0 and above allow a leading UTF-8
`Byte-Order Mark`_ in source files.
-.. _`Byte-Order Mark`: http://en.wikipedia.org/wiki/Byte_order_mark
+.. _Byte-Order Mark: https://en.wikipedia.org/wiki/Byte_order_mark
Source Files
------------
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 93beea9..d161a28 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -193,6 +193,7 @@ They are normally called through the :command:`find_package` command.
/module/FindOpenGL
/module/FindOpenMP
/module/FindOpenSceneGraph
+ /module/FindOpenSP
/module/FindOpenSSL
/module/FindOpenThreads
/module/Findosg
@@ -236,6 +237,7 @@ They are normally called through the :command:`find_package` command.
/module/FindRuby
/module/FindSDL
/module/FindSDL_image
+ /module/FindSDL_gfx
/module/FindSDL_mixer
/module/FindSDL_net
/module/FindSDL_sound
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index f6ab0c7..d6a30ff 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -52,6 +52,16 @@ to determine whether to report an error on use of deprecated macros or
functions.
+Policies Introduced by CMake 3.25
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0142: The Xcode generator does not append per-config suffixes to library search paths. </policy/CMP0142>
+ CMP0141: MSVC debug information format flags are selected by an abstraction. </policy/CMP0141>
+ CMP0140: The return() command checks its arguments. </policy/CMP0140>
+
Policies Introduced by CMake 3.24
=================================
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index a96c704..da699d8 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -10,6 +10,8 @@ cmake-presets(7)
Introduction
============
+.. versionadded:: 3.19
+
One problem that CMake users often face is sharing settings with other people
for common ways to configure a project. This may be done to support CI builds,
or for users who frequently use the same build. CMake supports two main files,
@@ -19,10 +21,10 @@ supports files included with the ``include`` field.
``CMakePresets.json`` and ``CMakeUserPresets.json`` live in the project's root
directory. They both have exactly the same format, and both are optional
-(though at least one must be present if ``--preset`` is specified).
-``CMakePresets.json`` is meant to specify project-wide build details, while
-``CMakeUserPresets.json`` is meant for developers to specify their own local
-build details.
+(though at least one must be present if :option:`--preset <cmake --preset>`
+is specified). ``CMakePresets.json`` is meant to specify project-wide build
+details, while ``CMakeUserPresets.json`` is meant for developers to specify
+their own local build details.
``CMakePresets.json`` may be checked into a version control system, and
``CMakeUserPresets.json`` should NOT be checked in. For example, if a
@@ -40,7 +42,6 @@ The files are a JSON document with an object as the root:
The root object recognizes the following fields:
``version``
-
A required integer representing the version of the JSON schema.
The supported versions are:
@@ -59,32 +60,29 @@ The root object recognizes the following fields:
``5``
.. versionadded:: 3.24
-``cmakeMinimumRequired``
+ ``6``
+ .. versionadded:: 3.25
+``cmakeMinimumRequired``
An optional object representing the minimum version of CMake needed to
build this project. This object consists of the following fields:
``major``
-
An optional integer representing the major version.
``minor``
-
An optional integer representing the minor version.
``patch``
-
An optional integer representing the patch version.
``include``
-
An optional array of strings representing files to include. If the filenames
are not absolute, they are considered relative to the current file.
This is allowed in preset files specifying version ``4`` or above.
See `Includes`_ for discussion of the constraints on included files.
``vendor``
-
An optional map containing vendor-specific information. CMake does not
interpret the contents of this field except to verify that it is a map if
it does exist. However, the keys should be a vendor-specific domain name
@@ -93,20 +91,25 @@ The root object recognizes the following fields:
desired by the vendor, though will typically be a map.
``configurePresets``
-
An optional array of `Configure Preset`_ objects.
This is allowed in preset files specifying version ``1`` or above.
``buildPresets``
-
An optional array of `Build Preset`_ objects.
This is allowed in preset files specifying version ``2`` or above.
``testPresets``
-
An optional array of `Test Preset`_ objects.
This is allowed in preset files specifying version ``2`` or above.
+``packagePresets``
+ An optional array of `Package Preset`_ objects.
+ This is allowed in preset files specifying version ``6`` or above.
+
+``workflowPresets``
+ An optional array of `Workflow Preset`_ objects.
+ This is allowed in preset files specifying version ``6`` or above.
+
Includes
^^^^^^^^
@@ -134,15 +137,14 @@ Each entry of the ``configurePresets`` array is a JSON object
that may contain the following fields:
``name``
-
A required string representing the machine-friendly name of the preset.
This identifier is used in the :ref:`cmake --preset <CMake Options>` option.
There must not be two configure presets in the union of ``CMakePresets.json``
and ``CMakeUserPresets.json`` in the same directory with the same name.
- However, a configure preset may have the same name as a build or test preset.
+ However, a configure preset may have the same name as a build, test,
+ package, or workflow preset.
``hidden``
-
An optional boolean specifying whether or not a preset should be hidden.
If a preset is hidden, it cannot be used in the ``--preset=`` argument,
will not show up in the :manual:`CMake GUI <cmake-gui(1)>`, and does not
@@ -151,7 +153,6 @@ that may contain the following fields:
other presets to inherit via the ``inherits`` field.
``inherits``
-
An optional array of strings representing the names of presets to inherit
from. This field can also be a string, which is equivalent to an array
containing one string.
@@ -160,7 +161,7 @@ that may contain the following fields:
presets by default (except ``name``, ``hidden``, ``inherits``,
``description``, and ``displayName``), but can override them as
desired. If multiple ``inherits`` presets provide conflicting values for
- the same field, the earlier preset in the ``inherits`` list will be
+ the same field, the earlier preset in the ``inherits`` array will be
preferred.
A preset can only inherit from another preset that is defined in the
@@ -169,12 +170,10 @@ that may contain the following fields:
``CMakeUserPresets.json``.
``condition``
-
An optional `Condition`_ object. This is allowed in preset files specifying
version ``3`` or above.
``vendor``
-
An optional map containing vendor-specific information. CMake does not
interpret the contents of this field except to verify that it is a map
if it does exist. However, it should follow the same conventions as the
@@ -183,47 +182,43 @@ that may contain the following fields:
when appropriate.
``displayName``
-
An optional string with a human-friendly name of the preset.
``description``
-
An optional string with a human-friendly description of the preset.
``generator``
-
An optional string representing the generator to use for the preset. If
``generator`` is not specified, it must be inherited from the
``inherits`` preset (unless this preset is ``hidden``). In version ``3``
or above, this field may be omitted to fall back to regular generator
discovery procedure.
- Note that for Visual Studio generators, unlike in the command line ``-G``
- argument, you cannot include the platform name in the generator name. Use
- the ``architecture`` field instead.
+ Note that for Visual Studio generators, unlike in the command line
+ :option:`-G <cmake -G>` argument, you cannot include the platform name
+ in the generator name. Use the ``architecture`` field instead.
``architecture``, ``toolset``
-
Optional fields representing the platform and toolset, respectively, for
- generators that support them. Each may be either a string or an object
- with the following fields:
+ :manual:`generators <cmake-generators(7)>` that support them.
- ``value``
+ See :option:`cmake -A` option for possible values for ``architecture``
+ and :option:`cmake -T` for ``toolset``.
+
+ Each may be either a string or an object with the following fields:
+ ``value``
An optional string representing the value.
``strategy``
-
An optional string telling CMake how to handle the ``architecture`` or
``toolset`` field. Valid values are:
``"set"``
-
Set the respective value. This will result in an error for generators
that do not support the respective field.
``"external"``
-
Do not set the value, even if the generator supports it. This is
useful if, for example, a preset uses the Ninja generator, and an IDE
knows how to set up the Visual C++ environment from the
@@ -231,8 +226,10 @@ that may contain the following fields:
ignore the field, but the IDE can use them to set up the environment
before invoking CMake.
-``toolchainFile``
+ If no ``strategy`` field is given, or if the field uses the string form
+ rather than the object form, the behavior is the same as ``"set"``.
+``toolchainFile``
An optional string representing the path to the toolchain file.
This field supports `macro expansion`_. If a relative path is specified,
it is calculated relative to the build directory, and if not found,
@@ -241,7 +238,6 @@ that may contain the following fields:
specifying version ``3`` or above.
``binaryDir``
-
An optional string representing the path to the output binary directory.
This field supports `macro expansion`_. If a relative path is specified,
it is calculated relative to the source directory. If ``binaryDir`` is not
@@ -250,20 +246,17 @@ that may contain the following fields:
omitted.
``installDir``
-
An optional string representing the path to the installation directory.
This field supports `macro expansion`_. If a relative path is specified,
it is calculated relative to the source directory. This is allowed in
preset files specifying version ``3`` or above.
``cmakeExecutable``
-
An optional string representing the path to the CMake executable to use
for this preset. This is reserved for use by IDEs, and is not used by
CMake itself. IDEs that use this field should expand any macros in it.
``cacheVariables``
-
An optional map of cache variables. The key is the variable name (which
may not be an empty string), and the value is either ``null``, a boolean
(which is equivalent to a value of ``"TRUE"`` or ``"FALSE"`` and a type
@@ -271,11 +264,9 @@ that may contain the following fields:
supports `macro expansion`_), or an object with the following fields:
``type``
-
An optional string representing the type of the variable.
``value``
-
A required string or boolean representing the value of the variable.
A boolean is equivalent to ``"TRUE"`` or ``"FALSE"``. This field
supports `macro expansion`_.
@@ -288,7 +279,6 @@ that may contain the following fields:
a value was inherited from another preset.
``environment``
-
An optional map of environment variables. The key is the variable name
(which may not be an empty string), and the value is either ``null`` or
a string representing the value of the variable. Each variable is set
@@ -306,73 +296,68 @@ that may contain the following fields:
a value was inherited from another preset.
``warnings``
-
An optional object specifying the warnings to enable. The object may
contain the following fields:
``dev``
-
- An optional boolean. Equivalent to passing ``-Wdev`` or ``-Wno-dev``
- on the command line. This may not be set to ``false`` if ``errors.dev``
- is set to ``true``.
+ An optional boolean. Equivalent to passing :option:`-Wdev <cmake -Wdev>`
+ or :option:`-Wno-dev <cmake -Wno-dev>` on the command line. This may not
+ be set to ``false`` if ``errors.dev`` is set to ``true``.
``deprecated``
-
- An optional boolean. Equivalent to passing ``-Wdeprecated`` or
- ``-Wno-deprecated`` on the command line. This may not be set to
- ``false`` if ``errors.deprecated`` is set to ``true``.
+ An optional boolean. Equivalent to passing
+ :option:`-Wdeprecated <cmake -Wdeprecated>` or
+ :option:`-Wno-deprecated <cmake -Wno-deprecated>` on the command line.
+ This may not be set to ``false`` if ``errors.deprecated`` is set to
+ ``true``.
``uninitialized``
-
An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--warn-uninitialized`` on the command line.
+ :option:`--warn-uninitialized <cmake --warn-uninitialized>` on the command
+ line.
``unusedCli``
-
An optional boolean. Setting this to ``false`` is equivalent to passing
- ``--no-warn-unused-cli`` on the command line.
+ :option:`--no-warn-unused-cli <cmake --no-warn-unused-cli>` on the command
+ line.
``systemVars``
-
An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--check-system-vars`` on the command line.
+ :option:`--check-system-vars <cmake --check-system-vars>` on the command
+ line.
``errors``
-
An optional object specifying the errors to enable. The object may
contain the following fields:
``dev``
-
- An optional boolean. Equivalent to passing ``-Werror=dev`` or
- ``-Wno-error=dev`` on the command line. This may not be set to ``true``
- if ``warnings.dev`` is set to ``false``.
+ An optional boolean. Equivalent to passing :option:`-Werror=dev <cmake -Werror>`
+ or :option:`-Wno-error=dev <cmake -Werror>` on the command line.
+ This may not be set to ``true`` if ``warnings.dev`` is set to ``false``.
``deprecated``
-
- An optional boolean. Equivalent to passing ``-Werror=deprecated`` or
- ``-Wno-error=deprecated`` on the command line. This may not be set to
- ``true`` if ``warnings.deprecated`` is set to ``false``.
+ An optional boolean. Equivalent to passing
+ :option:`-Werror=deprecated <cmake -Werror>` or
+ :option:`-Wno-error=deprecated <cmake -Werror>` on the command line.
+ This may not be set to ``true`` if ``warnings.deprecated`` is set to
+ ``false``.
``debug``
-
An optional object specifying debug options. The object may contain the
following fields:
``output``
-
An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--debug-output`` on the command line.
+ :option:`--debug-output <cmake --debug-output>` on the command line.
``tryCompile``
-
An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--debug-trycompile`` on the command line.
+ :option:`--debug-trycompile <cmake --debug-trycompile>` on the command
+ line.
``find``
-
An optional boolean. Setting this to ``true`` is equivalent to passing
- ``--debug-find`` on the command line.
+ :option:`--debug-find <cmake --debug-find>` on the command line.
Build Preset
^^^^^^^^^^^^
@@ -381,24 +366,23 @@ Each entry of the ``buildPresets`` array is a JSON object
that may contain the following fields:
``name``
-
A required string representing the machine-friendly name of the preset.
This identifier is used in the
:ref:`cmake --build --preset <Build Tool Mode>` option.
There must not be two build presets in the union of ``CMakePresets.json``
and ``CMakeUserPresets.json`` in the same directory with the same name.
- However, a build preset may have the same name as a configure or test preset.
+ However, a build preset may have the same name as a configure, test,
+ package, or workflow preset.
``hidden``
-
An optional boolean specifying whether or not a preset should be hidden.
- If a preset is hidden, it cannot be used in the ``--preset`` argument
+ If a preset is hidden, it cannot be used in the
+ :option:`--preset <cmake --preset>` argument
and does not have to have a valid ``configurePreset``, even from
inheritance. ``hidden`` presets are intended to be used as a base for
other presets to inherit via the ``inherits`` field.
``inherits``
-
An optional array of strings representing the names of presets to inherit
from. This field can also be a string, which is equivalent to an array
containing one string.
@@ -407,7 +391,7 @@ that may contain the following fields:
``inherits`` presets by default (except ``name``, ``hidden``,
``inherits``, ``description``, and ``displayName``), but can override
them as desired. If multiple ``inherits`` presets provide conflicting
- values for the same field, the earlier preset in the ``inherits`` list
+ values for the same field, the earlier preset in the ``inherits`` array
will be preferred.
A preset can only inherit from another preset that is defined in the
@@ -416,12 +400,10 @@ that may contain the following fields:
``CMakeUserPresets.json``.
``condition``
-
An optional `Condition`_ object. This is allowed in preset files specifying
version ``3`` or above.
``vendor``
-
An optional map containing vendor-specific information. CMake does not
interpret the contents of this field except to verify that it is a map
if it does exist. However, it should follow the same conventions as the
@@ -430,15 +412,12 @@ that may contain the following fields:
when appropriate.
``displayName``
-
An optional string with a human-friendly name of the preset.
``description``
-
An optional string with a human-friendly description of the preset.
``environment``
-
An optional map of environment variables. The key is the variable name
(which may not be an empty string), and the value is either ``null`` or
a string representing the value of the variable. Each variable is set
@@ -469,7 +448,6 @@ that may contain the following fields:
project.
``configurePreset``
-
An optional string specifying the name of a configure preset to
associate with this build preset. If ``configurePreset`` is not
specified, it must be inherited from the inherits preset (unless this
@@ -478,36 +456,30 @@ that may contain the following fields:
configuration did.
``inheritConfigureEnvironment``
-
An optional boolean that defaults to true. If true, the environment
variables from the associated configure preset are inherited after all
inherited build preset environments, but before environment variables
explicitly specified in this build preset.
``jobs``
-
- An optional integer. Equivalent to passing ``--parallel`` or ``-j`` on
- the command line.
+ An optional integer. Equivalent to passing
+ :option:`--parallel <cmake--build --parallel>` or ``-j`` on the command line.
``targets``
-
An optional string or array of strings. Equivalent to passing
- ``--target`` or ``-t`` on the command line. Vendors may ignore the
- targets property or hide build presets that explicitly specify targets.
- This field supports macro expansion.
+ :option:`--target <cmake--build --target>` or ``-t`` on the command line.
+ Vendors may ignore the targets property or hide build presets that
+ explicitly specify targets. This field supports macro expansion.
``configuration``
-
- An optional string. Equivalent to passing ``--config`` on the command
- line.
+ An optional string. Equivalent to passing
+ :option:`--config <cmake--build --config>` on the command line.
``cleanFirst``
-
- An optional bool. If true, equivalent to passing ``--clean-first`` on
- the command line.
+ An optional bool. If true, equivalent to passing
+ :option:`--clean-first <cmake--build --clean-first>` on the command line.
``resolvePackageReferences``
-
An optional string that specifies the package resolve mode. This is
allowed in preset files specifying version ``4`` or above.
@@ -517,24 +489,23 @@ that may contain the following fields:
package references, this option does nothing. Valid values are:
``on``
-
Causes package references to be resolved before attempting a build.
``off``
-
Package references will not be resolved. Note that this may cause
errors in some build environments, such as .NET SDK style projects.
``only``
-
Only resolve package references, but do not perform a build.
.. note::
- The command line parameter ``--resolve-package-references`` will take
- priority over this setting. If the command line parameter is not provided
- and this setting is not specified, an environment-specific cache variable
- will be evaluated to decide, if package restoration should be performed.
+ The command line parameter
+ :option:`--resolve-package-references <cmake--build --resolve-package-references>`
+ will take priority over this setting. If the command line parameter is not
+ provided and this setting is not specified, an environment-specific cache
+ variable will be evaluated to decide, if package restoration should be
+ performed.
When using the Visual Studio generator, package references are defined
using the :prop_tgt:`VS_PACKAGE_REFERENCES` property. Package references
@@ -543,12 +514,10 @@ that may contain the following fields:
done from within a configure preset.
``verbose``
-
- An optional bool. If true, equivalent to passing ``--verbose`` on the
- command line.
+ An optional bool. If true, equivalent to passing
+ :option:`--verbose <cmake--build --verbose>` on the command line.
``nativeToolOptions``
-
An optional array of strings. Equivalent to passing options after ``--``
on the command line. The array values support macro expansion.
@@ -559,23 +528,22 @@ Each entry of the ``testPresets`` array is a JSON object
that may contain the following fields:
``name``
-
A required string representing the machine-friendly name of the preset.
- This identifier is used in the :ref:`ctest --preset <CTest Options>` option.
+ This identifier is used in the :option:`ctest --preset` option.
There must not be two test presets in the union of ``CMakePresets.json``
and ``CMakeUserPresets.json`` in the same directory with the same name.
- However, a test preset may have the same name as a configure or build preset.
+ However, a test preset may have the same name as a configure, build,
+ package, or workflow preset.
``hidden``
-
An optional boolean specifying whether or not a preset should be hidden.
- If a preset is hidden, it cannot be used in the ``--preset`` argument
+ If a preset is hidden, it cannot be used in the
+ :option:`--preset <ctest --preset>` argument
and does not have to have a valid ``configurePreset``, even from
inheritance. ``hidden`` presets are intended to be used as a base for
other presets to inherit via the ``inherits`` field.
``inherits``
-
An optional array of strings representing the names of presets to inherit
from. This field can also be a string, which is equivalent to an array
containing one string.
@@ -584,7 +552,7 @@ that may contain the following fields:
``inherits`` presets by default (except ``name``, ``hidden``,
``inherits``, ``description``, and ``displayName``), but can override
them as desired. If multiple ``inherits`` presets provide conflicting
- values for the same field, the earlier preset in the ``inherits`` list
+ values for the same field, the earlier preset in the ``inherits`` array
will be preferred.
A preset can only inherit from another preset that is defined in the
@@ -593,12 +561,10 @@ that may contain the following fields:
``CMakeUserPresets.json``.
``condition``
-
An optional `Condition`_ object. This is allowed in preset files specifying
version ``3`` or above.
``vendor``
-
An optional map containing vendor-specific information. CMake does not
interpret the contents of this field except to verify that it is a map
if it does exist. However, it should follow the same conventions as the
@@ -607,15 +573,12 @@ that may contain the following fields:
when appropriate.
``displayName``
-
An optional string with a human-friendly name of the preset.
``description``
-
An optional string with a human-friendly description of the preset.
``environment``
-
An optional map of environment variables. The key is the variable name
(which may not be an empty string), and the value is either ``null`` or
a string representing the value of the variable. Each variable is set
@@ -633,7 +596,6 @@ that may contain the following fields:
even if a value was inherited from another preset.
``configurePreset``
-
An optional string specifying the name of a configure preset to
associate with this test preset. If ``configurePreset`` is not
specified, it must be inherited from the inherits preset (unless this
@@ -642,233 +604,210 @@ that may contain the following fields:
configuration did and build did.
``inheritConfigureEnvironment``
-
An optional boolean that defaults to true. If true, the environment
variables from the associated configure preset are inherited after all
inherited test preset environments, but before environment variables
explicitly specified in this test preset.
``configuration``
-
- An optional string. Equivalent to passing ``--build-config`` on the
- command line.
+ An optional string. Equivalent to passing
+ :option:`--build-config <ctest --build-config>` on the command line.
``overwriteConfigurationFile``
-
An optional array of configuration options to overwrite options
specified in the CTest configuration file. Equivalent to passing
- ``--overwrite`` for each value in the array. The array values
- support macro expansion.
+ :option:`--overwrite <ctest --overwrite>` for each value in the array.
+ The array values support macro expansion.
``output``
-
An optional object specifying output options. The object may contain the
following fields.
``shortProgress``
-
- An optional bool. If true, equivalent to passing ``--progress`` on the
- command line.
+ An optional bool. If true, equivalent to passing
+ :option:`--progress <ctest --progress>` on the command line.
``verbosity``
-
An optional string specifying verbosity level. Must be one of the
following:
``default``
-
Equivalent to passing no verbosity flags on the command line.
``verbose``
-
- Equivalent to passing ``--verbose`` on the command line.
+ Equivalent to passing :option:`--verbose <ctest --verbose>` on
+ the command line.
``extra``
-
- Equivalent to passing ``--extra-verbose`` on the command line.
+ Equivalent to passing :option:`--extra-verbose <ctest --extra-verbose>`
+ on the command line.
``debug``
-
- An optional bool. If true, equivalent to passing ``--debug`` on the
- command line.
+ An optional bool. If true, equivalent to passing
+ :option:`--debug <ctest --debug>` on the command line.
``outputOnFailure``
-
An optional bool. If true, equivalent to passing
- ``--output-on-failure`` on the command line.
+ :option:`--output-on-failure <ctest --output-on-failure>` on the command
+ line.
``quiet``
-
- An optional bool. If true, equivalent to passing ``--quiet`` on the
- command line.
+ An optional bool. If true, equivalent to passing
+ :option:`--quiet <ctest --quiet>` on the command line.
``outputLogFile``
-
An optional string specifying a path to a log file. Equivalent to
- passing ``--output-log`` on the command line. This field supports
- macro expansion.
+ passing :option:`--output-log <ctest --output-log>` on the command line.
+ This field supports macro expansion.
- ``labelSummary``
+ ``outputJUnitFile``
+ An optional string specifying a path to a JUnit file. Equivalent to
+ passing :option:`--output-junit <ctest --output-junit>` on the command line.
+ This field supports macro expansion. This is allowed in preset files
+ specifying version ``6`` or above.
+ ``labelSummary``
An optional bool. If false, equivalent to passing
- ``--no-label-summary`` on the command line.
+ :option:`--no-label-summary <ctest --no-label-summary>` on the command
+ line.
``subprojectSummary``
-
An optional bool. If false, equivalent to passing
- ``--no-subproject-summary`` on the command line.
+ :option:`--no-subproject-summary <ctest --no-subproject-summary>`
+ on the command line.
``maxPassedTestOutputSize``
-
An optional integer specifying the maximum output for passed tests in
- bytes. Equivalent to passing ``--test-output-size-passed`` on the
- command line.
+ bytes. Equivalent to passing
+ :option:`--test-output-size-passed <ctest --test-output-size-passed>`
+ on the command line.
``maxFailedTestOutputSize``
-
An optional integer specifying the maximum output for failed tests in
- bytes. Equivalent to passing ``--test-output-size-failed`` on the
- command line.
+ bytes. Equivalent to passing
+ :option:`--test-output-size-failed <ctest --test-output-size-failed>`
+ on the command line.
``testOutputTruncation``
-
An optional string specifying the test output truncation mode. Equivalent
- to passing ``--test-output-truncation`` on the command line."
- This is allowed in preset files specifying version ``5`` or above.
+ to passing
+ :option:`--test-output-truncation <ctest --test-output-truncation>` on
+ the command line. This is allowed in preset files specifying version
+ ``5`` or above.
``maxTestNameWidth``
-
An optional integer specifying the maximum width of a test name to
- output. Equivalent to passing ``--max-width`` on the command line.
+ output. Equivalent to passing :option:`--max-width <ctest --max-width>`
+ on the command line.
``filter``
-
An optional object specifying how to filter the tests to run. The object
may contain the following fields.
``include``
-
An optional object specifying which tests to include. The object may
contain the following fields.
``name``
-
An optional string specifying a regex for test names. Equivalent to
- passing ``--tests-regex`` on the command line. This field supports
- macro expansion. CMake regex syntax is described under
- :ref:`string(REGEX) <Regex Specification>`.
-
+ passing :option:`--tests-regex <ctest --tests-regex>` on the command
+ line. This field supports macro expansion. CMake regex syntax is
+ described under :ref:`string(REGEX) <Regex Specification>`.
``label``
-
An optional string specifying a regex for test labels. Equivalent to
- passing ``--label-regex`` on the command line. This field supports
- macro expansion.
+ passing :option:`--label-regex <ctest --label-regex>` on the command
+ line. This field supports macro expansion.
``useUnion``
-
- An optional bool. Equivalent to passing ``--union`` on the command
- line.
+ An optional bool. Equivalent to passing :option:`--union <ctest --union>`
+ on the command line.
``index``
-
An optional object specifying tests to include by test index. The
object may contain the following fields. Can also be an optional
string specifying a file with the command line syntax for
- ``--tests-information``. If specified as a string, this field
- supports macro expansion.
+ :option:`--tests-information <ctest --tests-information>`.
+ If specified as a string, this field supports macro expansion.
``start``
-
An optional integer specifying a test index to start testing at.
``end``
-
An optional integer specifying a test index to stop testing at.
``stride``
-
An optional integer specifying the increment.
``specificTests``
-
An optional array of integers specifying specific test indices to
run.
``exclude``
-
An optional object specifying which tests to exclude. The object may
contain the following fields.
``name``
-
An optional string specifying a regex for test names. Equivalent to
- passing ``--exclude-regex`` on the command line. This field supports
- macro expansion.
+ passing :option:`--exclude-regex <ctest --exclude-regex>` on the
+ command line. This field supports macro expansion.
``label``
-
An optional string specifying a regex for test labels. Equivalent to
- passing ``--label-exclude`` on the command line. This field supports
- macro expansion.
+ passing :option:`--label-exclude <ctest --label-exclude>` on the
+ command line. This field supports macro expansion.
``fixtures``
-
An optional object specifying which fixtures to exclude from adding
tests. The object may contain the following fields.
``any``
-
An optional string specifying a regex for text fixtures to exclude
- from adding any tests. Equivalent to ``--fixture-exclude-any`` on
+ from adding any tests. Equivalent to
+ :option:`--fixture-exclude-any <ctest --fixture-exclude-any>` on
the command line. This field supports macro expansion.
``setup``
-
An optional string specifying a regex for text fixtures to exclude
- from adding setup tests. Equivalent to ``--fixture-exclude-setup``
+ from adding setup tests. Equivalent to
+ :option:`--fixture-exclude-setup <ctest --fixture-exclude-setup>`
on the command line. This field supports macro expansion.
``cleanup``
-
An optional string specifying a regex for text fixtures to exclude
from adding cleanup tests. Equivalent to
- ``--fixture-exclude-cleanup`` on the command line. This field
- supports macro expansion.
+ :option:`--fixture-exclude-cleanup <ctest --fixture-exclude-cleanup>`
+ on the command line. This field supports macro expansion.
``execution``
-
An optional object specifying options for test execution. The object may
contain the following fields.
``stopOnFailure``
-
- An optional bool. If true, equivalent to passing ``--stop-on-failure``
- on the command line.
+ An optional bool. If true, equivalent to passing
+ :option:`--stop-on-failure <ctest --stop-on-failure>` on the command
+ line.
``enableFailover``
-
- An optional bool. If true, equivalent to passing ``-F`` on the command
- line.
+ An optional bool. If true, equivalent to passing :option:`-F <ctest -F>`
+ on the command line.
``jobs``
-
- An optional integer. Equivalent to passing ``--parallel`` on the
- command line.
+ An optional integer. Equivalent to passing
+ :option:`--parallel <ctest --parallel>` on the command line.
``resourceSpecFile``
-
- An optional string. Equivalent to passing ``--resource-spec-file`` on
+ An optional string. Equivalent to passing
+ :option:`--resource-spec-file <ctest --resource-spec-file>` on
the command line. This field supports macro expansion.
``testLoad``
-
- An optional integer. Equivalent to passing ``--test-load`` on the
- command line.
+ An optional integer. Equivalent to passing
+ :option:`--test-load <ctest --test-load>` on the command line.
``showOnly``
-
- An optional string. Equivalent to passing ``--show-only`` on the
+ An optional string. Equivalent to passing
+ :option:`--show-only <ctest --show-only>` on the
command line. The string must be one of the following values:
``human``
@@ -876,13 +815,11 @@ that may contain the following fields:
``json-v1``
``repeat``
-
An optional object specifying how to repeat tests. Equivalent to
- passing ``--repeat`` on the command line. The object must have the
- following fields.
+ passing :option:`--repeat <ctest --repeat>` on the command line.
+ The object must have the following fields.
``mode``
-
A required string. Must be one of the following values:
``until-fail``
@@ -892,42 +829,204 @@ that may contain the following fields:
``after-timeout``
``count``
-
A required integer.
``interactiveDebugging``
-
An optional bool. If true, equivalent to passing
- ``--interactive-debug-mode 1`` on the command line. If false,
- equivalent to passing ``--interactive-debug-mode 0`` on the command
- line.
+ :option:`--interactive-debug-mode 1 <ctest --interactive-debug-mode>`
+ on the command line. If false, equivalent to passing
+ :option:`--interactive-debug-mode 0 <ctest --interactive-debug-mode>`
+ on the command line.
``scheduleRandom``
-
- An optional bool. If true, equivalent to passing ``--schedule-random``
- on the command line.
+ An optional bool. If true, equivalent to passing
+ :option:`--schedule-random <ctest --schedule-random>` on the command
+ line.
``timeout``
-
- An optional integer. Equivalent to passing ``--timeout`` on the
- command line.
+ An optional integer. Equivalent to passing
+ :option:`--timeout <ctest --timeout>` on the command line.
``noTestsAction``
-
An optional string specifying the behavior if no tests are found. Must
be one of the following values:
``default``
-
Equivalent to not passing any value on the command line.
``error``
-
- Equivalent to passing ``--no-tests=error`` on the command line.
+ Equivalent to passing :option:`--no-tests=error <ctest --no-tests>`
+ on the command line.
``ignore``
+ Equivalent to passing :option:`--no-tests=ignore <ctest --no-tests>`
+ on the command line.
+
+Package Preset
+^^^^^^^^^^^^^^
+
+Package presets may be used in schema version ``6`` or above. Each entry of
+the ``packagePresets`` array is a JSON object that may contain the following
+fields:
+
+``name``
+ A required string representing the machine-friendly name of the preset.
+ This identifier is used in the :option:`cpack --preset` option.
+ There must not be two package presets in the union of ``CMakePresets.json``
+ and ``CMakeUserPresets.json`` in the same directory with the same name.
+ However, a package preset may have the same name as a configure, build,
+ test, or workflow preset.
+
+``hidden``
+ An optional boolean specifying whether or not a preset should be hidden.
+ If a preset is hidden, it cannot be used in the
+ :option:`--preset <cpack --preset>` argument
+ and does not have to have a valid ``configurePreset``, even from
+ inheritance. ``hidden`` presets are intended to be used as a base for
+ other presets to inherit via the ``inherits`` field.
+
+``inherits``
+ An optional array of strings representing the names of presets to inherit
+ from. This field can also be a string, which is equivalent to an array
+ containing one string.
+
+ The preset will inherit all of the fields from the
+ ``inherits`` presets by default (except ``name``, ``hidden``,
+ ``inherits``, ``description``, and ``displayName``), but can override
+ them as desired. If multiple ``inherits`` presets provide conflicting
+ values for the same field, the earlier preset in the ``inherits`` array
+ will be preferred.
+
+ A preset can only inherit from another preset that is defined in the
+ same file or in one of the files it includes (directly or indirectly).
+ Presets in ``CMakePresets.json`` may not inherit from presets in
+ ``CMakeUserPresets.json``.
+
+``condition``
+ An optional `Condition`_ object.
+
+``vendor``
+ An optional map containing vendor-specific information. CMake does not
+ interpret the contents of this field except to verify that it is a map
+ if it does exist. However, it should follow the same conventions as the
+ root-level ``vendor`` field. If vendors use their own per-preset
+ ``vendor`` field, they should implement inheritance in a sensible manner
+ when appropriate.
+
+``displayName``
+ An optional string with a human-friendly name of the preset.
- Equivalent to passing ``--no-tests=ignore`` on the command line.
+``description``
+ An optional string with a human-friendly description of the preset.
+
+``environment``
+ An optional map of environment variables. The key is the variable name
+ (which may not be an empty string), and the value is either ``null`` or
+ a string representing the value of the variable. Each variable is set
+ regardless of whether or not a value was given to it by the process's
+ environment. This field supports macro expansion, and environment
+ variables in this map may reference each other, and may be listed in any
+ order, as long as such references do not cause a cycle (for example, if
+ ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
+
+ Environment variables are inherited through the ``inherits`` field, and
+ the preset's environment will be the union of its own ``environment``
+ and the ``environment`` from all its parents. If multiple presets in
+ this union define the same variable, the standard rules of ``inherits``
+ are applied. Setting a variable to ``null`` causes it to not be set,
+ even if a value was inherited from another preset.
+
+``configurePreset``
+ An optional string specifying the name of a configure preset to
+ associate with this package preset. If ``configurePreset`` is not
+ specified, it must be inherited from the inherits preset (unless this
+ preset is hidden). The build directory is inferred from the configure
+ preset, so packaging will run in the same ``binaryDir`` that the
+ configuration did and build did.
+
+``inheritConfigureEnvironment``
+ An optional boolean that defaults to true. If true, the environment
+ variables from the associated configure preset are inherited after all
+ inherited package preset environments, but before environment variables
+ explicitly specified in this package preset.
+
+``generators``
+ An optional array of strings representing generators for CPack to use.
+
+``configurations``
+ An optional array of strings representing build configurations for CPack to
+ package.
+
+``variables``
+ An optional map of variables to pass to CPack, equivalent to
+ :option:`-D <cpack -D>` arguments. Each key is the name of a variable, and
+ the value is the string to assign to that variable.
+
+``configFile``
+ An optional string representing the config file for CPack to use.
+
+``output``
+ An optional object specifying output options. Valid keys are:
+
+ ``debug``
+ An optional boolean specifying whether or not to print debug information.
+ A value of ``true`` is equivalent to passing
+ :option:`--debug <cpack --debug>` on the command line.
+
+ ``verbose``
+ An optional boolean specifying whether or not to print verbosely. A value
+ of ``true`` is equivalent to passing :option:`--verbose <cpack --verbose>`
+ on the command line.
+
+``packageName``
+ An optional string representing the package name.
+
+``packageVersion``
+ An optional string representing the package version.
+
+``packageDirectory``
+ An optional string representing the directory in which to place the package.
+
+``vendorName``
+ An optional string representing the vendor name.
+
+.. _`Workflow Preset`:
+
+Workflow Preset
+^^^^^^^^^^^^^^^
+
+Workflow presets may be used in schema version ``6`` or above. Each entry of
+the ``workflowPresets`` array is a JSON object that may contain the following
+fields:
+
+``name``
+ A required string representing the machine-friendly name of the preset.
+ This identifier is used in the
+ :ref:`cmake --workflow --preset <Workflow Mode>` option. There must not be
+ two workflow presets in the union of ``CMakePresets.json`` and
+ ``CMakeUserPresets.json`` in the same directory with the same name. However,
+ a workflow preset may have the same name as a configure, build, test, or
+ package preset.
+
+``displayName``
+ An optional string with a human-friendly name of the preset.
+
+``description``
+ An optional string with a human-friendly description of the preset.
+
+``steps``
+ A required array of objects describing the steps of the workflow. The first
+ step must be a configure preset, and all subsequent steps must be non-
+ configure presets whose ``configurePreset`` field matches the starting
+ configure preset. Each object may contain the following fields:
+
+ ``type``
+ A required string. The first step must be ``configure``. Subsequent steps
+ must be either ``build``, ``test``, or ``package``.
+
+ ``name``
+ A required string representing the name of the configure, build, test, or
+ package preset to run as this workflow step.
Condition
^^^^^^^^^
@@ -943,65 +1042,53 @@ a ``not``, ``anyOf``, or ``allOf`` condition) may not be ``null``. If it is an
object, it has the following fields:
``type``
-
A required string with one of the following values:
``"const"``
-
Indicates that the condition is constant. This is equivalent to using a
boolean in place of the object. The condition object will have the
following additional fields:
``value``
-
A required boolean which provides a constant value for the condition's
evaluation.
``"equals"``
``"notEquals"``
-
Indicates that the condition compares two strings to see if they are equal
(or not equal). The condition object will have the following additional
fields:
``lhs``
-
First string to compare. This field supports macro expansion.
``rhs``
-
Second string to compare. This field supports macro expansion.
``"inList"``
``"notInList"``
-
Indicates that the condition searches for a string in a list of strings.
The condition object will have the following additional fields:
``string``
-
A required string to search for. This field supports macro expansion.
``list``
-
- A required list of strings to search. This field supports macro
+ A required array of strings to search. This field supports macro
expansion, and uses short-circuit evaluation.
``"matches"``
``"notMatches"``
-
Indicates that the condition searches for a regular expression in a string.
The condition object will have the following additional fields:
``string``
-
A required string to search. This field supports macro expansion.
``regex``
-
A required regular expression to search for. This field supports macro
expansion.
@@ -1013,17 +1100,14 @@ object, it has the following fields:
conditions. The condition object will have the following additional fields:
``conditions``
-
A required array of condition objects. These conditions use short-circuit
evaluation.
``"not"``
-
Indicates that the condition is an inversion of another condition. The
condition object will have the following additional fields:
``condition``
-
A required condition object.
Macro Expansion
@@ -1045,46 +1129,37 @@ interpreted as a literal dollar sign.
Recognized macros include:
``${sourceDir}``
-
Path to the project source directory (i.e. the same as
:variable:`CMAKE_SOURCE_DIR`).
``${sourceParentDir}``
-
Path to the project source directory's parent directory.
``${sourceDirName}``
-
The last filename component of ``${sourceDir}``. For example, if
``${sourceDir}`` is ``/path/to/source``, this would be ``source``.
``${presetName}``
-
Name specified in the preset's ``name`` field.
``${generator}``
-
Generator specified in the preset's ``generator`` field. For build and
test presets, this will evaluate to the generator specified by
``configurePreset``.
``${hostSystemName}``
-
The name of the host operating system. Contains the same value as
:variable:`CMAKE_HOST_SYSTEM_NAME`. This is allowed in preset files
specifying version ``3`` or above.
``${fileDir}``
-
Path to the directory containing the preset file which contains the macro.
This is allowed in preset files specifying version ``4`` or above.
``${dollar}``
-
A literal dollar sign (``$``).
``${pathListSep}``
-
Native character for separating lists of paths, such as ``:`` or ``;``.
For example, by setting ``PATH`` to
@@ -1095,7 +1170,6 @@ Recognized macros include:
This is allowed in preset files specifying version ``5`` or above.
``$env{<variable-name>}``
-
Environment variable with name ``<variable-name>``. The variable name may
not be an empty string. If the variable is defined in the ``environment``
field, that value is used instead of the value from the parent environment.
@@ -1108,7 +1182,6 @@ Recognized macros include:
the casing of environment variable names consistent.
``$penv{<variable-name>}``
-
Similar to ``$env{<variable-name>}``, except that the value only comes from
the parent environment, and never from the ``environment`` field. This
allows you to prepend or append values to existing environment variables.
@@ -1118,7 +1191,6 @@ Recognized macros include:
references.
``$vendor{<macro-name>}``
-
An extension point for vendors to insert their own macros. CMake will not
be able to use presets which have a ``$vendor{<macro-name>}`` macro, and
effectively ignores such presets. However, it will still be able to use
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index d88322c..b17be82 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -90,6 +90,7 @@ Properties on Directories
/prop_dir/RULE_LAUNCH_LINK
/prop_dir/SOURCE_DIR
/prop_dir/SUBDIRECTORIES
+ /prop_dir/SYSTEM
/prop_dir/TESTS
/prop_dir/TEST_INCLUDE_FILES
/prop_dir/VARIABLES
@@ -184,6 +185,16 @@ Properties on Targets
/prop_tgt/CUDA_STANDARD
/prop_tgt/CUDA_STANDARD_REQUIRED
/prop_tgt/CXX_EXTENSIONS
+ /prop_tgt/CXX_MODULE_DIRS
+ /prop_tgt/CXX_MODULE_DIRS_NAME
+ /prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS
+ /prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS_NAME
+ /prop_tgt/CXX_MODULE_HEADER_UNIT_SET
+ /prop_tgt/CXX_MODULE_HEADER_UNIT_SET_NAME
+ /prop_tgt/CXX_MODULE_HEADER_UNIT_SETS
+ /prop_tgt/CXX_MODULE_SET
+ /prop_tgt/CXX_MODULE_SET_NAME
+ /prop_tgt/CXX_MODULE_SETS
/prop_tgt/CXX_STANDARD
/prop_tgt/CXX_STANDARD_REQUIRED
/prop_tgt/DEBUG_POSTFIX
@@ -202,6 +213,7 @@ Properties on Targets
/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD_CONFIG
/prop_tgt/EXPORT_COMPILE_COMMANDS
/prop_tgt/EXPORT_NAME
+ /prop_tgt/EXPORT_NO_SYSTEM
/prop_tgt/EXPORT_PROPERTIES
/prop_tgt/FOLDER
/prop_tgt/Fortran_BUILDING_INSTRINSIC_MODULES
@@ -262,6 +274,8 @@ Properties on Targets
/prop_tgt/INTERFACE_COMPILE_DEFINITIONS
/prop_tgt/INTERFACE_COMPILE_FEATURES
/prop_tgt/INTERFACE_COMPILE_OPTIONS
+ /prop_tgt/INTERFACE_CXX_MODULE_HEADER_UNIT_SETS
+ /prop_tgt/INTERFACE_CXX_MODULE_SETS
/prop_tgt/INTERFACE_HEADER_SETS
/prop_tgt/INTERFACE_HEADER_SETS_TO_VERIFY
/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES
@@ -327,6 +341,7 @@ Properties on Targets
/prop_tgt/MACOSX_RPATH
/prop_tgt/MANUALLY_ADDED_DEPENDENCIES
/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG
+ /prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT
/prop_tgt/MSVC_RUNTIME_LIBRARY
/prop_tgt/NAME
/prop_tgt/NO_SONAME
@@ -342,8 +357,8 @@ Properties on Targets
/prop_tgt/OSX_ARCHITECTURES_CONFIG
/prop_tgt/OUTPUT_NAME
/prop_tgt/OUTPUT_NAME_CONFIG
- /prop_tgt/PCH_WARN_INVALID
/prop_tgt/PCH_INSTANTIATE_TEMPLATES
+ /prop_tgt/PCH_WARN_INVALID
/prop_tgt/PDB_NAME
/prop_tgt/PDB_NAME_CONFIG
/prop_tgt/PDB_OUTPUT_DIRECTORY
@@ -375,6 +390,7 @@ Properties on Targets
/prop_tgt/Swift_LANGUAGE_VERSION
/prop_tgt/Swift_MODULE_DIRECTORY
/prop_tgt/Swift_MODULE_NAME
+ /prop_tgt/SYSTEM
/prop_tgt/TYPE
/prop_tgt/UNITY_BUILD
/prop_tgt/UNITY_BUILD_BATCH_SIZE
@@ -444,13 +460,17 @@ Properties on Targets
/prop_tgt/XCODE_SCHEME_ARGUMENTS
/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT
/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
- /prop_tgt/XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
+ /prop_tgt/XCODE_SCHEME_ENABLE_GPU_API_VALIDATION
+ /prop_tgt/XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
+ /prop_tgt/XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION
/prop_tgt/XCODE_SCHEME_ENVIRONMENT
/prop_tgt/XCODE_SCHEME_EXECUTABLE
/prop_tgt/XCODE_SCHEME_GUARD_MALLOC
+ /prop_tgt/XCODE_SCHEME_LAUNCH_CONFIGURATION
+ /prop_tgt/XCODE_SCHEME_LAUNCH_MODE
/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES
/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index f156f95..d0d6ea0 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -14,7 +14,7 @@ CMake can find and use Qt 4 and Qt 5 libraries. The Qt 4 libraries are found
by the :module:`FindQt4` find-module shipped with CMake, whereas the
Qt 5 libraries are found using "Config-file Packages" shipped with Qt 5. See
:manual:`cmake-packages(7)` for more information about CMake packages, and
-see `the Qt cmake manual <http://qt-project.org/doc/qt-5/cmake-manual.html>`_
+see `the Qt cmake manual <https://contribute.qt-project.org/doc/qt-5/cmake-manual.html>`_
for your Qt version.
Qt 4 and Qt 5 may be used together in the same
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index e194df0..8a83807 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -17,6 +17,9 @@ determines the toolchain for host builds based on system introspection and
defaults. In cross-compiling scenarios, a toolchain file may be specified
with information about compiler and utility paths.
+.. versionadded:: 3.19
+ One may use :manual:`cmake-presets(7)` to specify toolchain files.
+
Languages
=========
@@ -58,20 +61,24 @@ Variables and Properties
========================
Several variables relate to the language components of a toolchain which are
-enabled. :variable:`CMAKE_<LANG>_COMPILER` is the full path to the compiler used
-for ``<LANG>``. :variable:`CMAKE_<LANG>_COMPILER_ID` is the identifier used
-by CMake for the compiler and :variable:`CMAKE_<LANG>_COMPILER_VERSION` is the
-version of the compiler.
-
-The :variable:`CMAKE_<LANG>_FLAGS` variables and the configuration-specific
-equivalents contain flags that will be added to the compile command when
-compiling a file of a particular language.
-
-As the linker is invoked by the compiler driver, CMake needs a way to determine
-which compiler to use to invoke the linker. This is calculated by the
-:prop_sf:`LANGUAGE` of source files in the target, and in the case of static
-libraries, the language of the dependent libraries. The choice CMake makes may
-be overridden with the :prop_tgt:`LINKER_LANGUAGE` target property.
+enabled:
+
+:variable:`CMAKE_<LANG>_COMPILER`
+ The full path to the compiler used for ``<LANG>``
+:variable:`CMAKE_<LANG>_COMPILER_ID`
+ The compiler identifier used by CMake
+:variable:`CMAKE_<LANG>_COMPILER_VERSION`
+ The version of the compiler.
+:variable:`CMAKE_<LANG>_FLAGS`
+ The variables and the configuration-specific equivalents contain flags that
+ will be added to the compile command when compiling a file of a particular
+ language.
+
+CMake needs a way to determine which compiler to use to invoke the linker.
+This is determined by the :prop_sf:`LANGUAGE` property of source files of the
+:manual:`target <cmake-buildsystem(7)>`, and in the case of static libraries,
+the ``LANGUAGE`` of the dependent libraries. The choice CMake makes may be overridden
+with the :prop_tgt:`LINKER_LANGUAGE` target property.
Toolchain Features
==================
@@ -96,7 +103,8 @@ Cross Compiling
===============
If :manual:`cmake(1)` is invoked with the command line parameter
-``--toolchain path/to/file`` or ``-DCMAKE_TOOLCHAIN_FILE=path/to/file``, the
+:option:`--toolchain path/to/file <cmake --toolchain>` or
+:option:`-DCMAKE_TOOLCHAIN_FILE=path/to/file <cmake -D>`, the
file will be loaded early to set values for the compilers.
The :variable:`CMAKE_CROSSCOMPILING` variable is set to true when CMake is
cross-compiling.
@@ -132,24 +140,24 @@ as:
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
-The :variable:`CMAKE_SYSTEM_NAME` is the CMake-identifier of the target platform
-to build for.
-
-The :variable:`CMAKE_SYSTEM_PROCESSOR` is the CMake-identifier of the target architecture
-to build for.
+Where:
-The :variable:`CMAKE_SYSROOT` is optional, and may be specified if a sysroot
-is available.
-
-The :variable:`CMAKE_STAGING_PREFIX` is also optional. It may be used to specify
-a path on the host to install to. The :variable:`CMAKE_INSTALL_PREFIX` is always
-the runtime installation location, even when cross-compiling.
-
-The :variable:`CMAKE_<LANG>_COMPILER` variables may be set to full paths, or to
-names of compilers to search for in standard locations. For toolchains that
-do not support linking binaries without custom flags or scripts one may set
-the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to ``STATIC_LIBRARY``
-to tell CMake not to try to link executables during its checks.
+:variable:`CMAKE_SYSTEM_NAME`
+ is the CMake-identifier of the target platform to build for.
+:variable:`CMAKE_SYSTEM_PROCESSOR`
+ is the CMake-identifier of the target architecture.
+:variable:`CMAKE_SYSROOT`
+ is optional, and may be specified if a sysroot is available.
+:variable:`CMAKE_STAGING_PREFIX`
+ is also optional. It may be used to specify a path on the host to install to.
+ The :variable:`CMAKE_INSTALL_PREFIX` is always the runtime installation
+ location, even when cross-compiling.
+:variable:`CMAKE_<LANG>_COMPILER`
+ variable may be set to full paths, or to names of compilers to search for
+ in standard locations. For toolchains that do not support linking binaries
+ without custom flags or scripts one may set the
+ :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to ``STATIC_LIBRARY`` to
+ tell CMake not to try to link executables during its checks.
CMake ``find_*`` commands will look in the sysroot, and the :variable:`CMAKE_FIND_ROOT_PATH`
entries by default in all cases, as well as looking in the host system root prefix.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 7c8a7fa..cd46615 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -128,9 +128,9 @@ Variables that Provide Information
/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR
/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION
- /variable/CMAKE_VS_TARGET_FRAMEWORK_VERSION
/variable/CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER
/variable/CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION
+ /variable/CMAKE_VS_TARGET_FRAMEWORK_VERSION
/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM
/variable/CMAKE_XCODE_BUILD_SYSTEM
@@ -207,9 +207,9 @@ Variables that Change Behavior
/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH
- /variable/CMAKE_FIND_USE_INSTALL_PREFIX
/variable/CMAKE_FIND_USE_CMAKE_PATH
/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH
+ /variable/CMAKE_FIND_USE_INSTALL_PREFIX
/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY
/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH
/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH
@@ -228,12 +228,12 @@ Variables that Change Behavior
/variable/CMAKE_LIBRARY_PATH
/variable/CMAKE_LINK_DIRECTORIES_BEFORE
/variable/CMAKE_LINK_LIBRARIES_ONLY_TARGETS
- /variable/CMAKE_MFC_FLAG
/variable/CMAKE_MAXIMUM_RECURSION_DEPTH
/variable/CMAKE_MESSAGE_CONTEXT
/variable/CMAKE_MESSAGE_CONTEXT_SHOW
/variable/CMAKE_MESSAGE_INDENT
/variable/CMAKE_MESSAGE_LOG_LEVEL
+ /variable/CMAKE_MFC_FLAG
/variable/CMAKE_MODULE_PATH
/variable/CMAKE_POLICY_DEFAULT_CMPNNNN
/variable/CMAKE_POLICY_WARNING_CMPNNNN
@@ -272,12 +272,16 @@ Variables that Change Behavior
/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER
/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
- /variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
+ /variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION
+ /variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE
+ /variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION
/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT
/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC
+ /variable/CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION
+ /variable/CMAKE_XCODE_SCHEME_LAUNCH_MODE
/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE
@@ -300,10 +304,13 @@ Variables that Describe the System
/variable/ANDROID
/variable/APPLE
/variable/BORLAND
+ /variable/BSD
/variable/CMAKE_ANDROID_NDK_VERSION
/variable/CMAKE_CL_64
/variable/CMAKE_COMPILER_2005
/variable/CMAKE_HOST_APPLE
+ /variable/CMAKE_HOST_BSD
+ /variable/CMAKE_HOST_LINUX
/variable/CMAKE_HOST_SOLARIS
/variable/CMAKE_HOST_SYSTEM
/variable/CMAKE_HOST_SYSTEM_NAME
@@ -321,6 +328,7 @@ Variables that Describe the System
/variable/CYGWIN
/variable/GHSMULTI
/variable/IOS
+ /variable/LINUX
/variable/MINGW
/variable/MSVC
/variable/MSVC10
@@ -412,19 +420,19 @@ Variables that Control the Build
/variable/CMAKE_DEBUG_POSTFIX
/variable/CMAKE_DEFAULT_BUILD_TYPE
/variable/CMAKE_DEFAULT_CONFIGS
- /variable/CMAKE_DISABLE_PRECOMPILE_HEADERS
/variable/CMAKE_DEPENDS_USE_COMPILER
+ /variable/CMAKE_DISABLE_PRECOMPILE_HEADERS
/variable/CMAKE_ENABLE_EXPORTS
/variable/CMAKE_EXE_LINKER_FLAGS
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT
/variable/CMAKE_EXE_LINKER_FLAGS_INIT
/variable/CMAKE_FOLDER
- /variable/CMAKE_FRAMEWORK
- /variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG
/variable/CMAKE_Fortran_FORMAT
/variable/CMAKE_Fortran_MODULE_DIRECTORY
/variable/CMAKE_Fortran_PREPROCESS
+ /variable/CMAKE_FRAMEWORK
+ /variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG
/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE
/variable/CMAKE_GLOBAL_AUTOGEN_TARGET
/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
@@ -445,14 +453,14 @@ Variables that Control the Build
/variable/CMAKE_LANG_CPPCHECK
/variable/CMAKE_LANG_CPPLINT
/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE
- /variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE
- /variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE_SUPPORTED
- /variable/CMAKE_LANG_LINKER_LAUNCHER
/variable/CMAKE_LANG_LINK_GROUP_USING_FEATURE
/variable/CMAKE_LANG_LINK_GROUP_USING_FEATURE_SUPPORTED
/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG
/variable/CMAKE_LANG_LINK_LIBRARY_FLAG
+ /variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE
+ /variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE_SUPPORTED
/variable/CMAKE_LANG_LINK_WHAT_YOU_USE_FLAG
+ /variable/CMAKE_LANG_LINKER_LAUNCHER
/variable/CMAKE_LANG_VISIBILITY_PRESET
/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY
/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG
@@ -475,8 +483,9 @@ Variables that Control the Build
/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG
/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT
/variable/CMAKE_MODULE_LINKER_FLAGS_INIT
- /variable/CMAKE_MSVCIDE_RUN_PATH
+ /variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
/variable/CMAKE_MSVC_RUNTIME_LIBRARY
+ /variable/CMAKE_MSVCIDE_RUN_PATH
/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX
/variable/CMAKE_NO_BUILTIN_CHRPATH
/variable/CMAKE_NO_SYSTEM_FROM_IMPORTED
@@ -484,8 +493,8 @@ Variables that Control the Build
/variable/CMAKE_OSX_ARCHITECTURES
/variable/CMAKE_OSX_DEPLOYMENT_TARGET
/variable/CMAKE_OSX_SYSROOT
- /variable/CMAKE_PCH_WARN_INVALID
/variable/CMAKE_PCH_INSTANTIATE_TEMPLATES
+ /variable/CMAKE_PCH_WARN_INVALID
/variable/CMAKE_PDB_OUTPUT_DIRECTORY
/variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_PLATFORM_NO_VERSIONED_SONAME
@@ -502,6 +511,7 @@ Variables that Control the Build
/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG
/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT
/variable/CMAKE_STATIC_LINKER_FLAGS_INIT
+ /variable/CMAKE_TASKING_TOOLSET
/variable/CMAKE_TRY_COMPILE_CONFIGURATION
/variable/CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES
/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
@@ -538,6 +548,10 @@ Variables for Languages
.. toctree::
:maxdepth: 1
+ /variable/CMAKE_C_COMPILE_FEATURES
+ /variable/CMAKE_C_EXTENSIONS
+ /variable/CMAKE_C_STANDARD
+ /variable/CMAKE_C_STANDARD_REQUIRED
/variable/CMAKE_COMPILER_IS_GNUCC
/variable/CMAKE_COMPILER_IS_GNUCXX
/variable/CMAKE_COMPILER_IS_GNUG77
@@ -552,10 +566,6 @@ Variables for Languages
/variable/CMAKE_CXX_EXTENSIONS
/variable/CMAKE_CXX_STANDARD
/variable/CMAKE_CXX_STANDARD_REQUIRED
- /variable/CMAKE_C_COMPILE_FEATURES
- /variable/CMAKE_C_EXTENSIONS
- /variable/CMAKE_C_STANDARD
- /variable/CMAKE_C_STANDARD_REQUIRED
/variable/CMAKE_Fortran_MODDIR_DEFAULT
/variable/CMAKE_Fortran_MODDIR_FLAG
/variable/CMAKE_Fortran_MODOUT_FLAG
@@ -573,6 +583,7 @@ Variables for Languages
/variable/CMAKE_LANG_ARCHIVE_CREATE
/variable/CMAKE_LANG_ARCHIVE_FINISH
/variable/CMAKE_LANG_BYTE_ORDER
+ /variable/CMAKE_LANG_COMPILE_OBJECT
/variable/CMAKE_LANG_COMPILER
/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN
/variable/CMAKE_LANG_COMPILER_ID
@@ -580,7 +591,6 @@ Variables for Languages
/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND
/variable/CMAKE_LANG_COMPILER_TARGET
/variable/CMAKE_LANG_COMPILER_VERSION
- /variable/CMAKE_LANG_COMPILE_OBJECT
/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY
/variable/CMAKE_LANG_CREATE_SHARED_MODULE
/variable/CMAKE_LANG_CREATE_STATIC_LIBRARY
@@ -653,12 +663,12 @@ Variables for CTest
/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS
/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS
/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
- /variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION
/variable/CTEST_CUSTOM_MEMCHECK_IGNORE
/variable/CTEST_CUSTOM_POST_MEMCHECK
/variable/CTEST_CUSTOM_POST_TEST
/variable/CTEST_CUSTOM_PRE_MEMCHECK
/variable/CTEST_CUSTOM_PRE_TEST
+ /variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION
/variable/CTEST_CUSTOM_TESTS_IGNORE
/variable/CTEST_CUSTOM_WARNING_EXCEPTION
/variable/CTEST_CUSTOM_WARNING_MATCH
@@ -694,9 +704,9 @@ Variables for CTest
/variable/CTEST_SCP_COMMAND
/variable/CTEST_SCRIPT_DIRECTORY
/variable/CTEST_SITE
+ /variable/CTEST_SOURCE_DIRECTORY
/variable/CTEST_SUBMIT_INACTIVITY_TIMEOUT
/variable/CTEST_SUBMIT_URL
- /variable/CTEST_SOURCE_DIRECTORY
/variable/CTEST_SVN_COMMAND
/variable/CTEST_SVN_OPTIONS
/variable/CTEST_SVN_UPDATE_OPTIONS
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 38105dd..b31ad11 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -9,8 +9,7 @@ Synopsis
.. parsed-literal::
`Generate a Project Buildsystem`_
- cmake [<options>] <path-to-source>
- cmake [<options>] <path-to-existing-build>
+ cmake [<options>] <path-to-source | path-to-existing-build>
cmake [<options>] -S <path-to-source> -B <path-to-build>
`Build a Project`_
@@ -23,7 +22,7 @@ Synopsis
cmake --open <dir>
`Run a Script`_
- cmake [{-D <var>=<value>}...] -P <cmake-script-file>
+ cmake [-D <var>=<value>]... -P <cmake-script-file>
`Run a Command-Line Tool`_
cmake -E <command> [<options>]
@@ -31,6 +30,9 @@ Synopsis
`Run the Find-Package Tool`_
cmake --find-package [<options>]
+ `Run a Workflow Preset`_
+ cmake --workflow [<options>]
+
`View Help`_
cmake --help[-<topic>]
@@ -96,9 +98,10 @@ Build Tree
Generator
This chooses the kind of buildsystem to generate. See the
:manual:`cmake-generators(7)` manual for documentation of all generators.
- Run ``cmake --help`` to see a list of generators available locally.
- Optionally use the ``-G`` option below to specify a generator, or simply
- accept the default CMake chooses for the current platform.
+ Run :option:`cmake --help` to see a list of generators available locally.
+ Optionally use the :option:`-G <cmake -G>` option below to specify a
+ generator, or simply accept the default CMake chooses for the current
+ platform.
When using one of the :ref:`Command-Line Build Tool Generators`
CMake expects that the environment needed by the compiler toolchain
@@ -139,6 +142,9 @@ source and build trees and generate a buildsystem:
$ cmake .
``cmake [<options>] -S <path-to-source> -B <path-to-build>``
+
+ .. versionadded:: 3.13
+
Uses ``<path-to-build>`` as the build tree and ``<path-to-source>``
as the source tree. The specified paths may be absolute or relative
to the current working directory. The source tree must contain a
@@ -152,11 +158,11 @@ source and build trees and generate a buildsystem:
In all cases the ``<options>`` may be zero or more of the `Options`_ below.
The above styles for specifying the source and build trees may be mixed.
-Paths specified with ``-S`` or ``-B`` are always classified as source or
-build trees, respectively. Paths specified with plain arguments are
-classified based on their content and the types of paths given earlier.
-If only one type of path is given, the current working directory (cwd)
-is used for the other. For example:
+Paths specified with :option:`-S <cmake -S>` or :option:`-B <cmake -B>`
+are always classified as source or build trees, respectively. Paths
+specified with plain arguments are classified based on their content
+and the types of paths given earlier. If only one type of path is given,
+the current working directory (cwd) is used for the other. For example:
============================== ============ ===========
Command Line Source Dir Build Dir
@@ -195,51 +201,60 @@ automatically choosing and invoking the appropriate native build tool.
Options
-------
+.. program:: cmake
+
.. include:: OPTIONS_BUILD.txt
-``--fresh``
+.. option:: --fresh
+
.. versionadded:: 3.24
Perform a fresh configuration of the build tree.
This removes any existing ``CMakeCache.txt`` file and associated
``CMakeFiles/`` directory, and recreates them from scratch.
-``-L[A][H]``
+.. option:: -L[A][H]
+
List non-advanced cached variables.
List ``CACHE`` variables will run CMake and list all the variables from
the CMake ``CACHE`` that are not marked as ``INTERNAL`` or :prop_cache:`ADVANCED`.
This will effectively display current CMake settings, which can then be
- changed with ``-D`` option. Changing some of the variables may result
- in more variables being created. If ``A`` is specified, then it will
- display also advanced variables. If ``H`` is specified, it will also
+ changed with :option:`-D <cmake -D>` option. Changing some of the variables
+ may result in more variables being created. If ``A`` is specified, then it
+ will display also advanced variables. If ``H`` is specified, it will also
display help for each variable.
-``-N``
+.. option:: -N
+
View mode only.
Only load the cache. Do not actually run configure and generate
steps.
-``--graphviz=[file]``
+.. option:: --graphviz=<file>
+
Generate graphviz of dependencies, see :module:`CMakeGraphVizOptions` for more.
Generate a graphviz input file that will contain all the library and
executable dependencies in the project. See the documentation for
:module:`CMakeGraphVizOptions` for more details.
-``--system-information [file]``
+.. option:: --system-information [file]
+
Dump information about this system.
Dump a wide range of information about the current system. If run
from the top of a binary tree for a CMake project it will dump
additional information such as the cache, log files etc.
-``--log-level=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>``
- Set the log level.
+.. option:: --log-level=<level>
+
+ Set the log ``<level>``.
The :command:`message` command will only output messages of the specified
- log level or higher. The default log level is ``STATUS``.
+ log level or higher. The valid log levels are ``ERROR``, ``WARNING``,
+ ``NOTICE``, ``STATUS`` (default), ``VERBOSE``, ``DEBUG``, or ``TRACE``.
To make a log level persist between CMake runs, set
:variable:`CMAKE_MESSAGE_LOG_LEVEL` as a cache variable instead.
@@ -249,7 +264,12 @@ Options
For backward compatibility reasons, ``--loglevel`` is also accepted as a
synonym for this option.
-``--log-context``
+ .. versionadded:: 3.25
+ See the :command:`cmake_language` command for a way to
+ :ref:`query the current message logging level <query_message_log_level>`.
+
+.. option:: --log-context
+
Enable the :command:`message` command outputting context attached to each
message.
@@ -259,24 +279,36 @@ Options
When this command line option is given, :variable:`CMAKE_MESSAGE_CONTEXT_SHOW`
is ignored.
-``--debug-trycompile``
- Do not delete the :command:`try_compile` build tree.
- Only useful on one :command:`try_compile` at a time.
+.. option:: --debug-trycompile
+
+ Do not delete the files and directories created for
+ :command:`try_compile` / :command:`try_run` calls.
+ This is useful in debugging failed checks.
+
+ Note that some uses of :command:`try_compile` may use the same build tree,
+ which will limit the usefulness of this option if a project executes more
+ than one :command:`try_compile`. For example, such uses may change results
+ as artifacts from a previous try-compile may cause a different test to either
+ pass or fail incorrectly. This option is best used only when debugging.
+
+ (With respect to the preceding, the :command:`try_run` command
+ is effectively a :command:`try_compile`. Any combination of the two
+ is subject to the potential issues described.)
- Do not delete the files and directories created for :command:`try_compile`
- calls. This is useful in debugging failed try_compiles. It may
- however change the results of the try-compiles as old junk from a
- previous try-compile may cause a different test to either pass or
- fail incorrectly. This option is best used for one try-compile at a
- time, and only when debugging.
+ .. versionadded:: 3.25
+
+ When this option is enabled, every try-compile check prints a log
+ message reporting the directory in which the check is performed.
+
+.. option:: --debug-output
-``--debug-output``
Put cmake in a debug mode.
Print extra information during the cmake run like stack traces with
:command:`message(SEND_ERROR)` calls.
-``--debug-find``
+.. option:: --debug-find
+
Put cmake find commands in a debug mode.
Print extra find call information during the cmake run to standard
@@ -284,32 +316,39 @@ Options
See also the :variable:`CMAKE_FIND_DEBUG_MODE` variable for debugging
a more local part of the project.
-``--debug-find-pkg=<pkg>[,...]``
+.. option:: --debug-find-pkg=<pkg>[,...]
+
Put cmake find commands in a debug mode when running under calls
to :command:`find_package(\<pkg\>) <find_package>`, where ``<pkg>``
is an entry in the given comma-separated list of case-sensitive package
names.
- Like ``--debug-find``, but limiting scope to the specified packages.
+ Like :option:`--debug-find <cmake --debug-find>`, but limiting scope
+ to the specified packages.
+
+.. option:: --debug-find-var=<var>[,...]
-``--debug-find-var=<var>[,...]``
Put cmake find commands in a debug mode when called with ``<var>``
as the result variable, where ``<var>`` is an entry in the given
comma-separated list.
- Like ``--debug-find``, but limiting scope to the specified variable names.
+ Like :option:`--debug-find <cmake --debug-find>`, but limiting scope
+ to the specified variable names.
+
+.. option:: --trace
-``--trace``
Put cmake in trace mode.
Print a trace of all calls made and from where.
-``--trace-expand``
+.. option:: --trace-expand
+
Put cmake in trace mode.
- Like ``--trace``, but with variables expanded.
+ Like :option:`--trace <cmake --trace>`, but with variables expanded.
+
+.. option:: --trace-format=<format>
-``--trace-format=<format>``
Put cmake in trace mode and sets the trace output format.
``<format>`` can be one of the following values.
@@ -395,46 +434,57 @@ Options
Indicates the version of the JSON format. The version has a
major and minor components following semantic version conventions.
-``--trace-source=<file>``
+.. option:: --trace-source=<file>
+
Put cmake in trace mode, but output only lines of a specified file.
Multiple options are allowed.
-``--trace-redirect=<file>``
+.. option:: --trace-redirect=<file>
+
Put cmake in trace mode and redirect trace output to a file instead of stderr.
-``--warn-uninitialized``
+.. option:: --warn-uninitialized
+
Warn about uninitialized values.
Print a warning when an uninitialized variable is used.
-``--warn-unused-vars``
+.. option:: --warn-unused-vars
+
Does nothing. In CMake versions 3.2 and below this enabled warnings about
unused variables. In CMake versions 3.3 through 3.18 the option was broken.
In CMake 3.19 and above the option has been removed.
-``--no-warn-unused-cli``
+.. option:: --no-warn-unused-cli
+
Don't warn about command line options.
Don't find variables that are declared on the command line, but not
used.
-``--check-system-vars``
+.. option:: --check-system-vars
+
Find problems with variable usage in system files.
Normally, unused and uninitialized variables are searched for only
in :variable:`CMAKE_SOURCE_DIR` and :variable:`CMAKE_BINARY_DIR`.
This flag tells CMake to warn about other files as well.
-``--compile-no-warning-as-error``
+.. option:: --compile-no-warning-as-error
+
Ignore target property :prop_tgt:`COMPILE_WARNING_AS_ERROR` and variable
:variable:`CMAKE_COMPILE_WARNING_AS_ERROR`, preventing warnings from being
treated as errors on compile.
-``--profiling-output=<path>``
- Used in conjunction with ``--profiling-format`` to output to a given path.
+.. option:: --profiling-output=<path>
+
+ Used in conjunction with
+ :option:`--profiling-format <cmake --profiling-format>` to output to a
+ given path.
+
+.. option:: --profiling-format=<file>
-``--profiling-format=<file>``
Enable the output of profiling data of CMake script in the given format.
This can aid performance analysis of CMake scripts executed. Third party
@@ -445,7 +495,8 @@ Options
about:tracing tab of Google Chrome or using a plugin for a tool like Trace
Compass.
-``--preset <preset>``, ``--preset=<preset>``
+.. option:: --preset <preset>, --preset=<preset>
+
Reads a :manual:`preset <cmake-presets(7)>` from
``<path-to-source>/CMakePresets.json`` and
``<path-to-source>/CMakeUserPresets.json``. The preset may specify the
@@ -461,15 +512,20 @@ Options
a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a
``-D`` argument, the value ``2`` is preferred.
-``--list-presets, --list-presets=<[configure | build | test | all]>``
- Lists the available presets. If no option is specified only configure presets
- will be listed. The current working directory must contain CMake preset files.
+.. option:: --list-presets[=<type>]
+
+ Lists the available presets of the specified ``<type>``. Valid values for
+ ``<type>`` are ``configure``, ``build``, ``test``, ``package``, or ``all``.
+ If ``<type>`` is omitted, ``configure`` is assumed. The current working
+ directory must contain CMake preset files.
.. _`Build Tool Mode`:
Build a Project
===============
+.. program:: cmake
+
CMake provides a command-line signature to build an already-generated
project binary tree:
@@ -481,21 +537,29 @@ project binary tree:
This abstracts a native build tool's command-line interface with the
following options:
-``--build <dir>``
+.. option:: --build <dir>
+
Project binary directory to be built. This is required (unless a preset
is specified) and must be first.
-``--preset <preset>``, ``--preset=<preset>``
+.. program:: cmake--build
+
+.. option:: --preset <preset>, --preset=<preset>
+
Use a build preset to specify build options. The project binary directory
is inferred from the ``configurePreset`` key. The current working directory
must contain CMake preset files.
See :manual:`preset <cmake-presets(7)>` for more details.
-``--list-presets``
+.. option:: --list-presets
+
Lists the available build presets. The current working directory must
contain CMake preset files.
-``--parallel [<jobs>], -j [<jobs>]``
+.. option:: -j [<jobs>], --parallel [<jobs>]
+
+ .. versionadded:: 3.12
+
The maximum number of concurrent processes to use when building.
If ``<jobs>`` is omitted the native build tool's default number is used.
@@ -505,24 +569,29 @@ following options:
Some native build tools always build in parallel. The use of ``<jobs>``
value of ``1`` can be used to limit to a single job.
-``--target <tgt>..., -t <tgt>...``
+.. option:: -t <tgt>..., --target <tgt>...
+
Build ``<tgt>`` instead of the default target. Multiple targets may be
given, separated by spaces.
-``--config <cfg>``
+.. option:: --config <cfg>
+
For multi-configuration tools, choose configuration ``<cfg>``.
-``--clean-first``
+.. option:: --clean-first
+
Build target ``clean`` first, then build.
- (To clean only, use ``--target clean``.)
+ (To clean only, use :option:`--target clean <cmake--build --target>`.)
+
+.. option:: --resolve-package-references=<value>
-``--resolve-package-references=<on|off|only>``
.. versionadded:: 3.23
Resolve remote package references from external package managers (e.g. NuGet)
- before build. When set to ``on`` (default), packages will be restored before
- building a target. When set to ``only``, the packages will be restored, but no
- build will be performed. When set to ``off``, no packages will be restored.
+ before build. When ``<value>`` is set to ``on`` (default), packages will be
+ restored before building a target. When ``<value>`` is set to ``only``, the
+ packages will be restored, but no build will be performed. When
+ ``<value>`` is set to ``off``, no packages will be restored.
If the target does not define any package references, this option does nothing.
@@ -539,10 +608,12 @@ following options:
are restored using NuGet. It can be disabled by setting the
``CMAKE_VS_NUGET_PACKAGE_RESTORE`` variable to ``OFF``.
-``--use-stderr``
+.. option:: --use-stderr
+
Ignored. Behavior is default in CMake >= 3.0.
-``--verbose, -v``
+.. option:: -v, --verbose
+
Enable verbose output - if supported - including the build commands to be
executed.
@@ -550,14 +621,17 @@ following options:
:variable:`CMAKE_VERBOSE_MAKEFILE` cached variable is set.
-``--``
+.. option:: --
+
Pass remaining options to the native tool.
-Run ``cmake --build`` with no options for quick help.
+Run :option:`cmake --build` with no options for quick help.
Install a Project
=================
+.. program:: cmake
+
CMake provides a command-line signature to install an already-generated
project binary tree:
@@ -569,34 +643,45 @@ This may be used after building a project to run installation without
using the generated build system or the native build tool.
The options are:
-``--install <dir>``
+.. option:: --install <dir>
+
Project binary directory to install. This is required and must be first.
-``--config <cfg>``
+.. program:: cmake--install
+
+.. option:: --config <cfg>
+
For multi-configuration generators, choose configuration ``<cfg>``.
-``--component <comp>``
+.. option:: --component <comp>
+
Component-based install. Only install component ``<comp>``.
-``--default-directory-permissions <permissions>``
+.. option:: --default-directory-permissions <permissions>
+
Default directory install permissions. Permissions in format ``<u=rwx,g=rx,o=rx>``.
-``--prefix <prefix>``
+.. option:: --prefix <prefix>
+
Override the installation prefix, :variable:`CMAKE_INSTALL_PREFIX`.
-``--strip``
+.. option:: --strip
+
Strip before installing.
-``-v, --verbose``
+.. option:: -v, --verbose
+
Enable verbose output.
This option can be omitted if :envvar:`VERBOSE` environment variable is set.
-Run ``cmake --install`` with no options for quick help.
+Run :option:`cmake --install` with no options for quick help.
Open a Project
==============
+.. program:: cmake
+
.. code-block:: shell
cmake --open <dir>
@@ -610,14 +695,26 @@ supported by some generators.
Run a Script
============
+.. program:: cmake
+
.. code-block:: shell
- cmake [{-D <var>=<value>}...] -P <cmake-script-file> [-- <unparsed-options>...]
+ cmake [-D <var>=<value>]... -P <cmake-script-file> [-- <unparsed-options>...]
+
+.. program:: cmake-P
+
+.. option:: -D <var>=<value>
+
+ Define a variable for script mode.
-Process the given cmake file as a script written in the CMake
-language. No configure or generate step is performed and the cache
-is not modified. If variables are defined using ``-D``, this must be
-done before the ``-P`` argument.
+.. program:: cmake
+
+.. option:: -P <cmake-script-file>
+
+ Process the given cmake file as a script written in the CMake
+ language. No configure or generate step is performed and the cache
+ is not modified. If variables are defined using ``-D``, this must be
+ done before the ``-P`` argument.
Any options after ``--`` are not parsed by CMake, but they are still included
in the set of :variable:`CMAKE_ARGV<n> <CMAKE_ARGV0>` variables passed to the
@@ -629,16 +726,24 @@ script (including the ``--`` itself).
Run a Command-Line Tool
=======================
+.. program:: cmake
+
CMake provides builtin command-line tools through the signature
.. code-block:: shell
cmake -E <command> [<options>]
-Run ``cmake -E`` or ``cmake -E help`` for a summary of commands.
+.. option:: -E [help]
+
+ Run ``cmake -E`` or ``cmake -E help`` for a summary of commands.
+
+.. program:: cmake-E
+
Available commands are:
-``capabilities``
+.. option:: capabilities
+
.. versionadded:: 3.7
Report cmake capabilities in JSON format. The output is a JSON object
@@ -648,7 +753,7 @@ Available commands are:
A JSON object with version information. Keys are:
``string``
- The full version string as displayed by cmake ``--version``.
+ The full version string as displayed by cmake :option:`--version <cmake --version>`.
``major``
The major version number in integer form.
``minor``
@@ -675,7 +780,8 @@ Available commands are:
Optional member that may be present when the generator supports
platform specification via :variable:`CMAKE_GENERATOR_PLATFORM`
- (``-A ...``). The value is a list of platforms known to be supported.
+ (:option:`-A ... <cmake -A>`). The value is a list of platforms known to
+ be supported.
``extraGenerators``
A list of strings with all the extra generators compatible with
the generator.
@@ -700,30 +806,52 @@ Available commands are:
``true`` if cmake supports server-mode and ``false`` otherwise.
Always false since CMake 3.20.
-``cat [--] <files>...``
+ ``tls``
+ .. versionadded:: 3.25
+
+ ``true`` if TLS support is enabled and ``false`` otherwise.
+
+.. option:: cat [--] <files>...
+
.. versionadded:: 3.18
Concatenate files and print on the standard output.
- .. versionadded:: 3.24
+ .. program:: cmake-E_cat
+
+ .. option:: --
+
+ .. versionadded:: 3.24
+
Added support for the double dash argument ``--``. This basic implementation
of ``cat`` does not support any options, so using a option starting with
``-`` will result in an error. Use ``--`` to indicate the end of options, in
case a file starts with ``-``.
-``chdir <dir> <cmd> [<arg>...]``
+.. program:: cmake-E
+
+.. option:: chdir <dir> <cmd> [<arg>...]
+
Change the current working directory and run a command.
-``compare_files [--ignore-eol] <file1> <file2>``
+.. option:: compare_files [--ignore-eol] <file1> <file2>
+
Check if ``<file1>`` is same as ``<file2>``. If files are the same,
then returns ``0``, if not it returns ``1``. In case of invalid
arguments, it returns 2.
- .. versionadded:: 3.14
- The ``--ignore-eol`` option implies line-wise comparison and ignores
- LF/CRLF differences.
+ .. program:: cmake-E_compare_files
+
+ .. option:: --ignore-eol
+
+ .. versionadded:: 3.14
+
+ The option implies line-wise comparison and ignores LF/CRLF differences.
+
+.. program:: cmake-E
+
+.. option:: copy <file>... <destination>
-``copy <file>... <destination>``
Copy files to ``<destination>`` (either file or directory).
If multiple files are specified, the ``<destination>`` must be
directory and it must exist. Wildcards are not supported.
@@ -733,7 +861,8 @@ Available commands are:
.. versionadded:: 3.5
Support for multiple input files.
-``copy_directory <dir>... <destination>``
+.. option:: copy_directory <dir>... <destination>
+
Copy content of ``<dir>...`` directories to ``<destination>`` directory.
If ``<destination>`` directory does not exist it will be created.
``copy_directory`` does follow symlinks.
@@ -745,7 +874,8 @@ Available commands are:
The command now fails when the source directory does not exist.
Previously it succeeded by creating an empty destination directory.
-``copy_if_different <file>... <destination>``
+.. option:: copy_if_different <file>... <destination>
+
Copy files to ``<destination>`` (either file or directory) if
they have changed.
If multiple files are specified, the ``<destination>`` must be
@@ -755,7 +885,8 @@ Available commands are:
.. versionadded:: 3.5
Support for multiple input files.
-``create_symlink <old> <new>``
+.. option:: create_symlink <old> <new>
+
Create a symbolic link ``<new>`` naming ``<old>``.
.. versionadded:: 3.13
@@ -764,7 +895,8 @@ Available commands are:
.. note::
Path to where ``<new>`` symbolic link will be created has to exist beforehand.
-``create_hardlink <old> <new>``
+.. option:: create_hardlink <old> <new>
+
.. versionadded:: 3.19
Create a hard link ``<new>`` naming ``<old>``.
@@ -773,31 +905,65 @@ Available commands are:
Path to where ``<new>`` hard link will be created has to exist beforehand.
``<old>`` has to exist beforehand.
-``echo [<string>...]``
+.. option:: echo [<string>...]
+
Displays arguments as text.
-``echo_append [<string>...]``
+.. option:: echo_append [<string>...]
+
Displays arguments as text but no new line.
-``env [--unset=NAME ...] [NAME=VALUE ...] [--] <command> [<arg>...]``
+.. option:: env [<options>] [--] <command> [<arg>...]
+
.. versionadded:: 3.1
- Run command in a modified environment.
+ Run command in a modified environment. Options are:
+
+ .. program:: cmake-E_env
+
+ .. option:: NAME=VALUE
+
+ Replaces the current value of ``NAME`` with ``VALUE``.
+
+ .. option:: --unset=NAME
+
+ Unsets the current value of ``NAME``.
+
+ .. option:: --modify ENVIRONMENT_MODIFICATION
+
+ .. versionadded:: 3.25
+
+ Apply a single :prop_test:`ENVIRONMENT_MODIFICATION` operation to the
+ modified environment.
+
+ The ``NAME=VALUE`` and ``--unset=NAME`` options are equivalent to
+ ``--modify NAME=set:VALUE`` and ``--modify NAME=unset:``, respectively.
+ Note that ``--modify NAME=reset:`` resets ``NAME`` to the value it had
+ when ``cmake`` launched (or unsets it), not to the most recent
+ ``NAME=VALUE`` option.
+
+ .. option:: --
+
+ .. versionadded:: 3.24
- .. versionadded:: 3.24
Added support for the double dash argument ``--``. Use ``--`` to stop
interpreting options/environment variables and treat the next argument as
the command, even if it start with ``-`` or contains a ``=``.
-``environment``
+.. program:: cmake-E
+
+.. option:: environment
+
Display the current environment variables.
-``false``
+.. option:: false
+
.. versionadded:: 3.16
Do nothing, with an exit code of 1.
-``make_directory <dir>...``
+.. option:: make_directory <dir>...
+
Create ``<dir>`` directories. If necessary, create parent
directories too. If a directory already exists it will be
silently ignored.
@@ -805,13 +971,15 @@ Available commands are:
.. versionadded:: 3.5
Support for multiple input directories.
-``md5sum <file>...``
+.. option:: md5sum <file>...
+
Create MD5 checksum of files in ``md5sum`` compatible format::
351abe79cd3800b38cdfb25d45015a15 file1.txt
052f86c15bbde68af55c7f7b340ab639 file2.txt
-``sha1sum <file>...``
+.. option:: sha1sum <file>...
+
.. versionadded:: 3.10
Create SHA1 checksum of files in ``sha1sum`` compatible format::
@@ -819,7 +987,8 @@ Available commands are:
4bb7932a29e6f73c97bb9272f2bdc393122f86e0 file1.txt
1df4c8f318665f9a5f2ed38f55adadb7ef9f559c file2.txt
-``sha224sum <file>...``
+.. option:: sha224sum <file>...
+
.. versionadded:: 3.10
Create SHA224 checksum of files in ``sha224sum`` compatible format::
@@ -827,7 +996,8 @@ Available commands are:
b9b9346bc8437bbda630b0b7ddfc5ea9ca157546dbbf4c613192f930 file1.txt
6dfbe55f4d2edc5fe5c9197bca51ceaaf824e48eba0cc453088aee24 file2.txt
-``sha256sum <file>...``
+.. option:: sha256sum <file>...
+
.. versionadded:: 3.10
Create SHA256 checksum of files in ``sha256sum`` compatible format::
@@ -835,7 +1005,8 @@ Available commands are:
76713b23615d31680afeb0e9efe94d47d3d4229191198bb46d7485f9cb191acc file1.txt
15b682ead6c12dedb1baf91231e1e89cfc7974b3787c1e2e01b986bffadae0ea file2.txt
-``sha384sum <file>...``
+.. option:: sha384sum <file>...
+
.. versionadded:: 3.10
Create SHA384 checksum of files in ``sha384sum`` compatible format::
@@ -843,7 +1014,8 @@ Available commands are:
acc049fedc091a22f5f2ce39a43b9057fd93c910e9afd76a6411a28a8f2b8a12c73d7129e292f94fc0329c309df49434 file1.txt
668ddeb108710d271ee21c0f3acbd6a7517e2b78f9181c6a2ff3b8943af92b0195dcb7cce48aa3e17893173c0a39e23d file2.txt
-``sha512sum <file>...``
+.. option:: sha512sum <file>...
+
.. versionadded:: 3.10
Create SHA512 checksum of files in ``sha512sum`` compatible format::
@@ -851,7 +1023,8 @@ Available commands are:
2a78d7a6c5328cfb1467c63beac8ff21794213901eaadafd48e7800289afbc08e5fb3e86aa31116c945ee3d7bf2a6194489ec6101051083d1108defc8e1dba89 file1.txt
7a0b54896fe5e70cca6dd643ad6f672614b189bf26f8153061c4d219474b05dad08c4e729af9f4b009f1a1a280cb625454bf587c690f4617c27e3aebdf3b7a2d file2.txt
-``remove [-f] <file>...``
+.. option:: remove [-f] <file>...
+
.. deprecated:: 3.17
Remove the file(s). The planned behavior was that if any of the
@@ -864,7 +1037,8 @@ Available commands are:
The implementation was buggy and always returned 0. It cannot be fixed without
breaking backwards compatibility. Use ``rm`` instead.
-``remove_directory <dir>...``
+.. option:: remove_directory <dir>...
+
.. deprecated:: 3.17
Remove ``<dir>`` directories and their contents. If a directory does
@@ -877,11 +1051,13 @@ Available commands are:
.. versionadded:: 3.16
If ``<dir>`` is a symlink to a directory, just the symlink will be removed.
-``rename <oldname> <newname>``
+.. option:: rename <oldname> <newname>
+
Rename a file or directory (on one volume). If file with the ``<newname>`` name
already exists, then it will be silently replaced.
-``rm [-rRf] [--] <file|dir>...``
+.. option:: rm [-rRf] [--] <file|dir>...
+
.. versionadded:: 3.17
Remove the files ``<file>`` or directories ``<dir>``.
@@ -892,22 +1068,29 @@ Available commands are:
situations instead. Use ``--`` to stop interpreting options and treat all
remaining arguments as paths, even if they start with ``-``.
-``server``
+.. option:: server
+
Launch :manual:`cmake-server(7)` mode.
-``sleep <number>...``
+.. option:: sleep <number>...
+
.. versionadded:: 3.0
Sleep for given number of seconds.
-``tar [cxt][vf][zjJ] file.tar [<options>] [--] [<pathname>...]``
+.. option:: tar [cxt][vf][zjJ] file.tar [<options>] [--] [<pathname>...]
+
Create or extract a tar or zip archive. Options are:
- ``c``
+ .. program:: cmake-E_tar
+
+ .. option:: c
+
Create a new archive containing the specified files.
If used, the ``<pathname>...`` argument is mandatory.
- ``x``
+ .. option:: x
+
Extract to disk from the archive.
.. versionadded:: 3.15
@@ -916,33 +1099,40 @@ Available commands are:
When extracting selected files or directories, you must provide their exact
names including the path, as printed by list (``-t``).
- ``t``
+ .. option:: t
+
List archive contents.
.. versionadded:: 3.15
The ``<pathname>...`` argument could be used to list only selected files
or directories.
- ``v``
+ .. option:: v
+
Produce verbose output.
- ``z``
+ .. option:: z
+
Compress the resulting archive with gzip.
- ``j``
+ .. option:: j
+
Compress the resulting archive with bzip2.
- ``J``
+ .. option:: J
+
.. versionadded:: 3.1
Compress the resulting archive with XZ.
- ``--zstd``
+ .. option:: --zstd
+
.. versionadded:: 3.15
Compress the resulting archive with Zstandard.
- ``--files-from=<file>``
+ .. option:: --files-from=<file>
+
.. versionadded:: 3.1
Read file names from the given file, one per line.
@@ -950,25 +1140,29 @@ Available commands are:
except for ``--add-file=<name>`` to add files whose
names start in ``-``.
- ``--format=<format>``
+ .. option:: --format=<format>
+
.. versionadded:: 3.3
Specify the format of the archive to be created.
Supported formats are: ``7zip``, ``gnutar``, ``pax``,
``paxr`` (restricted pax, default), and ``zip``.
- ``--mtime=<date>``
+ .. option:: --mtime=<date>
+
.. versionadded:: 3.1
Specify modification time recorded in tarball entries.
- ``--touch``
+ .. option:: --touch
+
.. versionadded:: 3.24
Use current local timestamp instead of extracting file timestamps
from the archive.
- ``--``
+ .. option:: --
+
.. versionadded:: 3.1
Stop interpreting options and treat all remaining arguments
@@ -983,7 +1177,10 @@ Available commands are:
``tar`` tool. The command now also parses all flags, and if an invalid flag
was provided, a warning is issued.
-``time <command> [<args>...]``
+.. program:: cmake-E
+
+.. option:: time <command> [<args>...]
+
Run command and display elapsed time.
.. versionadded:: 3.5
@@ -991,15 +1188,18 @@ Available commands are:
through to the child process. This may break scripts that worked around the
bug with their own extra quoting or escaping.
-``touch <file>...``
+.. option:: touch <file>...
+
Creates ``<file>`` if file do not exist.
If ``<file>`` exists, it is changing ``<file>`` access and modification times.
-``touch_nocreate <file>...``
+.. option:: touch_nocreate <file>...
+
Touch a file if it exists but do not create it. If a file does
not exist it will be silently ignored.
-``true``
+.. option:: true
+
.. versionadded:: 3.16
Do nothing, with an exit code of 0.
@@ -1009,28 +1209,34 @@ Windows-specific Command-Line Tools
The following ``cmake -E`` commands are available only on Windows:
-``delete_regv <key>``
+.. option:: delete_regv <key>
+
Delete Windows registry value.
-``env_vs8_wince <sdkname>``
+.. option:: env_vs8_wince <sdkname>
+
.. versionadded:: 3.2
Displays a batch file which sets the environment for the provided
Windows CE SDK installed in VS2005.
-``env_vs9_wince <sdkname>``
+.. option:: env_vs9_wince <sdkname>
+
.. versionadded:: 3.2
Displays a batch file which sets the environment for the provided
Windows CE SDK installed in VS2008.
-``write_regv <key> <value>``
+.. option:: write_regv <key> <value>
+
Write Windows registry value.
Run the Find-Package Tool
=========================
+.. program:: cmake--find-package
+
CMake provides a pkg-config like helper for Makefile-based projects:
.. code-block:: shell
@@ -1046,10 +1252,51 @@ autoconf-based projects (via ``share/aclocal/cmake.m4``).
This mode is not well-supported due to some technical limitations.
It is kept for compatibility but should not be used in new projects.
+.. _`Workflow Mode`:
+
+Run a Workflow Preset
+=====================
+
+.. program:: cmake
+
+:manual:`CMake Presets <cmake-presets(7)>` provides a way to execute multiple
+build steps in order:
+
+.. code-block:: shell
+
+ cmake --workflow [<options>]
+
+The options are:
+
+.. option:: --workflow
+
+ Select a :ref:`Workflow Preset` using one of the following options.
+
+.. program:: cmake--workflow
+
+.. option:: --preset <preset>, --preset=<preset>
+
+ Use a workflow preset to specify a workflow. The project binary directory
+ is inferred from the initial configure preset. The current working directory
+ must contain CMake preset files.
+ See :manual:`preset <cmake-presets(7)>` for more details.
+
+.. option:: --list-presets
+
+ Lists the available workflow presets. The current working directory must
+ contain CMake preset files.
+
+.. option:: --fresh
+
+ Perform a fresh configuration of the build tree.
+ This removes any existing ``CMakeCache.txt`` file and associated
+ ``CMakeFiles/`` directory, and recreates them from scratch.
View Help
=========
+.. program:: cmake
+
To print selected pages from the CMake documentation, use
.. code-block:: shell
diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst
index 395cd41..3f26d72 100644
--- a/Help/manual/cpack.1.rst
+++ b/Help/manual/cpack.1.rst
@@ -26,12 +26,12 @@ All supported generators are specified in the :manual:`cpack-generators
<cpack-generators(7)>` manual. The command ``cpack --help`` prints a
list of generators supported for the target platform. Which of them are
to be used can be selected through the :variable:`CPACK_GENERATOR` variable
-or through the command-line option ``-G``.
+or through the command-line option :option:`-G <cpack -G>`.
The **cpack** program is steered by a configuration file written in the
:manual:`CMake language <cmake-language(7)>`. Unless chosen differently
-through the command-line option ``--config``, the file ``CPackConfig.cmake``
-in the current directory is used.
+through the command-line option :option:`--config <cpack --config>`, the
+file ``CPackConfig.cmake`` in the current directory is used.
In the standard CMake workflow, the file ``CPackConfig.cmake`` is generated
by the :manual:`cmake <cmake(1)>` executable, provided the :module:`CPack`
@@ -40,7 +40,10 @@ module is included by the project's ``CMakeLists.txt`` file.
Options
=======
-``-G <generators>``
+.. program:: cpack
+
+.. option:: -G <generators>
+
``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>`
of generator names. ``cpack`` will iterate through this list and produce
package(s) in that generator's format according to the details provided in
@@ -48,7 +51,8 @@ Options
the :variable:`CPACK_GENERATOR` variable determines the default set of
generators that will be used.
-``-C <configs>``
+.. option:: -C <configs>
+
Specify the project configuration(s) to be packaged (e.g. ``Debug``,
``Release``, etc.), where ``<configs>`` is a
:ref:`semicolon-separated list <CMake Language Lists>`.
@@ -58,36 +62,44 @@ Options
The user is responsible for ensuring that the configuration(s) listed
have already been built before invoking ``cpack``.
-``-D <var>=<value>``
+.. option:: -D <var>=<value>
+
Set a CPack variable. This will override any value set for ``<var>`` in the
input file read by ``cpack``.
-``--config <configFile>``
+.. option:: --config <configFile>
+
Specify the configuration file read by ``cpack`` to provide the packaging
details. By default, ``CPackConfig.cmake`` in the current directory will
be used.
-``--verbose, -V``
+.. option:: -V, --verbose
+
Run ``cpack`` with verbose output. This can be used to show more details
from the package generation tools and is suitable for project developers.
-``--debug``
+.. option:: --debug
+
Run ``cpack`` with debug output. This option is intended mainly for the
developers of ``cpack`` itself and is not normally needed by project
developers.
-``--trace``
+.. option:: --trace
+
Put the underlying cmake scripts in trace mode.
-``--trace-expand``
+.. option:: --trace-expand
+
Put the underlying cmake scripts in expanded trace mode.
-``-P <packageName>``
+.. option:: -P <packageName>
+
Override/define the value of the :variable:`CPACK_PACKAGE_NAME` variable used
for packaging. Any value set for this variable in the ``CPackConfig.cmake``
file will then be ignored.
-``-R <packageVersion>``
+.. option:: -R <packageVersion>
+
Override/define the value of the :variable:`CPACK_PACKAGE_VERSION`
variable used for packaging. It will override a value set in the
``CPackConfig.cmake`` file or one automatically computed from
@@ -95,16 +107,26 @@ Options
:variable:`CPACK_PACKAGE_VERSION_MINOR` and
:variable:`CPACK_PACKAGE_VERSION_PATCH`.
-``-B <packageDirectory>``
+.. option:: -B <packageDirectory>
+
Override/define :variable:`CPACK_PACKAGE_DIRECTORY`, which controls the
directory where CPack will perform its packaging work. The resultant
package(s) will be created at this location by default and a
``_CPack_Packages`` subdirectory will also be created below this directory to
use as a working area during package creation.
-``--vendor <vendorName>``
+.. option:: --vendor <vendorName>
+
Override/define :variable:`CPACK_PACKAGE_VENDOR`.
+.. option:: --preset <presetName>
+
+ Use a preset from :manual:`cmake-presets(7)`.
+
+.. option:: --list-presets
+
+ List presets from :manual:`cmake-presets(7)`.
+
.. include:: OPTIONS_HELP.txt
See Also
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 06f0d4e..3497a9f 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -10,12 +10,24 @@ Synopsis
.. parsed-literal::
- ctest [<options>]
- ctest --build-and-test <path-to-source> <path-to-build>
- --build-generator <generator> [<options>...]
- [--build-options <opts>...] [--test-command <command> [<args>...]]
- ctest {-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>}
- [-- <dashboard-options>...]
+ `Run Tests`_
+ ctest [<options>]
+
+ `Build and Test Mode`_
+ ctest --build-and-test <path-to-source> <path-to-build>
+ --build-generator <generator> [<options>...]
+ [--build-options <opts>...]
+ [--test-command <command> [<args>...]]
+
+ `Dashboard Client`_
+ ctest -D <dashboard> [-- <dashboard-options>...]
+ ctest -M <model> -T <action> [-- <dashboard-options>...]
+ ctest -S <script> [-- <dashboard-options>...]
+ ctest -SP <script> [-- <dashboard-options>...]
+
+ `View Help`_
+ ctest --help[-<topic>]
+
Description
===========
@@ -25,22 +37,27 @@ CMake-generated build trees created for projects that use the
:command:`enable_testing` and :command:`add_test` commands have testing support.
This program will run the tests and report results.
-.. _`CTest Options`:
+.. _`Run Tests`:
-Options
-=======
+Run Tests
+=========
+
+.. program:: ctest
+
+.. option:: --preset <preset>, --preset=<preset>
-``--preset <preset>``, ``--preset=<preset>``
Use a test preset to specify test options. The project binary directory
is inferred from the ``configurePreset`` key. The current working directory
must contain CMake preset files.
See :manual:`preset <cmake-presets(7)>` for more details.
-``--list-presets``
+.. option:: --list-presets
+
Lists the available test presets. The current working directory must contain
CMake preset files.
-``-C <cfg>, --build-config <cfg>``
+.. option:: -C <cfg>, --build-config <cfg>
+
Choose configuration to test.
Some CMake-generated build trees can have multiple build
@@ -48,7 +65,8 @@ Options
which one should be tested. Example configurations are ``Debug`` and
``Release``.
-``--progress``
+.. option:: --progress
+
Enable short progress output from tests.
When the output of **ctest** is being sent directly to a terminal, the
@@ -61,40 +79,47 @@ Options
This option can also be enabled by setting the environment variable
:envvar:`CTEST_PROGRESS_OUTPUT`.
-``-V,--verbose``
+.. option:: -V, --verbose
+
Enable verbose output from tests.
Test output is normally suppressed and only summary information is
displayed. This option will show all test output.
-``-VV,--extra-verbose``
+.. option:: -VV, --extra-verbose
+
Enable more verbose output from tests.
Test output is normally suppressed and only summary information is
displayed. This option will show even more test output.
-``--debug``
+.. option:: --debug
+
Displaying more verbose internals of CTest.
This feature will result in a large number of output that is mostly
useful for debugging dashboard problems.
-``--output-on-failure``
+.. option:: --output-on-failure
+
Output anything outputted by the test program if the test should fail.
This option can also be enabled by setting the
:envvar:`CTEST_OUTPUT_ON_FAILURE` environment variable
-``--stop-on-failure``
+.. option:: --stop-on-failure
+
Stop running the tests when the first failure happens.
-``-F``
+.. option:: -F
+
Enable failover.
This option allows CTest to resume a test set execution that was
previously interrupted. If no interruption occurred, the ``-F`` option
will have no effect.
-``-j <jobs>, --parallel <jobs>``
+.. option:: -j <jobs>, --parallel <jobs>
+
Run the tests in parallel using the given number of jobs.
This option tells CTest to run the tests in parallel using given
@@ -105,7 +130,8 @@ Options
See `Label and Subproject Summary`_.
-``--resource-spec-file <file>``
+.. option:: --resource-spec-file <file>
+
Run CTest with :ref:`resource allocation <ctest-resource-allocation>` enabled,
using the
:ref:`resource specification file <ctest-resource-specification-file>`
@@ -114,40 +140,54 @@ Options
When ``ctest`` is run as a `Dashboard Client`_ this sets the
``ResourceSpecFile`` option of the `CTest Test Step`_.
-``--test-load <level>``
- While running tests in parallel (e.g. with ``-j``), try not to start
- tests when they may cause the CPU load to pass above a given threshold.
+.. option:: --test-load <level>
+
+ While running tests in parallel (e.g. with :option:`-j <ctest -j>`), try
+ not to start tests when they may cause the CPU load to pass above a given
+ threshold.
When ``ctest`` is run as a `Dashboard Client`_ this sets the
``TestLoad`` option of the `CTest Test Step`_.
-``-Q,--quiet``
+.. option:: -Q, --quiet
+
Make CTest quiet.
This option will suppress all the output. The output log file will
- still be generated if the ``--output-log`` is specified. Options such
- as ``--verbose``, ``--extra-verbose``, and ``--debug`` are ignored
+ still be generated if the :option:`--output-log <ctest --output-log>` is
+ specified. Options such as :option:`--verbose <ctest --verbose>`,
+ :option:`--extra-verbose <ctest --extra-verbose>`, and
+ :option:`--debug <ctest --debug>` are ignored
if ``--quiet`` is specified.
-``-O <file>, --output-log <file>``
+.. option:: -O <file>, --output-log <file>
+
Output to log file.
This option tells CTest to write all its output to a ``<file>`` log file.
-``--output-junit <file>``
+.. option:: --output-junit <file>
+
+ .. versionadded:: 3.21
+
Write test results in JUnit format.
This option tells CTest to write test results to ``<file>`` in JUnit XML
format. If ``<file>`` already exists, it will be overwritten. If using the
- ``-S`` option to run a dashboard script, use the ``OUTPUT_JUNIT`` keyword
- with the :command:`ctest_test` command instead.
+ :option:`-S <ctest -S>` option to run a dashboard script, use the
+ ``OUTPUT_JUNIT`` keyword with the :command:`ctest_test` command instead.
+
+.. option:: -N, --show-only[=<format>]
-``-N,--show-only[=<format>]``
Disable actual execution of tests.
This option tells CTest to list the tests that would be run but not
- actually run them. Useful in conjunction with the ``-R`` and ``-E``
- options.
+ actually run them. Useful in conjunction with the :option:`-R <ctest -R>`
+ and :option:`-E <ctest -E>` options.
+
+ .. versionadded:: 3.14
+
+ The ``--show-only`` option accepts a ``<format>`` value.
``<format>`` can be one of the following values.
@@ -159,7 +199,8 @@ Options
Dump the test information in JSON format.
See `Show as JSON Object Model`_.
-``-L <regex>, --label-regex <regex>``
+.. option:: -L <regex>, --label-regex <regex>
+
Run tests with labels matching regular expression as described under
:ref:`string(REGEX) <Regex Specification>`.
@@ -169,19 +210,22 @@ Options
of the test's labels (i.e. the multiple ``-L`` labels form an ``AND``
relationship). See `Label Matching`_.
-``-R <regex>, --tests-regex <regex>``
+.. option:: -R <regex>, --tests-regex <regex>
+
Run tests matching regular expression.
This option tells CTest to run only the tests whose names match the
given regular expression.
-``-E <regex>, --exclude-regex <regex>``
+.. option:: -E <regex>, --exclude-regex <regex>
+
Exclude tests matching regular expression.
This option tells CTest to NOT run the tests whose names match the
given regular expression.
-``-LE <regex>, --label-exclude <regex>``
+.. option:: -LE <regex>, --label-exclude <regex>
+
Exclude tests with labels matching regular expression.
This option tells CTest to NOT run the tests whose labels match the
@@ -190,7 +234,8 @@ Options
of the test's labels (i.e. the multiple ``-LE`` labels form an ``AND``
relationship). See `Label Matching`_.
-``-FA <regex>, --fixture-exclude-any <regex>``
+.. option:: -FA <regex>, --fixture-exclude-any <regex>
+
Exclude fixtures matching ``<regex>`` from automatically adding any tests to
the test set.
@@ -201,72 +246,18 @@ Options
including test dependencies and skipping tests that have fixture setup tests
that fail.
-``-FS <regex>, --fixture-exclude-setup <regex>``
- Same as ``-FA`` except only matching setup tests are excluded.
-
-``-FC <regex>, --fixture-exclude-cleanup <regex>``
- Same as ``-FA`` except only matching cleanup tests are excluded.
-
-``-D <dashboard>, --dashboard <dashboard>``
- Execute dashboard test.
-
- This option tells CTest to act as a CDash client and perform a
- dashboard test. All tests are ``<Mode><Test>``, where ``<Mode>`` can be
- ``Experimental``, ``Nightly``, and ``Continuous``, and ``<Test>`` can be
- ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
- ``Coverage``, and ``Submit``.
-
- See `Dashboard Client`_.
-
-``-D <var>:<type>=<value>``
- Define a variable for script mode.
-
- Pass in variable values on the command line. Use in conjunction
- with ``-S`` to pass variable values to a dashboard script. Parsing ``-D``
- arguments as variable values is only attempted if the value
- following ``-D`` does not match any of the known dashboard types.
-
-``-M <model>, --test-model <model>``
- Sets the model for a dashboard.
-
- This option tells CTest to act as a CDash client where the ``<model>``
- can be ``Experimental``, ``Nightly``, and ``Continuous``.
- Combining ``-M`` and ``-T`` is similar to ``-D``.
+.. option:: -FS <regex>, --fixture-exclude-setup <regex>
- See `Dashboard Client`_.
+ Same as :option:`-FA <ctest -FA>` except only matching setup tests are
+ excluded.
-``-T <action>, --test-action <action>``
- Sets the dashboard action to perform.
-
- This option tells CTest to act as a CDash client and perform some
- action such as ``start``, ``build``, ``test`` etc. See
- `Dashboard Client Steps`_ for the full list of actions.
- Combining ``-M`` and ``-T`` is similar to ``-D``.
+.. option:: -FC <regex>, --fixture-exclude-cleanup <regex>
- See `Dashboard Client`_.
+ Same as :option:`-FA <ctest -FA>` except only matching cleanup tests are
+ excluded.
-``-S <script>, --script <script>``
- Execute a dashboard for a configuration.
+.. option:: -I [Start,End,Stride,test#,test#|Test file], --tests-information
- This option tells CTest to load in a configuration script which sets
- a number of parameters such as the binary and source directories.
- Then CTest will do what is required to create and run a dashboard.
- This option basically sets up a dashboard and then runs ``ctest -D``
- with the appropriate options.
-
- See `Dashboard Client`_.
-
-``-SP <script>, --script-new-process <script>``
- Execute a dashboard for a configuration.
-
- This option does the same operations as ``-S`` but it will do them in a
- separate process. This is primarily useful in cases where the
- script may modify the environment and you do not want the modified
- environment to impact other ``-S`` scripts.
-
- See `Dashboard Client`_.
-
-``-I [Start,End,Stride,test#,test#|Test file], --tests-information``
Run a specific number of tests by number.
This option causes CTest to run tests starting at number ``Start``,
@@ -275,23 +266,29 @@ Options
``End``, or ``Stride`` can be empty. Optionally a file can be given that
contains the same syntax as the command line.
-``-U, --union``
- Take the Union of ``-I`` and ``-R``.
+.. option:: -U, --union
+
+ Take the Union of :option:`-I <ctest -I>` and :option:`-R <ctest -R>`.
+
+ When both :option:`-R <ctest -R>` and :option:`-I <ctest -I>` are specified
+ by default the intersection of tests are run. By specifying ``-U`` the union
+ of tests is run instead.
- When both ``-R`` and ``-I`` are specified by default the intersection of
- tests are run. By specifying ``-U`` the union of tests is run instead.
+.. option:: --rerun-failed
-``--rerun-failed``
Run only the tests that failed previously.
This option tells CTest to perform only the tests that failed during
its previous run. When this option is specified, CTest ignores all
- other options intended to modify the list of tests to run (``-L``, ``-R``,
- ``-E``, ``-LE``, ``-I``, etc). In the event that CTest runs and no tests
- fail, subsequent calls to CTest with the ``--rerun-failed`` option will run
- the set of tests that most recently failed (if any).
+ other options intended to modify the list of tests to run (
+ :option:`-L <ctest -L>`, :option:`-R <ctest -R>`, :option:`-E <ctest -E>`,
+ :option:`-LE <ctest -LE>`, :option:`-I <ctest -I>`, etc). In the event that
+ CTest runs and no tests fail, subsequent calls to CTest with the
+ ``--rerun-failed`` option will run the set of tests that most recently
+ failed (if any).
+
+.. option:: --repeat <mode>:<n>
-``--repeat <mode>:<n>``
Run tests repeatedly based on the given ``<mode>`` up to ``<n>`` times.
The modes are:
@@ -310,17 +307,20 @@ Options
This is useful in tolerating sporadic timeouts in test cases
on busy machines.
-``--repeat-until-fail <n>``
- Equivalent to ``--repeat until-fail:<n>``.
+.. option:: --repeat-until-fail <n>
+
+ Equivalent to :option:`--repeat until-fail:\<n\> <ctest --repeat>`.
+
+.. option:: --max-width <width>
-``--max-width <width>``
Set the max width for a test name to output.
Set the maximum width for each test name to show in the output.
This allows the user to widen the output to avoid clipping the test
name which can be very annoying.
-``--interactive-debug-mode [0|1]``
+.. option:: --interactive-debug-mode [0|1]
+
Set the interactive mode to ``0`` or ``1``.
This option causes CTest to run tests in either an interactive mode
@@ -332,7 +332,8 @@ Options
popup windows to appear. Now, due to CTest's use of ``libuv`` to launch
test processes, all system debug popup windows are always blocked.
-``--no-label-summary``
+.. option:: --no-label-summary
+
Disable timing summary information for labels.
This option tells CTest not to print summary information for each
@@ -341,7 +342,8 @@ Options
See `Label and Subproject Summary`_.
-``--no-subproject-summary``
+.. option:: --no-subproject-summary
+
Disable timing summary information for subprojects.
This option tells CTest not to print summary information for each
@@ -350,79 +352,95 @@ Options
See `Label and Subproject Summary`_.
-``--build-and-test``
-See `Build and Test Mode`_.
+.. option:: --test-dir <dir>
+
+ Specify the directory in which to look for tests.
-``--test-dir <dir>``
-Specify the directory in which to look for tests.
+.. option:: --test-output-size-passed <size>
-``--test-output-size-passed <size>``
.. versionadded:: 3.4
Limit the output for passed tests to ``<size>`` bytes.
-``--test-output-size-failed <size>``
+.. option:: --test-output-size-failed <size>
+
.. versionadded:: 3.4
Limit the output for failed tests to ``<size>`` bytes.
-``--test-output-truncation <mode>``
+.. option:: --test-output-truncation <mode>
+
.. versionadded:: 3.24
Truncate ``tail`` (default), ``middle`` or ``head`` of test output once
maximum output size is reached.
-``--overwrite``
+.. option:: --overwrite
+
Overwrite CTest configuration option.
By default CTest uses configuration options from configuration file.
This option will overwrite the configuration option.
-``--force-new-ctest-process``
+.. option:: --force-new-ctest-process
+
Run child CTest instances as new processes.
By default CTest will run child CTest instances within the same
process. If this behavior is not desired, this argument will
enforce new processes for child CTest processes.
-``--schedule-random``
+.. option:: --schedule-random
+
Use a random order for scheduling tests.
This option will run the tests in a random order. It is commonly
used to detect implicit dependencies in a test suite.
-``--submit-index``
+.. option:: --submit-index
+
Legacy option for old Dart2 dashboard server feature.
Do not use.
-``--timeout <seconds>``
+.. option:: --timeout <seconds>
+
Set the default test timeout.
This option effectively sets a timeout on all tests that do not
already have a timeout set on them via the :prop_test:`TIMEOUT`
property.
-``--stop-time <time>``
+.. option:: --stop-time <time>
+
Set a time at which all tests should stop running.
Set a real time of day at which all tests should timeout. Example:
``7:00:00 -0400``. Any time format understood by the curl date parser
is accepted. Local time is assumed if no timezone is specified.
-``--print-labels``
+.. option:: --print-labels
+
Print all available test labels.
This option will not run any tests, it will simply print the list of
all labels associated with the test set.
-``--no-tests=<[error|ignore]>``
- Regard no tests found either as error or ignore it.
+.. option:: --no-tests=<action>
+
+ Regard no tests found either as error (when ``<action>`` is set to
+ ``error``) or ignore it (when ``<action>`` is set to ``ignore``).
If no tests were found, the default behavior of CTest is to always log an
error message but to return an error code in script mode only. This option
unifies the behavior of CTest by either returning an error code if no tests
were found or by ignoring it.
+View Help
+=========
+
+To print version details or selected pages from the CMake documentation,
+use one of the following options:
+
.. include:: OPTIONS_HELP.txt
.. _`Label Matching`:
@@ -435,17 +453,17 @@ or excluded from a test run by filtering on the labels.
Each individual filter is a regular expression applied to
the labels attached to a test.
-When ``-L`` is used, in order for a test to be included in a
+When :option:`-L <ctest -L>` is used, in order for a test to be included in a
test run, each regular expression must match at least one
-label. Using more than one ``-L`` option means "match **all**
+label. Using more than one :option:`-L <ctest -L>` option means "match **all**
of these".
-The ``-LE`` option works just like ``-L``, but excludes tests
-rather than including them. A test is excluded if each regular
-expression matches at least one label.
+The :option:`-LE <ctest -LE>` option works just like :option:`-L <ctest -L>`,
+but excludes tests rather than including them. A test is excluded if each
+regular expression matches at least one label.
-If a test has no labels attached to it, then ``-L`` will never
-include that test, and ``-LE`` will never exclude that test.
+If a test has no labels attached to it, then :option:`-L <ctest -L>` will never
+include that test, and :option:`-LE <ctest -LE>` will never exclude that test.
As an example of tests with labels, consider five tests,
with the following labels:
@@ -532,62 +550,85 @@ be provided to use ``--build-and-test``. If ``--test-command`` is specified
then that will be run after the build is complete. Other options that affect
this mode include:
-``--build-target``
- Specify a specific target to build.
+.. option:: --build-and-test
- If left out the ``all`` target is built.
+ Switch into the build and test mode.
+
+.. option:: --build-target
+
+ Specify a specific target to build. The option can be given multiple times
+ with different targets, in which case each target is built in turn.
+ A clean will be done before building each target unless the
+ :option:`--build-noclean` option is given.
+
+ If no ``--build-target`` is specified, the ``all`` target is built.
+
+.. option:: --build-nocmake
-``--build-nocmake``
Run the build without running cmake first.
Skip the cmake step.
-``--build-run-dir``
+.. option:: --build-run-dir
+
Specify directory to run programs from.
Directory where programs will be after it has been compiled.
-``--build-two-config``
+.. option:: --build-two-config
+
Run CMake twice.
-``--build-exe-dir``
+.. option:: --build-exe-dir
+
Specify the directory for the executable.
-``--build-generator``
+.. option:: --build-generator
+
Specify the generator to use. See the :manual:`cmake-generators(7)` manual.
-``--build-generator-platform``
+.. option:: --build-generator-platform
+
Specify the generator-specific platform.
-``--build-generator-toolset``
+.. option:: --build-generator-toolset
+
Specify the generator-specific toolset.
-``--build-project``
+.. option:: --build-project
+
Specify the name of the project to build.
-``--build-makeprogram``
+.. option:: --build-makeprogram
+
Specify the explicit make program to be used by CMake when configuring and
building the project. Only applicable for Make and Ninja based generators.
-``--build-noclean``
+.. option:: --build-noclean
+
Skip the make clean step.
-``--build-config-sample``
+.. option:: --build-config-sample
+
A sample executable to use to determine the configuration that
should be used. e.g. ``Debug``, ``Release`` etc.
-``--build-options``
+.. option:: --build-options
+
Additional options for configuring the build (i.e. for CMake, not for
the build tool). Note that if this is specified, the ``--build-options``
keyword and its arguments must be the last option given on the command
line, with the possible exception of ``--test-command``.
-``--test-command``
- The command to run as the test step with the ``--build-and-test`` option.
+.. option:: --test-command
+
+ The command to run as the test step with the
+ :option:`--build-and-test <ctest --build-and-test>` option.
All arguments following this keyword will be assumed to be part of the
test command line, so it must be the last option given.
-``--test-timeout``
+.. option:: --test-timeout
+
The time limit in seconds
.. _`Dashboard Client`:
@@ -600,12 +641,80 @@ application. As a dashboard client, CTest performs a sequence of steps
to configure, build, and test software, and then submits the results to
a `CDash`_ server. The command-line signature used to submit to `CDash`_ is::
- ctest (-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>)
- [-- <dashboard-options>...]
+ ctest -D <dashboard> [-- <dashboard-options>...]
+ ctest -M <model> -T <action> [-- <dashboard-options>...]
+ ctest -S <script> [-- <dashboard-options>...]
+ ctest -SP <script> [-- <dashboard-options>...]
Options for Dashboard Client include:
-``--group <group>``
+.. option:: -D <dashboard>, --dashboard <dashboard>
+
+ Execute dashboard test.
+
+ This option tells CTest to act as a CDash client and perform a
+ dashboard test. All tests are ``<Mode><Test>``, where ``<Mode>`` can be
+ ``Experimental``, ``Nightly``, and ``Continuous``, and ``<Test>`` can be
+ ``Start``, ``Update``, ``Configure``, ``Build``, ``Test``,
+ ``Coverage``, and ``Submit``.
+
+ If ``<dashboard>`` is not one of the recognized ``<Mode><Test>`` values,
+ this will be treated as a variable definition instead (see the
+ :ref:`dashboard-options <Dashboard Options>` further below).
+
+.. option:: -M <model>, --test-model <model>
+
+ Sets the model for a dashboard.
+
+ This option tells CTest to act as a CDash client where the ``<model>``
+ can be ``Experimental``, ``Nightly``, and ``Continuous``.
+ Combining ``-M`` and :option:`-T <ctest -T>` is similar to
+ :option:`-D <ctest -D>`.
+
+.. option:: -T <action>, --test-action <action>
+
+ Sets the dashboard action to perform.
+
+ This option tells CTest to act as a CDash client and perform some
+ action such as ``start``, ``build``, ``test`` etc. See
+ `Dashboard Client Steps`_ for the full list of actions.
+ Combining :option:`-M <ctest -M>` and ``-T`` is similar to
+ :option:`-D <ctest -D>`.
+
+.. option:: -S <script>, --script <script>
+
+ Execute a dashboard for a configuration.
+
+ This option tells CTest to load in a configuration script which sets
+ a number of parameters such as the binary and source directories.
+ Then CTest will do what is required to create and run a dashboard.
+ This option basically sets up a dashboard and then runs :option:`ctest -D`
+ with the appropriate options.
+
+.. option:: -SP <script>, --script-new-process <script>
+
+ Execute a dashboard for a configuration.
+
+ This option does the same operations as :option:`-S <ctest -S>` but it
+ will do them in a separate process. This is primarily useful in cases
+ where the script may modify the environment and you do not want the modified
+ environment to impact other :option:`-S <ctest -S>` scripts.
+
+.. _`Dashboard Options`:
+
+The available ``<dashboard-options>`` are the following:
+
+.. option:: -D <var>:<type>=<value>
+
+ Define a variable for script mode.
+
+ Pass in variable values on the command line. Use in conjunction
+ with :option:`-S <ctest -S>` to pass variable values to a dashboard script.
+ Parsing ``-D`` arguments as variable values is only attempted if the value
+ following ``-D`` does not match any of the known dashboard types.
+
+.. option:: --group <group>
+
Specify what group you'd like to submit results to
Submit dashboard to specified group instead of default one. By
@@ -616,29 +725,34 @@ Options for Dashboard Client include:
This replaces the deprecated option ``--track``.
Despite the name change its behavior is unchanged.
-``-A <file>, --add-notes <file>``
+.. option:: -A <file>, --add-notes <file>
+
Add a notes file with submission.
This option tells CTest to include a notes file when submitting
dashboard.
-``--tomorrow-tag``
+.. option:: --tomorrow-tag
+
``Nightly`` or ``Experimental`` starts with next day tag.
This is useful if the build will not finish in one day.
-``--extra-submit <file>[;<file>]``
+.. option:: --extra-submit <file>[;<file>]
+
Submit extra files to the dashboard.
This option will submit extra files to the dashboard.
-``--http1.0``
+.. option:: --http1.0
+
Submit using `HTTP 1.0`.
This option will force CTest to use `HTTP 1.0` to submit files to the
dashboard, instead of `HTTP 1.1`.
-``--no-compress-output``
+.. option:: --no-compress-output
+
Do not compress test output when submitting.
This flag will turn off automatic compression of test output. Use
@@ -722,7 +836,7 @@ Run the ``ctest`` command with the current working directory set
to the build tree and use one of these signatures::
ctest -D <mode>[<step>]
- ctest -M <mode> [ -T <step> ]...
+ ctest -M <mode> [-T <step>]...
The ``<mode>`` must be one of the above `Dashboard Client Modes`_,
and each ``<step>`` must be one of the above `Dashboard Client Steps`_.
@@ -1027,9 +1141,9 @@ Configuration settings include:
``DefaultCTestConfigurationType``
When the build system to be launched allows build-time selection
of the configuration (e.g. ``Debug``, ``Release``), this specifies
- the default configuration to be built when no ``-C`` option is
- given to the ``ctest`` command. The value will be substituted into
- the value of ``MakeCommand`` to replace the literal string
+ the default configuration to be built when no :option:`-C <ctest -C>`
+ option is given to the ``ctest`` command. The value will be substituted
+ into the value of ``MakeCommand`` to replace the literal string
``${CTEST_CONFIGURATION_TYPE}`` if it appears.
* `CTest Script`_ variable: :variable:`CTEST_CONFIGURATION_TYPE`
@@ -1101,8 +1215,9 @@ Configuration settings include:
See `Label and Subproject Summary`_.
``TestLoad``
- While running tests in parallel (e.g. with ``-j``), try not to start
- tests when they may cause the CPU load to pass above a given threshold.
+ While running tests in parallel (e.g. with :option:`-j <ctest -j>`),
+ try not to start tests when they may cause the CPU load to pass above
+ a given threshold.
* `CTest Script`_ variable: :variable:`CTEST_TEST_LOAD`
* :module:`CTest` module variable: ``CTEST_TEST_LOAD``
@@ -1382,6 +1497,8 @@ Configuration settings include:
Show as JSON Object Model
=========================
+.. versionadded:: 3.14
+
When the ``--show-only=json-v1`` command line option is given, the test
information is output in JSON format. Version 1.0 of the JSON object
model is defined as follows:
@@ -1518,12 +1635,12 @@ Resource Specification File
---------------------------
The resource specification file is a JSON file which is passed to CTest, either
-on the :manual:`ctest(1)` command line as ``--resource-spec-file``, or as the
+on the command line as :option:`ctest --resource-spec-file`, or as the
``RESOURCE_SPEC_FILE`` argument of :command:`ctest_test`. If a dashboard script
is used and ``RESOURCE_SPEC_FILE`` is not specified, the value of
:variable:`CTEST_RESOURCE_SPEC_FILE` in the dashboard script is used instead.
-If ``--resource-spec-file``, ``RESOURCE_SPEC_FILE``, and
-:variable:`CTEST_RESOURCE_SPEC_FILE` in the dashboard script are not specified,
+If :option:`--resource-spec-file <ctest --resource-spec-file>`, ``RESOURCE_SPEC_FILE``,
+and :variable:`CTEST_RESOURCE_SPEC_FILE` in the dashboard script are not specified,
the value of :variable:`CTEST_RESOURCE_SPEC_FILE` in the CMake build is used
instead. If none of these are specified, no resource spec file is used.
diff --git a/Help/manual/presets/example.json b/Help/manual/presets/example.json
index be5c791..696ab47 100644
--- a/Help/manual/presets/example.json
+++ b/Help/manual/presets/example.json
@@ -1,5 +1,5 @@
{
- "version": 5,
+ "version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
@@ -66,6 +66,38 @@
"execution": {"noTestsAction": "error", "stopOnFailure": true}
}
],
+ "packagePresets": [
+ {
+ "name": "default",
+ "configurePreset": "default",
+ "generators": [
+ "TGZ"
+ ]
+ }
+ ],
+ "workflowPresets": [
+ {
+ "name": "default",
+ "steps": [
+ {
+ "type": "configure",
+ "name": "default"
+ },
+ {
+ "type": "build",
+ "name": "default"
+ },
+ {
+ "type": "test",
+ "name": "default"
+ },
+ {
+ "type": "package",
+ "name": "default"
+ }
+ ]
+ }
+ ],
"vendor": {
"example.com/ExampleIDE/1.0": {
"autoFormat": false
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json
index c96405c..348116b 100644
--- a/Help/manual/presets/schema.json
+++ b/Help/manual/presets/schema.json
@@ -72,6 +72,23 @@
"include": { "$ref": "#/definitions/include"}
},
"additionalProperties": false
+ },
+ {
+ "properties": {
+ "version": {
+ "const": 6,
+ "description": "A required integer representing the version of the JSON schema."
+ },
+ "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"},
+ "vendor": { "$ref": "#/definitions/vendor" },
+ "configurePresets": { "$ref": "#/definitions/configurePresetsV3"},
+ "buildPresets": { "$ref": "#/definitions/buildPresetsV4"},
+ "testPresets": { "$ref": "#/definitions/testPresetsV6"},
+ "packagePresets": { "$ref": "#/definitions/packagePresetsV6"},
+ "workflowPresets": { "$ref": "#/definitions/workflowPresetsV6" },
+ "include": { "$ref": "#/definitions/include"}
+ },
+ "additionalProperties": false
}
],
"required": [
@@ -476,12 +493,12 @@
"properties": {
"name": {
"type": "string",
- "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, or test) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, package, or workflow) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
"minLength": 1
},
"hidden": {
"type": "boolean",
- "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset argument, will not show up in the CMake GUI, and does not have to have a valid configurePreset, even from inheritance. Hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
+ "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset argument and does not have to have a valid configurePreset, even from inheritance. Hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
},
"inherits": {
"anyOf": [
@@ -688,6 +705,25 @@
"additionalProperties": false
}
},
+ "testPresetsItemsV6": {
+ "type": "array",
+ "description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 6 and higher.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "output": {
+ "type": "object",
+ "description": "An optional object specifying output options.",
+ "properties": {
+ "outputJUnitFile": {
+ "type": "string",
+ "description": "An optional string specifying a path to a JUnit file. Equivalent to passing --output-junit on the command line."
+ }
+ }
+ }
+ }
+ }
+ },
"testPresetsItemsV5": {
"type": "array",
"description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 5 and higher.",
@@ -728,12 +764,12 @@
"properties": {
"name": {
"type": "string",
- "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, or test) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, package, or workflow) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
"minLength": 1
},
"hidden": {
"type": "boolean",
- "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset argument, will not show up in the CMake GUI, and does not have to have a valid configurePreset, even from inheritance. Hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
+ "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset argument and does not have to have a valid configurePreset, even from inheritance. Hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
},
"inherits": {
"anyOf": [
@@ -1034,6 +1070,58 @@
]
}
},
+ "testPresetsV6": {
+ "type": "array",
+ "description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 6 and higher.",
+ "allOf": [
+ { "$ref": "#/definitions/testPresetsItemsV2" },
+ { "$ref": "#/definitions/testPresetsItemsV3" },
+ { "$ref": "#/definitions/testPresetsItemsV5" },
+ { "$ref": "#/definitions/testPresetsItemsV6" }
+ ],
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {},
+ "hidden": {},
+ "inherits": {},
+ "configurePreset": {},
+ "vendor": {},
+ "displayName": {},
+ "description": {},
+ "inheritConfigureEnvironment": {},
+ "environment": {},
+ "configuration": {},
+ "overwriteConfigurationFile": {},
+ "output": {
+ "type": "object",
+ "properties": {
+ "shortProgress": {},
+ "verbosity": {},
+ "debug": {},
+ "outputOnFailure": {},
+ "quiet": {},
+ "outputLogFile": {},
+ "outputJUnitFile": {},
+ "labelSummary": {},
+ "subprojectSummary": {},
+ "maxPassedTestOutputSize": {},
+ "maxFailedTestOutputSize": {},
+ "maxTestNameWidth": {},
+ "testOutputTruncation": {}
+ },
+ "additionalProperties": false
+ },
+ "filter": {},
+ "execution": {},
+ "condition": {}
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
"testPresetsV5": {
"type": "array",
"description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 5 and higher.",
@@ -1056,7 +1144,24 @@
"environment": {},
"configuration": {},
"overwriteConfigurationFile": {},
- "output": {},
+ "output": {
+ "type": "object",
+ "properties": {
+ "shortProgress": {},
+ "verbosity": {},
+ "debug": {},
+ "outputOnFailure": {},
+ "quiet": {},
+ "outputLogFile": {},
+ "labelSummary": {},
+ "subprojectSummary": {},
+ "maxPassedTestOutputSize": {},
+ "maxFailedTestOutputSize": {},
+ "maxTestNameWidth": {},
+ "testOutputTruncation": {}
+ },
+ "additionalProperties": false
+ },
"filter": {},
"execution": {},
"condition": {}
@@ -1088,7 +1193,23 @@
"environment": {},
"configuration": {},
"overwriteConfigurationFile": {},
- "output": {},
+ "output": {
+ "type": "object",
+ "properties": {
+ "shortProgress": {},
+ "verbosity": {},
+ "debug": {},
+ "outputOnFailure": {},
+ "quiet": {},
+ "outputLogFile": {},
+ "labelSummary": {},
+ "subprojectSummary": {},
+ "maxPassedTestOutputSize": {},
+ "maxFailedTestOutputSize": {},
+ "maxTestNameWidth": {}
+ },
+ "additionalProperties": false
+ },
"filter": {},
"execution": {},
"condition": {}
@@ -1119,7 +1240,23 @@
"environment": {},
"configuration": {},
"overwriteConfigurationFile": {},
- "output": {},
+ "output": {
+ "type": "object",
+ "properties": {
+ "shortProgress": {},
+ "verbosity": {},
+ "debug": {},
+ "outputOnFailure": {},
+ "quiet": {},
+ "outputLogFile": {},
+ "labelSummary": {},
+ "subprojectSummary": {},
+ "maxPassedTestOutputSize": {},
+ "maxFailedTestOutputSize": {},
+ "maxTestNameWidth": {}
+ },
+ "additionalProperties": false
+ },
"filter": {},
"execution": {}
},
@@ -1129,6 +1266,260 @@
"additionalProperties": false
}
},
+ "packagePresetsItemsV6": {
+ "type": "array",
+ "description": "An optional array of package preset objects. Used to specify arguments to cpack. Available in version 6 and higher.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, package, or workflow) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "minLength": 1
+ },
+ "hidden": {
+ "type": "boolean",
+ "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset argument and does not have to have a valid configurePreset, even from inheritance. Hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
+ },
+ "inherits": {
+ "anyOf": [
+ {
+ "type": "string",
+ "description": "An optional string representing the name of the package preset to inherit from.",
+ "minLength": 1
+ },
+ {
+ "type": "array",
+ "description": "An optional array of strings representing the names of package presets to inherit from. The preset will inherit all of the fields from the inherits presets by default (except name, hidden, inherits, description, and displayName), but can override them as desired. If multiple inherits presets provide conflicting values for the same field, the earlier preset in the inherits list will be preferred. Presets in CMakePresets.json must not inherit from presets in CMakeUserPresets.json.",
+ "items": {
+ "type": "string",
+ "description": "An optional string representing the name of the preset to inherit from.",
+ "minLength": 1
+ }
+ }
+ ]
+ },
+ "configurePreset": {
+ "type": "string",
+ "description": "An optional string specifying the name of a configure preset to associate with this package preset. If configurePreset is not specified, it must be inherited from the inherits preset (unless this preset is hidden). The build tree directory is inferred from the configure preset.",
+ "minLength": 1
+ },
+ "vendor": {
+ "type": "object",
+ "description": "An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, it should follow the same conventions as the root-level vendor field. If vendors use their own per-preset vendor field, they should implement inheritance in a sensible manner when appropriate.",
+ "properties": {}
+ },
+ "displayName": {
+ "type": "string",
+ "description": "An optional string with a human-friendly name of the preset."
+ },
+ "description": {
+ "type": "string",
+ "description": "An optional string with a human-friendly description of the preset."
+ },
+ "inheritConfigureEnvironment": {
+ "type": "boolean",
+ "description": "An optional boolean that defaults to true. If true, the environment variables from the associated configure preset are inherited after all inherited package preset environments, but before environment variables explicitly specified in this package preset."
+ },
+ "environment": {
+ "type": "object",
+ "description": "An optional map of environment variables. The key is the variable name (which must not be an empty string). Each variable is set regardless of whether or not a value was given to it by the process's environment. This field supports macro expansion, and environment variables in this map may reference each other, and may be listed in any order, as long as such references do not cause a cycle (for example,if ENV_1 is $env{ENV_2}, ENV_2 may not be $env{ENV_1}.) Environment variables are inherited through the inherits field, and the preset's environment will be the union of its own environment and the environment from all its parents. If multiple presets in this union define the same variable, the standard rules of inherits are applied. Setting a variable to null causes it to not be set, even if a value was inherited from another preset.",
+ "properties": {},
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "type": "null",
+ "description": "Setting a variable to null causes it to not be set, even if a value was inherited from another preset."
+ },
+ {
+ "type": "string",
+ "description": "A string representing the value of the variable."
+ }
+ ]
+ },
+ "propertyNames": {
+ "pattern": "^.+$"
+ }
+ },
+ "condition": { "$ref": "#/definitions/topCondition" },
+ "generators": {
+ "type": "array",
+ "description": "An optional list of strings representing generators for CPack to use.",
+ "items": {
+ "type": "string",
+ "description": "An optional string representing the name of the CPack generator to use."
+ }
+ },
+ "configurations": {
+ "type": "array",
+ "description": "An optional list of strings representing build configurations for CPack to package.",
+ "items": {
+ "type": "string",
+ "description": "An optional string representing the name of the configuration to use."
+ }
+ },
+ "variables": {
+ "type": "object",
+ "description": "An optional map of variables to pass to CPack, equivalent to -D arguments. Each key is the name of a variable, and the value is the string to assign to that variable.",
+ "items": {
+ "type": "string",
+ "description": "An optional string representing the value of the variable."
+ }
+ },
+ "configFile": {
+ "type": "string",
+ "description": "An optional string representing the config file for CPack to use."
+ },
+ "output": {
+ "type": "object",
+ "description": "An optional object specifying output options.",
+ "properties": {
+ "debug": {
+ "type": "boolean",
+ "description": "An optional boolean specifying whether or not to print debug information. A value of true is equivalent to passing --debug on the command line."
+ },
+ "verbose": {
+ "type": "boolean",
+ "description": "An optional boolean specifying whether or not to print verbosely. A value of true is equivalent to passing --verbose on the command line."
+ }
+ },
+ "additionalProperties": false
+ },
+ "packageName": {
+ "type": "string",
+ "description": "An optional string representing the package name."
+ },
+ "packageVersion": {
+ "type": "string",
+ "description": "An optional string representing the package version."
+ },
+ "packageDirectory": {
+ "type": "string",
+ "description": "An optional string representing the directory in which to place the package."
+ },
+ "vendorName": {
+ "type": "string",
+ "description": "An optional string representing the vendor name."
+ }
+ },
+ "required": [
+ "name"
+ ]
+ }
+ },
+ "packagePresetsV6": {
+ "type": "array",
+ "description": "An optional array of package preset objects. Used to specify arguments to cpack. Available in version 6 and higher.",
+ "allOf": [
+ { "$ref": "#/definitions/packagePresetsItemsV6" }
+ ],
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {},
+ "hidden": {},
+ "inherits": {},
+ "configurePreset": {},
+ "vendor": {},
+ "displayName": {},
+ "description": {},
+ "inheritConfigureEnvironment": {},
+ "environment": {},
+ "condition": {},
+ "generators": {},
+ "configurations": {},
+ "variables": {},
+ "configFile": {},
+ "output": {},
+ "packageName": {},
+ "packageVersion": {},
+ "packageDirectory": {},
+ "vendorName": {}
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "workflowPresetsItemsV6": {
+ "type": "array",
+ "description": "An optional array of workflow preset objects. Used to execute configure, build, test, and package presets in order. Available in version 6 and higher.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, package, or workflow) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "minLength": 1
+ },
+ "vendor": {
+ "type": "object",
+ "description": "An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, it should follow the same conventions as the root-level vendor field.",
+ "properties": {}
+ },
+ "displayName": {
+ "type": "string",
+ "description": "An optional string with a human-friendly name of the preset."
+ },
+ "description": {
+ "type": "string",
+ "description": "An optional string with a human-friendly description of the preset."
+ },
+ "steps": {
+ "type": "array",
+ "description": "A required array of objects describing the steps of the workflow. The first step must be a configure preset, and all subsequent steps must be non-configure presets whose configurePreset field matches the starting configure preset.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "A required string. The first step must be configure. Subsequent steps must be either build, test, or package.",
+ "enum": ["configure", "build", "test", "package"]
+ },
+ "name": {
+ "type": "string",
+ "description": "A required string representing the name of the configure, build, test, or package preset to run as this workflow step.",
+ "minLength": 1
+ }
+ },
+ "required": [
+ "type",
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "name",
+ "steps"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "workflowPresetsV6": {
+ "type": "array",
+ "description": "An optional array of workflow preset objects. Used to execute configure, build, test, and package presets in order. Available in version 6 and higher.",
+ "allOf": [
+ { "$ref": "#/definitions/workflowPresetsItemsV6" }
+ ],
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {},
+ "vendor": {},
+ "displayName": {},
+ "description": {},
+ "steps": {}
+ },
+ "required": [
+ "name",
+ "steps"
+ ],
+ "additionalProperties": false
+ }
+ },
"condition": {
"anyOf": [
{
diff --git a/Help/module/FindOpenSP.rst b/Help/module/FindOpenSP.rst
new file mode 100644
index 0000000..1a3da01
--- /dev/null
+++ b/Help/module/FindOpenSP.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindOpenSP.cmake
diff --git a/Help/module/FindSDL_gfx.rst b/Help/module/FindSDL_gfx.rst
new file mode 100644
index 0000000..e05d661
--- /dev/null
+++ b/Help/module/FindSDL_gfx.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindSDL_gfx.cmake
diff --git a/Help/policy/CMP0058.rst b/Help/policy/CMP0058.rst
index 06cc74b..faab1cb 100644
--- a/Help/policy/CMP0058.rst
+++ b/Help/policy/CMP0058.rst
@@ -50,7 +50,7 @@ that ensure ``byproduct.txt`` will exist before its consumers
need it. See discussion of this problem in `Ninja Issue 760`_
for further details on why Ninja works this way.
-.. _`Ninja Issue 760`: https://github.com/martine/ninja/issues/760
+.. _Ninja Issue 760: https://github.com/ninja-build/ninja/issues/760
Instead of leaving byproducts undeclared in the rules that generate
them, Ninja expects byproducts to be listed along with other outputs.
@@ -71,6 +71,9 @@ every custom command dependency, even on source files, needs to
be treated this way because CMake does not have enough information
to know which files are generated as byproducts of custom commands.
+Introducing Byproducts
+^^^^^^^^^^^^^^^^^^^^^^
+
CMake 3.2 introduced the ``BYPRODUCTS`` option to the
:command:`add_custom_command` and :command:`add_custom_target`
commands. This option allows byproducts to be specified explicitly:
diff --git a/Help/policy/CMP0140.rst b/Help/policy/CMP0140.rst
new file mode 100644
index 0000000..dea8989
--- /dev/null
+++ b/Help/policy/CMP0140.rst
@@ -0,0 +1,17 @@
+CMP0140
+-------
+
+.. versionadded:: 3.25
+
+The :command:`return` command checks its parameters.
+
+The ``OLD`` behavior for this policy is to ignore any parameters given to the
+command.
+The ``NEW`` behavior is to check the validity of the parameters.
+
+This policy was introduced in CMake version 3.25.
+CMake version |release| warns when the policy is not set and uses
+``OLD`` behavior. Use the :command:`cmake_policy` command to set
+it to ``OLD`` or ``NEW`` explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0141.rst b/Help/policy/CMP0141.rst
new file mode 100644
index 0000000..970e41d
--- /dev/null
+++ b/Help/policy/CMP0141.rst
@@ -0,0 +1,55 @@
+CMP0141
+-------
+
+.. versionadded:: 3.25
+
+MSVC debug information format flags are selected by an abstraction.
+
+Compilers targeting the MSVC ABI have flags to select the debug information
+format. Debug information format selection typically varies with build
+configuration.
+
+In CMake 3.24 and below, debug information format flags are added to
+the default :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` cache entries by CMake
+automatically. This allows users to edit their cache entries to adjust the
+flags. However, the presence of such default flags is problematic for
+projects that want to choose a different runtime library programmatically.
+In particular, it requires string editing of the
+:variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` variables with knowledge of the
+CMake builtin defaults so they can be replaced.
+
+CMake 3.25 and above prefer to leave the debug information format flags
+out of the default :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` values and instead
+offer a first-class abstraction. The
+:variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable and
+:prop_tgt:`MSVC_DEBUG_INFORMATION_FORMAT` target property may be set to
+select the MSVC debug information format. If they are not set, CMake
+enables debug information in debug configurations using the default value
+``$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>``, if supported by the
+compiler, and otherwise ``$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>``.
+
+This policy provides compatibility with projects that have not been updated
+to be aware of the abstraction. The policy setting takes effect as of the
+first :command:`project` or :command:`enable_language` command that enables
+a language whose compiler targets the MSVC ABI.
+
+.. note::
+
+ Once the policy has taken effect at the top of a project, that choice
+ will be used throughout the tree. In projects that have nested projects
+ in subdirectories, be sure to confirm if everything is working with the
+ selected policy behavior.
+
+The ``OLD`` behavior for this policy is to place MSVC debug information
+format flags in the default :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` cache
+entries and ignore the :variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT`
+abstraction. The ``NEW`` behavior for this policy is to *not* place MSVC
+debug information format flags in the default cache entries and use
+the abstraction instead.
+
+This policy was introduced in CMake version 3.25. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike many policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0142.rst b/Help/policy/CMP0142.rst
new file mode 100644
index 0000000..1f928f0
--- /dev/null
+++ b/Help/policy/CMP0142.rst
@@ -0,0 +1,27 @@
+CMP0142
+-------
+
+.. versionadded:: 3.25
+
+The :generator:`Xcode` generator does not append per-config suffixes to
+library search paths.
+
+In CMake 3.24 and below, the :generator:`Xcode` generator preceded each
+entry of a library search path with a copy of itself appended with
+``$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)``. This was left from
+very early versions of CMake in which per-config directories were not well
+modeled. Such paths often do not exist, resulting in warnings from the
+toolchain. CMake 3.25 and above prefer to not add such library search
+paths. This policy provides compatibility for projects that may have been
+accidentally relying on the old behavior.
+
+The ``OLD`` behavior for this policy is to append
+``$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)`` to all library search paths.
+The ``NEW`` behavior is to not modify library search paths.
+
+This policy was introduced in CMake version 3.25. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike many policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_dir/SYSTEM.rst b/Help/prop_dir/SYSTEM.rst
new file mode 100644
index 0000000..4f923b7
--- /dev/null
+++ b/Help/prop_dir/SYSTEM.rst
@@ -0,0 +1,10 @@
+SYSTEM
+------
+
+.. versionadded:: 3.25
+
+This directory property is used to initialize the :prop_tgt:`SYSTEM`
+target property for targets created in that directory. It is set to
+true by :command:`add_subdirectory` and
+:command:`FetchContent_Declare` when the ``SYSTEM`` option is given
+as an argument to those commands.
diff --git a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
index d93a9c1..a31ee3a 100644
--- a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
@@ -36,4 +36,9 @@ The features known to this version of CMake are:
Compiler mode is at least CUDA/C++ 23.
+``cuda_std_26``
+ .. versionadded:: 3.25
+
+ Compiler mode is at least CUDA/C++ 26.
+
.. include:: CMAKE_LANG_STD_FLAGS.txt
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index 6846850..e54b927 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -46,6 +46,11 @@ but it does not necessarily imply complete conformance to that standard.
Compiler mode is at least C++ 23.
+``cxx_std_26``
+ .. versionadded:: 3.25
+
+ Compiler mode is at least C++ 26.
+
.. include:: CMAKE_LANG_STD_FLAGS.txt
Low level individual compile features
@@ -74,233 +79,233 @@ Individual features from C++ 11
``cxx_alias_templates``
Template aliases, as defined in N2258_.
- .. _N2258: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
+ .. _N2258: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
``cxx_alignas``
Alignment control ``alignas``, as defined in N2341_.
- .. _N2341: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
+ .. _N2341: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
``cxx_alignof``
Alignment control ``alignof``, as defined in N2341_.
- .. _N2341: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
+ .. _N2341: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
``cxx_attributes``
Generic attributes, as defined in N2761_.
- .. _N2761: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
+ .. _N2761: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
``cxx_auto_type``
Automatic type deduction, as defined in N1984_.
- .. _N1984: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
+ .. _N1984: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
``cxx_constexpr``
Constant expressions, as defined in N2235_.
- .. _N2235: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
+ .. _N2235: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
``cxx_decltype_incomplete_return_types``
Decltype on incomplete return types, as defined in N3276_.
- .. _N3276 : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf
+ .. _N3276 : https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf
``cxx_decltype``
Decltype, as defined in N2343_.
- .. _N2343: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
+ .. _N2343: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
``cxx_default_function_template_args``
Default template arguments for function templates, as defined in DR226_
- .. _DR226: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
+ .. _DR226: https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
``cxx_defaulted_functions``
Defaulted functions, as defined in N2346_.
- .. _N2346: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
+ .. _N2346: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
``cxx_defaulted_move_initializers``
Defaulted move initializers, as defined in N3053_.
- .. _N3053: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
+ .. _N3053: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
``cxx_delegating_constructors``
Delegating constructors, as defined in N1986_.
- .. _N1986: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
+ .. _N1986: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
``cxx_deleted_functions``
Deleted functions, as defined in N2346_.
- .. _N2346: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
+ .. _N2346: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
``cxx_enum_forward_declarations``
Enum forward declarations, as defined in N2764_.
- .. _N2764: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
+ .. _N2764: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
``cxx_explicit_conversions``
Explicit conversion operators, as defined in N2437_.
- .. _N2437: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
+ .. _N2437: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
``cxx_extended_friend_declarations``
Extended friend declarations, as defined in N1791_.
- .. _N1791: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
+ .. _N1791: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
``cxx_extern_templates``
Extern templates, as defined in N1987_.
- .. _N1987: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
+ .. _N1987: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
``cxx_final``
Override control ``final`` keyword, as defined in N2928_, N3206_ and N3272_.
- .. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
- .. _N3206: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
- .. _N3272: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
+ .. _N2928: https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
+ .. _N3206: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
+ .. _N3272: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
``cxx_func_identifier``
Predefined ``__func__`` identifier, as defined in N2340_.
- .. _N2340: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
+ .. _N2340: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
``cxx_generalized_initializers``
Initializer lists, as defined in N2672_.
- .. _N2672: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
+ .. _N2672: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
``cxx_inheriting_constructors``
Inheriting constructors, as defined in N2540_.
- .. _N2540: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
+ .. _N2540: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
``cxx_inline_namespaces``
Inline namespaces, as defined in N2535_.
- .. _N2535: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
+ .. _N2535: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
``cxx_lambdas``
Lambda functions, as defined in N2927_.
- .. _N2927: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2927.pdf
+ .. _N2927: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2927.pdf
``cxx_local_type_template_args``
Local and unnamed types as template arguments, as defined in N2657_.
- .. _N2657: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
+ .. _N2657: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
``cxx_long_long_type``
``long long`` type, as defined in N1811_.
- .. _N1811: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
+ .. _N1811: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
``cxx_noexcept``
Exception specifications, as defined in N3050_.
- .. _N3050: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
+ .. _N3050: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
``cxx_nonstatic_member_init``
Non-static data member initialization, as defined in N2756_.
- .. _N2756: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2756.htm
+ .. _N2756: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2756.htm
``cxx_nullptr``
Null pointer, as defined in N2431_.
- .. _N2431: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
+ .. _N2431: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
``cxx_override``
Override control ``override`` keyword, as defined in N2928_, N3206_
and N3272_.
- .. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
- .. _N3206: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
- .. _N3272: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
+ .. _N2928: https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
+ .. _N3206: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
+ .. _N3272: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
``cxx_range_for``
Range-based for, as defined in N2930_.
- .. _N2930: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
+ .. _N2930: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
``cxx_raw_string_literals``
Raw string literals, as defined in N2442_.
- .. _N2442: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
+ .. _N2442: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
``cxx_reference_qualified_functions``
Reference qualified functions, as defined in N2439_.
- .. _N2439: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
+ .. _N2439: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
``cxx_right_angle_brackets``
Right angle bracket parsing, as defined in N1757_.
- .. _N1757: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
+ .. _N1757: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
``cxx_rvalue_references``
R-value references, as defined in N2118_.
- .. _N2118: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
+ .. _N2118: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
``cxx_sizeof_member``
Size of non-static data members, as defined in N2253_.
- .. _N2253: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
+ .. _N2253: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
``cxx_static_assert``
Static assert, as defined in N1720_.
- .. _N1720: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
+ .. _N1720: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
``cxx_strong_enums``
Strongly typed enums, as defined in N2347_.
- .. _N2347: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
+ .. _N2347: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
``cxx_thread_local``
Thread-local variables, as defined in N2659_.
- .. _N2659: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
+ .. _N2659: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
``cxx_trailing_return_types``
Automatic function return type, as defined in N2541_.
- .. _N2541: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
+ .. _N2541: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
``cxx_unicode_literals``
Unicode string literals, as defined in N2442_.
- .. _N2442: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
+ .. _N2442: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
``cxx_uniform_initialization``
Uniform initialization, as defined in N2640_.
- .. _N2640: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf
+ .. _N2640: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf
``cxx_unrestricted_unions``
Unrestricted unions, as defined in N2544_.
- .. _N2544: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
+ .. _N2544: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
``cxx_user_literals``
User-defined literals, as defined in N2765_.
- .. _N2765: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
+ .. _N2765: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
``cxx_variadic_macros``
Variadic macros, as defined in N1653_.
- .. _N1653: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
+ .. _N1653: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
``cxx_variadic_templates``
Variadic templates, as defined in N2242_.
- .. _N2242: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
+ .. _N2242: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
Individual features from C++ 14
@@ -309,54 +314,54 @@ Individual features from C++ 14
``cxx_aggregate_default_initializers``
Aggregate default initializers, as defined in N3605_.
- .. _N3605: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3605.html
+ .. _N3605: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3605.html
``cxx_attribute_deprecated``
``[[deprecated]]`` attribute, as defined in N3760_.
- .. _N3760: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html
+ .. _N3760: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html
``cxx_binary_literals``
Binary literals, as defined in N3472_.
- .. _N3472: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf
+ .. _N3472: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf
``cxx_contextual_conversions``
Contextual conversions, as defined in N3323_.
- .. _N3323: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3323.pdf
+ .. _N3323: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3323.pdf
``cxx_decltype_auto``
``decltype(auto)`` semantics, as defined in N3638_.
- .. _N3638: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3638.html
+ .. _N3638: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3638.html
``cxx_digit_separators``
Digit separators, as defined in N3781_.
- .. _N3781: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf
+ .. _N3781: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf
``cxx_generic_lambdas``
Generic lambdas, as defined in N3649_.
- .. _N3649: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3649.html
+ .. _N3649: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3649.html
``cxx_lambda_init_captures``
Initialized lambda captures, as defined in N3648_.
- .. _N3648: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3648.html
+ .. _N3648: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3648.html
``cxx_relaxed_constexpr``
Relaxed constexpr, as defined in N3652_.
- .. _N3652: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
+ .. _N3652: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
``cxx_return_type_deduction``
Return type deduction on normal functions, as defined in N3386_.
- .. _N3386: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3386.html
+ .. _N3386: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3386.html
``cxx_variable_templates``
Variable templates, as defined in N3651_.
- .. _N3651: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3651.pdf
+ .. _N3651: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3651.pdf
diff --git a/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst b/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst
index fb8807f..e70eeb4 100644
--- a/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst
+++ b/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst
@@ -3,7 +3,7 @@ CPACK_START_MENU_SHORTCUTS
.. versionadded:: 3.3
-Species a list of shortcut names that should be created in the `Start Menu`
+Species a list of shortcut names that should be created in the ``Start Menu``
for this file.
The property is currently only supported by the :cpack_gen:`CPack WIX Generator`.
diff --git a/Help/prop_test/FIXTURES_REQUIRED.rst b/Help/prop_test/FIXTURES_REQUIRED.rst
index f850830..7a05601 100644
--- a/Help/prop_test/FIXTURES_REQUIRED.rst
+++ b/Help/prop_test/FIXTURES_REQUIRED.rst
@@ -19,10 +19,11 @@ be executed. The cleanup tests for the fixture will always be executed, even if
some setup tests fail.
When CTest is asked to execute only a subset of tests (e.g. by the use of
-regular expressions or when run with the ``--rerun-failed`` command line
-option), it will automatically add any setup or cleanup tests for fixtures
-required by any of the tests that are in the execution set. This behavior can
-be overridden with the ``-FS``, ``-FC`` and ``-FA`` command line options to
+regular expressions or when run with the :option:`--rerun-failed <ctest --rerun-failed>`
+command line option), it will automatically add any setup or cleanup tests for
+fixtures required by any of the tests that are in the execution set. This
+behavior can be overridden with the :option:`-FS <ctest -FS>`,
+:option:`-FC <ctest -FC>` and :option:`-FA <ctest -FA>` command line options to
:manual:`ctest(1)` if desired.
Since setup and cleanup tasks are also tests, they can have an ordering
diff --git a/Help/prop_test/LABELS.rst b/Help/prop_test/LABELS.rst
index a06f152..d827adc 100644
--- a/Help/prop_test/LABELS.rst
+++ b/Help/prop_test/LABELS.rst
@@ -4,7 +4,7 @@ LABELS
Specify a list of text labels associated with a test. The labels are
reported in both the ``ctest`` output summary and in dashboard submissions.
They can also be used to filter the set of tests to be executed (see the
-``ctest -L`` and ``ctest -LE`` :ref:`CTest Options`).
+:option:`ctest -L` and :option:`ctest -LE` options).
See :ref:`Additional Labels` for adding labels to a test dynamically during
test execution.
diff --git a/Help/prop_tgt/COMPILE_WARNING_AS_ERROR.rst b/Help/prop_tgt/COMPILE_WARNING_AS_ERROR.rst
index 19323cb..0d2b295 100644
--- a/Help/prop_tgt/COMPILE_WARNING_AS_ERROR.rst
+++ b/Help/prop_tgt/COMPILE_WARNING_AS_ERROR.rst
@@ -5,8 +5,8 @@ COMPILE_WARNING_AS_ERROR
Specify whether to treat warnings on compile as errors.
If enabled, adds a flag to treat warnings on compile as errors.
-If the ``--compile-no-warning-as-error`` option is given on the
-:manual:`cmake(1)` command line, this property is ignored.
+If the :option:`cmake --compile-no-warning-as-error` option is given
+on the :manual:`cmake(1)` command line, this property is ignored.
This property is not implemented for all compilers. It is silently ignored
if there is no implementation for the compiler being used. The currently
@@ -26,10 +26,12 @@ implemented :variable:`compiler IDs <CMAKE_<LANG>_COMPILER_ID>` are:
* ``NVIDIA`` (CUDA)
* ``QCC``
* ``SunPro``
+* ``Tasking``
* ``TI``
* ``VisualAge``
* ``XL``
* ``XLClang``
This property is initialized by the value of the variable
-:variable:`CMAKE_COMPILE_WARNING_AS_ERROR` if it is set when a target is created.
+:variable:`CMAKE_COMPILE_WARNING_AS_ERROR` if it is set when a target is
+created.
diff --git a/Help/prop_tgt/CONFIG_POSTFIX.rst b/Help/prop_tgt/CONFIG_POSTFIX.rst
index 5c2fbd7..69caa39 100644
--- a/Help/prop_tgt/CONFIG_POSTFIX.rst
+++ b/Help/prop_tgt/CONFIG_POSTFIX.rst
@@ -1,13 +1,13 @@
<CONFIG>_POSTFIX
----------------
-Postfix to append to the target file name for configuration <CONFIG>.
+Postfix to append to the target file name for configuration ``<CONFIG>``.
-When building with configuration <CONFIG> the value of this property
+When building with configuration ``<CONFIG>`` the value of this property
is appended to the target file name built on disk. For non-executable
-targets, this property is initialized by the value of the variable
-CMAKE_<CONFIG>_POSTFIX if it is set when a target is created. This
-property is ignored on the Mac for Frameworks and App Bundles.
+targets, this property is initialized by the value of the
+:variable:`CMAKE_<CONFIG>_POSTFIX` variable if it is set when a target is
+created. This property is ignored on macOS for Frameworks and App Bundles.
For macOS see also the :prop_tgt:`FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>`
target property.
diff --git a/Help/prop_tgt/CUDA_STANDARD.rst b/Help/prop_tgt/CUDA_STANDARD.rst
index 950ba12..ada69b9 100644
--- a/Help/prop_tgt/CUDA_STANDARD.rst
+++ b/Help/prop_tgt/CUDA_STANDARD.rst
@@ -39,6 +39,12 @@ Supported values are:
CUDA C++23
+``26``
+ .. versionadded:: 3.25
+
+ CUDA C++26. CMake 3.25 and later *recognize* ``26`` as a valid value,
+ no version has support for any compiler.
+
If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead. This
means that using:
diff --git a/Help/prop_tgt/CXX_MODULE_DIRS.rst b/Help/prop_tgt/CXX_MODULE_DIRS.rst
new file mode 100644
index 0000000..a32b5b1
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_DIRS.rst
@@ -0,0 +1,19 @@
+CXX_MODULE_DIRS
+---------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Semicolon-separated list of base directories of the target's default
+C++ module set (i.e. the file set with name and type ``CXX_MODULES``). The
+property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is normally only set by :command:`target_sources(FILE_SET)`
+rather than being manipulated directly.
+
+See :prop_tgt:`CXX_MODULE_DIRS_<NAME>` for the list of base directories in
+other C++ module sets.
diff --git a/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst b/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst
new file mode 100644
index 0000000..9190991
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst
@@ -0,0 +1,19 @@
+CXX_MODULE_DIRS_<NAME>
+----------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Semicolon-separated list of base directories of the target's ``<NAME>`` C++
+module set, which has the set type ``CXX_MODULES``. The property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is normally only set by :command:`target_sources(FILE_SET)`
+rather than being manipulated directly.
+
+See :prop_tgt:`CXX_MODULE_DIRS` for the list of base directories in the
+default C++ module set. See :prop_tgt:`CXX_MODULE_SETS` for the file set names
+of all C++ module sets.
diff --git a/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS.rst b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS.rst
new file mode 100644
index 0000000..5f33111
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS.rst
@@ -0,0 +1,19 @@
+CXX_MODULE_HEADER_UNIT_DIRS
+---------------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Semicolon-separated list of base directories of the target's default C++
+module header set (i.e. the file set with name and type
+``CXX_MODULE_HEADER_UNITS``). The property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is normally only set by :command:`target_sources(FILE_SET)`
+rather than being manipulated directly.
+
+See :prop_tgt:`CXX_MODULE_HEADER_UNIT_DIRS_<NAME>` for the list of base
+directories in other C++ module header sets.
diff --git a/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS_NAME.rst b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS_NAME.rst
new file mode 100644
index 0000000..b6163da
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS_NAME.rst
@@ -0,0 +1,21 @@
+CXX_MODULE_HEADER_UNIT_DIRS_<NAME>
+----------------------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Semicolon-separated list of base directories of the target's ``<NAME>`` C++
+module header set, which has the set type ``CXX_MODULE_HEADER_UNITS``. The
+property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is normally only set by :command:`target_sources(FILE_SET)`
+rather than being manipulated directly.
+
+See :prop_tgt:`CXX_MODULE_HEADER_UNIT_DIRS` for the list of base directories
+in the default C++ module header set. See
+:prop_tgt:`CXX_MODULE_HEADER_UNIT_SETS` for the file set names of all C++
+module header sets.
diff --git a/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET.rst b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET.rst
new file mode 100644
index 0000000..3b1bd04
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET.rst
@@ -0,0 +1,20 @@
+CXX_MODULE_HEADER_UNIT_SET
+--------------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Semicolon-separated list of files in the target's default C++ module header
+set, (i.e. the file set with name and type ``CXX_MODULE_HEADER_UNITS``). If
+any of the paths are relative, they are computed relative to the target's
+source directory. The property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is normally only set by :command:`target_sources(FILE_SET)`
+rather than being manipulated directly.
+
+See :prop_tgt:`CXX_MODULE_HEADER_UNIT_SET_<NAME>` for the list of files in
+other C++ module header sets.
diff --git a/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SETS.rst b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SETS.rst
new file mode 100644
index 0000000..ffc2daf
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SETS.rst
@@ -0,0 +1,20 @@
+CXX_MODULE_HEADER_UNIT_SETS
+---------------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Read-only list of the target's ``PRIVATE`` and ``PUBLIC`` C++ module header
+sets (i.e. all file sets with the type ``CXX_MODULE_HEADER_UNITS``). Files
+listed in these file sets are treated as source files for the purpose of IDE
+integration.
+
+C++ module header sets may be defined using the :command:`target_sources`
+command ``FILE_SET`` option with type ``CXX_MODULE_HEADER_UNITS``.
+
+See also :prop_tgt:`CXX_MODULE_HEADER_UNIT_SET_<NAME>`,
+:prop_tgt:`CXX_MODULE_HEADER_UNIT_SET` and
+:prop_tgt:`INTERFACE_CXX_MODULE_HEADER_UNIT_SETS`.
diff --git a/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET_NAME.rst b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET_NAME.rst
new file mode 100644
index 0000000..4bf5069
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET_NAME.rst
@@ -0,0 +1,21 @@
+CXX_MODULE_HEADER_UNIT_SET_<NAME>
+---------------------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Semicolon-separated list of files in the target's ``<NAME>`` C++ module header
+set, which has the set type ``CXX_MODULE_HEADER_UNITS``. If any of the paths
+are relative, they are computed relative to the target's source directory. The
+property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is normally only set by :command:`target_sources(FILE_SET)`
+rather than being manipulated directly.
+
+See :prop_tgt:`CXX_MODULE_HEADER_UNIT_SET` for the list of files in the
+default C++ module header set. See :prop_tgt:`CXX_MODULE_HEADER_UNIT_SETS` for
+the file set names of all C++ module header sets.
diff --git a/Help/prop_tgt/CXX_MODULE_SET.rst b/Help/prop_tgt/CXX_MODULE_SET.rst
new file mode 100644
index 0000000..f5cd8b2
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_SET.rst
@@ -0,0 +1,20 @@
+CXX_MODULE_SET
+--------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Semicolon-separated list of files in the target's default C++ module set,
+(i.e. the file set with name and type ``CXX_MODULES``). If any of the paths
+are relative, they are computed relative to the target's source directory. The
+property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is normally only set by :command:`target_sources(FILE_SET)`
+rather than being manipulated directly.
+
+See :prop_tgt:`CXX_MODULE_SET_<NAME>` for the list of files in other C++
+module sets.
diff --git a/Help/prop_tgt/CXX_MODULE_SETS.rst b/Help/prop_tgt/CXX_MODULE_SETS.rst
new file mode 100644
index 0000000..0e8945a
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_SETS.rst
@@ -0,0 +1,18 @@
+CXX_MODULE_SETS
+---------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Read-only list of the target's ``PRIVATE`` and ``PUBLIC`` C++ module sets (i.e.
+all file sets with the type ``CXX_MODULES``). Files listed in these file sets
+are treated as source files for the purpose of IDE integration.
+
+C++ module sets may be defined using the :command:`target_sources` command
+``FILE_SET`` option with type ``CXX_MODULES``.
+
+See also :prop_tgt:`CXX_MODULE_SET_<NAME>`, :prop_tgt:`CXX_MODULE_SET` and
+:prop_tgt:`INTERFACE_CXX_MODULE_SETS`.
diff --git a/Help/prop_tgt/CXX_MODULE_SET_NAME.rst b/Help/prop_tgt/CXX_MODULE_SET_NAME.rst
new file mode 100644
index 0000000..5674c99
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_SET_NAME.rst
@@ -0,0 +1,20 @@
+CXX_MODULE_SET_<NAME>
+---------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Semicolon-separated list of files in the target's ``<NAME>`` C++ module set,
+which has the set type ``CXX_MODULES``. If any of the paths are relative, they
+are computed relative to the target's source directory. The property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is normally only set by :command:`target_sources(FILE_SET)`
+rather than being manipulated directly.
+
+See :prop_tgt:`CXX_MODULE_SET` for the list of files in the default C++ module
+set. See :prop_tgt:`CXX_MODULE_SETS` for the file set names of all C++ module
+sets.
diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst
index b10d201..9b381e4 100644
--- a/Help/prop_tgt/CXX_STANDARD.rst
+++ b/Help/prop_tgt/CXX_STANDARD.rst
@@ -37,6 +37,12 @@ Supported values are:
C++23
+``26``
+ .. versionadded:: 3.25
+
+ C++26. CMake 3.25 and later *recognize* ``26`` as a valid value,
+ no version has support for any compiler.
+
If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead. This
means that using:
diff --git a/Help/prop_tgt/EXPORT_NO_SYSTEM.rst b/Help/prop_tgt/EXPORT_NO_SYSTEM.rst
new file mode 100644
index 0000000..61f0a8d
--- /dev/null
+++ b/Help/prop_tgt/EXPORT_NO_SYSTEM.rst
@@ -0,0 +1,11 @@
+EXPORT_NO_SYSTEM
+----------------
+
+.. versionadded:: 3.25
+
+Specifies that :command:`install(EXPORT)` and :command:`export` commands will
+generate an imported target with :prop_tgt:`SYSTEM` property `OFF`.
+
+See the :prop_tgt:`NO_SYSTEM_FROM_IMPORTED` target property to set this
+behavior on the target *consuming* the include directories rather than the
+one *providing* them.
diff --git a/Help/prop_tgt/HIP_STANDARD.rst b/Help/prop_tgt/HIP_STANDARD.rst
index 0c767c6..9de8730 100644
--- a/Help/prop_tgt/HIP_STANDARD.rst
+++ b/Help/prop_tgt/HIP_STANDARD.rst
@@ -25,6 +25,12 @@ Supported values are:
``23``
HIP C++23
+``26``
+ .. versionadded:: 3.25
+
+ HIP C++26. CMake 3.25 and later *recognize* ``26`` as a valid value,
+ no version has support for any compiler.
+
If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead. This
means that using:
diff --git a/Help/prop_tgt/IMPORTED_NO_SYSTEM.rst b/Help/prop_tgt/IMPORTED_NO_SYSTEM.rst
index ee22d6f..913d9f2 100644
--- a/Help/prop_tgt/IMPORTED_NO_SYSTEM.rst
+++ b/Help/prop_tgt/IMPORTED_NO_SYSTEM.rst
@@ -3,11 +3,21 @@ IMPORTED_NO_SYSTEM
.. versionadded:: 3.23
+.. deprecated:: 3.25
+
+ ``IMPORTED_NO_SYSTEM`` is deprecated. Set :prop_tgt:`SYSTEM` to `OFF`
+ instead if you don't want target's include directories to be ``SYSTEM``
+ when compiling consumers. Set :prop_tgt:`EXPORT_NO_SYSTEM` to `ON` instead
+ if you don't want the include directories of the imported target generated
+ by :command:`install(EXPORT)` and :command:`export` commands to be
+ ``SYSTEM`` when compiling consumers.
+
Specifies that an :ref:`Imported Target <Imported Targets>` is not
a ``SYSTEM`` library. This has the following effects:
* Entries of :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` are not treated
- as ``SYSTEM`` include directories when compiling consumers, as they
+ as ``SYSTEM`` include directories when compiling consumers (regardless of
+ the value of the consumed target's :prop_tgt:`SYSTEM` property), as they
would be by default. Entries of
:prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` are not affected,
and will always be treated as ``SYSTEM`` include directories.
diff --git a/Help/prop_tgt/INTERFACE_CXX_MODULE_HEADER_UNIT_SETS.rst b/Help/prop_tgt/INTERFACE_CXX_MODULE_HEADER_UNIT_SETS.rst
new file mode 100644
index 0000000..3fe6d9a
--- /dev/null
+++ b/Help/prop_tgt/INTERFACE_CXX_MODULE_HEADER_UNIT_SETS.rst
@@ -0,0 +1,18 @@
+INTERFACE_CXX_MODULE_HEADER_UNIT_SETS
+-------------------------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Read-only list of the target's ``PUBLIC`` C++ module header sets (i.e. all
+file sets with the type ``CXX_MODULE_HEADER_UNITS``). Files listed in these
+C++ module header sets can be installed with :command:`install(TARGETS)` and
+exported with :command:`install(EXPORT)` and :command:`export`.
+
+C++ module header sets may be defined using the :command:`target_sources`
+command ``FILE_SET`` option with type ``CXX_MODULE_HEADER_UNITS``.
+
+See also :prop_tgt:`CXX_MODULE_HEADER_UNIT_SETS`.
diff --git a/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst b/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst
new file mode 100644
index 0000000..c7ed46d
--- /dev/null
+++ b/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst
@@ -0,0 +1,18 @@
+INTERFACE_CXX_MODULE_SETS
+-------------------------
+
+.. versionadded:: 3.25
+
+.. note ::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API``
+
+Read-only list of the target's ``PUBLIC`` C++ module sets (i.e. all file sets
+with the type ``CXX_MODULES``). Files listed in these C++ module sets can be
+installed with :command:`install(TARGETS)` and exported with
+:command:`install(EXPORT)` and :command:`export`.
+
+C++ module sets may be defined using the :command:`target_sources` command
+``FILE_SET`` option with type ``CXX_MODULES``.
+
+See also :prop_tgt:`CXX_MODULE_SETS`.
diff --git a/Help/prop_tgt/LANG_CLANG_TIDY.rst b/Help/prop_tgt/LANG_CLANG_TIDY.rst
index af16d3c..31f1876 100644
--- a/Help/prop_tgt/LANG_CLANG_TIDY.rst
+++ b/Help/prop_tgt/LANG_CLANG_TIDY.rst
@@ -3,13 +3,25 @@
.. versionadded:: 3.6
-This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, ``OBJC`` or ``OBJCXX``.
+This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, ``OBJC``
+or ``OBJCXX``.
-Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
-line for the ``clang-tidy`` tool. The :ref:`Makefile Generators`
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing
+a command line for the ``clang-tidy`` tool. The :ref:`Makefile Generators`
and the :generator:`Ninja` generator will run this tool along with the
compiler and report a warning if the tool reports any problems.
+The specified ``clang-tidy`` command line will be invoked with additional
+arguments specifying the source file and, after ``--``, the full compiler
+command line.
+
+.. versionchanged:: 3.25
+
+ If the specified ``clang-tidy`` command line includes the ``-p`` option,
+ it will be invoked without ``--`` and the full compiler command line.
+ ``clang-tidy`` will look up the source file in the specified compiler
+ commands database.
+
This property is initialized by the value of
the :variable:`CMAKE_<LANG>_CLANG_TIDY` variable if it is set
when a target is created.
diff --git a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
index cba8ac9..2e039bd 100644
--- a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
+++ b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
@@ -14,3 +14,8 @@ its arguments to the tool. Some example tools are distcc and ccache.
This property is initialized by the value of
the :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable if it is set
when a target is created.
+
+.. versionadded:: 3.25
+
+ The property value may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
new file mode 100644
index 0000000..7f19bc0
--- /dev/null
+++ b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
@@ -0,0 +1,16 @@
+``Embedded``
+ Compile with ``-Z7`` or equivalent flag(s) to produce object files
+ with full symbolic debugging information.
+``ProgramDatabase``
+ Compile with ``-Zi`` or equivalent flag(s) to produce a program
+ database that contains all the symbolic debugging information.
+``EditAndContinue``
+ Compile with ``-ZI`` or equivalent flag(s) to produce a program
+ database that supports the Edit and Continue feature.
+
+The value is ignored on compilers not targeting the MSVC ABI, but an
+unsupported value will be rejected as an error when using a compiler
+targeting the MSVC ABI.
+
+The value may also be the empty string (``""``), in which case no debug
+information format flag will be added explicitly by CMake.
diff --git a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
new file mode 100644
index 0000000..0c7845c
--- /dev/null
+++ b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
@@ -0,0 +1,33 @@
+MSVC_DEBUG_INFORMATION_FORMAT
+-----------------------------
+
+.. versionadded:: 3.25
+
+Select debug information format when targeting the MSVC ABI.
+
+The allowed values are:
+
+.. include:: MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
+support per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+ add_executable(foo foo.c)
+ set_property(TARGET foo PROPERTY
+ MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>")
+
+selects for the target ``foo`` the program database debug information format
+for the Debug configuration.
+
+If this property is not set, CMake selects a debug information format using
+the default value ``$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>``, if
+supported by the compiler, and otherwise
+``$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>``.
+
+.. note::
+
+ This property has effect only when policy :policy:`CMP0141` is set to ``NEW``
+ prior to the first :command:`project` or :command:`enable_language` command
+ that enables a language using a compiler targeting the MSVC ABI.
diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt
index 6c61341..5f8b82d 100644
--- a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt
+++ b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt
@@ -11,8 +11,9 @@
Compile with ``-MDd`` or equivalent flag(s) to use a multi-threaded
dynamically-linked runtime library.
-The value is ignored on non-MSVC compilers but an unsupported value will
-be rejected as an error when using a compiler targeting the MSVC ABI.
+The value is ignored on compilers not targeting the MSVC ABI, but an
+unsupported value will be rejected as an error when using a compiler
+targeting the MSVC ABI.
The value may also be the empty string (``""``) in which case no runtime
library selection flag will be added explicitly by CMake. Note that with
diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
index 9b978b2..9f13d38 100644
--- a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
+++ b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
@@ -21,7 +21,9 @@ support per-configuration specification. For example, the code:
selects for the target ``foo`` a multi-threaded statically-linked runtime
library with or without debug information depending on the configuration.
-If this property is not set then CMake uses the default value
+The property is initialized from the value of the
+:variable:`CMAKE_MSVC_RUNTIME_LIBRARY` variable, if it is set.
+If the property is not set, then CMake uses the default value
``MultiThreaded$<$<CONFIG:Debug>:Debug>DLL`` to select a MSVC runtime library.
.. note::
diff --git a/Help/prop_tgt/OBJCXX_STANDARD.rst b/Help/prop_tgt/OBJCXX_STANDARD.rst
index 654e687..6ac8216 100644
--- a/Help/prop_tgt/OBJCXX_STANDARD.rst
+++ b/Help/prop_tgt/OBJCXX_STANDARD.rst
@@ -31,6 +31,12 @@ Supported values are:
Objective C++23
+``26``
+ .. versionadded:: 3.25
+
+ Objective C++26. CMake 3.25 and later *recognize* ``26`` as a valid value,
+ no version has support for any compiler.
+
If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead. This
means that using:
diff --git a/Help/prop_tgt/SYSTEM.rst b/Help/prop_tgt/SYSTEM.rst
new file mode 100644
index 0000000..a267738
--- /dev/null
+++ b/Help/prop_tgt/SYSTEM.rst
@@ -0,0 +1,22 @@
+SYSTEM
+------
+
+.. versionadded:: 3.25
+
+Specifies that a target is a ``SYSTEM`` library. This has the following
+effects:
+
+* Entries of :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` are treated as
+ ``SYSTEM`` include directories when compiling consumers.
+ Entries of :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` are not
+ affected, and will always be treated as ``SYSTEM`` include directories.
+
+For imported targets, this property defaults to true, which means
+that their :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` are treated
+as ``SYSTEM`` by default. If their ``SYSTEM`` property is false,
+then their :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` will not be
+treated as ``SYSTEM``, regardless of the value of the
+:prop_tgt:`IMPORTED_NO_SYSTEM` property.
+
+This target property is initialized from the :prop_dir:`SYSTEM`
+directory property when the target is created.
diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst
index 58476d6..1e84c00 100644
--- a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst
+++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst
@@ -9,5 +9,5 @@ The property value may use
This is defined in ``<LocalDebuggerCommand>`` in the Visual Studio
project file.
-This property only works for Visual Studio 2010 and above;
+This property only works for Visual Studio 11 2012 and above;
it is ignored on other generators.
diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst
index 6c26601..e54e140 100644
--- a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst
+++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst
@@ -9,5 +9,5 @@ The property value may use
This is defined in ``<LocalDebuggerCommandArguments>`` in the Visual Studio
project file.
-This property only works for Visual Studio 2010 and above;
+This property only works for Visual Studio 11 2012 and above;
it is ignored on other generators.
diff --git a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst
index 2f59a82..60bc2f0 100644
--- a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst
+++ b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst
@@ -9,5 +9,5 @@ The property value may use
This is defined in ``<LocalDebuggerEnvironment>`` in the Visual Studio
project file.
-This property only works for Visual Studio 2010 and above;
+This property only works for Visual Studio 11 2012 and above;
it is ignored on other generators.
diff --git a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst
index c163abf..f9ce7aa 100644
--- a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst
+++ b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst
@@ -9,5 +9,5 @@ The property value may use
This is defined in ``<LocalDebuggerWorkingDirectory>`` in the Visual Studio
project file.
-This property only works for Visual Studio 2010 and above;
+This property only works for Visual Studio 11 2012 and above;
it is ignored on other generators.
diff --git a/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst b/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst
index 5212293..8a85ba4 100644
--- a/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst
+++ b/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst
@@ -12,7 +12,7 @@ If the property is unset, Visual Studio uses the first matching
than one ``Main()`` method is available in the current project, the property
becomes mandatory for building the project.
-This property only works for Visual Studio 2010 and above;
+This property only works for Visual Studio 11 2012 and above;
it is ignored on other generators.
.. code-block:: cmake
diff --git a/Help/prop_tgt/VS_KEYWORD.rst b/Help/prop_tgt/VS_KEYWORD.rst
index 6c2e042..221b986 100644
--- a/Help/prop_tgt/VS_KEYWORD.rst
+++ b/Help/prop_tgt/VS_KEYWORD.rst
@@ -7,4 +7,4 @@ Can be set to change the visual studio keyword, for example Qt
integration works better if this is set to Qt4VSv1.0.
Use the :prop_tgt:`VS_GLOBAL_KEYWORD` target property to set the
-keyword for Visual Studio 10 (2010) and newer.
+keyword for Visual Studio 11 (2012) and newer.
diff --git a/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst b/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst
index 8f46d2f..fa3c5bc 100644
--- a/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst
+++ b/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst
@@ -30,6 +30,9 @@ at target creation time.
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER_STOP`
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER`
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP`
+- :prop_tgt:`XCODE_SCHEME_LAUNCH_CONFIGURATION`
+- :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_API_VALIDATION`
+- :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION`
- :prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS`
The following target properties will be applied on the
@@ -41,4 +44,5 @@ The following target properties will be applied on the
- :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE`
- :prop_tgt:`XCODE_SCHEME_ENVIRONMENT`
- :prop_tgt:`XCODE_SCHEME_EXECUTABLE`
+- :prop_tgt:`XCODE_SCHEME_LAUNCH_MODE`
- :prop_tgt:`XCODE_SCHEME_WORKING_DIRECTORY`
diff --git a/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst b/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst
new file mode 100644
index 0000000..3b801c5
--- /dev/null
+++ b/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst
@@ -0,0 +1,14 @@
+XCODE_SCHEME_ENABLE_GPU_API_VALIDATION
+--------------------------------------
+
+.. versionadded:: 3.25
+
+Property value for ``Metal: API Validation`` in the Options section of
+the generated Xcode scheme.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION`
+if it is set when a target is created.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst b/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst
new file mode 100644
index 0000000..5358087
--- /dev/null
+++ b/Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst
@@ -0,0 +1,14 @@
+XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION
+-----------------------------------------
+
+.. versionadded:: 3.25
+
+Property value for ``Metal: Shader Validation`` in the Options section of
+the generated Xcode scheme.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION`
+if it is set when a target is created.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/prop_tgt/XCODE_SCHEME_LAUNCH_CONFIGURATION.rst b/Help/prop_tgt/XCODE_SCHEME_LAUNCH_CONFIGURATION.rst
new file mode 100644
index 0000000..9643322
--- /dev/null
+++ b/Help/prop_tgt/XCODE_SCHEME_LAUNCH_CONFIGURATION.rst
@@ -0,0 +1,13 @@
+XCODE_SCHEME_LAUNCH_CONFIGURATION
+---------------------------------
+
+.. versionadded:: 3.25
+
+Set the build configuration to run the target.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION`
+if it is set when a target is created.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/prop_tgt/XCODE_SCHEME_LAUNCH_MODE.rst b/Help/prop_tgt/XCODE_SCHEME_LAUNCH_MODE.rst
new file mode 100644
index 0000000..df5ae07
--- /dev/null
+++ b/Help/prop_tgt/XCODE_SCHEME_LAUNCH_MODE.rst
@@ -0,0 +1,22 @@
+XCODE_SCHEME_LAUNCH_MODE
+------------------------
+
+.. versionadded:: 3.25
+
+Property value for ``Launch`` in the Info section of the generated Xcode
+scheme.
+
+Possible values are:
+
+``AUTO``
+ Launch automatically. This is the default.
+
+``WAIT``
+ Wait for the executable to be launched.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_XCODE_SCHEME_LAUNCH_MODE` if it is set when a target is
+created.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/release/3.0.rst b/Help/release/3.0.rst
index 64491e3..e37c130 100644
--- a/Help/release/3.0.rst
+++ b/Help/release/3.0.rst
@@ -11,7 +11,7 @@ Documentation Changes
=====================
* The CMake documentation has been converted to reStructuredText and
- now transforms via Sphinx (`<http://sphinx-doc.org>`__) into man and
+ now transforms via Sphinx (`<https://www.sphinx-doc.org>`__) into man and
html pages. This allows the documentation to be properly indexed
and to contain cross-references.
diff --git a/Help/release/3.11.rst b/Help/release/3.11.rst
index a80657d..957dd4f 100644
--- a/Help/release/3.11.rst
+++ b/Help/release/3.11.rst
@@ -174,7 +174,7 @@ Modules
to removal of the ``javah`` tool by `JEP 313`_.
.. _`FLAME`: https://github.com/flame
-.. _`JEP 313`: http://openjdk.java.net/jeps/313
+.. _`JEP 313`: https://openjdk.java.net/jeps/313
Autogen
-------
diff --git a/Help/release/3.12.rst b/Help/release/3.12.rst
index 481027e..dcdae1d 100644
--- a/Help/release/3.12.rst
+++ b/Help/release/3.12.rst
@@ -242,7 +242,7 @@ CPack
* A :cpack_gen:`CPack NuGet Generator` was was added with basic
support for `NuGet`_.
-.. _NuGet: https://docs.microsoft.com/en-us/nuget/what-is-nuget
+.. _NuGet: https://learn.microsoft.com/en-us/nuget/what-is-nuget
Other
-----
@@ -302,4 +302,4 @@ Other Changes
(and legacy ``swig_add_module`` command) now set the prefix of
Java modules to ``""`` for MINGW, MSYS, and CYGWIN environments.
-.. _`Fortran Submodules`: http://fortranwiki.org/fortran/show/Submodules
+.. _Fortran Submodules: https://fortranwiki.org/fortran/show/Submodules
diff --git a/Help/release/3.20.rst b/Help/release/3.20.rst
index 42e95be..40cac41 100644
--- a/Help/release/3.20.rst
+++ b/Help/release/3.20.rst
@@ -217,8 +217,8 @@ Autogen
CTest
-----
-* :manual:`ctest(1)` gained a ``--test-dir`` option to specify the directory
- in which to look for tests.
+* :manual:`ctest(1)` gained a :option:`--test-dir <ctest --test-dir>`
+ option to specify the directory in which to look for tests.
CPack
-----
@@ -263,7 +263,7 @@ CPack
:variable:`CPACK_NUGET_<compName>_PACKAGE_LANGUAGE` allow the locale
for a package to be specified, for example ``en_CA``.
-.. _Software Package Data Exchange: https://spdx.org/
+.. _Software Package Data Exchange: https://spdx.dev/
Deprecated and Removed Features
===============================
diff --git a/Help/release/3.21.rst b/Help/release/3.21.rst
index 462d2be..91c3768 100644
--- a/Help/release/3.21.rst
+++ b/Help/release/3.21.rst
@@ -49,15 +49,15 @@ Languages
Command-Line
------------
-* :manual:`cmake(1)` gained the ``--install-prefix <dir>``
+* :manual:`cmake(1)` gained the :option:`--install-prefix <cmake --install-prefix>`
command-line option to specify the location of the install prefix.
-* :manual:`cmake(1)` gained the ``--toolchain <path/to/file>``
+* :manual:`cmake(1)` gained the :option:`--toolchain <cmake --toolchain>`
command-line option to specify a toolchain file.
-* :manual:`cmake(1)` ``-E capabilities`` output, for some generators,
- may now contain a ``supportedPlatforms`` field listing platforms
- known to be supported in :variable:`CMAKE_GENERATOR_PLATFORM`.
+* :manual:`cmake(1)` :option:`-E capabilities <cmake-E capabilities>` output,
+ for some generators, may now contain a ``supportedPlatforms`` field listing
+ platforms known to be supported in :variable:`CMAKE_GENERATOR_PLATFORM`.
* Messages printed to a terminal now may be colored by message type.
@@ -208,8 +208,8 @@ CTest
:prop_test:`ATTACHED_FILES_ON_FAIL` test properties.
See :ref:`Additional Test Measurements` for more information.
-* :manual:`ctest(1)` gained a ``--output-junit`` option to write test results
- to a JUnit XML file.
+* :manual:`ctest(1)` gained a :option:`--output-junit <ctest --output-junit>`
+ option to write test results to a JUnit XML file.
* The :command:`ctest_build` command gained a ``PARALLEL_LEVEL`` option.
diff --git a/Help/release/3.23.rst b/Help/release/3.23.rst
index 47b1869..6376d77 100644
--- a/Help/release/3.23.rst
+++ b/Help/release/3.23.rst
@@ -43,19 +43,22 @@ Generators
Command-Line
------------
-* The :manual:`cmake(1)` ``--build`` command, when used with
+* The :manual:`cmake(1)` :option:`--build <cmake --build>` command, when used with
:ref:`Visual Studio Generators` on projects that set the
:prop_tgt:`VS_PACKAGE_REFERENCES` target property, now automatically
restores package references from NuGet. The cache variable
:variable:`CMAKE_VS_NUGET_PACKAGE_RESTORE` may be set to toggle this behavior
- in a build tree. Use the ``--resolve-package-references=<on|off|only>``
+ in a build tree. Use the
+ :option:`--resolve-package-references <cmake--build --resolve-package-references>`
command-line option to control the behavior on one invocation.
-* The :manual:`cmake(1)` command line tool gained a ``--debug-find-pkg=``
+* The :manual:`cmake(1)` command line tool gained a
+ :option:`--debug-find-pkg <cmake --debug-find-pkg>`
option to enable debug messages under specific :command:`find_package`
calls.
-* The :manual:`cmake(1)` command line tool gained a ``--debug-find-var=``
+* The :manual:`cmake(1)` command line tool gained a
+ :option:`--debug-find-var <cmake --debug-find-var>`
option to enable debug messages for ``find_*`` calls that use specific
result variables.
diff --git a/Help/release/3.24.rst b/Help/release/3.24.rst
index 9317e51..f484e1a 100644
--- a/Help/release/3.24.rst
+++ b/Help/release/3.24.rst
@@ -34,25 +34,28 @@ Generators
Command-Line
------------
-* :manual:`cmake(1)` gained the ``--fresh`` command-line option to remove
- any existing ``CMakeCache.txt`` file and associated ``CMakeFiles/``
+* :manual:`cmake(1)` gained the :option:`--fresh <cmake --fresh>` command-line
+ option to remove any existing ``CMakeCache.txt`` file and associated ``CMakeFiles/``
directory, when configuring a build tree, thus starting a new configuration
as if the build tree were freshly created.
-* :manual:`cmake(1)` gained the ``--compile-no-warning-as-error`` command-line
- option which causes the effects of the :prop_tgt:`COMPILE_WARNING_AS_ERROR`
- target property and :variable:`CMAKE_COMPILE_WARNING_AS_ERROR` variable
- to be ignored.
+* :manual:`cmake(1)` gained the
+ :option:`--compile-no-warning-as-error <cmake --compile-no-warning-as-error>`
+ command-line option which causes the effects of the
+ :prop_tgt:`COMPILE_WARNING_AS_ERROR` target property and
+ :variable:`CMAKE_COMPILE_WARNING_AS_ERROR` variable to be ignored.
-* The :manual:`cmake(1)` ``--trace=json-v1`` trace format gained fields
- ``global_frame`` and ``line_end``.
+* The :manual:`cmake(1)` :option:`--trace=json-v1 <cmake --trace>` trace
+ format gained fields ``global_frame`` and ``line_end``.
-* The :manual:`cmake(1)` ``-E`` commands ``cat`` and ``env`` learned to respect
- a double dash (``--``) argument that acts as a delimiter indicating the end of
- options. Any following arguments are treated as operands/positional arguments,
- even if they begin with a dash ``-`` character.
+* The :manual:`cmake(1)` :option:`-E <cmake -E>` commands :option:`cat <cmake-E cat>`
+ and :option:`env <cmake-E env>` learned to respect a double dash
+ (:option:`-- <cmake-E_env -->`) argument that acts as a delimiter indicating
+ the end of options. Any following arguments are treated as operands/positional
+ arguments, even if they begin with a dash ``-`` character.
-* The :manual:`cmake(1)` ``-E tar`` command gained the ``--touch`` option
+* The :manual:`cmake(1)` :option:`-E tar <cmake-E tar>` command gained the
+ :option:`--touch <cmake-E_tar --touch>` option
to keep the current local timestamp instead of extracting file timestamps
from the archive.
@@ -289,9 +292,10 @@ Generator Expressions
CTest
-----
-* :manual:`ctest(1)` gained a ``--test-output-truncation`` option (and
- corresponding :variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variable) to
- specify the truncation mode once the maximum test output size has been
+* :manual:`ctest(1)` gained a
+ :option:`--test-output-truncation <ctest --test-output-truncation>` option
+ (and corresponding :variable:`CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION` variable)
+ to specify the truncation mode once the maximum test output size has been
reached. Possible values are ``tail`` (default), ``middle`` or ``head``.
CPack
diff --git a/Help/release/3.25.rst b/Help/release/3.25.rst
new file mode 100644
index 0000000..7d0cf0a
--- /dev/null
+++ b/Help/release/3.25.rst
@@ -0,0 +1,240 @@
+CMake 3.25 Release Notes
+************************
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake 3.24 include the following.
+
+New Features
+============
+
+Presets
+-------
+
+* The :manual:`cmake-presets(7)` schema version has been bumped to ``6``.
+
+* The :manual:`cmake-presets(7)` format now supports a
+ ``packagePresets`` field to specify presets for :option:`cpack --preset`.
+
+* The :manual:`cmake-presets(7)` format now supports a
+ ``workflowPresets`` field to specify presets for :option:`cmake --workflow`.
+
+* The :manual:`cmake-presets(7)` format now supports an
+ ``outputJUnitFile`` field to specify JUnit output in test presets.
+
+Languages
+---------
+
+* The :manual:`Compile Features <cmake-compile-features(7)>` functionality
+ is now aware of C++26, and defines a ``cxx_std_26`` meta-feature.
+ C++26 compiler modes may also be specified via the :prop_tgt:`CXX_STANDARD`,
+ :prop_tgt:`CUDA_STANDARD`, :prop_tgt:`HIP_STANDARD`,
+ or :prop_tgt:`OBJCXX_STANDARD` target properties.
+
+* ``CUDA`` language support now includes device link-time optimization when
+ using ``nvcc``. The :variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION` variable
+ and the associated :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target property
+ will activate device LTO.
+
+Command-Line
+------------
+
+* A :option:`cmake --workflow --preset <cmake--workflow --preset>` mode was
+ added to drive sequences of configure, build, test, and package operations
+ through a single command.
+
+* The :option:`cmake -E capabilities <cmake-E capabilities>` command
+ gained a new ``tls`` field that tells whether or not TLS is enabled.
+
+* The :option:`cmake -E env <cmake-E env>` command-line tool gained
+ a ``--modify`` flag to support :prop_test:`ENVIRONMENT_MODIFICATION`
+ operations.
+
+* The :option:`cmake --debug-trycompile` option now prints log messages
+ reporting the directory in which each try-compile check is done.
+
+Compilers
+---------
+
+* Support for the `Tasking compiler toolsets`_ (SmartCode, TriCore,
+ Standalone: ARM, MCS, 8051) was added with compiler id ``Tasking``.
+ See the :variable:`CMAKE_TASKING_TOOLSET` variable.
+
+.. _Tasking compiler toolsets: https://www.tasking.com
+
+Commands
+--------
+
+* The :command:`add_subdirectory` command gained a ``SYSTEM`` option
+ to enable the :prop_dir:`SYSTEM` directory property in the subdirectory.
+
+* The :command:`block` and :command:`endblock` commands were added to manage
+ specific scopes (policy or variable) for a contained block of commands.
+
+* The :command:`cmake_language` command gained a new
+ ``GET_MESSAGE_LOG_LEVEL`` sub-command. It can be used to
+ query the current message logging level.
+
+* The :command:`find_file`, :command:`find_path`, :command:`find_library`, and
+ :command:`find_program` commands gained a ``VALIDATOR`` option to specify a
+ function to be called for each candidate item to validate it.
+
+* The :command:`find_package` command now considers paths of
+ the form ``<prefix>/<name>*/(cmake|CMake)/<name>*/`` when
+ searching for package configuration files.
+
+* The :command:`return` command gained a ``PROPAGATE`` option to propagate
+ variables to the scope to which control returns.
+ See policy :policy:`CMP0140`.
+
+* The :command:`try_compile` and :command:`try_run` commands gained new
+ signatures that more consistently use keyword dispatch and do not require a
+ binary directory to be specified. Additionally, these signatures use a
+ unique directory for each invocation, which allows multiple outputs to be
+ preserved when using :option:`cmake --debug-trycompile`.
+
+* The :command:`try_compile` and :command:`try_run` commands gained the
+ option ``NO_CACHE`` to store results in normal variables.
+
+* The :command:`try_run` command gained ``RUN_OUTPUT_STDOUT_VARIABLE``
+ and ``RUN_OUTPUT_STDERR_VARIABLE`` options to capture stdout and stderr
+ separately from the output of the compiled program.
+
+Variables
+---------
+
+* The :variable:`BSD` and :variable:`CMAKE_HOST_BSD` variables are now set
+ to a string value when the target or host system is BSD, respectively.
+
+* The :variable:`LINUX` and :variable:`CMAKE_HOST_LINUX` variables are
+ now set to true when the target or host system is Linux, respectively.
+
+* The :variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable and
+ :prop_tgt:`MSVC_DEBUG_INFORMATION_FORMAT` target property were introduced
+ to select the debug information format for compilers targeting the MSVC ABI.
+ See policy :policy:`CMP0141`.
+
+* The :variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION` variable and
+ corresponding :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_API_VALIDATION` target
+ property were added to tell the :generator:`Xcode` generator what to put
+ in the scheme's ``Metal: API Validation`` setting.
+
+* The :variable:`CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION` variable and
+ corresponding :prop_tgt:`XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION` target
+ property were added to tell the :generator:`Xcode` generator what to put
+ in the scheme's ``Metal: Shader Validation`` setting.
+
+* The :variable:`CMAKE_XCODE_SCHEME_LAUNCH_MODE` variable and corresponding
+ :prop_tgt:`XCODE_SCHEME_LAUNCH_MODE` target property were added to tell
+ the :generator:`Xcode` generator what to put in the scheme's "Launch"
+ mode setting.
+
+* The :variable:`CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION` variable and
+ corresponding :prop_tgt:`XCODE_SCHEME_LAUNCH_CONFIGURATION` target
+ property were added to tell the :generator:`Xcode` generator what
+ configuration to put in the scheme's Launch action.
+
+Properties
+----------
+
+* The :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property now supports
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+* The :prop_tgt:`EXPORT_NO_SYSTEM` target property was added to
+ specify that :command:`install(EXPORT)` and :command:`export`
+ commands will generate na imported target with
+ :prop_tgt:`SYSTEM` property ``OFF``.
+
+* The :prop_tgt:`SYSTEM` target property was added to specify
+ whether a target should be treated as a system library (i.e.
+ its include directories are automatically ``SYSTEM`` when
+ compiling consumers). If not set, the default is the previous
+ behavior: on for imported targets and off for other targets.
+
+* The :prop_dir:`SYSTEM` directory property was added to initialize the
+ :prop_tgt:`SYSTEM` target property for targets created in that directory.
+
+Modules
+-------
+
+* The :module:`FetchContent` module :command:`FetchContent_Declare`
+ command gained a ``SYSTEM`` option to enable the :prop_dir:`SYSTEM`
+ directory property in the subdirectory.
+
+* The :module:`FindCUDAToolkit` module now provides a target for
+ :ref:`nvtx3 <cuda_toolkit_nvtx3>` for CUDA 10.0+, which supersedes
+ :ref:`nvToolsExt <cuda_toolkit_nvToolsExt>`. A deprecation warning
+ is emitted when using ``nvToolsExt`` if the project requires CMake
+ 3.25 and CUDA 10.0+ is used.
+
+* The :module:`FindDoxygen` module's version handling has been improved:
+
+ * Multiple candidate installations will now be considered, if needed,
+ to satisfy version constraints. Previously, only the first one
+ encountered would be considered.
+
+ * Version ranges are supported.
+
+ * Variations in the version format reported by Doxygen are now
+ tolerated (e.g. a trailing git commit hash).
+
+* The :module:`FindOpenAL` module now provides an imported target.
+
+* The :module:`FindOpenSP` module was added to find the OpenSP library.
+
+* The :module:`FindVulkan` module gained support for new components:
+
+ ``dxc``
+ DirectX Shader Compiler.
+
+ ``volk``
+ Volk open-source vulkan meta-loader.
+
+CPack
+-----
+
+* The :cpack_gen:`CPack Archive Generator` gained a new
+ :variable:`CPACK_ARCHIVE_FILE_EXTENSION` variable to control
+ the package file name extension.
+
+* The :cpack_gen:`CPack NSIS Generator` gained two new variables
+ :variable:`CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS` and
+ :variable:`CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS`
+ to provide arguments to the nsis executable invocation.
+
+* The :module:`CPack` module gained the :variable:`CPACK_READELF_EXECUTABLE`,
+ :variable:`CPACK_OBJCOPY_EXECUTABLE`, and
+ :variable:`CPACK_OBJDUMP_EXECUTABLE` variables to control the locations
+ of binutils used by :manual:`cpack(1)`.
+
+Deprecated and Removed Features
+===============================
+
+* The :prop_tgt:`IMPORTED_NO_SYSTEM` target property has been deprecated
+ in favor of :prop_tgt:`SYSTEM` and :prop_tgt:`EXPORT_NO_SYSTEM`.
+
+* The :generator:`Visual Studio 10 2010` generator has been removed.
+
+* The :generator:`Visual Studio 11 2012` generator is now deprecated
+ and will be removed in a future version of CMake.
+
+Other Changes
+=============
+
+* On Windows, when targeting the MSVC ABI, the :command:`find_library` command
+ now accepts ``.a`` file names after first considering ``.lib``. This is
+ symmetric with existing behavior when targeting the GNU ABI, in which the
+ command accepts ``.lib`` file names after first considering ``.a``.
+
+* The :envvar:`SSL_CERT_FILE` and :envvar:`SSL_CERT_DIR` environment
+ variables can now be used to override where to find certificate
+ authorities for TLS/SSL operations.
+
+* If :prop_tgt:`<LANG>_CLANG_TIDY` includes a ``-p`` argument, the
+ full compiler command line is no longer appended after ``--``.
+
+* The :generator:`Xcode` generator no longer adds the per-config suffix
+ ``$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)`` to library search paths.
+ See policy :policy:`CMP0142`.
diff --git a/Help/release/3.3.rst b/Help/release/3.3.rst
index 44f4e19..2dc237f 100644
--- a/Help/release/3.3.rst
+++ b/Help/release/3.3.rst
@@ -26,7 +26,7 @@ Generators
added on Windows. `Green Hills MULTI`_ is an IDE for embedded
real-time systems.
-.. _`Green Hills MULTI`: http://www.ghs.com/products/MULTI_IDE.html
+.. _`Green Hills MULTI`: https://www.ghs.com/products/MULTI_IDE.html
Commands
--------
diff --git a/Help/release/3.4.rst b/Help/release/3.4.rst
index 943d267..abfede6 100644
--- a/Help/release/3.4.rst
+++ b/Help/release/3.4.rst
@@ -227,7 +227,7 @@ Other
will be merged with linker-generated manifests and embedded in the
binary.
-* The `Concurrent Fortran 77 <https://ccur.com>`__ compiler is now supported.
+* The Concurrent Fortran 77 compiler is now supported.
Its :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` is ``CCur``.
* :manual:`cmake(1)` gained a new ``--trace-expand`` command line option
diff --git a/Help/release/3.7.rst b/Help/release/3.7.rst
index 345c056..9656a54 100644
--- a/Help/release/3.7.rst
+++ b/Help/release/3.7.rst
@@ -315,5 +315,5 @@ Other Changes
* Vim support files ``indent/cmake.vim`` and ``syntax/cmake.vim``
from the `vim-cmake-syntax`_ project are now distributed with CMake.
-.. _`Fortran Submodules`: http://fortranwiki.org/fortran/show/Submodules
+.. _`Fortran Submodules`: https://fortranwiki.org/fortran/show/Submodules
.. _`vim-cmake-syntax`: https://github.com/pboettch/vim-cmake-syntax
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 4dfac8a..b6ecf7b 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -13,6 +13,7 @@ Releases
.. toctree::
:maxdepth: 1
+ 3.25 <3.25>
3.24 <3.24>
3.23 <3.23>
3.22 <3.22>
diff --git a/Help/variable/BSD.rst b/Help/variable/BSD.rst
new file mode 100644
index 0000000..fdfe5ec
--- /dev/null
+++ b/Help/variable/BSD.rst
@@ -0,0 +1,7 @@
+BSD
+---
+
+.. versionadded:: 3.25
+
+Set to a string value when the target system is BSD. This value can be one of
+the following: DragonFlyBSD, FreeBSD, OpenBSD, or NetBSD.
diff --git a/Help/variable/CMAKE_ANDROID_API.rst b/Help/variable/CMAKE_ANDROID_API.rst
index 4388bf2..aba9b6e 100644
--- a/Help/variable/CMAKE_ANDROID_API.rst
+++ b/Help/variable/CMAKE_ANDROID_API.rst
@@ -8,6 +8,7 @@ Edition`, this variable may be set to specify the default value for the
:prop_tgt:`ANDROID_API` target property. See that target property for
additional information.
-Otherwise, when :ref:`Cross Compiling for Android`, this variable provides
-the Android API version number targeted. This will be the same value as
-the :variable:`CMAKE_SYSTEM_VERSION` variable for ``Android`` platforms.
+When :ref:`Cross Compiling for Android`, the :variable:`CMAKE_SYSTEM_VERSION`
+variable represents the Android API version number targeted. For historical
+reasons, if a toolchain file sets ``CMAKE_ANDROID_API``, but not
+``CMAKE_SYSTEM_VERSION``, the latter will be initialized using the former.
diff --git a/Help/variable/CMAKE_BINARY_DIR.rst b/Help/variable/CMAKE_BINARY_DIR.rst
index 3b323b7..e601eb8 100644
--- a/Help/variable/CMAKE_BINARY_DIR.rst
+++ b/Help/variable/CMAKE_BINARY_DIR.rst
@@ -7,7 +7,7 @@ This is the full path to the top level of the current CMake build
tree. For an in-source build, this would be the same as
:variable:`CMAKE_SOURCE_DIR`.
-When run in -P script mode, CMake sets the variables
+When run in :option:`cmake -P` script mode, CMake sets the variables
:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`,
:variable:`CMAKE_CURRENT_BINARY_DIR` and
:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory.
diff --git a/Help/variable/CMAKE_CFG_INTDIR.rst b/Help/variable/CMAKE_CFG_INTDIR.rst
index 43668ea..3a57659 100644
--- a/Help/variable/CMAKE_CFG_INTDIR.rst
+++ b/Help/variable/CMAKE_CFG_INTDIR.rst
@@ -19,7 +19,7 @@ Example values:
::
$(ConfigurationName) = Visual Studio 9
- $(Configuration) = Visual Studio 10
+ $(Configuration) = Visual Studio 11 and above
$(CONFIGURATION) = Xcode
. = Make-based tools
. = Ninja
diff --git a/Help/variable/CMAKE_COMMAND.rst b/Help/variable/CMAKE_COMMAND.rst
index f80b46c..e65ff8c 100644
--- a/Help/variable/CMAKE_COMMAND.rst
+++ b/Help/variable/CMAKE_COMMAND.rst
@@ -4,5 +4,5 @@ CMAKE_COMMAND
The full path to the :manual:`cmake(1)` executable.
This is the full path to the CMake executable :manual:`cmake(1)` which is
-useful from custom commands that want to use the ``cmake -E`` option for
+useful from custom commands that want to use the :option:`cmake -E` option for
portable system commands. (e.g. ``/usr/local/bin/cmake``)
diff --git a/Help/variable/CMAKE_CPACK_COMMAND.rst b/Help/variable/CMAKE_CPACK_COMMAND.rst
index 3a81d68..f851a18 100644
--- a/Help/variable/CMAKE_CPACK_COMMAND.rst
+++ b/Help/variable/CMAKE_CPACK_COMMAND.rst
@@ -5,6 +5,6 @@ CMAKE_CPACK_COMMAND
Full path to :manual:`cpack(1)` command installed with CMake.
-This is the full path to the CPack executable :manual:`cpack(1)` which is
-useful from custom commands that want to use the :manual:`cmake(1)` ``-E``
-option for portable system commands.
+This is the full path to the CPack executable :manual:`cpack(1)`
+that can be used for custom commands or tests to invoke
+CPack commands.
diff --git a/Help/variable/CMAKE_CTEST_COMMAND.rst b/Help/variable/CMAKE_CTEST_COMMAND.rst
index b2942e2..a3b751f 100644
--- a/Help/variable/CMAKE_CTEST_COMMAND.rst
+++ b/Help/variable/CMAKE_CTEST_COMMAND.rst
@@ -3,6 +3,6 @@ CMAKE_CTEST_COMMAND
Full path to :manual:`ctest(1)` command installed with CMake.
-This is the full path to the CTest executable :manual:`ctest(1)` which is
-useful from custom commands that want to use the :manual:`cmake(1)` ``-E``
-option for portable system commands.
+This is the full path to the CTest executable :manual:`ctest(1)`
+that can be used for custom commands or tests to invoke
+CTest commands.
diff --git a/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst b/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst
index 8fc85ee..15f81d2 100644
--- a/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst
+++ b/Help/variable/CMAKE_CURRENT_BINARY_DIR.rst
@@ -9,7 +9,7 @@ create a binary directory in the build tree, and as it is being
processed this variable will be set. For in-source builds this is the
current source directory being processed.
-When run in -P script mode, CMake sets the variables
+When run in :option:`cmake -P` script mode, CMake sets the variables
:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`,
:variable:`CMAKE_CURRENT_BINARY_DIR` and
:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory.
diff --git a/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst b/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst
index 1a25efc..5b86026 100644
--- a/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst
+++ b/Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst
@@ -6,7 +6,7 @@ The path to the source directory currently being processed.
This is the full path to the source directory that is currently being
processed by cmake.
-When run in -P script mode, CMake sets the variables
+When run in :option:`cmake -P` script mode, CMake sets the variables
:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`,
:variable:`CMAKE_CURRENT_BINARY_DIR` and
:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory.
diff --git a/Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst b/Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst
index f77e939..58818f4 100644
--- a/Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst
+++ b/Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst
@@ -13,6 +13,6 @@ This switch should be used during the initial CMake run. Otherwise if
the package has already been found in a previous CMake run, the
variables which have been stored in the cache will still be there. In
that case it is recommended to remove the cache variables for this
-package from the cache using the cache editor or :manual:`cmake(1)` ``-U``
+package from the cache using the cache editor or :option:`cmake -U`.
See also the :variable:`CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable.
diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
index 53a19dc..a7e9029 100644
--- a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
+++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
@@ -33,7 +33,7 @@ property for all targets.
.. note::
This option is implemented only by :ref:`Makefile Generators`
- and the :generator:`Ninja`. It is ignored on other generators.
+ and :ref:`Ninja Generators`. It is ignored on other generators.
This option currently does not work well in combination with
the :prop_tgt:`UNITY_BUILD` target property or the
diff --git a/Help/variable/CMAKE_FIND_DEBUG_MODE.rst b/Help/variable/CMAKE_FIND_DEBUG_MODE.rst
index 8f2a82f..48b0dce 100644
--- a/Help/variable/CMAKE_FIND_DEBUG_MODE.rst
+++ b/Help/variable/CMAKE_FIND_DEBUG_MODE.rst
@@ -13,7 +13,7 @@ error:
* :command:`find_package`
Output is designed for human consumption and not for parsing.
-Enabling this variable is equivalent to using :manual:`cmake <cmake(1)>` ``--debug-find``
+Enabling this variable is equivalent to using :option:`cmake --debug-find`
with the added ability to enable debugging for a subset of find calls.
.. code-block:: cmake
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst b/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst
index 5d45fb0..b27a3d9 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst
@@ -25,4 +25,4 @@ CMake configures the project.
``CMAKE_FIND_PACKAGE_REDIRECTS_DIR`` is only set in CMake project mode.
It is not set when CMake is run in script mode
-(i.e. :manual:`cmake -P ... <cmake(1)>`).
+(i.e. :option:`cmake -P`).
diff --git a/Help/variable/CMAKE_GENERATOR.rst b/Help/variable/CMAKE_GENERATOR.rst
index ec52cd4..0e249eb 100644
--- a/Help/variable/CMAKE_GENERATOR.rst
+++ b/Help/variable/CMAKE_GENERATOR.rst
@@ -7,6 +7,6 @@ The name of the generator that is being used to generate the build
files. (e.g. ``Unix Makefiles``, ``Ninja``, etc.)
The value of this variable should never be modified by project code.
-A generator may be selected via the :manual:`cmake(1)` ``-G`` option,
+A generator may be selected via the :option:`cmake -G` option,
interactively in :manual:`cmake-gui(1)`, or via the :envvar:`CMAKE_GENERATOR`
environment variable.
diff --git a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
index b17d83a..acb7b2e 100644
--- a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
+++ b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
@@ -7,7 +7,7 @@ Generator-specific target platform specification provided by user.
Some CMake generators support a target platform name to be given
to the native build system to choose a compiler toolchain.
-If the user specifies a platform name (e.g. via the :manual:`cmake(1)` ``-A``
+If the user specifies a platform name (e.g. via the :option:`cmake -A`
option or via the :envvar:`CMAKE_GENERATOR_PLATFORM` environment variable)
the value will be available in this variable.
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index 45f2d32..4855477 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -5,7 +5,7 @@ Native build system toolset specification provided by user.
Some CMake generators support a toolset specification to tell the
native build system how to choose a compiler. If the user specifies
-a toolset (e.g. via the :manual:`cmake(1)` ``-T`` option or via
+a toolset (e.g. via the :option:`cmake -T` option or via
the :envvar:`CMAKE_GENERATOR_TOOLSET` environment variable) the value
will be available in this variable.
diff --git a/Help/variable/CMAKE_HOST_BSD.rst b/Help/variable/CMAKE_HOST_BSD.rst
new file mode 100644
index 0000000..d3554f9
--- /dev/null
+++ b/Help/variable/CMAKE_HOST_BSD.rst
@@ -0,0 +1,7 @@
+CMAKE_HOST_BSD
+--------------
+
+.. versionadded:: 3.25
+
+Set to a string value when the host system is BSD. This value can be one of
+the following: DragonFlyBSD, FreeBSD, OpenBSD, or NetBSD.
diff --git a/Help/variable/CMAKE_HOST_LINUX.rst b/Help/variable/CMAKE_HOST_LINUX.rst
new file mode 100644
index 0000000..e2361bd
--- /dev/null
+++ b/Help/variable/CMAKE_HOST_LINUX.rst
@@ -0,0 +1,6 @@
+CMAKE_HOST_LINUX
+----------------
+
+.. versionadded:: 3.25
+
+Set to true when the host system is Linux.
diff --git a/Help/variable/CMAKE_INSTALL_PREFIX.rst b/Help/variable/CMAKE_INSTALL_PREFIX.rst
index 6d42ea8..c76727e 100644
--- a/Help/variable/CMAKE_INSTALL_PREFIX.rst
+++ b/Help/variable/CMAKE_INSTALL_PREFIX.rst
@@ -27,8 +27,9 @@ first :command:`project` invocation.
The ``CMAKE_INSTALL_PREFIX`` may be defined when configuring a build tree
to set its installation prefix. Or, when using the :manual:`cmake(1)`
-command-line tool's ``--install`` mode, one may specify a different prefix
-using the ``--prefix`` option:
+command-line tool's :option:`--install <cmake --install>` mode, one may specify
+a different prefix using the :option:`--prefix <cmake--install --prefix>`
+option:
.. code-block:: shell
diff --git a/Help/variable/CMAKE_LANG_COMPILER.rst b/Help/variable/CMAKE_LANG_COMPILER.rst
index e694b33..db8f4e1 100644
--- a/Help/variable/CMAKE_LANG_COMPILER.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER.rst
@@ -14,7 +14,8 @@ This variable can be set by the user during the first time a build tree is confi
If a non-full path value is supplied then CMake will resolve the full path of
the compiler.
-The variable could be set in a user supplied toolchain file or via `-D` on the command line.
+The variable could be set in a user supplied toolchain file or via
+:option:`-D <cmake -D>` on the command line.
.. note::
Options that are required to make the compiler work correctly can be included
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 6a0a1d9..e311d1b 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -6,43 +6,62 @@ Compiler identification string.
A short string unique to the compiler vendor. Possible values
include:
-::
-
- Absoft = Absoft Fortran (absoft.com)
- ADSP = Analog VisualDSP++ (analog.com)
- AppleClang = Apple Clang (apple.com)
- ARMCC = ARM Compiler (arm.com)
- ARMClang = ARM Compiler based on Clang (arm.com)
- Bruce = Bruce C Compiler
- CCur = Concurrent Fortran (ccur.com)
- Clang = LLVM Clang (clang.llvm.org)
- Cray = Cray Compiler (cray.com)
- Embarcadero, Borland = Embarcadero (embarcadero.com)
- Flang = Classic Flang Fortran Compiler (https://github.com/flang-compiler/flang)
- LLVMFlang = LLVM Flang Fortran Compiler (https://github.com/llvm/llvm-project/tree/main/flang)
- Fujitsu = Fujitsu HPC compiler (Trad mode)
- FujitsuClang = Fujitsu HPC compiler (Clang mode)
- G95 = G95 Fortran (g95.org)
- GNU = GNU Compiler Collection (gcc.gnu.org)
- GHS = Green Hills Software (www.ghs.com)
- HP = Hewlett-Packard Compiler (hp.com)
- IAR = IAR Systems (iar.com)
- Intel = Intel Compiler (intel.com)
- IntelLLVM = Intel LLVM-Based Compiler (intel.com)
- LCC = MCST Elbrus C/C++/Fortran Compiler (mcst.ru)
- MSVC = Microsoft Visual Studio (microsoft.com)
- NVHPC = NVIDIA HPC SDK Compiler (nvidia.com)
- NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
- OpenWatcom = Open Watcom (openwatcom.org)
- PGI = The Portland Group (pgroup.com)
- PathScale = PathScale (pathscale.com)
- SDCC = Small Device C Compiler (sdcc.sourceforge.net)
- SunPro = Oracle Solaris Studio (oracle.com)
- TI = Texas Instruments (ti.com)
- TinyCC = Tiny C Compiler (tinycc.org)
- XL, VisualAge, zOS = IBM XL (ibm.com)
- XLClang = IBM Clang-based XL (ibm.com)
- IBMClang = IBM LLVM-based Compiler (ibm.com)
+=============================== ===============================================
+Value Name
+=============================== ===============================================
+``Absoft`` `Absoft Fortran`_
+``ADSP`` Analog VisualDSP++
+``AppleClang`` Apple Clang
+``ARMCC`` ARM Compiler
+``ARMClang`` ARM Compiler based on Clang
+``Bruce`` Bruce C Compiler
+``CCur`` Concurrent Fortran
+``Clang`` `LLVM Clang`_
+``Cray`` Cray Compiler
+``Embarcadero``, ``Borland`` `Embarcadero`_
+``Flang`` `Classic Flang Fortran Compiler`_
+``LLVMFlang`` `LLVM Flang Fortran Compiler`_
+``Fujitsu`` Fujitsu HPC compiler (Trad mode)
+``FujitsuClang`` Fujitsu HPC compiler (Clang mode)
+``G95`` `G95 Fortran`_
+``GNU`` `GNU Compiler Collection`_
+``GHS`` `Green Hills Software`_
+``HP`` Hewlett-Packard Compiler
+``IAR`` IAR Systems
+``Intel`` Intel Compiler
+``IntelLLVM`` Intel LLVM-Based Compiler
+``LCC`` MCST Elbrus C/C++/Fortran Compiler
+``MSVC`` `Microsoft Visual Studio`_
+``NVHPC`` `NVIDIA HPC Compiler`_
+``NVIDIA`` `NVIDIA CUDA Compiler`_
+``OpenWatcom`` `Open Watcom`_
+``PGI`` The Portland Group
+``PathScale`` PathScale
+``SDCC`` `Small Device C Compiler`_
+``SunPro`` Oracle Solaris Studio
+``Tasking`` `Tasking Compiler Toolsets`_
+``TI`` Texas Instruments
+``TinyCC`` `Tiny C Compiler`_
+``XL``, ``VisualAge``, ``zOS`` IBM XL
+``XLClang`` IBM Clang-based XL
+``IBMClang`` IBM LLVM-based Compiler
+=============================== ===============================================
This variable is not guaranteed to be defined for all compilers or
languages.
+
+.. _Absoft Fortran: https://www.absoft.com
+.. _LLVM Clang: https://clang.llvm.org
+.. _Embarcadero: https://www.embarcadero.com
+.. _Classic Flang Fortran Compiler: https://github.com/flang-compiler/flang
+.. _LLVM Flang Fortran Compiler: https://github.com/llvm/llvm-project/tree/main/flang
+.. _G95 Fortran: https://g95.sourceforge.net
+.. _GNU Compiler Collection: https://gcc.gnu.org
+.. _Green Hills Software: https://www.ghs.com/products/compiler.html
+.. _Microsoft Visual Studio: https://visualstudio.microsoft.com
+.. _NVIDIA HPC Compiler: https://developer.nvidia.com/hpc-compilers
+.. _NVIDIA CUDA Compiler: https://developer.nvidia.com/cuda-llvm-compiler
+.. _Open Watcom: https://open-watcom.github.io
+.. _Small Device C Compiler: https://sdcc.sourceforge.net
+.. _Tiny C Compiler: https://bellard.org/tcc
+.. _Tasking Compiler Toolsets: https://www.tasking.com
diff --git a/Help/variable/CMAKE_LANG_FLAGS.rst b/Help/variable/CMAKE_LANG_FLAGS.rst
index 2784397..4b39b1d 100644
--- a/Help/variable/CMAKE_LANG_FLAGS.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS.rst
@@ -5,7 +5,9 @@ Flags for all build types.
``<LANG>`` flags used regardless of the value of :variable:`CMAKE_BUILD_TYPE`.
-This is initialized for each language from environment variables:
+For each language, if this variable is not defined, it is initialized
+and stored in the cache using values from environment variables in
+combination with CMake's builtin defaults for the toolchain:
* ``CMAKE_C_FLAGS``:
Initialized by the :envvar:`CFLAGS` environment variable.
@@ -15,6 +17,12 @@ This is initialized for each language from environment variables:
Initialized by the :envvar:`CUDAFLAGS` environment variable.
* ``CMAKE_Fortran_FLAGS``:
Initialized by the :envvar:`FFLAGS` environment variable.
+* ``CMAKE_CSharp_FLAGS``:
+ Initialized by the :envvar:`CSFLAGS` environment variable.
+* ``CMAKE_HIP_FLAGS``:
+ Initialized by the :envvar:`HIPFLAGS` environment variable.
+* ``CMAKE_ISPC_FLAGS``:
+ Initialized by the :envvar:`ISPCFLAGS` environment variable.
This value is a command-line string fragment. Therefore, multiple options
should be separated by spaces, and options with spaces should be quoted.
diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst
index a3c8b7c..9769c7a 100644
--- a/Help/variable/CMAKE_MAKE_PROGRAM.rst
+++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst
@@ -59,6 +59,6 @@ to configure the project:
variable, changing the value has undefined behavior.
The ``CMAKE_MAKE_PROGRAM`` variable is set for use by project code.
-The value is also used by the :manual:`cmake(1)` ``--build`` and
-:manual:`ctest(1)` ``--build-and-test`` tools to launch the native
+The value is also used by the :option:`cmake --build` and
+:option:`ctest --build-and-test` tools to launch the native
build process.
diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst
index 41ace43..7274b7b 100644
--- a/Help/variable/CMAKE_MESSAGE_CONTEXT.rst
+++ b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst
@@ -3,7 +3,7 @@ CMAKE_MESSAGE_CONTEXT
.. versionadded:: 3.17
-When enabled by the :manual:`cmake <cmake(1)>` ``--log-context`` command line
+When enabled by the :option:`cmake --log-context` command line
option or the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` variable, the
:command:`message` command converts the ``CMAKE_MESSAGE_CONTEXT`` list into a
dot-separated string surrounded by square brackets and prepends it to each line
diff --git a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
index 3b45d1d..4539c90 100644
--- a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
+++ b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
@@ -5,8 +5,9 @@ CMAKE_MESSAGE_LOG_LEVEL
When set, this variable specifies the logging level used by the
:command:`message` command. Valid values are the same as those for the
-``--log-level`` command line option of the :manual:`cmake(1)` program.
-If this variable is set and the ``--log-level`` command line option is
+:option:`--log-level <cmake --log-level>` command line option of the
+:manual:`cmake(1)` program. If this variable is set and the
+:option:`--log-level <cmake --log-level>` command line option is
given, the command line option takes precedence.
The main advantage to using this variable is to make a log level persist
@@ -15,3 +16,8 @@ subsequent CMake runs will continue to use the chosen log level.
Projects should not set this variable, it is intended for users so that
they may control the log level according to their own needs.
+
+.. versionadded:: 3.25
+ See the :command:`cmake_language`
+ :ref:`cmake_language <query_message_log_level>` command for a way to query
+ the current message logging level.
diff --git a/Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst b/Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst
new file mode 100644
index 0000000..80df8fc
--- /dev/null
+++ b/Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst
@@ -0,0 +1,36 @@
+CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
+-----------------------------------
+
+.. versionadded:: 3.25
+
+Select the MSVC debug information format targeting the MSVC ABI.
+This variable is used to initialize the
+:prop_tgt:`MSVC_DEBUG_INFORMATION_FORMAT` property on all targets as they are
+created. It is also propagated by calls to the :command:`try_compile` command
+into the test project.
+
+The allowed values are:
+
+.. include:: ../prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
+support per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+ set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>")
+
+selects for all following targets the program database debug information format
+for the Debug configuration.
+
+If this variable is not set, the :prop_tgt:`MSVC_DEBUG_INFORMATION_FORMAT`
+target property will not be set automatically. If that property is not set,
+CMake selects a debug information format using the default value
+``$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>``, if supported by the
+compiler, and otherwise ``$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>``.
+
+.. note::
+
+ This variable has effect only when policy :policy:`CMP0141` is set to ``NEW``
+ prior to the first :command:`project` or :command:`enable_language` command
+ that enables a language using a compiler targeting the MSVC ABI.
diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
index 9dce760..f844105 100644
--- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
@@ -42,5 +42,8 @@ only for the policies that do not warn by default:
This variable should not be set by a project in CMake code. Project
developers running CMake may set this variable in their cache to
enable the warning (e.g. ``-DCMAKE_POLICY_WARNING_CMP<NNNN>=ON``).
-Alternatively, running :manual:`cmake(1)` with the ``--debug-output``,
-``--trace``, or ``--trace-expand`` option will also enable the warning.
+Alternatively, running :manual:`cmake(1)` with the
+:option:`--debug-output <cmake --debug-output>`,
+:option:`--trace <cmake --trace>`, or
+:option:`--trace-expand <cmake --trace-expand>` option will also
+enable the warning.
diff --git a/Help/variable/CMAKE_SCRIPT_MODE_FILE.rst b/Help/variable/CMAKE_SCRIPT_MODE_FILE.rst
index 981af60..313fb4e 100644
--- a/Help/variable/CMAKE_SCRIPT_MODE_FILE.rst
+++ b/Help/variable/CMAKE_SCRIPT_MODE_FILE.rst
@@ -1,9 +1,9 @@
CMAKE_SCRIPT_MODE_FILE
----------------------
-Full path to the :manual:`cmake(1)` ``-P`` script file currently being
+Full path to the :option:`cmake -P` script file currently being
processed.
-When run in :manual:`cmake(1)` ``-P`` script mode, CMake sets this variable to
+When run in :option:`cmake -P` script mode, CMake sets this variable to
the full path of the script file. When run to configure a ``CMakeLists.txt``
file, this variable is not set.
diff --git a/Help/variable/CMAKE_SOURCE_DIR.rst b/Help/variable/CMAKE_SOURCE_DIR.rst
index d1f1798..7210f75 100644
--- a/Help/variable/CMAKE_SOURCE_DIR.rst
+++ b/Help/variable/CMAKE_SOURCE_DIR.rst
@@ -7,7 +7,7 @@ This is the full path to the top level of the current CMake source
tree. For an in-source build, this would be the same as
:variable:`CMAKE_BINARY_DIR`.
-When run in ``-P`` script mode, CMake sets the variables
+When run in :option:`cmake -P` script mode, CMake sets the variables
:variable:`CMAKE_BINARY_DIR`, :variable:`CMAKE_SOURCE_DIR`,
:variable:`CMAKE_CURRENT_BINARY_DIR` and
:variable:`CMAKE_CURRENT_SOURCE_DIR` to the current working directory.
diff --git a/Help/variable/CMAKE_TASKING_TOOLSET.rst b/Help/variable/CMAKE_TASKING_TOOLSET.rst
new file mode 100644
index 0000000..6bd1479
--- /dev/null
+++ b/Help/variable/CMAKE_TASKING_TOOLSET.rst
@@ -0,0 +1,34 @@
+CMAKE_TASKING_TOOLSET
+---------------------
+
+.. versionadded:: 3.25
+
+Select the Tasking toolset which provides the compiler
+
+Architecture compilers are provided by different toolchains with
+incompatible versioning schemes. Set this variable in a
+:variable:`toolchain file <CMAKE_TOOLCHAIN_FILE>` so CMake can detect
+the compiler features correctly. If no toolset is specified,
+``Standalone`` is assumed.
+
+Due to the different versioning schemes, the compiler version
+(:variable:`CMAKE_<LANG>_COMPILER_VERSION`) depends on the toolset and
+architecture in use. If projects can be built with multiple toolsets or
+architectures, the specified :variable:`CMAKE_TASKING_TOOLSET` and the
+automatically determined :variable:`CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID`
+must be taken into account when comparing against the
+:variable:`CMAKE_<LANG>_COMPILER_VERSION`.
+
+``TriCore``
+ Compilers are provided by the TriCore toolset.
+
+``SmartCode``
+ Compilers are provided by the SmartCode toolset.
+
+``Standalone``
+ Compilers are provided by the standalone toolsets.
+
+ .. note::
+
+ For the TriCore architecture, the compiler from the TriCore toolset is
+ selected as standalone compiler.
diff --git a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst
index f109a9e..2bb97c4 100644
--- a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst
+++ b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst
@@ -10,5 +10,5 @@ This variable is not defined by other generators even if ``devenv.com``
is installed on the computer.
The :variable:`CMAKE_VS_MSBUILD_COMMAND` is also provided for
-:generator:`Visual Studio 10 2010` and above.
+:generator:`Visual Studio 11 2012` and above.
See also the :variable:`CMAKE_MAKE_PROGRAM` variable.
diff --git a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst
index 58f2bef..8a521a3 100644
--- a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst
+++ b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst
@@ -1,7 +1,7 @@
CMAKE_VS_MSBUILD_COMMAND
------------------------
-The generators for :generator:`Visual Studio 10 2010` and above set this
+The generators for :generator:`Visual Studio 11 2012` and above set this
variable to the ``MSBuild.exe`` command installed with the corresponding
Visual Studio version.
diff --git a/Help/variable/CMAKE_WARN_DEPRECATED.rst b/Help/variable/CMAKE_WARN_DEPRECATED.rst
index 4a224fa..c7b6159 100644
--- a/Help/variable/CMAKE_WARN_DEPRECATED.rst
+++ b/Help/variable/CMAKE_WARN_DEPRECATED.rst
@@ -7,4 +7,5 @@ If not ``FALSE``, use of deprecated functionality will issue warnings.
If this variable is not set, CMake behaves as if it were set to ``TRUE``.
When running :manual:`cmake(1)`, this option can be enabled with the
-``-Wdeprecated`` option, or disabled with the ``-Wno-deprecated`` option.
+:option:`-Wdeprecated <cmake -Wdeprecated>` option, or disabled with the
+:option:`-Wno-deprecated <cmake -Wno-deprecated>` option.
diff --git a/Help/variable/CMAKE_XCODE_PLATFORM_TOOLSET.rst b/Help/variable/CMAKE_XCODE_PLATFORM_TOOLSET.rst
index 210da52..6d72d14 100644
--- a/Help/variable/CMAKE_XCODE_PLATFORM_TOOLSET.rst
+++ b/Help/variable/CMAKE_XCODE_PLATFORM_TOOLSET.rst
@@ -5,5 +5,5 @@ Xcode compiler selection.
:generator:`Xcode` supports selection of a compiler from one of the installed
toolsets. CMake provides the name of the chosen toolset in this
-variable, if any is explicitly selected (e.g. via the :manual:`cmake(1)`
-``-T`` option).
+variable, if any is explicitly selected (e.g. via the :option:`cmake -T`
+option).
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst b/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst
new file mode 100644
index 0000000..ce5c4b3
--- /dev/null
+++ b/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst
@@ -0,0 +1,13 @@
+CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION
+--------------------------------------------
+
+.. versionadded:: 3.25
+
+Property value for ``Metal: API Validation`` in the Options section of
+the generated Xcode scheme.
+
+This variable initializes the
+:prop_tgt:`XCODE_SCHEME_ENABLE_GPU_API_VALIDATION` property on all targets.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst b/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst
new file mode 100644
index 0000000..073a6c9
--- /dev/null
+++ b/Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst
@@ -0,0 +1,13 @@
+CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION
+-----------------------------------------------
+
+.. versionadded:: 3.25
+
+Property value for ``Metal: Shader Validation`` in the Options section of
+the generated Xcode scheme.
+
+This variable initializes the
+:prop_tgt:`XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION` property on all targets.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION.rst b/Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION.rst
new file mode 100644
index 0000000..e5b4d18
--- /dev/null
+++ b/Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION.rst
@@ -0,0 +1,12 @@
+CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION
+---------------------------------------
+
+.. versionadded:: 3.25
+
+Set the build configuration to run the target.
+
+This variable initializes the :prop_tgt:`XCODE_SCHEME_LAUNCH_CONFIGURATION`
+property on all targets.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_MODE.rst b/Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_MODE.rst
new file mode 100644
index 0000000..c15b1ea
--- /dev/null
+++ b/Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_MODE.rst
@@ -0,0 +1,13 @@
+CMAKE_XCODE_SCHEME_LAUNCH_MODE
+------------------------------
+
+.. versionadded:: 3.25
+
+Property value for ``Launch`` in the Info section of the generated Xcode
+scheme.
+
+This variable initializes the :prop_tgt:`XCODE_SCHEME_LAUNCH_MODE` property on
+all targets.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/variable/CPACK_CUSTOM_INSTALL_VARIABLES.rst b/Help/variable/CPACK_CUSTOM_INSTALL_VARIABLES.rst
index 1c070b8..9bd50db 100644
--- a/Help/variable/CPACK_CUSTOM_INSTALL_VARIABLES.rst
+++ b/Help/variable/CPACK_CUSTOM_INSTALL_VARIABLES.rst
@@ -3,7 +3,7 @@ CPACK_CUSTOM_INSTALL_VARIABLES
.. versionadded:: 3.21
-CPack variables (set via e.g. ``cpack -D``, ``CPackConfig.cmake`` or
+CPack variables (set via e.g. :option:`cpack -D`, ``CPackConfig.cmake`` or
:variable:`CPACK_PROJECT_CONFIG_FILE` scripts) are not directly visible in
installation scripts. Instead, one can pass a list of ``varName=value``
pairs in the ``CPACK_CUSTOM_INSTALL_VARIABLES`` variable. At install time,
diff --git a/Help/variable/CTEST_CONFIGURATION_TYPE.rst b/Help/variable/CTEST_CONFIGURATION_TYPE.rst
index 392845e..932f81d 100644
--- a/Help/variable/CTEST_CONFIGURATION_TYPE.rst
+++ b/Help/variable/CTEST_CONFIGURATION_TYPE.rst
@@ -6,5 +6,5 @@ CTEST_CONFIGURATION_TYPE
Specify the CTest ``DefaultCTestConfigurationType`` setting
in a :manual:`ctest(1)` dashboard client script.
-If the configuration type is set via ``-C <cfg>`` from the command line
+If the configuration type is set via :option:`-C \<cfg\> <ctest -C>` from the command line
then this variable is populated accordingly.
diff --git a/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst b/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst
index 32c85ad..8cb6eaa 100644
--- a/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst
+++ b/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst
@@ -4,4 +4,4 @@ CTEST_RUN_CURRENT_SCRIPT
.. versionadded:: 3.11
Setting this to 0 prevents :manual:`ctest(1)` from being run again when it
-reaches the end of a script run by calling ``ctest -S``.
+reaches the end of a script run by calling :option:`ctest -S`.
diff --git a/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt b/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt
index 8ae6c57..aea1be8 100644
--- a/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt
+++ b/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt
@@ -45,8 +45,8 @@
wildcard, and optional parts are shown as ``[...]``):
* ``[/path/to/]FwName[.framework]``
- * ``[/path/to/]FwName.framework/FwName``
- * ``[/path/to/]FwName.framework/Versions/*/FwName``
+ * ``[/path/to/]FwName.framework/FwName[suffix]``
+ * ``[/path/to/]FwName.framework/Versions/*/FwName[suffix]``
Note that CMake recognizes and automatically handles framework targets,
even without using the ``$<LINK_LIBRARY:FRAMEWORK,...>`` expression.
@@ -59,6 +59,11 @@
``$<LINK_LIBRARY:FRAMEWORK,...>`` for file paths so that the expected
behavior is clear.
+ .. versionadded:: 3.25
+ The :prop_tgt:`FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>` target property as
+ well as the ``suffix`` of the framework library name are now supported by
+ the ``FRAMEWORK`` features.
+
``NEEDED_FRAMEWORK``
This is similar to the ``FRAMEWORK`` feature, except it forces the linker
to link with the framework even if no symbols are used from it. It uses
diff --git a/Help/variable/LINUX.rst b/Help/variable/LINUX.rst
new file mode 100644
index 0000000..26379b3
--- /dev/null
+++ b/Help/variable/LINUX.rst
@@ -0,0 +1,6 @@
+LINUX
+-----
+
+.. versionadded:: 3.25
+
+Set to true when the target system is Linux.
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index f19bc97..2643326 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -82,6 +82,7 @@ int main(int argc, char* argv[])
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
+ require += info_arch[argc];
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index f15974a..75d33e8 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -70,6 +70,7 @@ function(compiler_id_detection outvar lang)
FujitsuClang
Fujitsu
GHS
+ Tasking
)
if ("x${lang}" STREQUAL "xC")
list(APPEND ordered_compilers
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index ac0e262..9a3c940 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -84,7 +84,7 @@ macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
else()
set(${option} "${${option}_ISSET}")
endif()
- if("x${_CDO_CMP0127}x" STREQUAL "xx" AND "x${depends}x" MATCHES "[^A-Za-z0-9_; ]")
+ if("x${_CDO_CMP0127}x" STREQUAL "xx" AND "x${depends}x" MATCHES "[^A-Za-z0-9_.; ]")
cmake_policy(GET_WARNING CMP0127 _CDO_CMP0127_WARNING)
message(AUTHOR_WARNING "${_CDO_CMP0127_WARNING}")
endif()
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index d03cbef..5ec2972 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -129,14 +129,13 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
if("x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xIAR")
# primary necessary to detect architecture, so the right archiver and linker can be picked
# eg. "IAR Assembler V8.10.1.12857/W32 for ARM" or "IAR Assembler V4.11.1.4666 for Renesas RX"
- # Cut out identification first, newline handling is a pain
+ # Earlier versions did not provide `--version`, so grep the full output to extract Assembler ID string
string(REGEX MATCH "IAR Assembler[^\r\n]*" _compileid "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_OUTPUT}")
if("${_compileid}" MATCHES "V([0-9]+\\.[0-9]+\\.[0-9]+)")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION ${CMAKE_MATCH_1})
endif()
- string(REGEX MATCHALL "([A-Za-z0-9-]+)" _all_compileid_matches "${_compileid}")
- if(_all_compileid_matches)
- list(GET _all_compileid_matches "-1" CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID)
+ if("${_compileid}" MATCHES "for.*(MSP430|8051|ARM|AVR|RH850|RISC-?V|RL78|RX|STM8|V850)")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID ${CMAKE_MATCH_1})
endif()
elseif("x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xClang")
# Test whether an MSVC-like command-line option works.
diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake
index da860a8..fe98469 100644
--- a/Modules/CMakeDetermineCSharpCompiler.cmake
+++ b/Modules/CMakeDetermineCSharpCompiler.cmake
@@ -3,7 +3,7 @@
if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])")
message(FATAL_ERROR
- "C# is currently only supported for Microsoft Visual Studio 2010 and later.")
+ "C# is currently only supported for Microsoft Visual Studio 11 2012 and later.")
endif()
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 0ac06ac..f43b17b 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -275,7 +275,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
if(DEFINED CMAKE_CUDA_ARCHITECTURES)
if(CMAKE_CUDA_ARCHITECTURES STREQUAL "")
message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES must be non-empty if set.")
- elseif(CMAKE_CUDA_ARCHITECTURES AND NOT CMAKE_CUDA_ARCHITECTURES MATCHES "^([0-9]+(-real|-virtual)?(;[0-9]+(-real|-virtual)?|;)*|all|all-major|native)$")
+ elseif(CMAKE_CUDA_ARCHITECTURES AND NOT CMAKE_CUDA_ARCHITECTURES MATCHES "^([0-9]+a?(-real|-virtual)?(;[0-9]+a?(-real|-virtual)?|;)*|all|all-major|native)$")
message(FATAL_ERROR
"CMAKE_CUDA_ARCHITECTURES:\n"
" ${CMAKE_CUDA_ARCHITECTURES}\n"
@@ -503,7 +503,8 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES
CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES
log
- "${CMAKE_CUDA_IMPLICIT_OBJECT_REGEX}")
+ "${CMAKE_CUDA_IMPLICIT_OBJECT_REGEX}"
+ LANGUAGE CUDA)
# Detect CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT from the compiler by looking at which
# cudart library exists in the implicit link libraries passed to the host linker.
diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake
index a08e597..09de7b1 100644
--- a/Modules/CMakeDetermineCompileFeatures.cmake
+++ b/Modules/CMakeDetermineCompileFeatures.cmake
@@ -63,6 +63,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CXX17_COMPILE_FEATURES)
set(CMAKE_CXX20_COMPILE_FEATURES)
set(CMAKE_CXX23_COMPILE_FEATURES)
+ set(CMAKE_CXX26_COMPILE_FEATURES)
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -73,6 +74,9 @@ function(cmake_determine_compile_features lang)
return()
endif()
+ if (CMAKE_CXX23_COMPILE_FEATURES AND CMAKE_CXX26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX26_COMPILE_FEATURES ${CMAKE_CXX23_COMPILE_FEATURES})
+ endif()
if (CMAKE_CXX20_COMPILE_FEATURES AND CMAKE_CXX23_COMPILE_FEATURES)
list(REMOVE_ITEM CMAKE_CXX23_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES})
endif()
@@ -97,6 +101,7 @@ function(cmake_determine_compile_features lang)
${CMAKE_CXX17_COMPILE_FEATURES}
${CMAKE_CXX20_COMPILE_FEATURES}
${CMAKE_CXX23_COMPILE_FEATURES}
+ ${CMAKE_CXX26_COMPILE_FEATURES}
)
endif()
@@ -107,6 +112,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CXX23_COMPILE_FEATURES ${CMAKE_CXX23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX26_COMPILE_FEATURES ${CMAKE_CXX26_COMPILE_FEATURES} PARENT_SCOPE)
message(CHECK_PASS "done")
@@ -119,6 +125,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CUDA17_COMPILE_FEATURES)
set(CMAKE_CUDA20_COMPILE_FEATURES)
set(CMAKE_CUDA23_COMPILE_FEATURES)
+ set(CMAKE_CUDA26_COMPILE_FEATURES)
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -129,6 +136,9 @@ function(cmake_determine_compile_features lang)
return()
endif()
+ if (CMAKE_CUDA23_COMPILE_FEATURES AND CMAKE_CUDA26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CUDA26_COMPILE_FEATURES ${CMAKE_CUDA23_COMPILE_FEATURES})
+ endif()
if (CMAKE_CUDA20_COMPILE_FEATURES AND CMAKE_CUDA23_COMPILE_FEATURES)
list(REMOVE_ITEM CMAKE_CUDA23_COMPILE_FEATURES ${CMAKE_CUDA20_COMPILE_FEATURES})
endif()
@@ -153,6 +163,7 @@ function(cmake_determine_compile_features lang)
${CMAKE_CUDA17_COMPILE_FEATURES}
${CMAKE_CUDA20_COMPILE_FEATURES}
${CMAKE_CUDA23_COMPILE_FEATURES}
+ ${CMAKE_CUDA26_COMPILE_FEATURES}
)
endif()
@@ -163,6 +174,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_CUDA17_COMPILE_FEATURES ${CMAKE_CUDA17_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CUDA20_COMPILE_FEATURES ${CMAKE_CUDA20_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_CUDA23_COMPILE_FEATURES ${CMAKE_CUDA23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA26_COMPILE_FEATURES ${CMAKE_CUDA26_COMPILE_FEATURES} PARENT_SCOPE)
message(CHECK_PASS "done")
@@ -175,6 +187,8 @@ function(cmake_determine_compile_features lang)
set(CMAKE_HIP17_COMPILE_FEATURES)
set(CMAKE_HIP20_COMPILE_FEATURES)
set(CMAKE_HIP23_COMPILE_FEATURES)
+ set(CMAKE_HIP26_COMPILE_FEATURES)
+
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -185,6 +199,9 @@ function(cmake_determine_compile_features lang)
return()
endif()
+ if (CMAKE_HIP23_COMPILE_FEATURES AND CMAKE_HIP26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP26_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES})
+ endif()
if (CMAKE_HIP20_COMPILE_FEATURES AND CMAKE_HIP23_COMPILE_FEATURES)
list(REMOVE_ITEM CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES})
endif()
@@ -209,6 +226,7 @@ function(cmake_determine_compile_features lang)
${CMAKE_HIP17_COMPILE_FEATURES}
${CMAKE_HIP20_COMPILE_FEATURES}
${CMAKE_HIP23_COMPILE_FEATURES}
+ ${CMAKE_HIP26_COMPILE_FEATURES}
)
endif()
@@ -219,6 +237,7 @@ function(cmake_determine_compile_features lang)
set(CMAKE_HIP17_COMPILE_FEATURES ${CMAKE_HIP17_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_HIP20_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES} PARENT_SCOPE)
set(CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP26_COMPILE_FEATURES ${CMAKE_HIP26_COMPILE_FEATURES} PARENT_SCOPE)
message(CHECK_PASS "done")
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 82a6d21..053effa 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -55,7 +55,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
set(ENV{LANG} C)
try_compile(CMAKE_${lang}_ABI_COMPILED
- ${CMAKE_BINARY_DIR} ${src}
+ SOURCES ${src}
CMAKE_FLAGS ${CMAKE_FLAGS}
# Ignore unused flags when we are just determining the ABI.
"--no-warn-unused-cli"
@@ -149,7 +149,8 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
if(CMAKE_${lang}_VERBOSE_FLAG)
CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs implicit_fwks log
"${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}"
- COMPUTE_IMPLICIT_OBJECTS implicit_objs)
+ COMPUTE_IMPLICIT_OBJECTS implicit_objs
+ LANGUAGE ${lang})
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed ${lang} implicit link information from above output:\n${log}\n\n")
endif()
@@ -161,8 +162,9 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
message(CHECK_START "Determine Intel Fortran Compiler Implicit Link Path")
# Build a sample project which reports symbols.
try_compile(IFORT_LIB_PATH_COMPILED
- ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
- ${CMAKE_ROOT}/Modules/IntelVSImplicitPath
+ PROJECT IntelFortranImplicit
+ SOURCE_DIR ${CMAKE_ROOT}/Modules/IntelVSImplicitPath
+ BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
IntelFortranImplicit
CMAKE_FLAGS
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 2b19736..73c775a 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -720,7 +720,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
OR CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "warning #5117: Bad # preprocessor line"
)
# Compilation failed.
- set(MSG
+ string(APPEND _CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG
"Compiling the ${lang} compiler identification source file \"${src}\" failed.
${COMPILER_DESCRIPTION}
The output was:
@@ -736,7 +736,11 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
# Some languages may know the correct/desired set of flags and want to fail right away if they don't work.
# This is currently only used by CUDA.
if(__compiler_id_require_success)
- message(FATAL_ERROR "${MSG}")
+ message(FATAL_ERROR "${_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG}")
+ else()
+ # Build up the outputs for compiler detection attempts so that users
+ # can see all set of flags tried, instead of just last
+ set(_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG "${_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG}" PARENT_SCOPE)
endif()
# No output files should be inspected.
@@ -1123,7 +1127,7 @@ function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang userflags)
OUTPUT_VARIABLE out
ERROR_VARIABLE err
RESULT_VARIABLE res
- ENCODING AUTO # cl prints in current code page
+ ENCODING AUTO # cl prints in console output code page
)
if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n]*:[^:\n]*:[ \t]*)")
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}" PARENT_SCOPE)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 650c87a..087c0f6 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -44,17 +44,14 @@ else()
# finally list compilers to try
if(NOT CMAKE_Fortran_COMPILER_INIT)
# Known compilers:
- # f77/f90/f95: generic compiler names
# ftn: Cray fortran compiler wrapper
- # g77: GNU Fortran 77 compiler
# gfortran: putative GNU Fortran 95+ compiler (in progress)
- # fort77: native F77 compiler under HP-UX (and some older Crays)
- # frt: Fujitsu F77 compiler
+ # frt: Fujitsu Fortran compiler
# pathf90/pathf95/pathf2003: PathScale Fortran compiler
- # pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
+ # pgfortran: Portland Group Fortran compilers
# nvfortran: NVHPC Fotran compiler
# flang: Flang Fortran compiler
- # xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
+ # xlf: IBM (AIX) Fortran compiler
# lf95: Lahey-Fujitsu F95 compiler
# fl32: Microsoft Fortran 77 "PowerStation" compiler
# af77: Apogee F77 compiler for Intergraph hardware running CLIX
@@ -62,31 +59,20 @@ else()
# fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha
# ifx: Intel Fortran LLVM-based compiler
# ifort: Intel Classic Fortran compiler
- # ifc: Intel Fortran 95 compiler for Linux/x86
- # efc: Intel Fortran 95 compiler for IA64
# nagfor: NAG Fortran compiler
#
- # The order is 95 or newer compilers first, then 90,
- # then 77 or older compilers, gnu is always last in the group,
+ # GNU is last to be searched,
# so if you paid for a compiler it is picked by default.
- if(CMAKE_HOST_WIN32)
- set(CMAKE_Fortran_COMPILER_LIST
- ifort ifx pgf95 pgfortran nvfortran lf95 fort
- flang gfortran gfortran-4 g95 f90 pgf90
- pgf77 g77 f77 nag
- )
- else()
- set(CMAKE_Fortran_COMPILER_LIST
- ftn
- ifort ifc ifx efc pgf95 pgfortran nvfortran lf95 xlf95 fort
- flang lfortran gfortran gfortran-4 g95 f90 pgf90
- frt pgf77 xlf g77 f77 nag
- )
- endif()
+ set(CMAKE_Fortran_COMPILER_LIST
+ ftn
+ ifx ifort nvfortran pgfortran lf95 xlf fort
+ flang lfortran frt nagfor
+ gfortran
+ )
# Vendor-specific compiler names.
set(_Fortran_COMPILER_NAMES_LCC lfortran gfortran)
- set(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
+ set(_Fortran_COMPILER_NAMES_GNU gfortran)
set(_Fortran_COMPILER_NAMES_Intel ifort ifc efc ifx)
set(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
set(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
diff --git a/Modules/CMakeDetermineHIPCompiler.cmake b/Modules/CMakeDetermineHIPCompiler.cmake
index 7b7d7a3..6294d04 100644
--- a/Modules/CMakeDetermineHIPCompiler.cmake
+++ b/Modules/CMakeDetermineHIPCompiler.cmake
@@ -86,6 +86,7 @@ if(NOT CMAKE_HIP_COMPILER_ROCM_ROOT AND CMAKE_HIP_COMPILER_ID STREQUAL "Clang")
if(_CMAKE_HIP_COMPILER_RESULT EQUAL 0 AND _CMAKE_HIP_COMPILER_STDERR MATCHES "Found HIP installation: *([^,]*)[,\n]")
set(CMAKE_HIP_COMPILER_ROCM_ROOT "${CMAKE_MATCH_1}")
+ file(TO_CMAKE_PATH "${CMAKE_HIP_COMPILER_ROCM_ROOT}" CMAKE_HIP_COMPILER_ROCM_ROOT)
endif()
endif()
if(NOT CMAKE_HIP_COMPILER_ROCM_ROOT)
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index 53868d2..0d360b5 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -105,8 +105,7 @@ function(_DetermineVSServicePack_CheckVersionWithTryCompile _SUCCESS_VAR _VERSI
try_compile(
_CompileResult
- "${CMAKE_BINARY_DIR}"
- "${CMAKE_BINARY_DIR}/return0.cc"
+ SOURCES "${CMAKE_BINARY_DIR}/return0.cc"
OUTPUT_VARIABLE _output
COPY_FILE "${CMAKE_BINARY_DIR}/return0.cc")
@@ -128,8 +127,7 @@ function(_DetermineVSServicePack_CheckVersionWithTryRun _SUCCESS_VAR _VERSION_V
try_run(
_RunResult
_CompileResult
- "${CMAKE_BINARY_DIR}"
- "${CMAKE_BINARY_DIR}/return0.cc"
+ SOURCES "${CMAKE_BINARY_DIR}/return0.cc"
RUN_OUTPUT_VARIABLE _runoutput
)
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index a6bd0d1..2ac8879 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -170,7 +170,7 @@ else()
if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL Clang)
if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC")
list(PREPEND _CMAKE_LINKER_NAMES "lld-link")
- else()
+ elseif(NOT APPLE)
list(PREPEND _CMAKE_LINKER_NAMES "ld.lld")
endif()
if(APPLE)
diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake
index 8906f48..1aa3929 100644
--- a/Modules/CMakeFindFrameworks.cmake
+++ b/Modules/CMakeFindFrameworks.cmake
@@ -17,12 +17,19 @@ if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
macro(CMAKE_FIND_FRAMEWORKS fwk)
set(${fwk}_FRAMEWORKS)
if(APPLE)
+ # 'Frameworks' directory from Brew (Apple Silicon and Intel)
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
+ set(_brew_framework_path /opt/homebrew/Frameworks)
+ else()
+ set(_brew_framework_path /usr/local/Frameworks)
+ endif()
+
file(TO_CMAKE_PATH "$ENV{CMAKE_FRAMEWORK_PATH}" _cmff_CMAKE_FRAMEWORK_PATH)
set(_cmff_search_paths
${CMAKE_FRAMEWORK_PATH}
${_cmff_CMAKE_FRAMEWORK_PATH}
~/Library/Frameworks
- /usr/local/Frameworks
+ ${_brew_framework_path}
/Library/Frameworks
/System/Library/Frameworks
/Network/Library/Frameworks
diff --git a/Modules/CMakeHIPInformation.cmake b/Modules/CMakeHIPInformation.cmake
index 4c57677..33f8697 100644
--- a/Modules/CMakeHIPInformation.cmake
+++ b/Modules/CMakeHIPInformation.cmake
@@ -143,7 +143,7 @@ set(CMAKE_HIP_INFORMATION_LOADED 1)
# Load the file and find the relevant HIP runtime.
if(NOT DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
set(hip-lang_DIR "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/cmake/hip-lang")
- find_package(hip-lang CONFIG QUIET NO_DEFAULT_PATH)
+ find_package(hip-lang CONFIG QUIET NO_DEFAULT_PATH REQUIRED)
endif()
if(DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
list(APPEND CMAKE_HIP_RUNTIME_LIBRARIES_STATIC ${_CMAKE_HIP_DEVICE_RUNTIME_TARGET})
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index 6bdefde..1773dc4 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -22,7 +22,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
set(log "")
set(keywordArgs)
- set(oneValueArgs COMPUTE_IMPLICIT_OBJECTS)
+ set(oneValueArgs COMPUTE_IMPLICIT_OBJECTS LANGUAGE)
set(multiValueArgs )
cmake_parse_arguments(EXTRA_PARSE "${keywordArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -76,6 +76,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
endif()
endif()
set(is_msvc 0)
+ if(EXTRA_PARSE_LANGUAGE AND
+ ("x${CMAKE_${EXTRA_PARSE_LANGUAGE}_ID}" STREQUAL "xMSVC" OR
+ "x${CMAKE_${EXTRA_PARSE_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC"))
+ set(is_msvc 1)
+ endif()
set(search_static 0)
if("${cmd}" MATCHES "${linker_regex}")
string(APPEND log " link line: [${line}]\n")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 06f5ecd..32b7166 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -242,6 +242,30 @@
# elif defined(__ADSPBLACKFIN__)
# define ARCHITECTURE_ID "Blackfin"
+#elif defined(__TASKING__)
+
+# if defined(__CTC__) || defined(__CPTC__)
+# define ARCHITECTURE_ID "TriCore"
+
+# elif defined(__CMCS__)
+# define ARCHITECTURE_ID "MCS"
+
+# elif defined(__CARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__CARC__)
+# define ARCHITECTURE_ID "ARC"
+
+# elif defined(__C51__)
+# define ARCHITECTURE_ID "8051"
+
+# elif defined(__CPCP__)
+# define ARCHITECTURE_ID "PCP"
+
+# else
+# define ARCHITECTURE_ID ""
+# endif
+
#else
# define ARCHITECTURE_ID
#endif
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index ecad1d5..16726d2 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -65,7 +65,7 @@ set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -libc MD)
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -libc MTd)
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -libc MDd)
-set(CMAKE_Swift_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g")
set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index e045932..b5dc8d3 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -16,6 +16,8 @@ set(UNIX )
set(CYGWIN )
set(MSYS )
set(WIN32 )
+set(BSD )
+set(LINUX )
function(_cmake_record_install_prefix )
set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_VALUE "${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE)
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index ae5aa27..a706767 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -38,7 +38,7 @@ endif()
if(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C")
__TestCompiler_setTryCompileTargetType()
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
+ string(CONCAT __TestCompiler_testCCompilerSource
"#ifdef __cplusplus\n"
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
"#endif\n"
@@ -53,9 +53,10 @@ if(NOT CMAKE_C_COMPILER_WORKS)
# Clear result from normal variable.
unset(CMAKE_C_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
+ try_compile(CMAKE_C_COMPILER_WORKS
+ SOURCE_FROM_VAR testCCompiler.c __TestCompiler_testCCompilerSource
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
+ unset(__TestCompiler_testCCompilerSource)
# Move result from cache to normal variable.
set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS})
unset(CMAKE_C_COMPILER_WORKS CACHE)
diff --git a/Modules/CMakeTestCSharpCompiler.cmake b/Modules/CMakeTestCSharpCompiler.cmake
index adea250..1c9e249 100644
--- a/Modules/CMakeTestCSharpCompiler.cmake
+++ b/Modules/CMakeTestCSharpCompiler.cmake
@@ -12,8 +12,6 @@ include(CMakeTestCompilerCommon)
unset(CMAKE_CSharp_COMPILER_WORKS CACHE)
-set(test_compile_file "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCSharpCompiler.cs")
-
# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that the selected C# compiler can actually compile
# and link the most basic of programs. If not, a fatal error
@@ -23,19 +21,21 @@ if(NOT CMAKE_CSharp_COMPILER_WORKS)
# Don't call PrintTestCompilerStatus() because the "C#" we want to pass
# as the LANG doesn't match with the variable name "CMAKE_CSharp_COMPILER"
message(CHECK_START "Check for working C# compiler: ${CMAKE_CSharp_COMPILER}")
- file(WRITE "${test_compile_file}"
- "namespace Test {"
- " public class CSharp {"
- " static void Main(string[] args) {}"
- " }"
- "}"
+ string(CONCAT __TestCompiler_testCSharpCompilerSource
+ "namespace Test {\n"
+ " public class CSharp {\n"
+ " static void Main(string[] args) {}\n"
+ " }\n"
+ "}\n"
)
# Clear result from normal variable.
unset(CMAKE_CSharp_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_CSharp_COMPILER_WORKS ${CMAKE_BINARY_DIR} "${test_compile_file}"
+ try_compile(CMAKE_CSharp_COMPILER_WORKS
+ SOURCE_FROM_VAR testCSharpCompiler.cs __TestCompiler_testCSharpCompilerSource
OUTPUT_VARIABLE __CMAKE_CSharp_COMPILER_OUTPUT
)
+ unset(__TestCompiler_testCSharpCompilerSource)
# Move result from cache to normal variable.
set(CMAKE_CSharp_COMPILER_WORKS ${CMAKE_CSharp_COMPILER_WORKS})
unset(CMAKE_CSharp_COMPILER_WORKS CACHE)
diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake
index 853d655..f2fa6ea 100644
--- a/Modules/CMakeTestCUDACompiler.cmake
+++ b/Modules/CMakeTestCUDACompiler.cmake
@@ -76,7 +76,7 @@ endif()
# any makefiles or projects.
if(NOT CMAKE_CUDA_COMPILER_WORKS)
PrintTestCompilerStatus("CUDA")
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.cu
+ string(CONCAT __TestCompiler_testCudaCompilerSource
"#ifndef __CUDACC__\n"
"# error \"The CMAKE_CUDA_COMPILER is set to an invalid CUDA compiler\"\n"
"#endif\n"
@@ -86,9 +86,10 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS)
unset(CMAKE_CUDA_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_CUDA_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.cu
+ try_compile(CMAKE_CUDA_COMPILER_WORKS
+ SOURCE_FROM_VAR main.cu __TestCompiler_testCudaCompilerSource
OUTPUT_VARIABLE __CMAKE_CUDA_COMPILER_OUTPUT)
+ unset(__TestCompiler_testCudaCompilerSource)
# Move result from cache to normal variable.
set(CMAKE_CUDA_COMPILER_WORKS ${CMAKE_CUDA_COMPILER_WORKS})
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index bbe3533..fa4016a 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -38,7 +38,7 @@ endif()
if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerStatus("CXX")
__TestCompiler_setTryCompileTargetType()
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
+ string(CONCAT __TestCompiler_testCXXCompilerSource
"#ifndef __cplusplus\n"
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
"#endif\n"
@@ -46,9 +46,10 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
# Clear result from normal variable.
unset(CMAKE_CXX_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
+ try_compile(CMAKE_CXX_COMPILER_WORKS
+ SOURCE_FROM_VAR testCXXCompiler.cxx __TestCompiler_testCXXCompilerSource
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
+ unset(__TestCompiler_testCXXCompilerSource)
# Move result from cache to normal variable.
set(CMAKE_CXX_COMPILER_WORKS ${CMAKE_CXX_COMPILER_WORKS})
unset(CMAKE_CXX_COMPILER_WORKS CACHE)
@@ -56,7 +57,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerResult(CHECK_FAIL "broken")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining if the CXX compiler works failed with "
+ "Determining if the C++ compiler works failed with "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
string(REPLACE "\n" "\n " _output "${__CMAKE_CXX_COMPILER_OUTPUT}")
message(FATAL_ERROR "The C++ compiler\n \"${CMAKE_CXX_COMPILER}\"\n"
@@ -66,7 +67,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
endif()
PrintTestCompilerResult(CHECK_PASS "works")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Determining if the CXX compiler works passed with "
+ "Determining if the C++ compiler works passed with "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
endif()
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index 579f83f..e6d1f6d 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -38,7 +38,7 @@ endif()
# any makefiles or projects.
if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerStatus("Fortran")
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
+ set(__TestCompiler_testFortranCompilerSource "
PROGRAM TESTFortran
PRINT *, 'Hello'
END
@@ -46,9 +46,10 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
# Clear result from normal variable.
unset(CMAKE_Fortran_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
+ try_compile(CMAKE_Fortran_COMPILER_WORKS
+ SOURCE_FROM_VAR testFortranCompiler.f __TestCompiler_testFortranCompilerSource
OUTPUT_VARIABLE OUTPUT)
+ unset(__TestCompiler_testFortranCompilerSource)
# Move result from cache to normal variable.
set(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_Fortran_COMPILER_WORKS})
unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
@@ -72,14 +73,15 @@ endif()
# Test for Fortran 90 support by using an f90-specific construct.
if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
message(CHECK_START "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
+ set(__TestCompiler_testFortranCompilerSource "
PROGRAM TESTFortran90
integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do
END PROGRAM TESTFortran90
")
- try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
+ try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90
+ SOURCE_FROM_VAR testFortranCompilerF90.f90 __TestCompiler_testFortranCompilerF90Source
OUTPUT_VARIABLE OUTPUT)
+ unset(__TestCompiler_testFortranCompilerF90Source)
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
message(CHECK_PASS "yes")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
diff --git a/Modules/CMakeTestHIPCompiler.cmake b/Modules/CMakeTestHIPCompiler.cmake
index ecbfa7f..1da0ae4 100644
--- a/Modules/CMakeTestHIPCompiler.cmake
+++ b/Modules/CMakeTestHIPCompiler.cmake
@@ -41,7 +41,7 @@ endif()
if(NOT CMAKE_HIP_COMPILER_WORKS)
PrintTestCompilerStatus("HIP")
__TestCompiler_setTryCompileTargetType()
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testHIPCompiler.hip
+ string(CONCAT __TestCompiler_testHIPCompilerSource
"#ifndef __HIP__\n"
"# error \"The CMAKE_HIP_COMPILER is set to a C/CXX compiler\"\n"
"#endif\n"
@@ -49,9 +49,10 @@ if(NOT CMAKE_HIP_COMPILER_WORKS)
# Clear result from normal variable.
unset(CMAKE_HIP_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_HIP_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testHIPCompiler.hip
+ try_compile(CMAKE_HIP_COMPILER_WORKS
+ SOURCE_FROM_VAR testHIPCompiler.hip __TestCompiler_testHIPCompilerSource
OUTPUT_VARIABLE __CMAKE_HIP_COMPILER_OUTPUT)
+ unset(__TestCompiler_testHIPCompilerSource)
# Move result from cache to normal variable.
set(CMAKE_HIP_COMPILER_WORKS ${CMAKE_HIP_COMPILER_WORKS})
unset(CMAKE_HIP_COMPILER_WORKS CACHE)
diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake
index 20d1f8b..bbc90a7 100644
--- a/Modules/CMakeTestOBJCCompiler.cmake
+++ b/Modules/CMakeTestOBJCCompiler.cmake
@@ -38,7 +38,7 @@ endif()
if(NOT CMAKE_OBJC_COMPILER_WORKS)
PrintTestCompilerStatus("OBJC")
__TestCompiler_setTryCompileTargetType()
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m
+ string(CONCAT __TestCompiler_testObjCCompilerSource
"#ifdef __cplusplus\n"
"# error \"The CMAKE_OBJC_COMPILER is set to a C++ compiler\"\n"
"#endif\n"
@@ -50,9 +50,10 @@ if(NOT CMAKE_OBJC_COMPILER_WORKS)
# Clear result from normal variable.
unset(CMAKE_OBJC_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_OBJC_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m
+ try_compile(CMAKE_OBJC_COMPILER_WORKS
+ SOURCE_FROM_VAR testObjCCompiler.m __TestCompiler_testObjCCompilerSource
OUTPUT_VARIABLE __CMAKE_OBJC_COMPILER_OUTPUT)
+ unset(__TestCompiler_testObjCCompilerSource)
# Move result from cache to normal variable.
set(CMAKE_OBJC_COMPILER_WORKS ${CMAKE_OBJC_COMPILER_WORKS})
unset(CMAKE_OBJC_COMPILER_WORKS CACHE)
diff --git a/Modules/CMakeTestOBJCXXCompiler.cmake b/Modules/CMakeTestOBJCXXCompiler.cmake
index 4f7185f..aceb939 100644
--- a/Modules/CMakeTestOBJCXXCompiler.cmake
+++ b/Modules/CMakeTestOBJCXXCompiler.cmake
@@ -38,7 +38,7 @@ endif()
if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
PrintTestCompilerStatus("OBJCXX")
__TestCompiler_setTryCompileTargetType()
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm
+ string(CONCAT __TestCompiler_testObjCXXCompilerSource
"#ifndef __cplusplus\n"
"# error \"The CMAKE_OBJCXX_COMPILER is set to a C compiler\"\n"
"#endif\n"
@@ -49,9 +49,10 @@ if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
# Clear result from normal variable.
unset(CMAKE_OBJCXX_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_OBJCXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm
+ try_compile(CMAKE_OBJCXX_COMPILER_WORKS
+ SOURCE_FROM_VAR testObjCXXCompiler.mm __TestCompiler_testObjCXXCompilerSource
OUTPUT_VARIABLE __CMAKE_OBJCXX_COMPILER_OUTPUT)
+ unset(__TestCompiler_testObjCXXCompilerSource)
# Move result from cache to normal variable.
set(CMAKE_OBJCXX_COMPILER_WORKS ${CMAKE_OBJCXX_COMPILER_WORKS})
unset(CMAKE_OBJCXX_COMPILER_WORKS CACHE)
diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake
index 2f2546f..88a864c 100644
--- a/Modules/CMakeTestSwiftCompiler.cmake
+++ b/Modules/CMakeTestSwiftCompiler.cmake
@@ -21,13 +21,12 @@ unset(CMAKE_Swift_COMPILER_WORKS CACHE)
# any makefiles or projects.
if(NOT CMAKE_Swift_COMPILER_WORKS)
PrintTestCompilerStatus("Swift")
- file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
- "print(\"CMake\")\n")
# Clear result from normal variable.
unset(CMAKE_Swift_COMPILER_WORKS)
# Puts test result in cache variable.
- try_compile(CMAKE_Swift_COMPILER_WORKS ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
+ set(__CMAKE_Swift_TEST_SOURCE "print(\"CMake\")\n")
+ try_compile(CMAKE_Swift_COMPILER_WORKS
+ SOURCE_FROM_VAR main.swift __CMAKE_Swift_TEST_SOURCE
OUTPUT_VARIABLE __CMAKE_Swift_COMPILER_OUTPUT)
# Move result from cache to normal variable.
set(CMAKE_Swift_COMPILER_WORKS ${CMAKE_Swift_COMPILER_WORKS})
@@ -64,4 +63,5 @@ else()
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeSwiftCompiler.cmake)
endif()
+unset(__CMAKE_Swift_TEST_SOURCE)
unset(__CMAKE_Swift_COMPILER_OUTPUT)
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 4934934..7c3ad6b 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -53,9 +53,9 @@ Here's how it works:
* :manual:`cpack <cpack(1)>` runs
* it includes ``CPackConfig.cmake``
-* it iterates over the generators given by the ``-G`` command line option,
- or if no such option was specified, over the list of generators given by
- the :variable:`CPACK_GENERATOR` variable set in the ``CPackConfig.cmake``
+* it iterates over the generators given by the :option:`-G <cpack -G>` command
+ line option, or if no such option was specified, over the list of generators
+ given by the :variable:`CPACK_GENERATOR` variable set in the ``CPackConfig.cmake``
input file.
* foreach generator, it then
@@ -217,7 +217,8 @@ installers. The most commonly-used variables are:
to the user by the produced installer (often with an explicit "Accept"
button, for graphical installers) prior to installation. This license
file is NOT added to the installed files but is used by some CPack generators
- like NSIS. If you want to install a license file (may be the same as this
+ like NSIS. If you want to use UTF-8 characters, the file needs to be encoded
+ in UTF-8 BOM. If you want to install a license file (may be the same as this
one) along with your project, you must add an appropriate CMake
:command:`install` command in your ``CMakeLists.txt``.
@@ -246,9 +247,9 @@ installers. The most commonly-used variables are:
List of CPack generators to use. If not specified, CPack will create a
set of options following the naming pattern
:variable:`CPACK_BINARY_<GENNAME>` (e.g. ``CPACK_BINARY_NSIS``) allowing
- the user to enable/disable individual generators. If the ``-G`` option is
- given on the :manual:`cpack <cpack(1)>` command line, it will override this
- variable and any ``CPACK_BINARY_<GENNAME>`` options.
+ the user to enable/disable individual generators. If the :option:`-G <cpack -G>`
+ option is given on the :manual:`cpack <cpack(1)>` command line, it will override
+ this variable and any ``CPACK_BINARY_<GENNAME>`` options.
.. variable:: CPACK_OUTPUT_CONFIG_FILE
@@ -469,7 +470,35 @@ The following variables are for advanced uses of CPack:
generates (when :variable:`CPACK_GENERATOR` is not set) a set of CMake
options (see CMake :command:`option` command) which may then be used to
select the CPack generator(s) to be used when building the ``package``
- target or when running :manual:`cpack <cpack(1)>` without the ``-G`` option.
+ target or when running :manual:`cpack <cpack(1)>` without the
+ :option:`-G <cpack -G>` option.
+
+.. variable:: CPACK_READELF_EXECUTABLE
+
+ .. versionadded:: 3.25
+
+ Specify the ``readelf`` executable path used by CPack.
+ The default value will be ``CMAKE_READELF`` when set. Otherwise,
+ the default value will be empty and CPack will use :command:`find_program`
+ to determine the ``readelf`` path when needed.
+
+.. variable:: CPACK_OBJCOPY_EXECUTABLE
+
+ .. versionadded:: 3.25
+
+ Specify the ``objcopy`` executable path used by CPack.
+ The default value will be ``CMAKE_OBJCOPY`` when set. Otherwise,
+ the default value will be empty and CPack will use :command:`find_program`
+ to determine the ``objcopy`` path when needed.
+
+.. variable:: CPACK_OBJDUMP_EXECUTABLE
+
+ .. versionadded:: 3.25
+
+ Specify the ``objdump`` executable path used by CPack.
+ The default value will be ``CMAKE_OBJDUMP`` when set. Otherwise,
+ the default value will be empty and CPack will use :command:`find_program`
+ to determine the ``objdump`` path when needed.
#]=======================================================================]
@@ -590,6 +619,16 @@ _cpack_set_default(CPACK_RESOURCE_FILE_WELCOME
_cpack_set_default(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
+if(CMAKE_READELF)
+ _cpack_set_default(CPACK_READELF_EXECUTABLE "${CMAKE_READELF}")
+endif()
+if(CMAKE_OBJCOPY)
+ _cpack_set_default(CPACK_OBJCOPY_EXECUTABLE "${CMAKE_OBJCOPY}")
+endif()
+if(CMAKE_OBJDUMP)
+ _cpack_set_default(CPACK_OBJDUMP_EXECUTABLE "${CMAKE_OBJDUMP}")
+endif()
+
# Set default directory creation permissions mode
if(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS)
_cpack_set_default(CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 8ca9f28..529f4e7 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -301,7 +301,7 @@ be built and installed on system using macOS 10.5 or later.
The site argument is a URL where the archives for downloadable
components will reside, e.g.,
-https://cmake.org/files/2.6.1/installer/ All of the archives
+https://cmake.org/files/v3.25/ All of the archives
produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index a4bfe1d..d4e02f1 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -439,37 +439,57 @@ set(_CPACK_IFW_PREFIXES
"QtIFW-")
set(_CPACK_IFW_VERSIONS
+ "4.5.0"
+ "4.5"
+ "4.4.2"
+ "4.4.1"
+ "4.4.0"
"4.4"
+ "4.3.0"
"4.3"
+ "4.2.0"
"4.2"
+ "4.1.1"
+ "4.1.0"
"4.1"
+ "4.0.1"
+ "4.0.0"
"4.0"
- "3.2"
+ "3.2.3"
+ "3.2.2"
+ "3.2.1"
"3.2.0"
- "3.1"
+ "3.2"
+ "3.1.1"
"3.1.0"
- "3.0"
+ "3.1"
+ "3.0.6"
+ "3.0.4"
+ "3.0.3"
+ "3.0.2"
+ "3.0.1"
"3.0.0"
- "2.3"
+ "3.0"
"2.3.0"
- "2.2"
+ "2.3"
"2.2.0"
- "2.1"
+ "2.2"
"2.1.0"
- "2.0"
+ "2.1"
"2.0.5"
"2.0.3"
"2.0.2"
"2.0.1"
"2.0.0"
- "1.6"
+ "2.0"
"1.6.0"
- "1.5"
+ "1.6"
"1.5.0"
- "1.4"
+ "1.5"
"1.4.0"
- "1.3"
- "1.3.0")
+ "1.4"
+ "1.3.0"
+ "1.3")
set(_CPACK_IFW_SUFFIXES "bin")
foreach(_CPACK_IFW_PREFIX ${_CPACK_IFW_PREFIXES})
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 8f8ebb4..16283d6 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -33,7 +33,7 @@ file at the top of the project with content such as::
(the CDash server can provide the file to a project administrator who
configures ``MyProject``). Settings in the config file are shared by
both this ``CTest`` module and the :manual:`ctest(1)` command-line
-:ref:`Dashboard Client` mode (``ctest -S``).
+:ref:`Dashboard Client` mode (:option:`ctest -S`).
While building a project for submission to CDash, CTest scans the
build output for errors and warnings and reports them with surrounding
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index 838fbbf..b91b48e 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -86,7 +86,7 @@ if(NOT _CTEST_TARGETS_ADDED)
# or "RUN_TESTS" target:
if(CTEST_TEST_TARGET_ALIAS)
add_custom_target(${CTEST_TEST_TARGET_ALIAS}
- ${CMAKE_CTEST_COMMAND} ${__conf_types}
+ ${CMAKE_CTEST_COMMAND} ${CMAKE_CTEST_ARGUMENTS} ${__conf_types}
USES_TERMINAL
)
endif()
diff --git a/Modules/CTestUseLaunchers.cmake b/Modules/CTestUseLaunchers.cmake
index 23a206b..5c544f8 100644
--- a/Modules/CTestUseLaunchers.cmake
+++ b/Modules/CTestUseLaunchers.cmake
@@ -11,7 +11,7 @@ CTestUseLaunchers is automatically included when you include(CTest).
However, it is split out into its own module file so projects can use
the CTEST_USE_LAUNCHERS functionality independently.
-To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
+To use launchers, set CTEST_USE_LAUNCHERS to ON in a :option:`ctest -S`
dashboard script, and then also set it in the cache of the configured
project. Both cmake and ctest need to know the value of it for the
launchers to work properly. CMake needs to know in order to generate
@@ -27,9 +27,12 @@ variable initialization only occurs if CTEST_USE_LAUNCHERS is not
already defined.
.. versionadded:: 3.8
- If CTEST_USE_LAUNCHERS is on in a ctest -S script
+ If CTEST_USE_LAUNCHERS is on in a :option:`ctest -S` script
the ctest_configure command will add -DCTEST_USE_LAUNCHERS:BOOL=TRUE
to the cmake command used to configure the project.
+
+.. TODO Use RST markup
+
#]=======================================================================]
if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index 7b13c3a..1fa0898 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -74,5 +74,5 @@ include_guard(GLOBAL)
include(CheckSymbolExists)
macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
- __CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ __CHECK_SYMBOL_EXISTS_IMPL(CheckSymbolExists.cxx "${SYMBOL}" "${FILES}" "${VARIABLE}" )
endmacro()
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index 8f1ca9d..7e3a7ee 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -58,8 +58,7 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
else()
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
endif()
- file(WRITE
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
+ set(__CheckFunction_testFortranCompilerSource
"
program TESTFortran
external ${FUNCTION}
@@ -68,12 +67,12 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
"
)
try_compile(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
+ SOURCE_FROM_VAR testFortranCompiler.f __CheckFunction_testFortranCompilerSource
${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS}
${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
OUTPUT_VARIABLE OUTPUT
)
+ unset(__CheckFunction_testFortranCompilerSource)
if(${VARIABLE})
set(${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
message(CHECK_PASS "found")
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 9efa132..60f0184 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -81,17 +81,15 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
endif()
if(CMAKE_C_COMPILER_LOADED)
- set(_cfe_source ${CMAKE_ROOT}/Modules/CheckFunctionExists.c)
+ set(_cfe_source CheckFunctionExists.c)
elseif(CMAKE_CXX_COMPILER_LOADED)
- set(_cfe_source ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists/CheckFunctionExists.cxx)
- configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c "${_cfe_source}" COPYONLY)
+ set(_cfe_source CheckFunctionExists.cxx)
else()
message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled")
endif()
try_compile(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${_cfe_source}
+ SOURCE_FROM_FILE "${_cfe_source}" "${CMAKE_ROOT}/Modules/CheckFunctionExists.c"
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS}
${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index cca1be9..9108e34 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -76,6 +76,23 @@ endmacro()
# Run IPO/LTO test
macro(_ipo_run_language_check language)
+ set(_C_ext "c")
+ set(_CXX_ext "cpp")
+ set(_Fortran_ext "f")
+ string(COMPARE EQUAL "${language}" "CUDA" is_cuda)
+
+ set(ext ${_${language}_ext})
+ if(NOT "${ext}" STREQUAL "")
+ set(copy_sources foo.${ext} main.${ext})
+ elseif(is_cuda)
+ if(_CMAKE_CUDA_IPO_SUPPORTED_BY_CMAKE)
+ set("${X_RESULT}" YES PARENT_SCOPE)
+ endif()
+ return()
+ else()
+ message(FATAL_ERROR "Language not supported")
+ endif()
+
set(testdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/_CMakeLTOTest-${language}")
file(REMOVE_RECURSE "${testdir}")
@@ -100,20 +117,6 @@ macro(_ipo_run_language_check language)
@ONLY
)
- string(COMPARE EQUAL "${language}" "C" is_c)
- string(COMPARE EQUAL "${language}" "CXX" is_cxx)
- string(COMPARE EQUAL "${language}" "Fortran" is_fortran)
-
- if(is_c)
- set(copy_sources foo.c main.c)
- elseif(is_cxx)
- set(copy_sources foo.cpp main.cpp)
- elseif(is_fortran)
- set(copy_sources foo.f main.f)
- else()
- message(FATAL_ERROR "Language not supported")
- endif()
-
foreach(x ${copy_sources})
configure_file(
"${try_compile_src}/${x}"
@@ -134,9 +137,9 @@ macro(_ipo_run_language_check language)
try_compile(
_IPO_LANGUAGE_CHECK_RESULT
- "${bindir}"
- "${srcdir}"
- "${TRY_COMPILE_PROJECT_NAME}"
+ PROJECT "${TRY_COMPILE_PROJECT_NAME}"
+ SOURCE_DIR "${srcdir}"
+ BINARY_DIR "${bindir}"
CMAKE_FLAGS
"-DCMAKE_VERBOSE_MAKEFILE=ON"
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
@@ -214,6 +217,11 @@ function(check_ipo_supported)
list(APPEND languages "C")
endif()
+ list(FIND enabled_languages "CUDA" result)
+ if(NOT result EQUAL -1)
+ list(APPEND languages "CUDA")
+ endif()
+
list(FIND enabled_languages "Fortran" result)
if(NOT result EQUAL -1)
list(APPEND languages "Fortran")
@@ -222,7 +230,7 @@ function(check_ipo_supported)
string(COMPARE EQUAL "${languages}" "" no_languages)
if(no_languages)
_ipo_not_supported(
- "no C/CXX/Fortran languages found in ENABLED_LANGUAGES global property"
+ "no C/CXX/CUDA/Fortran languages found in ENABLED_LANGUAGES global property"
)
return()
endif()
@@ -230,7 +238,7 @@ function(check_ipo_supported)
set(languages "${X_LANGUAGES}")
set(unsupported_languages "${languages}")
- list(REMOVE_ITEM unsupported_languages "C" "CXX" "Fortran")
+ list(REMOVE_ITEM unsupported_languages "C" "CXX" "CUDA" "Fortran")
string(COMPARE NOTEQUAL "${unsupported_languages}" "" has_unsupported)
if(has_unsupported)
_ipo_not_supported(
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index 71ddde7..4cba91b 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -54,8 +54,8 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
endif()
set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
- configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c)
+ file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in _CIF_SOURCE_CONTENT)
+ string(CONFIGURE "${_CIF_SOURCE_CONTENT}" _CIF_SOURCE_CONTENT)
if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_START "Looking for ${INCLUDE}")
endif()
@@ -93,8 +93,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
endif()
try_compile(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c
+ SOURCE_FROM_VAR CheckIncludeFile.c _CIF_SOURCE_CONTENT
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${_CIF_LINK_OPTIONS}
${_CIF_LINK_LIBRARIES}
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index 953224e..f6af036 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -53,8 +53,8 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
endif()
set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
- configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
+ file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in _CIF_SOURCE_CONTENT)
+ string(CONFIGURE "${_CIF_SOURCE_CONTENT}" _CIF_SOURCE_CONTENT)
if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_START "Looking for C++ include ${INCLUDE}")
endif()
@@ -92,8 +92,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
endif()
try_compile(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
+ SOURCE_FROM_VAR CheckIncludeFile.cxx _CIF_SOURCE_CONTENT
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${_CIF_LINK_OPTIONS}
${_CIF_LINK_LIBRARIES}
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 1800ca8..8e82859 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -52,7 +52,7 @@ include_guard(GLOBAL)
macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
if(NOT DEFINED "${VARIABLE}")
- set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
+ set(_src_content "/* */\n")
if("x${ARGN}" STREQUAL "x")
if(CMAKE_C_COMPILER_LOADED)
@@ -71,9 +71,9 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
endif()
if(_lang STREQUAL "C")
- set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${VARIABLE}.c)
+ set(src ${VARIABLE}.c)
elseif(_lang STREQUAL "CXX")
- set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${VARIABLE}.cpp)
+ set(src ${VARIABLE}.cpp)
else()
message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n")
endif()
@@ -86,13 +86,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
foreach(FILE ${INCLUDE})
- string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
+ string(APPEND _src_content
"#include <${FILE}>\n")
endforeach()
- string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
+ string(APPEND _src_content
"\n\nint main(void){return 0;}\n")
- configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
- "${src}" @ONLY)
set(_INCLUDE ${INCLUDE}) # remove empty elements
if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
@@ -136,8 +134,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
message(CHECK_START "Looking for ${_description}")
endif()
try_compile(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${src}
+ SOURCE_FROM_VAR "${src}" _src_content
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${_CIF_LINK_OPTIONS}
${_CIF_LINK_LIBRARIES}
@@ -164,7 +161,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} "
"exist failed with the following output:\n"
- "${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
+ "${OUTPUT}\nSource:\n${_src_content}\n")
endif()
endif()
endmacro()
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 804e0cb..56424ac 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -61,17 +61,15 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
endif()
if(CMAKE_C_COMPILER_LOADED)
- set(_cle_source ${CMAKE_ROOT}/Modules/CheckFunctionExists.c)
+ set(_cle_source CheckFunctionExists.c)
elseif(CMAKE_CXX_COMPILER_LOADED)
- set(_cle_source ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckLibraryExists/CheckFunctionExists.cxx)
- configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c "${_cle_source}" COPYONLY)
+ set(_cle_source CheckFunctionExists.cxx)
else()
message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled")
endif()
try_compile(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${_cle_source}
+ SOURCE_FROM_FILE "${_cle_source}" "${CMAKE_ROOT}/Modules/CheckFunctionExists.c"
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_LIBRARY_EXISTS_LINK_OPTIONS}
LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}
diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake
index d29c5e8..12f4e86 100644
--- a/Modules/CheckPrototypeDefinition.cmake
+++ b/Modules/CheckPrototypeDefinition.cmake
@@ -94,14 +94,11 @@ function(check_prototype_definition _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
set(CHECK_PROTOTYPE_DEFINITION_PROTO ${_PROTOTYPE})
set(CHECK_PROTOTYPE_DEFINITION_RETURN ${_RETURN})
- configure_file("${__check_proto_def_dir}/CheckPrototypeDefinition.c.in"
- "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c" @ONLY)
-
- file(READ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c _SOURCE)
+ file(READ ${__check_proto_def_dir}/CheckPrototypeDefinition.c.in _SOURCE)
+ string(CONFIGURE "${_SOURCE}" _SOURCE @ONLY)
try_compile(${_VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c
+ SOURCE_FROM_VAR CheckPrototypeDefinition.c _SOURCE
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_PROTOTYPE_DEFINITION_LINK_OPTIONS}
${CHECK_PROTOTYPE_DEFINITION_LIBS}
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index a7139af..0d44d56 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -68,11 +68,11 @@ cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
if(CMAKE_C_COMPILER_LOADED)
__CHECK_SYMBOL_EXISTS_FILTER_FLAGS(C)
- __CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ __CHECK_SYMBOL_EXISTS_IMPL(CheckSymbolExists.c "${SYMBOL}" "${FILES}" "${VARIABLE}" )
__CHECK_SYMBOL_EXISTS_RESTORE_FLAGS(C)
elseif(CMAKE_CXX_COMPILER_LOADED)
__CHECK_SYMBOL_EXISTS_FILTER_FLAGS(CXX)
- __CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
+ __CHECK_SYMBOL_EXISTS_IMPL(CheckSymbolExists.cxx "${SYMBOL}" "${FILES}" "${VARIABLE}" )
__CHECK_SYMBOL_EXISTS_RESTORE_FLAGS(CXX)
else()
message(FATAL_ERROR "CHECK_SYMBOL_EXISTS needs either C or CXX language enabled")
@@ -92,7 +92,7 @@ endmacro()
macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)
if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}")
- set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
+ set(_CSE_SOURCE "/* */\n")
set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
if(CMAKE_REQUIRED_LINK_OPTIONS)
set(CHECK_SYMBOL_EXISTS_LINK_OPTIONS
@@ -113,17 +113,17 @@ macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)
set(CMAKE_SYMBOL_EXISTS_INCLUDES)
endif()
foreach(FILE ${FILES})
- string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT
+ string(APPEND _CSE_SOURCE
"#include <${FILE}>\n")
endforeach()
- string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT "
+ string(APPEND _CSE_SOURCE "
int main(int argc, char** argv)
{
(void)argv;")
set(_CSE_CHECK_NON_MACRO "return ((int*)(&${SYMBOL}))[argc];")
if("${SYMBOL}" MATCHES "^[a-zA-Z_][a-zA-Z0-9_]*$")
# The SYMBOL has a legal macro name. Test whether it exists as a macro.
- string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT "
+ string(APPEND _CSE_SOURCE "
#ifndef ${SYMBOL}
${_CSE_CHECK_NON_MACRO}
#else
@@ -132,22 +132,18 @@ int main(int argc, char** argv)
#endif")
else()
# The SYMBOL cannot be a macro (e.g., a template function).
- string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT "
+ string(APPEND _CSE_SOURCE "
${_CSE_CHECK_NON_MACRO}")
endif()
- string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT "
+ string(APPEND _CSE_SOURCE "
}")
unset(_CSE_CHECK_NON_MACRO)
- configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
- "${SOURCEFILE}" @ONLY)
-
if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_START "Looking for ${SYMBOL}")
endif()
try_compile(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- "${SOURCEFILE}"
+ SOURCE_FROM_VAR "${SOURCEFILE}" _CSE_SOURCE
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_SYMBOL_EXISTS_LINK_OPTIONS}
${CHECK_SYMBOL_EXISTS_LIBS}
@@ -164,7 +160,7 @@ int main(int argc, char** argv)
"Determining if the ${SYMBOL} "
"exist passed with the following output:\n"
"${OUTPUT}\nFile ${SOURCEFILE}:\n"
- "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
+ "${_CSE_SOURCE}\n")
else()
if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_FAIL "not found")
@@ -174,9 +170,9 @@ int main(int argc, char** argv)
"Determining if the ${SYMBOL} "
"exist failed with the following output:\n"
"${OUTPUT}\nFile ${SOURCEFILE}:\n"
- "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
+ "${_CSE_SOURCE}\n")
endif()
- unset(CMAKE_CONFIGURABLE_FILE_CONTENT)
+ unset(_CSE_SOURCE)
endif()
endmacro()
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 602170c..b14ab06 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -104,9 +104,9 @@ function(__check_type_size_impl type var map builtin language)
# Perform language check
if(language STREQUAL "C")
- set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
+ set(src ${var}.c)
elseif(language STREQUAL "CXX")
- set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
+ set(src ${var}.cpp)
else()
message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n")
endif()
@@ -142,8 +142,9 @@ function(__check_type_size_impl type var map builtin language)
# Perform the check.
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
- configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
- try_compile(HAVE_${var} ${CMAKE_BINARY_DIR} ${src}
+ file(READ ${__check_type_size_dir}/CheckTypeSize.c.in src_content)
+ string(CONFIGURE "${src_content}" src_content @ONLY)
+ try_compile(HAVE_${var} SOURCE_FROM_VAR "${src}" src_content
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
@@ -209,9 +210,8 @@ function(__check_type_size_impl type var map builtin language)
if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_FAIL "failed")
endif()
- file(READ ${src} content)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${content}\n\n")
+ "Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${src_content}\n\n")
set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown")
file(REMOVE ${map})
endif()
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index 7420124..5dc3441 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -62,8 +62,7 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
endif()
try_compile(${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_ROOT}/Modules/CheckVariableExists.c
+ SOURCES ${CMAKE_ROOT}/Modules/CheckVariableExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS}
${CHECK_VARIABLE_EXISTS_ADD_LIBRARIES}
diff --git a/Modules/Compiler/Clang-CUDA.cmake b/Modules/Compiler/Clang-CUDA.cmake
index 219897e..d9929f1 100644
--- a/Modules/Compiler/Clang-CUDA.cmake
+++ b/Modules/Compiler/Clang-CUDA.cmake
@@ -35,6 +35,10 @@ set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static")
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt;cudart")
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_NONE "")
+# Clang doesn't support CUDA device LTO
+set(_CMAKE_CUDA_IPO_SUPPORTED_BY_CMAKE NO)
+set(_CMAKE_CUDA_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)
+
if(UNIX)
list(APPEND CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl")
endif()
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index df115d3..4f9af37 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -80,7 +80,7 @@ else()
set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto")
endif()
- if(ANDROID AND NOT CMAKE_ANDROID_NDK_VERSION VERSION_GREATER_EQUAL "22")
+ if(ANDROID AND CMAKE_ANDROID_NDK_VERSION VERSION_LESS "22")
# https://github.com/android-ndk/ndk/issues/242
set(CMAKE_${lang}_LINK_OPTIONS_IPO "-fuse-ld=gold")
endif()
@@ -255,6 +255,7 @@ macro(__compiler_clang_cxx_standards lang)
cxx_std_17
cxx_std_20
cxx_std_23
+ cxx_std_26
)
_record_compiler_features(${lang} "" CMAKE_${lang}_COMPILE_FEATURES)
endmacro()
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 6c15735..3f0ef1f 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -22,9 +22,9 @@ if(NOT CMAKE_IAR_CXX_FLAG)
set(_CMAKE_IAR_MODERNCXX_LIST 14 17)
if(${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} IN_LIST _CMAKE_IAR_MODERNCXX_LIST OR
("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM" AND ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT} EQUAL 98))
- string(PREPEND CMAKE_CXX_FLAGS "--c++ ")
+ set(CMAKE_IAR_CXX_FLAG --c++)
else()
- string(PREPEND CMAKE_CXX_FLAGS "--eec++ ")
+ set(CMAKE_IAR_CXX_FLAG --eec++)
endif()
unset(_CMAKE_IAR_MODERNCXX_LIST)
diff --git a/Modules/Compiler/IntelLLVM-FindBinUtils.cmake b/Modules/Compiler/IntelLLVM-FindBinUtils.cmake
new file mode 100644
index 0000000..c5b1ee6
--- /dev/null
+++ b/Modules/Compiler/IntelLLVM-FindBinUtils.cmake
@@ -0,0 +1,45 @@
+if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
+ message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
+endif()
+
+# Ubuntu:
+# * /usr/bin/llvm-ar-9
+# * /usr/bin/llvm-ranlib-9
+string(REGEX MATCH "^([0-9]+)" __version_x
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}")
+
+# Debian:
+# * /usr/bin/llvm-ar-4.0
+# * /usr/bin/llvm-ranlib-4.0
+string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}")
+
+# Try to find tools in the IntelLLVM Clang tools directory
+get_filename_component(__intel_llvm_hint_1 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
+get_filename_component(__intel_llvm_hint_1 "${__intel_llvm_hint_1}/../bin-llvm" REALPATH)
+
+get_filename_component(__intel_llvm_hint_2 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
+
+set(__intel_llvm_hints ${__intel_llvm_hint_1} ${__intel_llvm_hint_2})
+
+# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ar.1.html
+find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x_y}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar"
+ HINTS ${__intel_llvm_hints}
+ NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
+ DOC "LLVM archiver"
+)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
+
+# http://manpages.ubuntu.com/manpages/precise/en/man1/llvm-ranlib.1.html
+find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x_y}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x}"
+ "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib"
+ HINTS ${__intel_llvm_hints}
+ NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
+ DOC "Generate index for LLVM archive"
+)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB)
diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake
index c5800dc..30de1a9 100644
--- a/Modules/Compiler/IntelLLVM.cmake
+++ b/Modules/Compiler/IntelLLVM.cmake
@@ -15,6 +15,15 @@ set(__pch_header_CXX "c++-header")
set(__pch_header_OBJC "objective-c-header")
set(__pch_header_OBJCXX "objective-c++-header")
+# Variables that are common across front-end variants
+macro(__compiler_intel_llvm_common lang)
+ set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
+ set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
+ set(CMAKE_${lang}_ARCHIVE_CREATE_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" r <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_FINISH_IPO "\"${CMAKE_${lang}_COMPILER_RANLIB}\" <TARGET>")
+endmacro()
+
if(CMAKE_HOST_WIN32)
# MSVC-like
macro(__compiler_intel_llvm lang)
@@ -24,6 +33,9 @@ if(CMAKE_HOST_WIN32)
set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-WX")
endif()
+ __compiler_intel_llvm_common(${lang})
+ set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-Qipo")
+ set(CMAKE_${lang}_LINK_OPTIONS_IPO "-Qipo")
endmacro()
else()
# GNU-like
@@ -61,12 +73,9 @@ else()
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
- set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
- set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
- set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto=thin")
- set(CMAKE_${lang}_ARCHIVE_CREATE_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>")
- set(CMAKE_${lang}_ARCHIVE_APPEND_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" r <TARGET> <LINK_FLAGS> <OBJECTS>")
- set(CMAKE_${lang}_ARCHIVE_FINISH_IPO "\"${CMAKE_${lang}_COMPILER_RANLIB}\" <TARGET>")
+ __compiler_intel_llvm_common(${lang})
+ set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-ipo")
+ set(CMAKE_${lang}_LINK_OPTIONS_IPO "-ipo")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index 75165fd..212f6d1 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -72,7 +72,20 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
cxx_std_17
cxx_std_20
cxx_std_23
+ cxx_std_26
)
_record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
endmacro()
endif()
+
+if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.34")
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
+ string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE
+ "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> <SOURCE> -nologo -TP"
+ " -showIncludes"
+ " -scanDependencies <DYNDEP_FILE>"
+ " -Fo<OBJECT>")
+ set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_DEPFILE_FORMAT "msvc")
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "msvc")
+ set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "@<MODULE_MAP_FILE>")
+endif ()
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index e07d152..c8dcd2a 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -48,6 +48,13 @@ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
set(CMAKE_CUDA_DEPENDS_USE_COMPILER TRUE)
endif()
+if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2)
+ set(_CMAKE_CUDA_IPO_SUPPORTED_BY_CMAKE YES)
+ set(_CMAKE_CUDA_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
+
+ set(CMAKE_CUDA_DEVICE_LINK_OPTIONS_IPO " -dlto")
+endif()
+
if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CUDA_COMPILE_OPTIONS_PIE -Xcompiler=-fPIE)
set(CMAKE_CUDA_COMPILE_OPTIONS_PIC -Xcompiler=-fPIC)
@@ -61,6 +68,7 @@ if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG")
string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
endif()
+
set(CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS -shared)
set(CMAKE_INCLUDE_SYSTEM_FLAG_CUDA -isystem=)
@@ -132,15 +140,19 @@ else()
endif()
-# FIXME: investigate use of --options-file.
-# Tell Makefile generator that nvcc does not support @<rspfile> syntax.
-set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0)
-set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
-set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0)
-
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0")
set(CMAKE_CUDA_RESPONSE_FILE_DEVICE_LINK_FLAG "--options-file ")
set(CMAKE_CUDA_RESPONSE_FILE_FLAG "--options-file ")
endif()
+if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0")
+ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
+ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+else()
+ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0)
+ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
+ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0)
+endif()
+
__compiler_check_default_language_standard(CUDA 6.0 03)
diff --git a/Modules/Compiler/Tasking-ASM.cmake b/Modules/Compiler/Tasking-ASM.cmake
new file mode 100644
index 0000000..19bce19
--- /dev/null
+++ b/Modules/Compiler/Tasking-ASM.cmake
@@ -0,0 +1,7 @@
+include(Compiler/Tasking)
+
+set(CMAKE_ASM_OUTPUT_EXTENSION ".o")
+set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1)
+
+set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS S;s;asm;msa)
diff --git a/Modules/Compiler/Tasking-C.cmake b/Modules/Compiler/Tasking-C.cmake
new file mode 100644
index 0000000..0ea3cd2
--- /dev/null
+++ b/Modules/Compiler/Tasking-C.cmake
@@ -0,0 +1,47 @@
+include(Compiler/Tasking)
+__compiler_tasking(C)
+
+set(CMAKE_C90_STANDARD_COMPILE_OPTION "--iso=90" "--strict")
+set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--iso=90" " ")
+
+set(CMAKE_C99_STANDARD_COMPILE_OPTION "--iso=99" "--strict")
+set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--iso=99" " ")
+
+set(CMAKE_C11_STANDARD_COMPILE_OPTION "--iso=11" "--strict")
+set(CMAKE_C11_EXTENSION_COMPILE_OPTION "--iso=11" " ")
+
+if(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "TriCore")
+ if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
+ __compiler_check_default_language_standard(C 10.1 11)
+ else()
+ __compiler_check_default_language_standard(C 6.3 11)
+ endif()
+elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM")
+ if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
+ __compiler_check_default_language_standard(C 10.1 11)
+ elseif(CMAKE_TASKING_TOOLSET STREQUAL "TriCore")
+ __compiler_check_default_language_standard(C 6.3 11)
+ else()
+ __compiler_check_default_language_standard(C 6.0 11)
+ endif()
+elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "MCS")
+ if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
+ __compiler_check_default_language_standard(C 10.1 11)
+ elseif(CMAKE_TASKING_TOOLSET STREQUAL "TriCore")
+ __compiler_check_default_language_standard(C 6.3 11)
+ else()
+ __compiler_check_default_language_standard(C 3.3 11)
+ endif()
+elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARC")
+ __compiler_check_default_language_standard(C 10.1 11)
+elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "8051")
+ if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
+ __compiler_check_default_language_standard(C 10.1 11)
+ elseif(CMAKE_TASKING_TOOLSET STREQUAL "TriCore")
+ __compiler_check_default_language_standard(C 6.3 11)
+ else()
+ __compiler_check_default_language_standard(C 7.2 89)
+ endif()
+elseif(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "PCP")
+ __compiler_check_default_language_standard(C 6.3 11)
+endif()
diff --git a/Modules/Compiler/Tasking-CXX.cmake b/Modules/Compiler/Tasking-CXX.cmake
new file mode 100644
index 0000000..635104c
--- /dev/null
+++ b/Modules/Compiler/Tasking-CXX.cmake
@@ -0,0 +1,31 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+include(Compiler/Tasking)
+__compiler_tasking(CXX)
+
+set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "--c++=03" "--strict")
+set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--iso=03" " ")
+
+set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "--c++=11" "--strict")
+set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "--c++=11" " ")
+
+set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "--c++=14" "--strict")
+set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "--c++=14" " ")
+
+if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "TriCore")
+ if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
+ __compiler_check_default_language_standard(CXX 10.1 14)
+ else()
+ __compiler_check_default_language_standard(CXX 6.3 14)
+ endif()
+elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "ARM")
+ if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
+ __compiler_check_default_language_standard(CXX 10.1 14)
+ elseif(CMAKE_TASKING_TOOLSET STREQUAL "TriCore")
+ __compiler_check_default_language_standard(CXX 6.3 14)
+ else()
+ __compiler_check_default_language_standard(CXX 6.0 14)
+ endif()
+else()
+ message(FATAL_ERROR "CXX is not supported with the ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} architecture.")
+endif()
diff --git a/Modules/Compiler/Tasking-DetermineCompiler.cmake b/Modules/Compiler/Tasking-DetermineCompiler.cmake
new file mode 100644
index 0000000..a40be19
--- /dev/null
+++ b/Modules/Compiler/Tasking-DetermineCompiler.cmake
@@ -0,0 +1,10 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+set(_compiler_id_pp_test "defined(__TASKING__)")
+
+set(_compiler_id_version_compute "
+ # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__VERSION__/1000)
+ # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__VERSION__ % 100)")
+
+string(APPEND _compiler_id_version_compute "
+# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__VERSION__)")
diff --git a/Modules/Compiler/Tasking-FindBinUtils.cmake b/Modules/Compiler/Tasking-FindBinUtils.cmake
new file mode 100644
index 0000000..eab31d7
--- /dev/null
+++ b/Modules/Compiler/Tasking-FindBinUtils.cmake
@@ -0,0 +1,18 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Find the archiver for the compiler architecture, which is always in the same
+# directory as the compiler.
+if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
+ message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
+endif()
+
+get_filename_component(__tasking_hints "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
+
+find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR
+ NAMES artc ararm armcs ar51 ararc arpcp
+ HINTS ${__tasking_hints}
+ NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
+ DOC "Tasking Archiver"
+)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
diff --git a/Modules/Compiler/Tasking.cmake b/Modules/Compiler/Tasking.cmake
new file mode 100644
index 0000000..5bf066e
--- /dev/null
+++ b/Modules/Compiler/Tasking.cmake
@@ -0,0 +1,54 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# This module is shared by multiple languages; use include blocker.
+if(_Tasking_CMAKE_LOADED)
+ return()
+endif()
+set(_Tasking_CMAKE_LOADED TRUE)
+include(Compiler/CMakeCommonCompilerMacros)
+
+set(CMAKE_EXECUTABLE_SUFFIX ".elf")
+set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+
+set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+set(BUILD_SHARED_LIBS FALSE CACHE BOOL "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+set(CMAKE_LINK_SEARCH_START_STATIC TRUE)
+
+if(NOT CMAKE_TASKING_TOOLSET)
+ set(CMAKE_TASKING_TOOLSET "Standalone")
+endif()
+
+macro(__compiler_tasking lang)
+
+ set(CMAKE_${lang}_VERBOSE_FLAG "-v")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "--pic")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl" " ")
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--dep-file=<DEP_FILE>")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "--warning-as-errors")
+
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -O0 -g")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O2 -t4 -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2 -t2 -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -t2 -g -DNDEBUG")
+
+ set(CMAKE_${lang}_ARCHIVE_CREATE "\"${CMAKE_${lang}_COMPILER_AR}\" -r <TARGET> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND "\"${CMAKE_${lang}_COMPILER_AR}\" -r <TARGET> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_FINISH "")
+
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -cs <SOURCE> -o <ASSEMBLY_SOURCE>")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -Ep <SOURCE> > <PREPROCESSED_SOURCE>")
+
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
+ if(CMAKE_${lang}_COMPILER_ARG1)
+ separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
+ unset(_COMPILER_ARGS)
+ endif()
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-Ep" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
+
+endmacro()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 9952658..22a25bd 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1840,7 +1840,11 @@ function(_ep_get_build_command
else()
set(cmd "${CMAKE_COMMAND}")
endif()
- set(args --build ".")
+ if(step STREQUAL "INSTALL")
+ set(args --install ".")
+ else()
+ set(args --build ".")
+ endif()
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig)
if (CMAKE_CFG_INTDIR AND
@@ -1862,9 +1866,6 @@ function(_ep_get_build_command
endif()
list(APPEND args --config ${config})
endif()
- if(step STREQUAL "INSTALL")
- list(APPEND args --target install)
- endif()
# But for "TEST" drive the project with corresponding "ctest".
if("x${step}x" STREQUAL "xTESTx")
string(REGEX REPLACE "^(.*/)cmake([^/]*)$" "\\1ctest\\2" cmd "${cmd}")
@@ -3832,6 +3833,19 @@ function(_ep_add_install_command name)
set(uses_terminal "")
endif()
+ # With BUILD_ALWAYS+BUILD_BYPRODUCTS, Ninja restats the
+ # build step outputs and may not consider this step to
+ # be out-of-date. Explicitly mark it out-of-date too.
+ get_property(build_always
+ TARGET ${name}
+ PROPERTY _EP_BUILD_ALWAYS
+ )
+ if(build_always)
+ set(always 1)
+ else()
+ set(always 0)
+ endif()
+
set(__cmdQuoted)
foreach(__item IN LISTS cmd)
string(APPEND __cmdQuoted " [==[${__item}]==]")
@@ -3842,6 +3856,7 @@ function(_ep_add_install_command name)
COMMAND ${__cmdQuoted}
WORKING_DIRECTORY \${binary_dir}
DEPENDEES build
+ ALWAYS \${always}
${log}
${uses_terminal}
)"
diff --git a/Modules/ExternalProject/gitupdate.cmake.in b/Modules/ExternalProject/gitupdate.cmake.in
index 7896f62..50f0167 100644
--- a/Modules/ExternalProject/gitupdate.cmake.in
+++ b/Modules/ExternalProject/gitupdate.cmake.in
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.5)
function(get_hash_for_ref ref out_var err_var)
execute_process(
- COMMAND "@git_EXECUTABLE@" rev-parse "${ref}^0"
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git rev-parse "${ref}^0"
WORKING_DIRECTORY "@work_dir@"
RESULT_VARIABLE error_code
OUTPUT_VARIABLE ref_hash
@@ -27,7 +27,7 @@ endif()
execute_process(
- COMMAND "@git_EXECUTABLE@" show-ref "@git_tag@"
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git show-ref "@git_tag@"
WORKING_DIRECTORY "@work_dir@"
OUTPUT_VARIABLE show_ref_output
)
@@ -95,7 +95,7 @@ endif()
if(fetch_required)
message(VERBOSE "Fetching latest from the remote @git_remote_name@")
execute_process(
- COMMAND "@git_EXECUTABLE@" fetch --tags --force "@git_remote_name@"
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git fetch --tags --force "@git_remote_name@"
WORKING_DIRECTORY "@work_dir@"
COMMAND_ERROR_IS_FATAL ANY
)
@@ -112,7 +112,7 @@ if(git_update_strategy MATCHES "^REBASE(_CHECKOUT)?$")
# We can't if we aren't already on a branch and we shouldn't if that local
# branch isn't tracking the one we want to checkout.
execute_process(
- COMMAND "@git_EXECUTABLE@" symbolic-ref -q HEAD
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git symbolic-ref -q HEAD
WORKING_DIRECTORY "@work_dir@"
OUTPUT_VARIABLE current_branch
OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -128,7 +128,7 @@ if(git_update_strategy MATCHES "^REBASE(_CHECKOUT)?$")
else()
execute_process(
- COMMAND "@git_EXECUTABLE@" for-each-ref "--format=%(upstream:short)" "${current_branch}"
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git for-each-ref "--format=%(upstream:short)" "${current_branch}"
WORKING_DIRECTORY "@work_dir@"
OUTPUT_VARIABLE upstream_branch
OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -151,7 +151,7 @@ endif()
# Check if stash is needed
execute_process(
- COMMAND "@git_EXECUTABLE@" status --porcelain
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git status --porcelain
WORKING_DIRECTORY "@work_dir@"
RESULT_VARIABLE error_code
OUTPUT_VARIABLE repo_status
@@ -165,7 +165,7 @@ string(LENGTH "${repo_status}" need_stash)
# rebase or checkout without losing those changes permanently
if(need_stash)
execute_process(
- COMMAND "@git_EXECUTABLE@" stash save @git_stash_save_options@
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git stash save @git_stash_save_options@
WORKING_DIRECTORY "@work_dir@"
COMMAND_ERROR_IS_FATAL ANY
)
@@ -173,13 +173,13 @@ endif()
if(git_update_strategy STREQUAL "CHECKOUT")
execute_process(
- COMMAND "@git_EXECUTABLE@" checkout "${checkout_name}"
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git checkout "${checkout_name}"
WORKING_DIRECTORY "@work_dir@"
COMMAND_ERROR_IS_FATAL ANY
)
else()
execute_process(
- COMMAND "@git_EXECUTABLE@" rebase "${checkout_name}"
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git rebase "${checkout_name}"
WORKING_DIRECTORY "@work_dir@"
RESULT_VARIABLE error_code
OUTPUT_VARIABLE rebase_output
@@ -188,7 +188,7 @@ else()
if(error_code)
# Rebase failed, undo the rebase attempt before continuing
execute_process(
- COMMAND "@git_EXECUTABLE@" rebase --abort
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git rebase --abort
WORKING_DIRECTORY "@work_dir@"
)
@@ -196,7 +196,7 @@ else()
# Not allowed to do a checkout as a fallback, so cannot proceed
if(need_stash)
execute_process(
- COMMAND "@git_EXECUTABLE@" stash pop --index --quiet
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git stash pop --index --quiet
WORKING_DIRECTORY "@work_dir@"
)
endif()
@@ -218,7 +218,7 @@ else()
message(WARNING "Rebase failed, output has been saved to ${error_log_file}"
"\nFalling back to checkout, previous commit tagged as ${tag_name}")
execute_process(
- COMMAND "@git_EXECUTABLE@" tag -a
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git tag -a
-m "ExternalProject attempting to move from here to ${checkout_name}"
${tag_name}
WORKING_DIRECTORY "@work_dir@"
@@ -226,7 +226,7 @@ else()
)
execute_process(
- COMMAND "@git_EXECUTABLE@" checkout "${checkout_name}"
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git checkout "${checkout_name}"
WORKING_DIRECTORY "@work_dir@"
COMMAND_ERROR_IS_FATAL ANY
)
@@ -236,29 +236,29 @@ endif()
if(need_stash)
# Put back the stashed changes
execute_process(
- COMMAND "@git_EXECUTABLE@" stash pop --index --quiet
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git stash pop --index --quiet
WORKING_DIRECTORY "@work_dir@"
RESULT_VARIABLE error_code
)
if(error_code)
# Stash pop --index failed: Try again dropping the index
execute_process(
- COMMAND "@git_EXECUTABLE@" reset --hard --quiet
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git reset --hard --quiet
WORKING_DIRECTORY "@work_dir@"
)
execute_process(
- COMMAND "@git_EXECUTABLE@" stash pop --quiet
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git stash pop --quiet
WORKING_DIRECTORY "@work_dir@"
RESULT_VARIABLE error_code
)
if(error_code)
# Stash pop failed: Restore previous state.
execute_process(
- COMMAND "@git_EXECUTABLE@" reset --hard --quiet ${head_sha}
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git reset --hard --quiet ${head_sha}
WORKING_DIRECTORY "@work_dir@"
)
execute_process(
- COMMAND "@git_EXECUTABLE@" stash pop --index --quiet
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git stash pop --index --quiet
WORKING_DIRECTORY "@work_dir@"
)
message(FATAL_ERROR "\nFailed to unstash changes in: '@work_dir@'."
@@ -270,7 +270,7 @@ endif()
set(init_submodules "@init_submodules@")
if(init_submodules)
execute_process(
- COMMAND "@git_EXECUTABLE@" submodule update @git_submodules_recurse@ --init @git_submodules@
+ COMMAND "@git_EXECUTABLE@" --git-dir=.git submodule update @git_submodules_recurse@ --init @git_submodules@
WORKING_DIRECTORY "@work_dir@"
COMMAND_ERROR_IS_FATAL ANY
)
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 995e69a..ac3918c 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -111,6 +111,7 @@ Commands
FetchContent_Declare(
<name>
<contentOptions>...
+ [SYSTEM]
[OVERRIDE_FIND_PACKAGE |
FIND_PACKAGE_ARGS args...]
)
@@ -229,6 +230,16 @@ Commands
to intercept any direct call to :command:`find_package`, except if that
call contains the ``BYPASS_PROVIDER`` option.
+ .. versionadded:: 3.25
+
+ ``SYSTEM``
+ If the ``SYSTEM`` argument is provided, targets created by
+ the dependency will have their :prop_tgt:`SYSTEM` property
+ set to true when populated by :command:`FetchContent_MakeAvailable`.
+ The entries in their :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
+ will be treated as ``SYSTEM`` include directories when
+ compiling consumers.
+
.. command:: FetchContent_MakeAvailable
.. versionadded:: 3.14
@@ -884,9 +895,10 @@ Overriding Where To Find CMakeLists.txt
If the sub-project's ``CMakeLists.txt`` file is not at the top level of its
source tree, the ``SOURCE_SUBDIR`` option can be used to tell ``FetchContent``
-where to find it. The following example shows how to use that option and
+where to find it. The following example shows how to use that option, and
it also sets a variable which is meaningful to the subproject before pulling
-it into the main build:
+it into the main build (set as an ``INTERNAL`` cache variable to avoid
+problems with policy :policy:`CMP0077`):
.. code-block:: cmake
@@ -897,7 +909,7 @@ it into the main build:
GIT_TAG ae50d9b9902526efd6c7a1907d09739f959c6297 # v3.15.0
SOURCE_SUBDIR cmake
)
- set(protobuf_BUILD_TESTS OFF)
+ set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(protobuf)
Complex Dependency Hierarchies
@@ -1972,13 +1984,17 @@ macro(FetchContent_MakeAvailable)
if("${__cmake_contentDetails}" STREQUAL "")
message(FATAL_ERROR "No details have been set for content: ${__cmake_contentName}")
endif()
- cmake_parse_arguments(__cmake_arg "" "SOURCE_SUBDIR" "" ${__cmake_contentDetails})
+ cmake_parse_arguments(__cmake_arg "SYSTEM" "SOURCE_SUBDIR" "" ${__cmake_contentDetails})
if(NOT "${__cmake_arg_SOURCE_SUBDIR}" STREQUAL "")
string(APPEND __cmake_srcdir "/${__cmake_arg_SOURCE_SUBDIR}")
endif()
if(EXISTS ${__cmake_srcdir}/CMakeLists.txt)
- add_subdirectory(${__cmake_srcdir} ${${__cmake_contentNameLower}_BINARY_DIR})
+ if (__cmake_arg_SYSTEM)
+ add_subdirectory(${__cmake_srcdir} ${${__cmake_contentNameLower}_BINARY_DIR} SYSTEM)
+ else()
+ add_subdirectory(${__cmake_srcdir} ${${__cmake_contentNameLower}_BINARY_DIR})
+ endif()
endif()
unset(__cmake_srcdir)
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index 9655440..d63b707 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -7,7 +7,7 @@ FindAVIFile
Locate AVIFILE library and include paths
-AVIFILE (http://avifile.sourceforge.net/) is a set of libraries for
+AVIFILE (https://avifile.sourceforge.net/) is a set of libraries for
i386 machines to use various AVI codecs. Support is limited beyond
Linux. Windows provides native AVI support, and so doesn't need this
library. This module defines
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 7a381af..7af1017 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -12,7 +12,7 @@ This module finds an installed Fortran library that implements the
At least one of the ``C``, ``CXX``, or ``Fortran`` languages must be enabled.
-.. _`BLAS linear-algebra interface`: http://www.netlib.org/blas/
+.. _`BLAS linear-algebra interface`: https://netlib.org/blas/
Input Variables
^^^^^^^^^^^^^^^
@@ -35,6 +35,12 @@ The following variables may be set to influence this module's behavior:
if set ``pkg-config`` will be used to search for a BLAS library first
and if one is found that is preferred
+``BLA_PKGCONFIG_BLAS``
+ .. versionadded:: 3.25
+
+ If set, the ``pkg-config`` method will look for this module name instead of
+ just ``blas``.
+
``BLA_SIZEOF_INTEGER``
.. versionadded:: 3.22
@@ -273,8 +279,11 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
if(BLA_PREFER_PKGCONFIG)
+ if(NOT BLA_PKGCONFIG_BLAS)
+ set(BLA_PKGCONFIG_BLAS "blas")
+ endif()
find_package(PkgConfig QUIET)
- pkg_check_modules(PKGC_BLAS QUIET blas)
+ pkg_check_modules(PKGC_BLAS QUIET ${BLA_PKGCONFIG_BLAS})
if(PKGC_BLAS_FOUND)
set(BLAS_FOUND ${PKGC_BLAS_FOUND})
set(BLAS_LIBRARIES "${PKGC_BLAS_LINK_LIBRARIES}")
diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake
index 3d8ce88..46b62d2 100644
--- a/Modules/FindBacktrace.cmake
+++ b/Modules/FindBacktrace.cmake
@@ -5,7 +5,7 @@
FindBacktrace
-------------
-Find provider for `backtrace(3) <http://man7.org/linux/man-pages/man3/backtrace.3.html>`__.
+Find provider for `backtrace(3) <https://man7.org/linux/man-pages/man3/backtrace.3.html>`__.
Checks if OS supports ``backtrace(3)`` via either ``libc`` or custom library.
This module defines the following variables:
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index af5f798..c928157 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -799,7 +799,9 @@ if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
unset(CUDA_VERSION CACHE)
endif()
-if(NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}")
+# If CUDA_TOOLKIT_TARGET_DIR exists, check if it has changed.
+if(DEFINED CUDA_TOOLKIT_TARGET_DIR
+ AND NOT "${CUDA_TOOLKIT_TARGET_DIR}" STREQUAL "${CUDA_TOOLKIT_TARGET_DIR_INTERNAL}")
cuda_unset_include_and_libraries()
endif()
@@ -1148,8 +1150,10 @@ if(NOT CUDA_VERSION VERSION_LESS "9.0")
find_cuda_helper_libs(nppc)
find_cuda_helper_libs(nppial)
find_cuda_helper_libs(nppicc)
+ set(CUDA_npp_LIBRARY ${CUDA_nppc_LIBRARY} ${CUDA_nppial_LIBRARY} ${CUDA_nppicc_LIBRARY})
if(CUDA_VERSION VERSION_LESS "11.0")
find_cuda_helper_libs(nppicom)
+ list(APPEND CUDA_npp_LIBRARY ${CUDA_nppicom_LIBRARY})
endif()
find_cuda_helper_libs(nppidei)
find_cuda_helper_libs(nppif)
@@ -1159,7 +1163,7 @@ if(NOT CUDA_VERSION VERSION_LESS "9.0")
find_cuda_helper_libs(nppisu)
find_cuda_helper_libs(nppitc)
find_cuda_helper_libs(npps)
- set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}")
+ list(APPEND CUDA_npp_LIBRARY ${CUDA_nppidei_LIBRARY} ${CUDA_nppif_LIBRARY} ${CUDA_nppig_LIBRARY} ${CUDA_nppim_LIBRARY} ${CUDA_nppist_LIBRARY} ${CUDA_nppisu_LIBRARY} ${CUDA_nppitc_LIBRARY} ${CUDA_npps_LIBRARY})
elseif(CUDA_VERSION VERSION_GREATER "5.0")
# In CUDA 5.5 NPP was split into 3 separate libraries.
find_cuda_helper_libs(nppc)
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index a35b3f8..5fad337 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -135,10 +135,10 @@ function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
"}\n")
if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
- try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
+ try_run(run_result compile_result SOURCES ${file}
RUN_OUTPUT_VARIABLE compute_capabilities)
else()
- try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
+ try_run(run_result compile_result SOURCES ${file}
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS}"
LINK_LIBRARIES ${CUDA_LIBRARIES}
RUN_OUTPUT_VARIABLE compute_capabilities)
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 5f83ccc..f06f0e8 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -109,6 +109,7 @@ of the following libraries that are part of the CUDAToolkit:
- :ref:`CUDA Runtime Library<cuda_toolkit_rt_lib>`
- :ref:`CUDA Driver Library<cuda_toolkit_driver_lib>`
- :ref:`cuBLAS<cuda_toolkit_cuBLAS>`
+- :ref:`cuFile<cuda_toolkit_cuFile>`
- :ref:`cuFFT<cuda_toolkit_cuFFT>`
- :ref:`cuRAND<cuda_toolkit_cuRAND>`
- :ref:`cuSOLVER<cuda_toolkit_cuSOLVER>`
@@ -119,8 +120,10 @@ of the following libraries that are part of the CUDAToolkit:
- :ref:`nvGRAPH<cuda_toolkit_nvGRAPH>`
- :ref:`nvJPEG<cuda_toolkit_nvJPEG>`
- :ref:`nvidia-ML<cuda_toolkit_nvML>`
+- :ref:`nvPTX Compiler<cuda_toolkit_nvptx>`
- :ref:`nvRTC<cuda_toolkit_nvRTC>`
- :ref:`nvToolsExt<cuda_toolkit_nvToolsExt>`
+- :ref:`nvtx3<cuda_toolkit_nvtx3>`
- :ref:`OpenCL<cuda_toolkit_opencl>`
- :ref:`cuLIBOS<cuda_toolkit_cuLIBOS>`
@@ -163,6 +166,22 @@ Targets Created:
- ``CUDA::cublasLt`` starting in CUDA 10.1
- ``CUDA::cublasLt_static`` starting in CUDA 10.1
+.. _`cuda_toolkit_cuFile`:
+
+cuFile
+""""""
+
+.. versionadded:: 3.25
+
+The NVIDIA GPUDirect Storage `cuFile <https://docs.nvidia.com/cuda/cufile-api/index.html>`_ library.
+
+Targets Created:
+
+- ``CUDA::cuFile`` starting in CUDA 11.4
+- ``CUDA::cuFile_static`` starting in CUDA 11.4
+- ``CUDA::cuFile_rdma`` starting in CUDA 11.4
+- ``CUDA::cuFile_rdma_static`` starting in CUDA 11.4
+
.. _`cuda_toolkit_cuFFT`:
cuFFT
@@ -333,6 +352,22 @@ Targets Created:
- ``CUDA::nvjpeg``
- ``CUDA::nvjpeg_static``
+.. _`cuda_toolkit_nvPTX`:
+
+nvPTX Compiler
+""""""""""""""
+
+.. versionadded:: 3.25
+
+The `nvPTX <https://docs.nvidia.com/cuda/ptx-compiler-api/index.html>`_ (PTX Compilation) library.
+The PTX Compiler APIs are a set of APIs which can be used to compile a PTX program into GPU assembly code.
+Introduced in CUDA 11.1
+This is a static library only.
+
+Targets Created:
+
+- ``CUDA::nvptxcompiler_static`` starting in CUDA 11.1
+
.. _`cuda_toolkit_nvRTC`:
nvRTC
@@ -362,6 +397,8 @@ Targets Created:
nvToolsExt
""""""""""
+.. deprecated:: 3.25 With CUDA 10.0+, use :ref:`nvtx3 <cuda_toolkit_nvtx3>`.
+
The `NVIDIA Tools Extension <https://docs.nvidia.com/gameworks/content/gameworkslibrary/nvtx/nvidia_tools_extension_library_nvtx.htm>`_.
This is a shared library only.
@@ -369,6 +406,20 @@ Targets Created:
- ``CUDA::nvToolsExt``
+.. _`cuda_toolkit_nvtx3`:
+
+nvtx3
+"""""
+
+.. versionadded:: 3.25
+
+The header-only `NVIDIA Tools Extension Library <https://nvidia.github.io/NVTX/doxygen/index.html>`_.
+Introduced in CUDA 10.0.
+
+Targets created:
+
+- ``CUDA::nvtx3``
+
.. _`cuda_toolkit_opencl`:
OpenCL
@@ -942,6 +993,14 @@ if(CUDAToolkit_FOUND)
_CUDAToolkit_find_and_add_import_lib(cublas_static DEPS culibos)
endif()
+ if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.4)
+ _CUDAToolkit_find_and_add_import_lib(cuFile DEPS culibos)
+ _CUDAToolkit_find_and_add_import_lib(cuFile_static DEPS culibos)
+
+ _CUDAToolkit_find_and_add_import_lib(cuFile_rdma DEPS cuFile culibos)
+ _CUDAToolkit_find_and_add_import_lib(cuFile_rdma_static DEPS cuFile_static culibos)
+ endif()
+
# cuFFTW depends on cuFFT
_CUDAToolkit_find_and_add_import_lib(cufftw DEPS cufft)
_CUDAToolkit_find_and_add_import_lib(cufftw_static DEPS cufft_static)
@@ -998,6 +1057,14 @@ if(CUDAToolkit_FOUND)
endif()
_CUDAToolkit_find_and_add_import_lib(nvrtc DEPS cuda_driver)
+ if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0)
+ if(NOT TARGET CUDA::nvptxcompiler_static)
+ _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver)
+ if(TARGET CUDA::nvptxcompiler_static)
+ target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads)
+ endif()
+ endif()
+ endif()
_CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml)
@@ -1014,6 +1081,21 @@ if(CUDAToolkit_FOUND)
endif()
_CUDAToolkit_find_and_add_import_lib(nvToolsExt ALT nvToolsExt64)
+ if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.0)
+ # nvToolsExt is deprecated since nvtx3 introduction.
+ # Warn only if the project requires a sufficiently new CMake to make migration possible.
+ if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER_EQUAL 3.25)
+ set_property(TARGET CUDA::nvToolsExt PROPERTY DEPRECATION "nvToolsExt has been superseded by nvtx3 since CUDA 10.0 and CMake 3.25. Use CUDA::nvtx3 and include <nvtx3/nvToolsExt.h> instead.")
+ endif()
+
+ # Header-only variant. Uses dlopen().
+ if(NOT TARGET CUDA::nvtx3)
+ add_library(CUDA::nvtx3 INTERFACE IMPORTED)
+ target_include_directories(CUDA::nvtx3 SYSTEM INTERFACE "${CUDAToolkit_INCLUDE_DIRS}")
+ target_link_libraries(CUDA::nvtx3 INTERFACE ${CMAKE_DL_LIBS})
+ endif()
+ endif()
+
_CUDAToolkit_find_and_add_import_lib(OpenCL)
endif()
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index e37d225..acb87dc 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -72,6 +72,8 @@ if(NOT CURL_NO_CURL_CMAKE)
# can print what we found and return.
if(CURL_FOUND)
find_package_handle_standard_args(CURL HANDLE_COMPONENTS CONFIG_MODE)
+ # The upstream curl package sets CURL_VERSION, not CURL_VERSION_STRING.
+ set(CURL_VERSION_STRING "${CURL_VERSION}")
return()
endif()
endif()
@@ -80,7 +82,6 @@ find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_CURL QUIET libcurl)
if(PC_CURL_FOUND)
- set(CURL_VERSION_STRING ${PC_CURL_VERSION})
pkg_get_variable(CURL_SUPPORTED_PROTOCOLS libcurl supported_protocols)
pkg_get_variable(CURL_SUPPORTED_FEATURES libcurl supported_features)
endif()
@@ -120,7 +121,7 @@ if(NOT CURL_LIBRARY)
select_library_configurations(CURL)
endif()
-if(CURL_INCLUDE_DIR AND NOT CURL_VERSION_STRING)
+if(CURL_INCLUDE_DIR)
foreach(_curl_version_header curlver.h curl.h)
if(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
file(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index 301e70b..5910ad1 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -31,11 +31,11 @@ if (WIN32)
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
)
- find_library(COIN3D_LIBRARY_DEBUG coin2d
+ find_library(COIN3D_LIBRARY_DEBUG NAMES coin2d coin4d
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
)
- find_library(COIN3D_LIBRARY_RELEASE coin2
+ find_library(COIN3D_LIBRARY_RELEASE NAMES coin2 coin4
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
)
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 3fc0e93..04f8b59 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -9,7 +9,7 @@ Find CxxTest unit testing framework.
Find the CxxTest suite and declare a helper macro for creating unit
tests and integrating them with CTest. For more details on CxxTest
-see http://cxxtest.tigris.org
+see https://cxxtest.com
INPUT Variables
diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake
index b2e00df..0154a05 100644
--- a/Modules/FindDCMTK.cmake
+++ b/Modules/FindDCMTK.cmake
@@ -18,15 +18,16 @@ Compatibility
^^^^^^^^^^^^^
This module is able to find a version of DCMTK that does or does not export
-a *DCMTKConfig.cmake* file. It applies a two step process:
+a ``DCMTKConfig.cmake`` file. It applies a two step process:
-* Step 1: Attempt to find DCMTK version providing a *DCMTKConfig.cmake* file.
-* Step 2: If step 1 failed, rely on *FindDCMTK.cmake* to set `DCMTK_*` variables details below.
+* Step 1: Attempt to find DCMTK version providing a ``DCMTKConfig.cmake`` file.
+* Step 2: If step 1 failed, rely on ``FindDCMTK.cmake`` to set ``DCMTK_*``
+ variables details below.
`Recent DCMTK
-<http://git.dcmtk.org/web?p=dcmtk.git;a=commit;h=662ae187c493c6b9a73dd5e3875372cebd0c11fe>`_
-provides a *DCMTKConfig.cmake* :manual:`package configuration file
+<https://git.dcmtk.org/?p=dcmtk.git;a=commit;h=662ae187c493c6b9a73dd5e3875372cebd0c11fe>`_
+provides a ``DCMTKConfig.cmake`` :manual:`package configuration file
<cmake-packages(7)>`. To exclusively use the package configuration file
(recommended when possible), pass the `NO_MODULE` option to
:command:`find_package`. For example, `find_package(DCMTK NO_MODULE)`.
diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake
index c8e5e31..7f726ff 100644
--- a/Modules/FindDevIL.cmake
+++ b/Modules/FindDevIL.cmake
@@ -8,7 +8,7 @@ FindDevIL
This module locates the developer's image library.
-http://openil.sourceforge.net/
+https://openil.sourceforge.net/
IMPORTED Targets
^^^^^^^^^^^^^^^^
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index 4a16e31..ef9801e 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -5,14 +5,14 @@
FindDoxygen
-----------
-Doxygen is a documentation generation tool (see http://www.doxygen.org).
+Doxygen is a documentation generation tool (see https://www.doxygen.nl).
This module looks for Doxygen and some optional tools it supports:
``dot``
- `Graphviz <http://graphviz.org>`_ ``dot`` utility used to render various
+ `Graphviz <https://graphviz.org>`_ ``dot`` utility used to render various
graphs.
``mscgen``
- `Message Chart Generator <http://www.mcternan.me.uk/mscgen/>`_ utility used
+ `Message Chart Generator <https://www.mcternan.me.uk/mscgen/>`_ utility used
by Doxygen's ``\msc`` and ``\mscfile`` commands.
``dia``
`Dia <https://wiki.gnome.org/Apps/Dia>`_ the diagram editor used by Doxygen's
@@ -91,7 +91,7 @@ Functions
base point. Note also that Doxygen's default behavior is to strip the working
directory from relative paths in the generated documentation (see the
``STRIP_FROM_PATH`` `Doxygen config option
- <http://www.doxygen.org/manual/config.html>`_ for details).
+ <https://www.doxygen.nl/manual/config.html>`_ for details).
If provided, the optional ``comment`` will be passed as the ``COMMENT`` for
the :command:`add_custom_target` command used to create the custom target
@@ -117,7 +117,7 @@ Functions
variables before calling ``doxygen_add_docs()``. Any variable with a name of
the form ``DOXYGEN_<tag>`` will have its value substituted for the
corresponding ``<tag>`` configuration option in the ``Doxyfile``. See the
- `Doxygen documentation <http://www.doxygen.org/manual/config.html>`_ for the
+ `Doxygen documentation <https://www.doxygen.nl/manual/config.html>`_ for the
full list of supported configuration options.
Some of Doxygen's defaults are overridden to provide more appropriate
@@ -432,9 +432,44 @@ endif()
# or use something like homebrew.
# ============== End OSX stuff ================
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
#
# Find Doxygen...
#
+function(_Doxygen_get_version doxy_version result_var doxy_path)
+ execute_process(
+ COMMAND "${doxy_path}" --version
+ OUTPUT_VARIABLE full_doxygen_version
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE version_result
+ )
+
+ # Ignore any commit hashes, etc.
+ string(REGEX MATCH [[^[0-9]+\.[0-9]+\.[0-9]+]] sem_doxygen_version "${full_doxygen_version}")
+
+ set(${result_var} ${version_result} PARENT_SCOPE)
+ set(${doxy_version} ${sem_doxygen_version} PARENT_SCOPE)
+endfunction()
+
+function(_Doxygen_version_validator version_match doxy_path)
+ if(NOT DEFINED Doxygen_FIND_VERSION)
+ set(${is_valid_version} TRUE PARENT_SCOPE)
+ else()
+ _Doxygen_get_version(candidate_version version_result "${doxy_path}")
+
+ if(version_result)
+ message(DEBUG "Unable to determine candidate doxygen version at ${doxy_path}: ${version_result}")
+ endif()
+
+ find_package_check_version("${candidate_version}" valid_doxy_version
+ HANDLE_VERSION_RANGE
+ )
+
+ set(${version_match} "${valid_doxy_version}" PARENT_SCOPE)
+ endif()
+endfunction()
+
macro(_Doxygen_find_doxygen)
find_program(
DOXYGEN_EXECUTABLE
@@ -445,17 +480,14 @@ macro(_Doxygen_find_doxygen)
/Applications/Doxygen.app/Contents/MacOS
/Applications/Utilities/Doxygen.app/Contents/Resources
/Applications/Utilities/Doxygen.app/Contents/MacOS
- DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
+ DOC "Doxygen documentation generation tool (https://www.doxygen.nl)"
+ VALIDATOR _Doxygen_version_validator
)
mark_as_advanced(DOXYGEN_EXECUTABLE)
if(DOXYGEN_EXECUTABLE)
- execute_process(
- COMMAND "${DOXYGEN_EXECUTABLE}" --version
- OUTPUT_VARIABLE DOXYGEN_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
- RESULT_VARIABLE _Doxygen_version_result
- )
+ _Doxygen_get_version(DOXYGEN_VERSION _Doxygen_version_result "${DOXYGEN_EXECUTABLE}")
+
if(_Doxygen_version_result)
message(WARNING "Unable to determine doxygen version: ${_Doxygen_version_result}")
endif()
@@ -642,11 +674,11 @@ endforeach()
unset(_comp)
# Verify find results
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(
Doxygen
REQUIRED_VARS DOXYGEN_EXECUTABLE
VERSION_VAR DOXYGEN_VERSION
+ HANDLE_VERSION_RANGE
HANDLE_COMPONENTS
)
@@ -919,7 +951,7 @@ doxygen_add_docs() for target ${targetName}")
if(NOT DEFINED DOXYGEN_HAVE_DOT)
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot
# tool is available from the path. This tool is part of Graphviz (see:
- # http://www.graphviz.org/), a graph visualization toolkit from AT&T
+ # https://www.graphviz.org/), a graph visualization toolkit from AT&T
# and Lucent Bell Labs. The other options in this section have no
# effect if this option is set to NO.
# Doxygen's default value is: NO.
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index 5237e15..e6eac30 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -160,7 +160,7 @@ unset(_gdal_version)
unset(_gdal_versions)
find_library(GDAL_LIBRARY
- NAMES ${_gdal_lib} ${_gdal_libnames} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
+ NAMES ${_gdal_lib} ${_gdal_libnames} gdal gdald gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
HINTS
ENV GDAL_DIR
ENV GDAL_ROOT
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index b9ebe08..bfde40b 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -63,11 +63,36 @@ This module defines the following variables:
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
find_package(GLEW CONFIG QUIET)
if(GLEW_FOUND)
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_CONFIG)
+ get_target_property(GLEW_INCLUDE_DIRS GLEW::GLEW INTERFACE_INCLUDE_DIRECTORIES)
+ set(GLEW_INCLUDE_DIR ${GLEW_INCLUDE_DIRS})
+ get_target_property(_GLEW_DEFS GLEW::GLEW INTERFACE_COMPILE_DEFINITIONS)
+ if("${_GLEW_DEFS}" MATCHES "GLEW_STATIC")
+ get_target_property(GLEW_LIBRARY_DEBUG GLEW::GLEW IMPORTED_LOCATION_DEBUG)
+ get_target_property(GLEW_LIBRARY_RELEASE GLEW::GLEW IMPORTED_LOCATION_RELEASE)
+ else()
+ get_target_property(GLEW_LIBRARY_DEBUG GLEW::GLEW IMPORTED_IMPLIB_DEBUG)
+ get_target_property(GLEW_LIBRARY_RELEASE GLEW::GLEW IMPORTED_IMPLIB_RELEASE)
+ endif()
+ get_target_property(_GLEW_LINK_INTERFACE GLEW::GLEW IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) # same for debug and release
+ list(APPEND GLEW_LIBRARIES ${_GLEW_LINK_INTERFACE})
+ list(APPEND GLEW_LIBRARY ${_GLEW_LINK_INTERFACE})
+ select_library_configurations(GLEW)
+ if("${_GLEW_DEFS}" MATCHES "GLEW_STATIC")
+ set(GLEW_STATIC_LIBRARIES ${GLEW_LIBRARIES})
+ else()
+ set(GLEW_SHARED_LIBRARIES ${GLEW_LIBRARIES})
+ endif()
+ unset(_GLEW_DEFS)
+ unset(_GLEW_LINK_INTERFACE)
+ unset(GLEW_LIBRARY)
+ unset(GLEW_LIBRARY_DEBUG)
+ unset(GLEW_LIBRARY_RELEASE)
return()
endif()
@@ -171,8 +196,6 @@ find_library(GLEW_STATIC_LIBRARY_DEBUG
set(CMAKE_FIND_LIBRARY_SUFFIXES ${__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES})
unset(__GLEW_CURRENT_FIND_LIBRARY_SUFFIXES)
-include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
-
select_library_configurations(GLEW_SHARED)
select_library_configurations(GLEW_STATIC)
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index 320ddad..09403bc 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -67,83 +67,41 @@ The following variables may also be provided, for backwards compatibility:
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-function(_add_glut_target_simple)
- if(TARGET GLUT::GLUT)
- return()
- endif()
- add_library(GLUT::GLUT INTERFACE IMPORTED)
- if(GLUT_INCLUDE_DIRS)
- target_include_directories(GLUT::GLUT SYSTEM
- INTERFACE "${GLUT_INCLUDE_DIRS}")
- endif()
- if(GLUT_LIBRARIES)
- target_link_libraries(GLUT::GLUT INTERFACE ${GLUT_LIBRARIES})
- endif()
- if(GLUT_LIBRARY_DIRS)
- target_link_directories(GLUT::GLUT INTERFACE ${GLUT_LIBRARY_DIRS})
- endif()
- if(GLUT_LDFLAGS)
- target_link_options(GLUT::GLUT INTERFACE ${GLUT_LDFLAGS})
- endif()
- if(GLUT_CFLAGS)
- separate_arguments(GLUT_CFLAGS_SPLIT UNIX_COMMAND "${GLUT_CFLAGS}")
- target_compile_options(GLUT::GLUT INTERFACE ${GLUT_CFLAGS_SPLIT})
- endif()
-
- set_property(TARGET GLUT::GLUT APPEND PROPERTY
- IMPORTED_LOCATION "${GLUT_glut_LIBRARY}")
-endfunction()
-
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
- # Tell pkg-config not to strip any -I flags to make sure GLUT_INCLUDE_DIRS
- # will be defined.
- if(DEFINED ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS})
- set(_pkgconfig_allow_system_cflags_old "$ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS}")
- else()
- unset(_pkgconfig_allow_system_cflags_old)
- endif()
- set(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} 1)
- pkg_check_modules(GLUT QUIET glut)
- if(DEFINED _pkgconfig_allow_system_cflags_old)
- set(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS} "${_pkgconfig_allow_system_cflags_old}")
- unset(_pkgconfig_allow_system_cflags_old)
- else()
- unset(ENV{PKG_CONFIG_ALLOW_SYSTEM_CFLAGS})
- endif()
- if(NOT GLUT_FOUND)
- pkg_check_modules(GLUT QUIET freeglut)
- endif()
- if(GLUT_FOUND)
- # GLUT_INCLUDE_DIRS is now the official result variable, but
- # older versions of CMake only provided GLUT_INCLUDE_DIR.
- set(GLUT_INCLUDE_DIR "${GLUT_INCLUDE_DIRS}")
- _add_glut_target_simple()
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_FOUND)
- return()
+ pkg_check_modules(PC_GLUT QUIET glut)
+ if(NOT PC_GLUT_FOUND)
+ pkg_check_modules(PC_GLUT QUIET freeglut)
endif()
endif()
if(WIN32)
find_path( GLUT_INCLUDE_DIR NAMES GL/glut.h
- PATHS ${GLUT_ROOT_PATH}/include )
+ PATHS ${GLUT_ROOT_PATH}/include
+ HINTS ${PC_GLUT_INCLUDE_DIRS})
mark_as_advanced(GLUT_INCLUDE_DIR)
find_library( GLUT_glut_LIBRARY_RELEASE NAMES freeglut glut glut32
PATHS
${OPENGL_LIBRARY_DIR}
${GLUT_ROOT_PATH}/Release
+ HINTS
+ ${PC_GLUT_LIBRARY_DIRS}
)
+# N.B. As the pkg-config cannot distinguish between release and debug libraries,
+# assume that their hint was the both Debug and Release library.
find_library( GLUT_glut_LIBRARY_DEBUG NAMES freeglutd
PATHS
${OPENGL_LIBRARY_DIR}
${GLUT_ROOT_PATH}/Debug
+ HINTS
+ ${PC_GLUT_LIBRARY_DIRS}
)
mark_as_advanced(GLUT_glut_LIBRARY_RELEASE GLUT_glut_LIBRARY_DEBUG)
select_library_configurations(GLUT_glut)
elseif(APPLE)
- find_path(GLUT_INCLUDE_DIR glut.h ${OPENGL_LIBRARY_DIR})
+ find_path(GLUT_INCLUDE_DIR glut.h PATHS ${OPENGL_LIBRARY_DIR} HINTS ${PC_GLUT_INCLUDE_DIRS})
mark_as_advanced(GLUT_INCLUDE_DIR)
- find_library(GLUT_glut_LIBRARY GLUT DOC "GLUT library for OSX")
+ find_library(GLUT_glut_LIBRARY GLUT HINTS ${PC_GLUT_LIBRARY_DIRS} DOC "GLUT library for OSX")
find_library(GLUT_cocoa_LIBRARY Cocoa DOC "Cocoa framework for OSX")
mark_as_advanced(GLUT_glut_LIBRARY GLUT_cocoa_LIBRARY)
@@ -192,18 +150,24 @@ else()
endif ()
find_path( GLUT_INCLUDE_DIR GL/glut.h
+ PATHS
/usr/include/GL
/usr/openwin/share/include
/usr/openwin/include
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglut
${_GLUT_INC_DIR}
+ HINTS
+ ${PC_GLUT_INCLUDE_DIRS}
)
mark_as_advanced(GLUT_INCLUDE_DIR)
find_library( GLUT_glut_LIBRARY glut
+ PATHS
/usr/openwin/lib
${_GLUT_glut_LIB_DIR}
+ HINTS
+ ${PC_GLUT_LIBRARY_DIRS}
)
mark_as_advanced(GLUT_glut_LIBRARY)
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 00bfc29..4634876 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -313,6 +313,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
/usr/openwin/lib
/sw/lib
/opt/local/lib
+ /opt/homebrew/lib
/usr/pkg/lib
/usr/pkg/include/glib
$ENV{GTKMM_BASEPATH}/include
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 40ed9a9..d662a7d 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -238,7 +238,7 @@ function(_HDF5_test_regular_compiler_C success version is_parallel)
" fid = H5Fcreate(\"foo.h5\",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);\n"
" return 0;\n"
"}")
- try_compile(${success} ${scratch_directory} ${test_file}
+ try_compile(${success} SOURCES ${test_file}
COPY_FILE ${scratch_directory}/compiler_has_h5_c
)
endif()
@@ -286,7 +286,7 @@ function(_HDF5_test_regular_compiler_CXX success version is_parallel)
" H5File file(\"foo.h5\", H5F_ACC_TRUNC);\n"
" return 0;\n"
"}")
- try_compile(${success} ${scratch_directory} ${test_file}
+ try_compile(${success} SOURCES ${test_file}
COPY_FILE ${scratch_directory}/compiler_has_h5_cxx
)
endif()
@@ -323,7 +323,7 @@ function(_HDF5_test_regular_compiler_Fortran success is_parallel)
" call h5open_f(error)\n"
" call h5close_f(error)\n"
"end\n")
- try_compile(${success} ${scratch_directory} ${test_file})
+ try_compile(${success} SOURCES ${test_file})
if(${success})
execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -showconfig
OUTPUT_VARIABLE config_output
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index 91dcba5..b4f4d71 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -254,13 +254,6 @@ function(_ICU_FIND)
set("${component_found}" ON)
set("${component_found_compat}" ON)
list(APPEND ICU_LIBRARY "${${component_cache}}")
- endif()
- mark_as_advanced("${component_found}")
- mark_as_advanced("${component_found_compat}")
- set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
- set("${component_found}" "${${component_found}}" PARENT_SCOPE)
- set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
- if(component_found OR component_found_compat)
if (ICU_FIND_REQUIRED_${component})
list(APPEND ICU_LIBS_FOUND "${component} (required): ${${component_cache}}")
else()
@@ -274,6 +267,11 @@ function(_ICU_FIND)
list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
endif()
endif()
+ mark_as_advanced("${component_found}")
+ mark_as_advanced("${component_found_compat}")
+ set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
+ set("${component_found}" "${${component_found}}" PARENT_SCOPE)
+ set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
endforeach()
set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index b08b359..1eecb1c 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -12,7 +12,7 @@ This module finds an installed Fortran library that implements the
At least one of the ``C``, ``CXX``, or ``Fortran`` languages must be enabled.
-.. _`LAPACK linear-algebra interface`: http://www.netlib.org/lapack/
+.. _`LAPACK linear-algebra interface`: https://netlib.org/lapack/
Input Variables
^^^^^^^^^^^^^^^
@@ -35,6 +35,13 @@ The following variables may be set to influence this module's behavior:
if set ``pkg-config`` will be used to search for a LAPACK library first
and if one is found that is preferred
+``BLA_PKGCONFIG_LAPACK``
+ .. versionadded:: 3.25
+
+ If set, the ``pkg-config`` method will look for this module name instead of
+ just ``lapack``.
+
+
``BLA_SIZEOF_INTEGER``
.. versionadded:: 3.22
@@ -278,8 +285,11 @@ endif()
# Search with pkg-config if specified
if(BLA_PREFER_PKGCONFIG)
+ if(NOT BLA_PKGCONFIG_LAPACK)
+ set(BLA_PKGCONFIG_LAPACK "lapack")
+ endif()
find_package(PkgConfig QUIET)
- pkg_check_modules(PKGC_LAPACK QUIET lapack)
+ pkg_check_modules(PKGC_LAPACK QUIET ${BLA_PKGCONFIG_LAPACK})
if(PKGC_LAPACK_FOUND)
set(LAPACK_FOUND TRUE)
set(LAPACK_LIBRARIES "${PKGC_LAPACK_LINK_LIBRARIES}")
diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake
index a70a418..eaace4f 100644
--- a/Modules/FindLTTngUST.cmake
+++ b/Modules/FindLTTngUST.cmake
@@ -8,7 +8,7 @@ FindLTTngUST
.. versionadded:: 3.6
Find
-`Linux Trace Toolkit Next Generation (LTTng-UST) <http://lttng.org/>`__ library.
+`Linux Trace Toolkit Next Generation (LTTng-UST) <https://lttng.org/>`__ library.
Imported target
^^^^^^^^^^^^^^^
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
index 08078a2..9d3ac13 100644
--- a/Modules/FindLibArchive.cmake
+++ b/Modules/FindLibArchive.cmake
@@ -26,6 +26,9 @@ The module defines the following ``IMPORTED`` targets:
.. versionadded:: 3.6
Support for new libarchive 3.2 version string format.
+.. versionadded:: 3.17
+ Provides an imported target.
+
#]=======================================================================]
find_path(LibArchive_INCLUDE_DIR
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index b8ca71b..2d5de89 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -29,23 +29,19 @@ endif()
if(MFC_ATTEMPT_TRY_COMPILE)
if(NOT DEFINED MFC_HAVE_MFC)
set(CHECK_INCLUDE_FILE_VAR "afxwin.h")
- configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
+ file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in _CIF_SOURCE_CONTENT)
+ string(CONFIGURE "${_CIF_SOURCE_CONTENT}" _CIF_SOURCE_CONTENT)
message(CHECK_START "Looking for MFC")
# Try both shared and static as the root project may have set the /MT flag
try_compile(MFC_HAVE_MFC
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
+ SOURCE_FROM_VAR CheckIncludeFile.cxx _CIF_SOURCE_CONTENT
CMAKE_FLAGS
-DCMAKE_MFC_FLAG:STRING=2
-DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL
OUTPUT_VARIABLE OUTPUT)
if(NOT MFC_HAVE_MFC)
- configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
try_compile(MFC_HAVE_MFC
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
+ SOURCE_FROM_VAR CheckIncludeFile.cxx _CIF_SOURCE_CONTENT
CMAKE_FLAGS
-DCMAKE_MFC_FLAG:STRING=1
OUTPUT_VARIABLE OUTPUT)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index bca0c10..e15be91 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -391,11 +391,11 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE)
# library that has invalid or missing version information there would be warning
# messages emitted by ld.so in the compiler output. In either case, we'll treat
# the output as invalid.
- if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found")
+ if(WRAPPER_OUTPUT MATCHES "undefined reference|unrecognized|need to set|no version information available|command not found")
set(WRAPPER_RETURN 255)
endif()
# Ensure that no error output might be passed upwards.
- if(NOT WRAPPER_RETURN EQUAL 0)
+ if(NOT WRAPPER_RETURN EQUAL "0")
unset(WRAPPER_OUTPUT)
else()
# Strip leading whitespace
@@ -441,13 +441,13 @@ function (_MPI_interrogate_compiler LANG)
if(MSVC)
get_filename_component(_MPI_UNDERLAYING_COMPILER "${_MPI_UNDERLAYING_COMPILER}" NAME)
endif()
- if("${LANG}" STREQUAL "C")
+ if(LANG STREQUAL "C")
_MPI_env_set_ifnot(I_MPI_CC _MPI_UNDERLAYING_COMPILER)
_MPI_env_set_ifnot(MPICH_CC _MPI_UNDERLAYING_COMPILER)
- elseif("${LANG}" STREQUAL "CXX")
+ elseif(LANG STREQUAL "CXX")
_MPI_env_set_ifnot(I_MPI_CXX _MPI_UNDERLAYING_COMPILER)
_MPI_env_set_ifnot(MPICH_CXX _MPI_UNDERLAYING_COMPILER)
- elseif("${LANG}" STREQUAL "Fortran")
+ elseif(LANG STREQUAL "Fortran")
_MPI_env_set_ifnot(I_MPI_FC _MPI_UNDERLAYING_COMPILER)
_MPI_env_set_ifnot(MPICH_FC _MPI_UNDERLAYING_COMPILER)
_MPI_env_set_ifnot(I_MPI_F77 _MPI_UNDERLAYING_COMPILER)
@@ -470,10 +470,10 @@ function (_MPI_interrogate_compiler LANG)
# or a newer version of LAM/MPI, and implies that -showme:link will also work.
# Open MPI also supports -show, but separates linker and compiler information
_MPI_check_compiler(${LANG} "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN)
- if (MPI_COMPILER_RETURN EQUAL 0)
+ if (MPI_COMPILER_RETURN EQUAL "0")
_MPI_check_compiler(${LANG} "-showme:link" MPI_LINK_CMDLINE MPI_COMPILER_RETURN)
- if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ if (NOT MPI_COMPILER_RETURN EQUAL "0")
unset(MPI_COMPILE_CMDLINE)
endif()
endif()
@@ -482,13 +482,13 @@ function (_MPI_interrogate_compiler LANG)
# For modern versions, both do the same as -show. However, for old versions, they do differ
# when called for mpicxx and mpif90 and it's necessary to use them over -show in order to find the
# removed MPI C++ bindings.
- if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ if (NOT MPI_COMPILER_RETURN EQUAL "0")
_MPI_check_compiler(${LANG} "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN)
- if (MPI_COMPILER_RETURN EQUAL 0)
+ if (MPI_COMPILER_RETURN EQUAL "0")
_MPI_check_compiler(${LANG} "-link-info" MPI_LINK_CMDLINE MPI_COMPILER_RETURN)
- if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ if (NOT MPI_COMPILER_RETURN EQUAL "0")
unset(MPI_COMPILE_CMDLINE)
endif()
endif()
@@ -496,18 +496,18 @@ function (_MPI_interrogate_compiler LANG)
# Cray compiler wrappers come usually without a separate mpicc/c++/ftn, but offer
# --cray-print-opts=...
- if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ if (NOT MPI_COMPILER_RETURN EQUAL "0")
_MPI_check_compiler(${LANG} "--cray-print-opts=cflags"
MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN)
- if (MPI_COMPILER_RETURN EQUAL 0)
+ if (MPI_COMPILER_RETURN EQUAL "0")
# Pass --no-as-needed so the mpi library is always linked. Otherwise, the
# Cray compiler wrapper puts an --as-needed flag around the mpi library,
# and it is not linked unless code directly refers to it.
_MPI_check_compiler(${LANG} "--no-as-needed;--cray-print-opts=libs"
MPI_LINK_CMDLINE MPI_COMPILER_RETURN)
- if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ if (NOT MPI_COMPILER_RETURN EQUAL "0")
unset(MPI_COMPILE_CMDLINE)
unset(MPI_LINK_CMDLINE)
endif()
@@ -516,24 +516,24 @@ function (_MPI_interrogate_compiler LANG)
# MPICH, MVAPICH2 and Intel MPI just use "-show". Open MPI also offers this, but the
# -showme commands are more specialized.
- if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ if (NOT MPI_COMPILER_RETURN EQUAL "0")
_MPI_check_compiler(${LANG} "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN)
endif()
# Older versions of LAM/MPI have "-showme". Open MPI also supports this.
# Unknown to MPICH, MVAPICH and Intel MPI.
- if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ if (NOT MPI_COMPILER_RETURN EQUAL "0")
_MPI_check_compiler(${LANG} "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN)
endif()
- if (MPI_COMPILER_RETURN EQUAL 0 AND DEFINED MPI_COMPILE_CMDLINE)
+ if (MPI_COMPILER_RETURN EQUAL "0" AND DEFINED MPI_COMPILE_CMDLINE)
# Intel MPI can be run with -compchk or I_MPI_CHECK_COMPILER set to 1.
# In this case, -show will be prepended with a line to the compiler checker. This is a script that performs
# compatibility checks and returns a non-zero exit code together with an error if something fails.
# It has to be called as "compchk.sh <arch> <compiler>". Here, <arch> is one out of 32 (i686), 64 (ia64) or 32e (x86_64).
# The compiler is identified by filename, and can be either the MPI compiler or the underlying compiler.
# NOTE: It is vital to run this script while the environment variables are set up, otherwise it can check the wrong compiler.
- if("${MPI_COMPILE_CMDLINE}" MATCHES "^([^\" ]+/compchk.sh|\"[^\"]+/compchk.sh\") +([^ ]+)")
+ if(MPI_COMPILE_CMDLINE MATCHES "^([^\" ]+/compchk.sh|\"[^\"]+/compchk.sh\") +([^ ]+)")
# Now CMAKE_MATCH_1 contains the path to the compchk.sh file and CMAKE_MATCH_2 the architecture flag.
unset(COMPILER_CHECKER_OUTPUT)
execute_process(
@@ -542,7 +542,7 @@ function (_MPI_interrogate_compiler LANG)
ERROR_VARIABLE COMPILER_CHECKER_OUTPUT ERROR_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE MPI_COMPILER_RETURN)
# If it returned a non-zero value, the check below will fail and cause the interrogation to be aborted.
- if(NOT MPI_COMPILER_RETURN EQUAL 0)
+ if(NOT MPI_COMPILER_RETURN EQUAL "0")
if(NOT MPI_FIND_QUIETLY)
message(STATUS "Intel MPI compiler check failed: ${COMPILER_CHECKER_OUTPUT}")
endif()
@@ -554,13 +554,13 @@ function (_MPI_interrogate_compiler LANG)
endif()
# Revert changes to the environment made previously
- if("${LANG}" STREQUAL "C")
+ if(LANG STREQUAL "C")
_MPI_env_unset_ifnot(I_MPI_CC)
_MPI_env_unset_ifnot(MPICH_CC)
- elseif("${LANG}" STREQUAL "CXX")
+ elseif(LANG STREQUAL "CXX")
_MPI_env_unset_ifnot(I_MPI_CXX)
_MPI_env_unset_ifnot(MPICH_CXX)
- elseif("${LANG}" STREQUAL "Fortran")
+ elseif(LANG STREQUAL "Fortran")
_MPI_env_unset_ifnot(I_MPI_FC)
_MPI_env_unset_ifnot(MPICH_FC)
_MPI_env_unset_ifnot(I_MPI_F77)
@@ -572,7 +572,7 @@ function (_MPI_interrogate_compiler LANG)
_MPI_env_unset_ifnot(I_MPI_DEBUG_INFO_STRIP)
_MPI_env_unset_ifnot(I_MPI_FORT_BIND)
- if (NOT (MPI_COMPILER_RETURN EQUAL 0) OR NOT (DEFINED MPI_COMPILE_CMDLINE))
+ if (NOT (MPI_COMPILER_RETURN EQUAL "0") OR NOT (DEFINED MPI_COMPILE_CMDLINE))
# Cannot interrogate this compiler, so exit.
set(MPI_${LANG}_WRAPPER_FOUND FALSE PARENT_SCOPE)
return()
@@ -613,13 +613,13 @@ function (_MPI_interrogate_compiler LANG)
if(UNIX)
# At this point, we obtained some output from a compiler wrapper that works.
# We'll now try to parse it into variables with meaning to us.
- if("${LANG}" STREQUAL "Fortran")
+ if(LANG STREQUAL "Fortran")
# If MPICH (and derivates) didn't recognize the Fortran compiler include flag during configuration,
# they'll return a set of three commands, consisting out of a symlink command for mpif.h,
# the actual compiler command and deletion of the created symlink.
# Especially with M(VA)PICH-1, this appears to happen erroneously, and therefore we should translate
# this output into an additional include directory and then drop it from the output.
- if("${MPI_COMPILE_CMDLINE}" MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h")
+ if(MPI_COMPILE_CMDLINE MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h")
get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY)
string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}")
@@ -651,7 +651,7 @@ function (_MPI_interrogate_compiler LANG)
# produce inconsistent results with the regularly flags.
# Similarly, aliasing flags do not belong into our flag array.
# Also strip out `-framework` flags.
- if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f((no-|)(stack-protector|strict-aliasing)|PI[CE]|pi[ce]|ramework)")
+ if(NOT _MPI_COMPILE_OPTION MATCHES "^-f((no-|)(stack-protector|strict-aliasing)|PI[CE]|pi[ce]|ramework)")
list(APPEND MPI_COMPILE_OPTIONS_WORK "${_MPI_COMPILE_OPTION}")
endif()
endforeach()
@@ -673,7 +673,7 @@ function (_MPI_interrogate_compiler LANG)
foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS)
string(REGEX REPLACE "^ ?${_MPI_PREPROCESSOR_FLAG_REGEX}-D *" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}")
string(REPLACE "\"" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}")
- if(NOT "${_MPI_COMPILE_DEFINITION}" MATCHES "^_FORTIFY_SOURCE.*")
+ if(NOT _MPI_COMPILE_DEFINITION MATCHES "^_FORTIFY_SOURCE.*")
list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${_MPI_COMPILE_DEFINITION}")
endif()
endforeach()
@@ -788,7 +788,7 @@ function (_MPI_interrogate_compiler LANG)
# decide how to link it based on file type, not based on a prefix like 'lib'.
set(_MPI_LIB_SUFFIX_REGEX "${CMAKE_STATIC_LIBRARY_SUFFIX}")
if(DEFINED CMAKE_IMPORT_LIBRARY_SUFFIX)
- if(NOT ("${CMAKE_IMPORT_LIBRARY_SUFFIX}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}"))
+ if(NOT (CMAKE_IMPORT_LIBRARY_SUFFIX STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX))
string(APPEND _MPI_LIB_SUFFIX_REGEX "|${CMAKE_IMPORT_LIBRARY_SUFFIX}")
endif()
else()
@@ -804,7 +804,7 @@ function (_MPI_interrogate_compiler LANG)
if(_MPI_LIB_NAME_TEST STREQUAL "")
string(REGEX REPLACE "^ +\"?|\"? +$" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}")
get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY)
- if(NOT "${_MPI_LIB_PATH}" STREQUAL "")
+ if(NOT _MPI_LIB_PATH STREQUAL "")
list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}")
else()
list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}")
@@ -845,7 +845,7 @@ function (_MPI_interrogate_compiler LANG)
foreach(_MPI_LINK_DIRECTORY IN LISTS MPI_LINK_DIRECTORIES_LEFTOVER)
file(TO_NATIVE_PATH "${_MPI_LINK_DIRECTORY}" _MPI_LINK_DIRECTORY_ACTUAL)
string(FIND "${_MPI_LINK_DIRECTORY_ACTUAL}" " " _MPI_LINK_DIRECTORY_CONTAINS_SPACE)
- if(NOT _MPI_LINK_DIRECTORY_CONTAINS_SPACE EQUAL -1)
+ if(NOT _MPI_LINK_DIRECTORY_CONTAINS_SPACE EQUAL "-1")
set(_MPI_LINK_DIRECTORY_ACTUAL "\"${_MPI_LINK_DIRECTORY_ACTUAL}\"")
endif()
if(MPI_LINK_FLAGS_WORK)
@@ -871,7 +871,7 @@ function (_MPI_interrogate_compiler LANG)
# MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to
# link it in that case. -lpthread is covered by the normal library treatment on the other hand.
- if("${MPI_COMPILE_CMDLINE}" MATCHES "-pthread")
+ if(MPI_COMPILE_CMDLINE MATCHES "-pthread")
list(APPEND MPI_COMPILE_OPTIONS_WORK "-pthread")
if(MPI_LINK_FLAGS_WORK)
string(APPEND MPI_LINK_FLAGS_WORK " -pthread")
@@ -918,10 +918,10 @@ function(_MPI_guess_settings LANG)
# The environment variables MSMPI_INC and MSMPILIB32/64 are the only ways of locating the MSMPI_SDK,
# which is installed separately from the runtime. Thus it's possible to have mpiexec but not MPI headers
# or import libraries and vice versa.
- if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MSMPI")
+ if(NOT MPI_GUESS_LIBRARY_NAME OR MPI_GUESS_LIBRARY_NAME STREQUAL "MSMPI")
# We first attempt to locate the msmpi.lib. Should be find it, we'll assume that the MPI present is indeed
# Microsoft MPI.
- if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ if(CMAKE_SIZEOF_VOID_P EQUAL "8")
file(TO_CMAKE_PATH "$ENV{MSMPI_LIB64}" MPI_MSMPI_LIB_PATH)
file(TO_CMAKE_PATH "$ENV{MSMPI_INC}/x64" MPI_MSMPI_INC_PATH_EXTRA)
else()
@@ -975,9 +975,9 @@ function(_MPI_guess_settings LANG)
# Our strategy is now to locate all libraries, but enter msmpifec into the LIB_NAMES array.
# Should this not be adequate it's a straightforward way for a user to change the LIB_NAMES array and
# have his library found. Still, this should not be necessary outside of exceptional cases, as reasoned.
- if ("${LANG}" STREQUAL "Fortran")
+ if (LANG STREQUAL "Fortran")
set(MPI_MSMPI_CALLINGCONVS c)
- if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4)
+ if(CMAKE_SIZEOF_VOID_P EQUAL "4")
list(APPEND MPI_MSMPI_CALLINGCONVS s)
endif()
foreach(mpistrlenpos IN ITEMS e m)
@@ -1025,7 +1025,7 @@ function(_MPI_guess_settings LANG)
# At this point there's not many MPIs that we could still consider.
# OpenMPI 1.6.x and below supported Windows, but these ship compiler wrappers that still work.
# The only other relevant MPI implementation without a wrapper is MPICH2, which had Windows support in 1.4.1p1 and older.
- if(NOT MPI_GUESS_FOUND AND (NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MPICH2"))
+ if(NOT MPI_GUESS_FOUND AND (NOT MPI_GUESS_LIBRARY_NAME OR MPI_GUESS_LIBRARY_NAME STREQUAL "MPICH2"))
set(MPI_MPICH_PREFIX_PATHS
"$ENV{ProgramW6432}/MPICH2/lib"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/../lib"
@@ -1042,7 +1042,7 @@ function(_MPI_guess_settings LANG)
set(MPI_MPICH_LIB_NAMES "mpi")
# If MPI-2 C++ bindings are requested, we need to locate cxx.lib as well.
# Otherwise, MPICH_SKIP_MPICXX will be defined and these bindings aren't needed.
- if("${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX)
+ if(LANG STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX)
find_library(MPI_cxx_LIBRARY
NAMES cxx
HINTS ${MPI_MPICH_PREFIX_PATHS})
@@ -1055,7 +1055,7 @@ function(_MPI_guess_settings LANG)
# fmpich2s.lib would be useful for Compaq Visual Fortran, fmpich2g.lib has to be used with GNU g77 and is also
# provided in the form of an .a archive for MinGW and Cygwin. From our perspective, fmpich2.lib is the only one
# we need to try, and if it doesn't work with the given Fortran compiler we'd find out later on during validation
- elseif("${LANG}" STREQUAL "Fortran")
+ elseif(LANG STREQUAL "Fortran")
find_library(MPI_fmpich2_LIBRARY
NAMES fmpich2
HINTS ${MPI_MPICH_PREFIX_PATHS})
@@ -1103,7 +1103,7 @@ function(_MPI_guess_settings LANG)
endfunction()
function(_MPI_adjust_compile_definitions LANG)
- if("${LANG}" STREQUAL "CXX")
+ if(LANG STREQUAL "CXX")
# To disable the C++ bindings, we need to pass some definitions since the mpi.h header has to deal with both C and C++
# bindings in MPI-2.
if(MPI_CXX_SKIP_MPICXX AND NOT MPI_${LANG}_COMPILE_DEFINITIONS MATCHES "SKIP_MPICXX")
@@ -1119,7 +1119,7 @@ endfunction()
macro(_MPI_assemble_libraries LANG)
set(MPI_${LANG}_LIBRARIES "")
# Only for libraries do we need to check whether the compiler's linking stage is separate.
- if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT)
+ if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER OR NOT MPI_${LANG}_WORKS_IMPLICIT)
foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES)
list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY})
endforeach()
@@ -1131,7 +1131,7 @@ macro(_MPI_assemble_include_dirs LANG)
${MPI_${LANG}_COMPILER_INCLUDE_DIRS}
${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}
)
- if("${LANG}" MATCHES "(C|CXX)")
+ if(LANG MATCHES "^(C|CXX)$")
if(MPI_${LANG}_HEADER_DIR)
list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}")
endif()
@@ -1156,7 +1156,7 @@ macro(_MPI_split_include_dirs LANG)
# We try to find the headers/modules among those paths (and system paths)
# For C/C++, we just need to have a look for mpi.h.
- if("${LANG}" MATCHES "(C|CXX)")
+ if(LANG MATCHES "^(C|CXX)$")
find_path(MPI_${LANG}_HEADER_DIR "mpi.h"
HINTS
${MPI_${LANG}_COMPILER_INCLUDE_DIRS}
@@ -1171,7 +1171,7 @@ macro(_MPI_split_include_dirs LANG)
# any of the Fortran 77/90/2008 APIs for MPI. For example, MSMPI
# only provides Fortran 77 and - if mpi.f90 is built - potentially
# a Fortran 90 module.
- elseif("${LANG}" STREQUAL "Fortran")
+ elseif(LANG STREQUAL "Fortran")
find_path(MPI_${LANG}_F77_HEADER_DIR "mpif.h"
HINTS
${MPI_${LANG}_COMPILER_INCLUDE_DIRS}
@@ -1238,28 +1238,30 @@ function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY SUPPRE
set(SRC_DIR "${CMAKE_ROOT}/Modules/FindMPI")
set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin")
unset(MPI_TEST_COMPILE_DEFINITIONS)
- if("${LANG}" STREQUAL "Fortran")
- if("${MODE}" STREQUAL "F90_MODULE")
+ if(LANG STREQUAL "Fortran")
+ if(MODE STREQUAL "F90_MODULE")
set(MPI_Fortran_INCLUDE_LINE "use mpi\n implicit none")
- elseif("${MODE}" STREQUAL "F08_MODULE")
+ elseif(MODE STREQUAL "F08_MODULE")
set(MPI_Fortran_INCLUDE_LINE "use mpi_f08\n implicit none")
else() # F77 header
set(MPI_Fortran_INCLUDE_LINE "implicit none\n include 'mpif.h'")
endif()
- configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.f90.in" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90" @ONLY)
- set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90")
- elseif("${LANG}" STREQUAL "CXX")
- configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp" COPYONLY)
- set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp")
- if("${MODE}" STREQUAL "TEST_MPICXX")
+ file(READ "${SRC_DIR}/${MPI_TEST_FILE_NAME}.f90.in" MPI_TEST_SOURCE_CONTENT)
+ string(CONFIGURE "${MPI_TEST_SOURCE_CONTENT}" MPI_TEST_SOURCE_CONTENT)
+ set(MPI_TEST_SOURCE_FILE "${MPI_TEST_FILE_NAME}.f90")
+ elseif(LANG STREQUAL "CXX")
+ file(READ "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" MPI_TEST_SOURCE_CONTENT)
+ set(MPI_TEST_SOURCE_FILE "${MPI_TEST_FILE_NAME}.cpp")
+ if(MODE STREQUAL "TEST_MPICXX")
set(MPI_TEST_COMPILE_DEFINITIONS TEST_MPI_MPICXX)
endif()
else() # C
- set(MPI_TEST_SOURCE_FILE "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c")
+ file(READ "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" MPI_TEST_SOURCE_CONTENT)
+ set(MPI_TEST_SOURCE_FILE "${MPI_TEST_FILE_NAME}.c")
endif()
if(RUN_BINARY)
try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}
- "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}"
+ SOURCE_FROM_VAR "${MPI_TEST_SOURCE_FILE}" MPI_TEST_SOURCE_CONTENT
COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS}
LINK_LIBRARIES MPI::MPI_${LANG}
RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}
@@ -1267,7 +1269,7 @@ function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY SUPPRE
set(MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} "${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}" PARENT_SCOPE)
else()
try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}
- "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}"
+ SOURCE_FROM_VAR "${MPI_TEST_SOURCE_FILE}" MPI_TEST_SOURCE_CONTENT
COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS}
LINK_LIBRARIES MPI::MPI_${LANG}
COPY_FILE "${BIN_FILE}"
@@ -1290,7 +1292,7 @@ macro(_MPI_check_lang_works LANG SUPPRESS_ERRORS)
# - *both*, the mpi module and 'mpif.h'
# Since older MPI standards (MPI-1) did not define anything but 'mpif.h', we need to check all three individually.
if( NOT MPI_${LANG}_WORKS )
- if("${LANG}" STREQUAL "Fortran")
+ if(LANG STREQUAL "Fortran")
set(MPI_Fortran_INTEGER_LINE "(kind=MPI_INTEGER_KIND)")
_MPI_try_staged_settings(${LANG} test_mpi F77_HEADER FALSE ${SUPPRESS_ERRORS})
_MPI_try_staged_settings(${LANG} test_mpi F90_MODULE FALSE ${SUPPRESS_ERRORS})
@@ -1339,11 +1341,11 @@ macro(MPI_search_mpi_prefix_folder PREFIX_FOLDER)
endmacro()
set(MPI_HINT_DIRS ${MPI_HOME} $ENV{MPI_HOME} $ENV{I_MPI_ROOT})
-if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
# SUSE Linux Enterprise Server stores its MPI implementations under /usr/lib64/mpi/gcc/<name>
# We enumerate the subfolders and append each as a prefix
MPI_search_mpi_prefix_folder("/usr/lib64/mpi/gcc")
-elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD")
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
# FreeBSD ships mpich under the normal system paths - but available openmpi implementations
# will be found in /usr/local/mpi/<name>
MPI_search_mpi_prefix_folder("/usr/local/mpi")
@@ -1410,7 +1412,7 @@ if(NOT MPI_IGNORE_LEGACY_VARIABLES)
if(MPI_${LANG}_COMPILE_FLAGS)
separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}")
foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS)
- if("${_MPI_FLAG}" MATCHES "^ *-D([^ ]+)")
+ if(_MPI_FLAG MATCHES "^ *-D([^ ]+)")
list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}")
else()
list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}")
@@ -1459,7 +1461,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(_MPI_FIND_${LANG} TRUE)
elseif( LANG IN_LIST MPI_FIND_COMPONENTS)
set(_MPI_FIND_${LANG} TRUE)
- elseif( "${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS )
+ elseif( LANG STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS )
set(_MPI_FIND_${LANG} TRUE)
else()
set(_MPI_FIND_${LANG} FALSE)
@@ -1471,7 +1473,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
endif()
if(_MPI_FIND_${LANG})
- if( "${LANG}" STREQUAL "CXX" AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS )
+ if( LANG STREQUAL "CXX" AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS )
option(MPI_CXX_SKIP_MPICXX "If true, the MPI-2 C++ bindings are disabled using definitions." FALSE)
mark_as_advanced(MPI_CXX_SKIP_MPICXX)
endif()
@@ -1493,7 +1495,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(MPI_${LANG}_TRIED_IMPLICIT TRUE)
endif()
- if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS)
+ if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER OR NOT MPI_${LANG}_WORKS)
set(MPI_${LANG}_WRAPPER_FOUND FALSE)
set(MPI_PINNED_COMPILER FALSE)
@@ -1529,7 +1531,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
DOC "MPI compiler for ${LANG}"
)
- if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+ if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
set(MPI_PINNED_COMPILER TRUE)
# If we haven't made the implicit compiler test yet, perform it now.
@@ -1590,7 +1592,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
if(_MPI_PKG AND PKG_CONFIG_FOUND)
pkg_check_modules("MPI_${LANG}_PKG" "${_MPI_PKG}")
- if("${MPI_${LANG}_PKG_FOUND}")
+ if(MPI_${LANG}_PKG_FOUND)
set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_${LANG}_PKG_CFLAGS} CACHE STRING "MPI ${LANG} compilation options" FORCE)
set(MPI_${LANG}_INCLUDE_PATH ${MPI_${LANG}_PKG_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} include directories" FORCE)
set(MPI_${LANG}_LINK_FLAGS ${MPI_${LANG}_PKG_LDFLAGS} CACHE STRING "MPI ${LANG} linker flags" FORCE)
@@ -1611,10 +1613,10 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
endif()
- if(NOT MPI_SKIP_GUESSING AND NOT "${MPI_${LANG}_PKG_FOUND}")
+ if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_PKG_FOUND)
# For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the
# settings for C. An MPI distribution that is in this situation would be IBM Platform MPI.
- if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND)
+ if(LANG STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND)
set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" )
set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" )
set(MPI_${LANG}_COMPILER_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} compiler wrapper include directories")
@@ -1628,7 +1630,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
endif()
- if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+ if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
_MPI_split_include_dirs(${LANG})
_MPI_assemble_include_dirs(${LANG})
else()
@@ -1665,7 +1667,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
# If we've found MPI, then we'll perform additional analysis: Determine the MPI version, MPI library version, supported
# MPI APIs (i.e. MPI-2 C++ bindings). For Fortran we also need to find specific parameters if we're under MPI-3.
if(MPI_${LANG}_WORKS)
- if("${LANG}" STREQUAL "CXX" AND NOT DEFINED MPI_MPICXX_FOUND)
+ if(LANG STREQUAL "CXX" AND NOT DEFINED MPI_MPICXX_FOUND)
if(NOT MPI_CXX_SKIP_MPICXX AND NOT MPI_CXX_VALIDATE_SKIP_MPICXX)
_MPI_try_staged_settings(${LANG} test_mpi MPICXX FALSE FALSE)
if(MPI_RESULT_${LANG}_test_mpi_MPICXX)
@@ -1689,7 +1691,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
# Fortran parameters, since those depend on the method of consumption.
# For C++, we can always use the C bindings, and should do so, since the C++ bindings do not exist in MPI-3
# whereas the C bindings do, and the C++ bindings never offered any feature advantage over their C counterparts.
- if("${LANG}" STREQUAL "Fortran")
+ if(LANG STREQUAL "Fortran")
if(MPI_${LANG}_HAVE_F08_MODULE)
set(MPI_${LANG}_HIGHEST_METHOD F08_MODULE)
elseif(MPI_${LANG}_HAVE_F90_MODULE)
@@ -1705,7 +1707,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
_MPI_try_staged_settings(${LANG} mpiver ${MPI_${LANG}_HIGHEST_METHOD} FALSE FALSE)
if(MPI_RESULT_${LANG}_mpiver_${MPI_${LANG}_HIGHEST_METHOD})
file(STRINGS ${MPI_BIN_FOLDER}/mpiver_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER")
- if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*")
+ if(_MPI_VERSION_STRING MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*")
set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}")
set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}")
@@ -1724,12 +1726,12 @@ foreach(LANG IN ITEMS C CXX Fortran)
_MPI_try_staged_settings(${LANG} fortranparam_mpi ${mpimethod} TRUE FALSE)
if(MPI_RESULT_${LANG}_fortranparam_mpi_${mpimethod} AND
NOT "${MPI_RUN_RESULT_${LANG}_fortranparam_mpi_${mpimethod}}" STREQUAL "FAILED_TO_RUN")
- if("${MPI_RUN_OUTPUT_${LANG}_fortranparam_mpi_${mpimethod}}" MATCHES
+ if(MPI_RUN_OUTPUT_${LANG}_fortranparam_mpi_${mpimethod} MATCHES
".*INFO:SUBARRAYS\\[ *([TF]) *\\]-ASYNCPROT\\[ *([TF]) *\\].*")
- if("${CMAKE_MATCH_1}" STREQUAL "T")
+ if(CMAKE_MATCH_1 STREQUAL "T")
set(MPI_${LANG}_${mpimethod}_SUBARRAYS TRUE)
endif()
- if("${CMAKE_MATCH_2}" STREQUAL "T")
+ if(CMAKE_MATCH_2 STREQUAL "T")
set(MPI_${LANG}_${mpimethod}_ASYNCPROT TRUE)
endif()
endif()
@@ -1744,7 +1746,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
# By the MPI-2 standard, MPI_VERSION and MPI_SUBVERSION are valid for both C and C++ bindings.
if(NOT DEFINED MPI_${LANG}_VERSION)
file(STRINGS ${MPI_BIN_FOLDER}/test_mpi_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER")
- if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*")
+ if(_MPI_VERSION_STRING MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*")
set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}")
set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}")
@@ -1764,7 +1766,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
if(MPI_DETERMINE_LIBRARY_VERSION AND NOT MPI_${LANG}_LIBRARY_VERSION_STRING)
_MPI_try_staged_settings(${LANG} libver_mpi ${MPI_${LANG}_HIGHEST_METHOD} TRUE FALSE)
if(MPI_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD} AND
- "${MPI_RUN_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" EQUAL "0")
+ MPI_RUN_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD} EQUAL "0")
string(STRIP "${MPI_RUN_OUTPUT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}"
MPI_${LANG}_LIBRARY_VERSION_STRING)
else()
@@ -1778,12 +1780,12 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT})
unset(MPI_${LANG}_REQUIRED_VARS)
- if (NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+ if (NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES)
list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY")
endforeach()
list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_LIB_NAMES")
- if("${LANG}" STREQUAL "Fortran")
+ if(LANG STREQUAL "Fortran")
# For Fortran we only need one of the module or header directories to have *some* support for MPI.
if(NOT MPI_${LANG}_MODULE_DIR)
list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_F77_HEADER_DIR")
@@ -1883,7 +1885,7 @@ else()
endif()
list(LENGTH MPI_LIBRARIES MPI_NUMLIBS)
-if (MPI_NUMLIBS GREATER 1)
+if (MPI_NUMLIBS GREATER "1")
set(MPI_EXTRA_LIBRARY_WORK "${MPI_LIBRARIES}")
list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0)
set(MPI_EXTRA_LIBRARY "${MPI_EXTRA_LIBRARY_WORK}")
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 470ebe0..07a9adf 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -85,10 +85,18 @@ Module Input Variables
Users or projects may set the following variables to configure the module
behavior:
+:variable:`Matlab_ROOT <<PackageName>_ROOT>`
+ .. versionadded:: 3.25
+
+ Default value for :variable:`Matlab_ROOT_DIR`, the root of the Matlab
+ installation.
+
:variable:`Matlab_ROOT_DIR`
- the root of the Matlab installation.
+ The root of the Matlab installation.
+
:variable:`MATLAB_FIND_DEBUG`
outputs debug information
+
:variable:`MATLAB_ADDITIONAL_VERSIONS`
additional versions of Matlab for the automatic retrieval of the installed
versions.
@@ -844,6 +852,15 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve
endif()
endif()
+ if(NOT EXISTS "${_matlab_temporary_folder}/matlabVersionLog.cmaketmp")
+ # last resort check as some HPC with "module load matlab" not enacted fail to catch in earlier checks
+ # and error CMake configure even if find_package(Matlab) is not REQUIRED
+ if(MATLAB_FIND_DEBUG)
+ message(WARNING "[MATLAB] Unable to determine the version of Matlab. The version log file does not exist.")
+ endif()
+ return()
+ endif()
+
# if successful, read back the log
file(READ "${_matlab_temporary_folder}/matlabVersionLog.cmaketmp" _matlab_version_from_cmd)
file(REMOVE "${_matlab_temporary_folder}/matlabVersionLog.cmaketmp")
@@ -1573,6 +1590,13 @@ endfunction()
# this variable will get all Matlab installations found in the current system.
set(_matlab_possible_roots)
+if(NOT DEFINED Matlab_ROOT AND DEFINED ENV{Matlab_ROOT})
+ set(Matlab_ROOT $ENV{Matlab_ROOT})
+endif()
+if(DEFINED Matlab_ROOT)
+ set(Matlab_ROOT_DIR ${Matlab_ROOT})
+endif()
+
if(Matlab_ROOT_DIR)
# if the user specifies a possible root, we keep this one
diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake
index cf58f3b..00e42b8 100644
--- a/Modules/FindOpenACC.cmake
+++ b/Modules/FindOpenACC.cmake
@@ -27,6 +27,13 @@ The module provides :prop_tgt:`IMPORTED` targets:
Variables
^^^^^^^^^
+The module defines the following variables:
+
+``OpenACC_FOUND``
+ .. versionadded:: 3.25
+
+ Variable indicating that OpenACC flags for at least one languages have been found.
+
This module will set the following variables per language in your
project, where ``<lang>`` is one of C, CXX, or Fortran:
@@ -121,21 +128,18 @@ set(OpenACC_Fortran_CHECK_VERSION_SOURCE
)
-function(_OPENACC_WRITE_SOURCE_FILE LANG SRC_FILE_CONTENT_VAR SRC_FILE_NAME SRC_FILE_FULLPATH)
- set(WORK_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindOpenACC)
+macro(_OPENACC_PREPARE_SOURCE LANG CONTENT_ID NAME_PREFIX FULLNAME_VAR CONTENT_VAR)
if("${LANG}" STREQUAL "C")
- set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.c")
- file(WRITE "${SRC_FILE}" "${OpenACC_C_CXX_${SRC_FILE_CONTENT_VAR}}")
+ set(${FULLNAME_VAR} "${NAME_PREFIX}.c")
+ set(${CONTENT_VAR} "${OpenACC_C_CXX_${CONTENT_ID}}")
elseif("${LANG}" STREQUAL "CXX")
- set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.cpp")
- file(WRITE "${SRC_FILE}" "${OpenACC_C_CXX_${SRC_FILE_CONTENT_VAR}}")
+ set(${FULLNAME_VAR} "${NAME_PREFIX}.cpp")
+ set(${CONTENT_VAR} "${OpenACC_C_CXX_${CONTENT_ID}}")
elseif("${LANG}" STREQUAL "Fortran")
- set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.F90")
- file(WRITE "${SRC_FILE}_in" "${OpenACC_Fortran_${SRC_FILE_CONTENT_VAR}}")
- configure_file("${SRC_FILE}_in" "${SRC_FILE}" @ONLY)
+ set(${FULLNAME_VAR} "${NAME_PREFIX}.F90")
+ set(${CONTENT_VAR} "${OpenACC_Fortran_${CONTENT_ID}}")
endif()
- set(${SRC_FILE_FULLPATH} "${SRC_FILE}" PARENT_SCOPE)
-endfunction()
+endmacro()
function(_OPENACC_GET_FLAGS_CANDIDATE LANG FLAG_VAR)
@@ -177,10 +181,12 @@ endfunction()
function(_OPENACC_GET_FLAGS LANG FLAG_VAR)
set(FLAG_CANDIDATES "")
_OPENACC_GET_FLAGS_CANDIDATE("${LANG}" FLAG_CANDIDATES)
- _OPENACC_WRITE_SOURCE_FILE("${LANG}" "TEST_SOURCE" OpenACCTryFlag _OPENACC_TEST_SRC)
+ _OPENACC_PREPARE_SOURCE("${LANG}" TEST_SOURCE OpenACCTryFlag
+ _OPENACC_TEST_SRC_NAME _OPENACC_TEST_SRC_CONTENT)
foreach(FLAG IN LISTS FLAG_CANDIDATES)
- try_compile(OpenACC_FLAG_TEST_RESULT ${CMAKE_BINARY_DIR} ${_OPENACC_TEST_SRC}
+ try_compile(OpenACC_FLAG_TEST_RESULT
+ SOURCE_FROM_VAR "${_OPENACC_TEST_SRC_NAME}" _OPENACC_TEST_SRC_CONTENT
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${FLAG}"
OUTPUT_VARIABLE OpenACC_TRY_COMPILE_OUTPUT
)
@@ -205,13 +211,15 @@ endfunction()
function(_OPENACC_GET_SPEC_DATE LANG SPEC_DATE)
- _OPENACC_WRITE_SOURCE_FILE("${LANG}" "CHECK_VERSION_SOURCE" OpenACCCheckVersion _OPENACC_TEST_SRC)
+ _OPENACC_PREPARE_SOURCE(${LANG} CHECK_VERSION_SOURCE OpenACCCheckVersion
+ _OPENACC_TEST_SRC_NAME _OPENACC_TEST_SRC_CONTENT)
set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindOpenACC/accver_${LANG}.bin")
- try_compile(OpenACC_SPECTEST_${LANG} "${CMAKE_BINARY_DIR}" "${_OPENACC_TEST_SRC}"
- CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OpenACC_${LANG}_FLAGS}"
- COPY_FILE ${BIN_FILE}
- OUTPUT_VARIABLE OUTPUT)
+ try_compile(OpenACC_SPECTEST_${LANG}
+ SOURCE_FROM_VAR "${_OPENACC_TEST_SRC_NAME}" _OPENACC_TEST_SRC_CONTENT
+ CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OpenACC_${LANG}_FLAGS}"
+ COPY_FILE "${BIN_FILE}"
+ OUTPUT_VARIABLE OUTPUT)
if(${OpenACC_SPECTEST_${LANG}})
file(STRINGS ${BIN_FILE} specstr LIMIT_COUNT 1 REGEX "INFO:OpenACC-date")
@@ -270,6 +278,9 @@ foreach (LANG IN ITEMS C CXX Fortran)
REQUIRED_VARS OpenACC_${LANG}_FLAGS
VERSION_VAR OpenACC_${LANG}_VERSION
)
+ if(OpenACC_${LANG}_FOUND)
+ set(OpenACC_FOUND TRUE)
+ endif()
endif()
endforeach()
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index b5b92c5..53aafdc 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -29,6 +29,16 @@ OpenAL is searched in the following order:
5. Manually compiled framework: ``/Library/Frameworks``.
6. Add-on package: ``/opt``.
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.25
+
+This module defines the :prop_tgt:`IMPORTED` target:
+
+``OpenAL::OpenAL``
+ The OpenAL library, if found.
+
Result Variables
^^^^^^^^^^^^^^^^
@@ -94,3 +104,19 @@ find_package_handle_standard_args(
)
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
+
+if(OPENAL_INCLUDE_DIR AND OPENAL_LIBRARY)
+ if(NOT TARGET OpenAL::OpenAL)
+ if(EXISTS "${OPENAL_LIBRARY}")
+ add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
+ set_target_properties(OpenAL::OpenAL PROPERTIES
+ IMPORTED_LOCATION "${OPENAL_LIBRARY}")
+ else()
+ add_library(OpenAL::OpenAL INTERFACE IMPORTED)
+ set_target_properties(OpenAL::OpenAL PROPERTIES
+ IMPORTED_LIBNAME "${OPENAL_LIBRARY}")
+ endif()
+ set_target_properties(OpenAL::OpenAL PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${OPENAL_INCLUDE_DIR}")
+ endif()
+endif()
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index d6d1c00..a9a1b2a 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -377,7 +377,7 @@ else()
(NOT OPENGL_USE_EGL AND
NOT OPENGL_glx_LIBRARY AND
OPENGL_gl_LIBRARY))
- list(APPEND _OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
+ list(PREPEND _OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
endif()
# We always need the 'gl.h' include dir.
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index ecfb7f9..9e24925 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -178,27 +178,25 @@ set(OpenMP_Fortran_TEST_SOURCE
"
)
-function(_OPENMP_WRITE_SOURCE_FILE LANG SRC_FILE_CONTENT_VAR SRC_FILE_NAME SRC_FILE_FULLPATH)
- set(WORK_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindOpenMP)
+macro(_OPENMP_PREPARE_SOURCE LANG CONTENT_ID NAME_PREFIX FULLNAME_VAR CONTENT_VAR)
if("${LANG}" STREQUAL "C")
- set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.c")
- file(WRITE "${SRC_FILE}" "${OpenMP_C_CXX_${SRC_FILE_CONTENT_VAR}}")
+ set(${FULLNAME_VAR} "${NAME_PREFIX}.c")
+ set(${CONTENT_VAR} "${OpenMP_C_CXX_${CONTENT_ID}}")
elseif("${LANG}" STREQUAL "CXX")
- set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.cpp")
- file(WRITE "${SRC_FILE}" "${OpenMP_C_CXX_${SRC_FILE_CONTENT_VAR}}")
+ set(${FULLNAME_VAR} "${NAME_PREFIX}.cpp")
+ set(${CONTENT_VAR} "${OpenMP_C_CXX_${CONTENT_ID}}")
elseif("${LANG}" STREQUAL "Fortran")
- set(SRC_FILE "${WORK_DIR}/${SRC_FILE_NAME}.f90")
- file(WRITE "${SRC_FILE}_in" "${OpenMP_Fortran_${SRC_FILE_CONTENT_VAR}}")
- configure_file("${SRC_FILE}_in" "${SRC_FILE}" @ONLY)
+ set(${FULLNAME_VAR} "${NAME_PREFIX}.F90")
+ string(CONFIGURE "${OpenMP_Fortran_${CONTENT_ID}}" ${CONTENT_VAR} @ONLY)
endif()
- set(${SRC_FILE_FULLPATH} "${SRC_FILE}" PARENT_SCOPE)
-endfunction()
+endmacro()
include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseImplicitLinkInfo.cmake)
function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
_OPENMP_FLAG_CANDIDATES("${LANG}")
- _OPENMP_WRITE_SOURCE_FILE("${LANG}" "TEST_SOURCE" OpenMPTryFlag _OPENMP_TEST_SRC)
+ _OPENMP_PREPARE_SOURCE("${LANG}" TEST_SOURCE OpenMPTryFlag
+ _OPENMP_TEST_SRC_NAME _OPENMP_TEST_SRC_CONTENT)
unset(OpenMP_VERBOSE_COMPILE_OPTIONS)
separate_arguments(OpenMP_VERBOSE_OPTIONS NATIVE_COMMAND "${CMAKE_${LANG}_VERBOSE_FLAG}")
@@ -214,7 +212,8 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
string(APPEND OPENMP_FLAGS_TEST " ${OpenMP_VERBOSE_COMPILE_OPTIONS}")
endif()
string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}")
- try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC}
+ try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}
+ SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}"
LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG}
OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT
@@ -238,11 +237,29 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
OpenMP_${LANG}_IMPLICIT_FWK_DIRS
OpenMP_${LANG}_LOG_VAR
"${CMAKE_${LANG}_IMPLICIT_OBJECT_REGEX}"
+ LANGUAGE ${LANG}
)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed ${LANG} OpenMP implicit link information from above output:\n${OpenMP_${LANG}_LOG_VAR}\n\n")
+ # For LCC we should additionally alanyze -print-search-dirs output
+ # to check for additional implicit_dirs.
+ # Note: This won't work if CMP0129 policy is set to OLD!
+ if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "LCC")
+ execute_process(
+ COMMAND ${CMAKE_${LANG}_COMPILER} -print-search-dirs
+ OUTPUT_VARIABLE output_lines
+ COMMAND_ERROR_IS_FATAL ANY
+ ERROR_QUIET)
+ if("${output_lines}" MATCHES ".*\nlibraries:[ \t]+(.*:)\n.*")
+ string(REPLACE ":" ";" implicit_dirs_addon "${CMAKE_MATCH_1}")
+ list(PREPEND OpenMP_${LANG}_IMPLICIT_LINK_DIRS ${implicit_dirs_addon})
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ " Extended OpenMP library search paths: [${implicit_dirs}]\n")
+ endif()
+ endif()
+
unset(_OPENMP_LIB_NAMES)
foreach(_OPENMP_IMPLICIT_LIB IN LISTS OpenMP_${LANG}_IMPLICIT_LIBRARIES)
get_filename_component(_OPENMP_IMPLICIT_LIB_DIR "${_OPENMP_IMPLICIT_LIB}" DIRECTORY)
@@ -262,7 +279,9 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
DOC "Path to the ${_OPENMP_IMPLICIT_LIB_PLAIN} library for OpenMP"
HINTS ${OpenMP_${LANG}_IMPLICIT_LINK_DIRS}
CMAKE_FIND_ROOT_PATH_BOTH
- NO_DEFAULT_PATH
+ NO_PACKAGE_ROOT_PATH
+ NO_CMAKE_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
)
endif()
mark_as_advanced(OpenMP_${_OPENMP_IMPLICIT_LIB_PLAIN}_LIBRARY)
@@ -291,7 +310,8 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
# Try without specifying include directory first. We only want to
# explicitly add a search path if the header can't be found on the
# default header search path already.
- try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC}
+ try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}
+ SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}"
LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} ${OpenMP_libomp_LIBRARY}
OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT
@@ -301,7 +321,8 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
mark_as_advanced(OpenMP_${LANG}_INCLUDE_DIR)
set(OpenMP_${LANG}_INCLUDE_DIR "${OpenMP_${LANG}_INCLUDE_DIR}" PARENT_SCOPE)
if(OpenMP_${LANG}_INCLUDE_DIR)
- try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC}
+ try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}
+ SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}"
"-DINCLUDE_DIRECTORIES:STRING=${OpenMP_${LANG}_INCLUDE_DIR}"
LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} ${OpenMP_libomp_LIBRARY}
@@ -323,7 +344,8 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
)
mark_as_advanced(OpenMP_libomp_LIBRARY)
if(OpenMP_libomp_LIBRARY)
- try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC}
+ try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}
+ SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}"
LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} ${OpenMP_libomp_LIBRARY}
OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT
@@ -385,7 +407,8 @@ set(OpenMP_Fortran_CHECK_VERSION_SOURCE
")
function(_OPENMP_GET_SPEC_DATE LANG SPEC_DATE)
- _OPENMP_WRITE_SOURCE_FILE("${LANG}" "CHECK_VERSION_SOURCE" OpenMPCheckVersion _OPENMP_TEST_SRC)
+ _OPENMP_PREPARE_SOURCE("${LANG}" CHECK_VERSION_SOURCE OpenMPCheckVersion
+ _OPENMP_TEST_SRC_NAME _OPENMP_TEST_SRC_CONTENT)
unset(_includeDirFlags)
if(OpenMP_${LANG}_INCLUDE_DIR)
@@ -394,10 +417,11 @@ function(_OPENMP_GET_SPEC_DATE LANG SPEC_DATE)
set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindOpenMP/ompver_${LANG}.bin")
string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}")
- try_compile(OpenMP_SPECTEST_${LANG}_${OPENMP_PLAIN_FLAG} "${CMAKE_BINARY_DIR}" "${_OPENMP_TEST_SRC}"
- CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OpenMP_${LANG}_FLAGS}" ${_includeDirFlags}
- COPY_FILE ${BIN_FILE}
- OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT)
+ try_compile(OpenMP_SPECTEST_${LANG}_${OPENMP_PLAIN_FLAG}
+ SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT
+ CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OpenMP_${LANG}_FLAGS}" ${_includeDirFlags}
+ COPY_FILE "${BIN_FILE}"
+ OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT)
if(${OpenMP_SPECTEST_${LANG}_${OPENMP_PLAIN_FLAG}})
file(STRINGS ${BIN_FILE} specstr LIMIT_COUNT 1 REGEX "INFO:OpenMP-date")
@@ -460,10 +484,14 @@ foreach(LANG IN ITEMS C CXX)
if(NOT DEFINED OpenMP_${LANG}_FLAGS OR "${OpenMP_${LANG}_FLAGS}" STREQUAL "NOTFOUND"
OR NOT DEFINED OpenMP_${LANG}_LIB_NAMES OR "${OpenMP_${LANG}_LIB_NAMES}" STREQUAL "NOTFOUND")
_OPENMP_GET_FLAGS("${LANG}" "${LANG}" OpenMP_${LANG}_FLAGS_WORK OpenMP_${LANG}_LIB_NAMES_WORK)
- set(OpenMP_${LANG}_FLAGS "${OpenMP_${LANG}_FLAGS_WORK}"
- CACHE STRING "${LANG} compiler flags for OpenMP parallelization" FORCE)
- set(OpenMP_${LANG}_LIB_NAMES "${OpenMP_${LANG}_LIB_NAMES_WORK}"
- CACHE STRING "${LANG} compiler libraries for OpenMP parallelization" FORCE)
+ if(NOT DEFINED OpenMP_${LANG}_FLAGS OR "${OpenMP_${LANG}_FLAGS}" STREQUAL "NOTFOUND")
+ set(OpenMP_${LANG}_FLAGS "${OpenMP_${LANG}_FLAGS_WORK}"
+ CACHE STRING "${LANG} compiler flags for OpenMP parallelization" FORCE)
+ endif()
+ if(NOT DEFINED OpenMP_${LANG}_LIB_NAMES OR "${OpenMP_${LANG}_LIB_NAMES}" STREQUAL "NOTFOUND")
+ set(OpenMP_${LANG}_LIB_NAMES "${OpenMP_${LANG}_LIB_NAMES_WORK}"
+ CACHE STRING "${LANG} compiler libraries for OpenMP parallelization" FORCE)
+ endif()
mark_as_advanced(OpenMP_${LANG}_FLAGS OpenMP_${LANG}_LIB_NAMES)
endif()
endif()
@@ -479,10 +507,14 @@ if(CMAKE_Fortran_COMPILER_LOADED)
set(OpenMP_Fortran_HAVE_OMPLIB_MODULE TRUE CACHE BOOL INTERNAL "")
endif()
- set(OpenMP_Fortran_FLAGS "${OpenMP_Fortran_FLAGS_WORK}"
- CACHE STRING "Fortran compiler flags for OpenMP parallelization")
- set(OpenMP_Fortran_LIB_NAMES "${OpenMP_Fortran_LIB_NAMES_WORK}"
- CACHE STRING "Fortran compiler libraries for OpenMP parallelization")
+ if(NOT DEFINED OpenMP_Fortran_FLAGS OR "${OpenMP_Fortran_FLAGS}" STREQUAL "NOTFOUND")
+ set(OpenMP_Fortran_FLAGS "${OpenMP_Fortran_FLAGS_WORK}"
+ CACHE STRING "Fortran compiler flags for OpenMP parallelization" FORCE)
+ endif()
+ if(NOT DEFINED OpenMP_Fortran_LIB_NAMES OR "${OpenMP_Fortran_LIB_NAMES}" STREQUAL "NOTFOUND")
+ set(OpenMP_Fortran_LIB_NAMES "${OpenMP_Fortran_LIB_NAMES_WORK}"
+ CACHE STRING "Fortran compiler libraries for OpenMP parallelization" FORCE)
+ endif()
mark_as_advanced(OpenMP_Fortran_FLAGS OpenMP_Fortran_LIB_NAMES)
endif()
@@ -495,11 +527,14 @@ if(CMAKE_Fortran_COMPILER_LOADED)
set(OpenMP_Fortran_HAVE_OMPLIB_HEADER TRUE CACHE BOOL INTERNAL "")
endif()
- set(OpenMP_Fortran_FLAGS "${OpenMP_Fortran_FLAGS_WORK}"
- CACHE STRING "Fortran compiler flags for OpenMP parallelization")
-
- set(OpenMP_Fortran_LIB_NAMES "${OpenMP_Fortran_LIB_NAMES}"
- CACHE STRING "Fortran compiler libraries for OpenMP parallelization")
+ if(NOT DEFINED OpenMP_Fortran_FLAGS OR "${OpenMP_Fortran_FLAGS}" STREQUAL "NOTFOUND")
+ set(OpenMP_Fortran_FLAGS "${OpenMP_Fortran_FLAGS_WORK}"
+ CACHE STRING "Fortran compiler flags for OpenMP parallelization" FORCE)
+ endif()
+ if(NOT DEFINED OpenMP_Fortran_LIB_NAMES OR "${OpenMP_Fortran_LIB_NAMES}" STREQUAL "NOTFOUND")
+ set(OpenMP_Fortran_LIB_NAMES "${OpenMP_Fortran_LIB_NAMES_WORK}"
+ CACHE STRING "Fortran compiler libraries for OpenMP parallelization" FORCE)
+ endif()
endif()
if(OpenMP_Fortran_HAVE_OMPLIB_MODULE)
@@ -571,7 +606,8 @@ foreach(LANG IN LISTS OpenMP_FINDLIST)
separate_arguments(_OpenMP_${LANG}_OPTIONS NATIVE_COMMAND "${OpenMP_${LANG}_FLAGS}")
set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY
INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_OPTIONS}>")
- if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Fujitsu")
+ if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Fujitsu"
+ OR ${CMAKE_${LANG}_COMPILER_ID} STREQUAL "IntelLLVM")
set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY
INTERFACE_LINK_OPTIONS "${OpenMP_${LANG}_FLAGS}")
endif()
diff --git a/Modules/FindOpenSP.cmake b/Modules/FindOpenSP.cmake
new file mode 100644
index 0000000..655dd65
--- /dev/null
+++ b/Modules/FindOpenSP.cmake
@@ -0,0 +1,155 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindOpenSP
+----------
+
+.. versionadded:: 3.25
+
+Try to find the OpenSP library.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables:
+
+``OpenSP_FOUND``
+ True if (the requested version of) ``OpenSP`` is available
+
+``OpenSP_VERSION``
+ The version of ``OpenSP``
+
+``OpenSP_VERSION_MAJOR``
+ The major version of ``OpenSP``
+
+``OpenSP_VERSION_MINOR``
+ The minor version of ``OpenSP``
+
+``OpenSP_VERSION_PATCH``
+ The patch version of ``OpenSP``
+
+``OpenSP_INCLUDE_DIRS``
+ The include dirs of ``OpenSP`` with its headers
+
+``OpenSP_LIBRARIES``
+ The OpenSP library for use with target_link_libraries().
+ This can be passed to target_link_libraries() instead of
+ the :prop_tgt:`IMPORTED` ``OpenSP::OpenSP`` target
+
+``OpenSP_MULTI_BYTE``
+ True if ``SP_MULTI_BYTE`` was found to be defined in OpenSP's ``config.h``
+ header file, which indicates that the ``OpenSP`` library was compiled with
+ support for multi-byte characters. The consuming target needs to define the
+ ``SP_MULTI_BYTE`` to match this value in order to avoid issues with character
+ decoding.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the :prop_tgt:`IMPORTED` target ``OpenSP::OpenSP``, if
+OpenSP has been found.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OpenSP_INCLUDE_DIR``
+ the OpenSP include directory
+
+``OpenSP_LIBRARY``
+ the absolute path of the osp library
+
+#]=======================================================================]
+
+if (NOT OpenSP_INCLUDE_DIR AND NOT OpenSP_LIBRARY)
+ find_package(PkgConfig)
+ if (PkgConfig_FOUND)
+ pkg_check_modules(OpenSP IMPORTED_TARGET GLOBAL opensp)
+
+ if (OpenSP_FOUND)
+ add_library(OpenSP::OpenSP INTERFACE IMPORTED)
+ target_link_libraries(OpenSP::OpenSP INTERFACE PkgConfig::OpenSP)
+
+ set(OpenSP_INCLUDE_DIR ${OpenSP_INCLUDE_DIRS})
+ set(OpenSP_LIBRARY ${OpenSP_LIBRARIES})
+ endif ()
+ endif ()
+endif ()
+
+if (NOT OpenSP_INCLUDE_DIR)
+ find_path(OpenSP_INCLUDE_DIR
+ NAMES ParserEventGeneratorKit.h
+ PATH_SUFFIXES OpenSP opensp
+ DOC "The OpenSP include directory"
+ )
+endif ()
+
+if (NOT OpenSP_LIBRARY)
+ find_library(OpenSP_LIBRARY_RELEASE
+ NAMES osp libosp opensp libopensp sp133 libsp
+ )
+
+ find_library(OpenSP_LIBRARY_DEBUG
+ NAMES ospd libospd openspd libopenspd sp133d libspd
+ )
+
+ include(SelectLibraryConfigurations)
+ select_library_configurations(OpenSP)
+endif ()
+
+if (OpenSP_INCLUDE_DIR AND OpenSP_LIBRARY)
+ if (EXISTS "${OpenSP_INCLUDE_DIR}/config.h")
+ if (NOT OpenSP_VERSION)
+ file(STRINGS "${OpenSP_INCLUDE_DIR}/config.h" opensp_version_str REGEX "^#define[\t ]+SP_VERSION[\t ]+\".*\"")
+ string(REGEX REPLACE "^.*SP_VERSION[\t ]+\"([^\"]*)\".*$" "\\1" OpenSP_VERSION "${opensp_version_str}")
+ unset(opensp_version_str)
+ endif ()
+
+ if (OpenSP_VERSION MATCHES [=[([0-9]+)\.([0-9]+)\.([0-9]+)]=])
+ set(OpenSP_VERSION_MAJOR "${CMAKE_MATCH_1}")
+ set(OpenSP_VERSION_MINOR "${CMAKE_MATCH_2}")
+ set(OpenSP_VERSION_PATCH "${CMAKE_MATCH_3}")
+ endif ()
+
+ include(CheckCXXSymbolExists)
+ check_cxx_symbol_exists(SP_MULTI_BYTE "${OpenSP_INCLUDE_DIR}/config.h" OpenSP_MULTI_BYTE)
+ endif ()
+
+ if (NOT TARGET OpenSP::OpenSP)
+ set(OpenSP_INCLUDE_DIRS ${OpenSP_INCLUDE_DIR})
+
+ add_library(OpenSP::OpenSP UNKNOWN IMPORTED)
+ set_target_properties(OpenSP::OpenSP PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${OpenSP_INCLUDE_DIRS}")
+
+ if (OpenSP_LIBRARY_RELEASE)
+ set_target_properties(OpenSP::OpenSP PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenSP_LIBRARY_RELEASE}")
+ set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ endif ()
+
+ if (OpenSP_LIBRARY_DEBUG)
+ set_target_properties(OpenSP::OpenSP PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenSP_LIBRARY_DEBUG}")
+ set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ endif ()
+
+ if (NOT OpenSP_LIBRARY_RELEASE AND NOT OpenSP_LIBRARY_DEBUG)
+ set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_LOCATION "${OpenSP_LIBRARY}")
+ endif ()
+ endif ()
+endif ()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(OpenSP
+ FOUND_VAR OpenSP_FOUND
+ REQUIRED_VARS OpenSP_LIBRARY OpenSP_INCLUDE_DIR
+ VERSION_VAR OpenSP_VERSION
+ )
+
+mark_as_advanced(OpenSP_INCLUDE_DIR OpenSP_LIBRARY OpenSP_MULTI_BYTE)
+
+include(FeatureSummary)
+set_package_properties(OpenSP PROPERTIES
+ URL "http://openjade.sourceforge.net/doc/index.htm"
+ DESCRIPTION "An SGML System Conforming to International Standard ISO 8879"
+ )
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 9278566..f66ffcf 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -90,13 +90,25 @@ This module will set the following variables in your project:
Hints
^^^^^
-Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation.
+The following variables may be set to control search behavior:
-.. versionadded:: 3.4
- Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries.
+``OPENSSL_ROOT_DIR``
+ Set to the root directory of an OpenSSL installation.
+
+``OPENSSL_USE_STATIC_LIBS``
+ .. versionadded:: 3.4
+
+ Set to ``TRUE`` to look for static libraries.
+
+``OPENSSL_MSVC_STATIC_RT``
+ .. versionadded:: 3.5
+
+ Set to ``TRUE`` to choose the MT version of the lib.
-.. versionadded:: 3.5
- Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib.
+``ENV{PKG_CONFIG_PATH}``
+ On UNIX-like systems, ``pkg-config`` is used to locate the system OpenSSL.
+ Set the ``PKG_CONFIG_PATH`` environment varialbe to look in alternate
+ locations. Useful on multi-lib systems.
#]=======================================================================]
macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library)
@@ -392,6 +404,7 @@ if(WIN32 AND NOT CYGWIN)
PATH_SUFFIXES
"lib/MinGW"
"lib"
+ "lib64"
)
find_library(SSL_EAY
@@ -402,6 +415,7 @@ if(WIN32 AND NOT CYGWIN)
PATH_SUFFIXES
"lib/MinGW"
"lib"
+ "lib64"
)
mark_as_advanced(SSL_EAY LIB_EAY)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index fbcf7cd..56ba1e6 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -535,18 +535,24 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
set(VERSION_MSG "")
set(VERSION_OK TRUE)
- # check with DEFINED here as the requested or found version may be "0"
+ # check that the version variable is not empty to avoid emitting a misleading
+ # message (i.e. `Found unsuitable version ""`)
if (DEFINED ${_NAME}_FIND_VERSION)
if(DEFINED ${FPHSA_VERSION_VAR})
- set(_FOUND_VERSION ${${FPHSA_VERSION_VAR}})
- if (FPHSA_HANDLE_VERSION_RANGE)
- set (FPCV_HANDLE_VERSION_RANGE HANDLE_VERSION_RANGE)
+ if(NOT "${${FPHSA_VERSION_VAR}}" STREQUAL "")
+ set(_FOUND_VERSION ${${FPHSA_VERSION_VAR}})
+ if (FPHSA_HANDLE_VERSION_RANGE)
+ set (FPCV_HANDLE_VERSION_RANGE HANDLE_VERSION_RANGE)
+ else()
+ set(FPCV_HANDLE_VERSION_RANGE NO_AUTHOR_WARNING_VERSION_RANGE)
+ endif()
+ find_package_check_version ("${_FOUND_VERSION}" VERSION_OK RESULT_MESSAGE_VARIABLE VERSION_MSG
+ ${FPCV_HANDLE_VERSION_RANGE})
else()
- set(FPCV_HANDLE_VERSION_RANGE NO_AUTHOR_WARNING_VERSION_RANGE)
+ set(VERSION_OK FALSE)
endif()
- find_package_check_version ("${_FOUND_VERSION}" VERSION_OK RESULT_MESSAGE_VARIABLE VERSION_MSG
- ${FPCV_HANDLE_VERSION_RANGE})
- else()
+ endif()
+ if("${${FPHSA_VERSION_VAR}}" STREQUAL "")
# if the package was not found, but a version was given, add that to the output:
if(${_NAME}_FIND_VERSION_EXACT)
set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 375cb70..04f9d8c 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -237,8 +237,8 @@ Hints
``Python_FIND_ABI``
.. versionadded:: 3.16
- This variable defines which ABIs, as defined in
- `PEP 3149 <https://www.python.org/dev/peps/pep-3149/>`_, should be searched.
+ This variable defines which ABIs, as defined in :pep:`3149`, should be
+ searched.
.. note::
@@ -363,7 +363,7 @@ Hints
``Anaconda`` or ``ActivePython``, rely on this implementation.
* ``IronPython``: This implementation use the ``CSharp`` language for
``.NET Framework`` on top of the `Dynamic Language Runtime` (``DLR``).
- See `IronPython <http://ironpython.net>`_.
+ See `IronPython <https://ironpython.net>`_.
* ``PyPy``: This implementation use ``RPython`` language and
``RPython translation toolchain`` to produce the python interpreter.
See `PyPy <https://www.pypy.org>`_.
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index c4fae6b..7a127e4 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -14,6 +14,8 @@ cmake_policy(PUSH)
cmake_policy (SET CMP0012 NEW)
# IN_LIST operator
cmake_policy (SET CMP0057 NEW)
+# registry view behavior
+cmake_policy (SET CMP0134 NEW)
if (NOT DEFINED _PYTHON_PREFIX)
message (FATAL_ERROR "FindPython: INTERNAL ERROR")
@@ -175,30 +177,31 @@ function (_PYTHON_GET_REGISTRIES _PYTHON_PGR_REGISTRY_PATHS)
foreach (version IN LISTS _PGR_VERSION)
string (REPLACE "." "" version_no_dots ${version})
list (APPEND registries
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${version}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${version}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath])
+ [HKEY_CURRENT_USER/SOFTWARE/Python/PythonCore/${version}-${_${_PYTHON_PREFIX}_ARCH}/InstallPath]
+ [HKEY_CURRENT_USER/SOFTWARE/Python/PythonCore/${version}-${_${_PYTHON_PREFIX}_ARCH2}/InstallPath])
if (version VERSION_GREATER_EQUAL "3.5")
+ # cmake_host_system_information is not usable in bootstrap
get_filename_component (arch "[HKEY_CURRENT_USER\\Software\\Python\\PythonCore\\${version};SysArchitecture]" NAME)
if (arch MATCHES "(${_${_PYTHON_PREFIX}_ARCH}|${_${_PYTHON_PREFIX}_ARCH2})bit")
list (APPEND registries
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${version}\\InstallPath])
+ [HKEY_CURRENT_USER/SOFTWARE/Python/PythonCore/${version}/InstallPath])
endif()
else()
list (APPEND registries
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${version}\\InstallPath])
+ [HKEY_CURRENT_USER/SOFTWARE/Python/PythonCore/${version}/InstallPath])
endif()
list (APPEND registries
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${version_no_dots}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${version_no_dots}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${version}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${version}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${version}\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${version_no_dots}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${version_no_dots}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath])
+ [HKEY_CURRENT_USER/SOFTWARE/Python/ContinuumAnalytics/Anaconda${version_no_dots}-${_${_PYTHON_PREFIX}_ARCH}/InstallPath]
+ [HKEY_CURRENT_USER/SOFTWARE/Python/ContinuumAnalytics/Anaconda${version_no_dots}-${_${_PYTHON_PREFIX}_ARCH2}/InstallPath]
+ [HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${version}-${_${_PYTHON_PREFIX}_ARCH}/InstallPath]
+ [HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${version}-${_${_PYTHON_PREFIX}_ARCH2}/InstallPath]
+ [HKEY_LOCAL_MACHINE/SOFTWARE/Python/PythonCore/${version}/InstallPath]
+ [HKEY_LOCAL_MACHINE/SOFTWARE/Python/ContinuumAnalytics/Anaconda${version_no_dots}-${_${_PYTHON_PREFIX}_ARCH}/InstallPath]
+ [HKEY_LOCAL_MACHINE/SOFTWARE/Python/ContinuumAnalytics/Anaconda${version_no_dots}-${_${_PYTHON_PREFIX}_ARCH2}/InstallPath])
endforeach()
elseif (implementation STREQUAL "IronPython")
foreach (version IN LISTS _PGR_VERSION)
- list (APPEND registries [HKEY_LOCAL_MACHINE\\SOFTWARE\\IronPython\\${version}\\InstallPath])
+ list (APPEND registries [HKEY_LOCAL_MACHINE/SOFTWARE/IronPython/${version}/InstallPath])
endforeach()
endif()
endforeach()
@@ -711,7 +714,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
if (_PVI_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_EXECUTABLE}")
# interpreter does not exist anymore
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot find the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Cannot find the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
@@ -732,7 +735,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
endif()
if (NOT abi IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
# incompatible ABI
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong ABI for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Wrong ABI for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
@@ -748,7 +751,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (result)
# interpreter is not usable
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
@@ -773,7 +776,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
if (_PVI_EXACT AND NOT version VERSION_EQUAL _PVI_VERSION)
# interpreter has wrong version
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
else()
@@ -782,7 +785,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
string(REGEX REPLACE "^([0-9]+)\\.?.*$" "\\1" expected_major_version "${_PVI_VERSION}")
if (NOT major_version VERSION_EQUAL expected_major_version
OR NOT version VERSION_GREATER_EQUAL _PVI_VERSION)
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
@@ -794,7 +797,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
find_package_check_version ("${version}" in_range HANDLE_VERSION_RANGE)
if (NOT in_range)
# interpreter has invalid version
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
@@ -813,9 +816,9 @@ function (_PYTHON_VALIDATE_INTERPRETER)
if (result OR NOT version EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
# interpreter not usable or has wrong major version
if (result)
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
else()
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong major version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Wrong major version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
endif()
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
@@ -836,9 +839,9 @@ function (_PYTHON_VALIDATE_INTERPRETER)
if (result OR NOT size EQUAL CMAKE_SIZEOF_VOID_P)
# interpreter not usable or has wrong architecture
if (result)
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
else()
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong architecture for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Wrong architecture for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
endif()
set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
@@ -846,6 +849,14 @@ function (_PYTHON_VALIDATE_INTERPRETER)
endif()
endfunction()
+function(_python_validate_find_interpreter status interpreter)
+ set(_${_PYTHON_PREFIX}_EXECUTABLE "${interpreter}" CACHE FILEPATH "" FORCE)
+ _python_validate_interpreter (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ if (NOT _${_PYTHON_PREFIX}_EXECUTABLE)
+ set (${status} FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
function (_PYTHON_VALIDATE_COMPILER)
if (NOT _${_PYTHON_PREFIX}_COMPILER)
@@ -856,7 +867,7 @@ function (_PYTHON_VALIDATE_COMPILER)
if (_PVC_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_COMPILER}")
# Compiler does not exist anymore
- set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot find the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Compiler_REASON_FAILURE PROPERTY VALUE "Cannot find the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
return()
endif()
@@ -883,7 +894,7 @@ function (_PYTHON_VALIDATE_COMPILER)
file (REMOVE_RECURSE "${working_dir}")
if (result)
# compiler is not usable
- set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot use the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Compiler_REASON_FAILURE PROPERTY VALUE "Cannot use the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
return()
endif()
@@ -909,7 +920,7 @@ function (_PYTHON_VALIDATE_COMPILER)
if (_PVC_EXACT AND NOT version VERSION_EQUAL _PVC_VERSION)
# interpreter has wrong version
- set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Compiler_REASON_FAILURE PROPERTY VALUE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
return()
else()
@@ -918,7 +929,7 @@ function (_PYTHON_VALIDATE_COMPILER)
string(REGEX REPLACE "^([0-9]+)\\.?.*$" "\\1" expected_major_version "${_PVC_VERSION}")
if (NOT major_version VERSION_EQUAL expected_major_version
OR NOT version VERSION_GREATER_EQUAL _PVC_VERSION)
- set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Compiler_REASON_FAILURE PROPERTY VALUE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
return()
endif()
@@ -930,7 +941,7 @@ function (_PYTHON_VALIDATE_COMPILER)
find_package_check_version ("${version}" in_range HANDLE_VERSION_RANGE)
if (NOT in_range)
# interpreter has invalid version
- set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Compiler_REASON_FAILURE PROPERTY VALUE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
return()
endif()
@@ -939,13 +950,21 @@ function (_PYTHON_VALIDATE_COMPILER)
string(REGEX REPLACE "^([0-9]+)\\.?.*$" "\\1" major_version "${version}")
if (NOT major_version EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
# Compiler has wrong major version
- set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Wrong major version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Compiler_REASON_FAILURE PROPERTY VALUE "Wrong major version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
return()
endif()
endif()
endfunction()
+function(_python_validate_find_compiler status compiler)
+ set(_${_PYTHON_PREFIX}_COMPILER "${compiler}" CACHE FILEPATH "" FORCE)
+ _python_validate_compiler (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ if (NOT _${_PYTHON_PREFIX}_COMPILER)
+ set (${status} FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
function (_PYTHON_VALIDATE_LIBRARY)
if (NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
@@ -957,7 +976,7 @@ function (_PYTHON_VALIDATE_LIBRARY)
if (_PVL_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
# library does not exist anymore
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
if (WIN32)
set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_DEBUG PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND")
@@ -971,7 +990,7 @@ function (_PYTHON_VALIDATE_LIBRARY)
if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT lib_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
# incompatible ABI
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong ABI for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Wrong ABI for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
else()
if (_PVL_VERSION OR _PVL_IN_RANGE)
@@ -980,7 +999,7 @@ function (_PYTHON_VALIDATE_LIBRARY)
string (REGEX MATCH "[0-9](\\.[0-9]+)?" version "${_PVL_VERSION}")
if ((_PVL_EXACT AND NOT lib_VERSION VERSION_EQUAL version) OR (lib_VERSION VERSION_LESS version))
# library has wrong version
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Wrong version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
endif()
endif()
@@ -990,14 +1009,14 @@ function (_PYTHON_VALIDATE_LIBRARY)
find_package_check_version ("${lib_VERSION}" in_range HANDLE_VERSION_RANGE)
if (NOT in_range)
# library has wrong version
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Wrong version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
endif()
endif()
else()
if (NOT lib_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
# library has wrong major version
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong major version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Wrong major version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
endif()
endif()
@@ -1023,7 +1042,7 @@ function (_PYTHON_VALIDATE_INCLUDE_DIR)
if (_PVID_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
# include file does not exist anymore
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
return()
endif()
@@ -1033,14 +1052,14 @@ function (_PYTHON_VALIDATE_INCLUDE_DIR)
if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT inc_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
# incompatible ABI
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong ABI for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Wrong ABI for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
else()
if (_PVID_VERSION OR _PVID_IN_RANGE)
if (_PVID_VERSION)
if ((_PVID_EXACT AND NOT inc_VERSION VERSION_EQUAL expected_version) OR (inc_VERSION VERSION_LESS expected_version))
# include dir has wrong version
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Wrong version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
endif()
endif()
@@ -1050,14 +1069,14 @@ function (_PYTHON_VALIDATE_INCLUDE_DIR)
find_package_check_version ("${inc_VERSION}" in_range HANDLE_VERSION_RANGE)
if (NOT in_range)
# include dir has wrong version
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Wrong version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
endif()
endif()
else()
if (NOT inc_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
# include dir has wrong major version
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong major version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"" PARENT_SCOPE)
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Wrong major version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
endif()
endif()
@@ -1247,12 +1266,14 @@ if (DEFINED ${_PYTHON_PREFIX}_FIND_STRATEGY)
endif()
# Python and Anaconda distributions: define which architectures can be used
+unset (_${_PYTHON_PREFIX}_REGISTRY_VIEW)
if (CMAKE_SIZEOF_VOID_P)
math (EXPR _${_PYTHON_PREFIX}_ARCH "${CMAKE_SIZEOF_VOID_P} * 8")
if ("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
OR "Development.Embed" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
# In this case, search only for 64bit or 32bit
set (_${_PYTHON_PREFIX}_ARCH2 ${_${_PYTHON_PREFIX}_ARCH})
+ set (_${_PYTHON_PREFIX}_REGISTRY_VIEW REGISTRY_VIEW ${_${_PYTHON_PREFIX}_ARCH})
else()
if (_${_PYTHON_PREFIX}_ARCH EQUAL "32")
set (_${_PYTHON_PREFIX}_ARCH2 64)
@@ -1506,9 +1527,13 @@ endfunction()
unset (_${_PYTHON_PREFIX}_REQUIRED_VARS)
unset (_${_PYTHON_PREFIX}_CACHED_VARS)
unset (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE)
+set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE CACHE INTERNAL "Interpreter reason failure")
unset (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE)
+set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE CACHE INTERNAL "Compiler reason failure")
unset (_${_PYTHON_PREFIX}_Development_REASON_FAILURE)
+set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE CACHE INTERNAL "Development reason failure")
unset (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE)
+set (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE CACHE INTERNAL "NumPy reason failure")
# preamble
@@ -1590,9 +1615,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
-
- _python_validate_interpreter (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1612,8 +1636,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_interpreter (${${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1626,9 +1650,10 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
HINTS ${_${_PYTHON_PREFIX}_HINTS}
PATHS ${_${_PYTHON_PREFIX}_REGISTRY_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
+ ${_${_PYTHON_PREFIX}_REGISTRY_VIEW}
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_interpreter (${${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1641,8 +1666,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
HINTS ${_${_PYTHON_PREFIX}_HINTS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_interpreter (${${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1650,8 +1675,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
find_program (_${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
NAMES_PER_DIR
- PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES})
- _python_validate_interpreter (${${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1663,8 +1688,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NAMES_PER_DIR
PATHS ${_${_PYTHON_PREFIX}_FRAMEWORK_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
- NO_DEFAULT_PATH)
- _python_validate_interpreter (${${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_DEFAULT_PATH
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1676,8 +1701,9 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NAMES_PER_DIR
PATHS ${_${_PYTHON_PREFIX}_REGISTRY_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
- NO_DEFAULT_PATH)
- _python_validate_interpreter (${${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ ${_${_PYTHON_PREFIX}_REGISTRY_VIEW}
+ NO_DEFAULT_PATH
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1687,9 +1713,9 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endwhile()
else()
# look-up for various versions and locations
- set (_${_PYTHON_PREFIX}_VALIDATE_OPTIONS EXACT)
+ set (_${_PYTHON_PREFIX}_COMMON_VALIDATE_OPTIONS EXACT)
if (${_PYTHON_PREFIX}_FIND_VERSION_RANGE)
- list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS IN_RANGE)
+ list (APPEND _${_PYTHON_PREFIX}_COMMON_VALIDATE_OPTIONS IN_RANGE)
endif()
foreach (_${_PYTHON_PREFIX}_VERSION IN LISTS _${_PYTHON_PREFIX}_FIND_VERSIONS)
@@ -1698,6 +1724,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
_python_get_frameworks (_${_PYTHON_PREFIX}_FRAMEWORK_PATHS VERSION ${_${_PYTHON_PREFIX}_VERSION})
_python_get_registries (_${_PYTHON_PREFIX}_REGISTRY_PATHS VERSION ${_${_PYTHON_PREFIX}_VERSION})
+ set (_${_PYTHON_PREFIX}_VALIDATE_OPTIONS VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_COMMON_VALIDATE_OPTIONS})
# Virtual environments handling
if (_${_PYTHON_PREFIX}_FIND_VIRTUALENV MATCHES "^(FIRST|ONLY)$")
@@ -1710,8 +1737,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_interpreter (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1731,7 +1758,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_interpreter)
endif()
# Windows registry
@@ -1742,11 +1770,12 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
HINTS ${_${_PYTHON_PREFIX}_HINTS}
PATHS ${_${_PYTHON_PREFIX}_REGISTRY_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
+ ${_${_PYTHON_PREFIX}_REGISTRY_VIEW}
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_interpreter)
endif()
- _python_validate_interpreter (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1758,21 +1787,18 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
HINTS ${_${_PYTHON_PREFIX}_HINTS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_interpreter (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
+
# try using standard paths.
- # NAMES_PER_DIR is not defined on purpose to have a chance to find
- # expected version.
- # For example, typical systems have 'python' for version 2.* and 'python3'
- # for version 3.*. So looking for names per dir will find, potentially,
- # systematically 'python' (i.e. version 2) even if version 3 is searched.
find_program (_${_PYTHON_PREFIX}_EXECUTABLE
NAMES ${_${_PYTHON_PREFIX}_NAMES}
- PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES})
- _python_validate_interpreter (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NAMES_PER_DIR
+ PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
+ VALIDATOR _python_validate_find_interpreter)
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1784,7 +1810,8 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NAMES_PER_DIR
PATHS ${_${_PYTHON_PREFIX}_FRAMEWORK_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
- NO_DEFAULT_PATH)
+ NO_DEFAULT_PATH
+ VALIDATOR _python_validate_find_interpreter)
endif()
# Windows registry
@@ -1794,10 +1821,11 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NAMES_PER_DIR
PATHS ${_${_PYTHON_PREFIX}_REGISTRY_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
- NO_DEFAULT_PATH)
+ ${_${_PYTHON_PREFIX}_REGISTRY_VIEW}
+ NO_DEFAULT_PATH
+ VALIDATOR _python_validate_find_interpreter)
endif()
- _python_validate_interpreter (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
if (_${_PYTHON_PREFIX}_EXECUTABLE)
break()
endif()
@@ -1806,15 +1834,12 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
if (NOT _${_PYTHON_PREFIX}_EXECUTABLE AND
NOT _${_PYTHON_PREFIX}_FIND_VIRTUALENV STREQUAL "ONLY")
# No specific version found. Retry with generic names and standard paths.
- # NAMES_PER_DIR is not defined on purpose to have a chance to find
- # expected version.
- # For example, typical systems have 'python' for version 2.* and 'python3'
- # for version 3.*. So looking for names per dir will find, potentially,
- # systematically 'python' (i.e. version 2) even if version 3 is searched.
_python_get_names (_${_PYTHON_PREFIX}_NAMES POSIX INTERPRETER)
+ unset (_${_PYTHON_PREFIX}_VALIDATE_OPTIONS)
find_program (_${_PYTHON_PREFIX}_EXECUTABLE
- NAMES ${_${_PYTHON_PREFIX}_NAMES})
- _python_validate_interpreter ()
+ NAMES ${_${_PYTHON_PREFIX}_NAMES}
+ NAMES_PER_DIR
+ VALIDATOR _python_validate_find_interpreter)
endif()
endif()
endif()
@@ -1836,7 +1861,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
# Interpreter is not usable
set (_${_PYTHON_PREFIX}_EXECUTABLE_USABLE FALSE)
unset (${_PYTHON_PREFIX}_VERSION)
- set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot run the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
+ set_property (CACHE _${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE PROPERTY VALUE "Cannot run the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
endif()
endif()
@@ -1884,7 +1909,7 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
if (${_PYTHON_PREFIX}_Interpreter_FOUND)
- unset (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE)
+ unset (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE CACHE)
# compute and save interpreter signature
string (MD5 __${_PYTHON_PREFIX}_INTERPRETER_SIGNATURE "${_${_PYTHON_PREFIX}_SIGNATURE}:${_${_PYTHON_PREFIX}_EXECUTABLE}")
@@ -2058,8 +2083,8 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_compiler (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2072,9 +2097,10 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
HINTS ${_${_PYTHON_PREFIX}_IRON_ROOT} ${_${_PYTHON_PREFIX}_HINTS}
PATHS ${_${_PYTHON_PREFIX}_REGISTRY_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
+ ${_${_PYTHON_PREFIX}_REGISTRY_VIEW}
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_compiler (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2087,8 +2113,8 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
HINTS ${_${_PYTHON_PREFIX}_IRON_ROOT} ${_${_PYTHON_PREFIX}_HINTS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_compiler (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2097,8 +2123,8 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
find_program (_${_PYTHON_PREFIX}_COMPILER
NAMES ${_${_PYTHON_PREFIX}_COMPILER_NAMES}
NAMES_PER_DIR
- PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES})
- _python_validate_compiler (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2110,12 +2136,13 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NAMES_PER_DIR
PATHS ${_${_PYTHON_PREFIX}_FRAMEWORK_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
- NO_DEFAULT_PATH)
- _python_validate_compiler (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_DEFAULT_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
endif()
+
# Windows registry
if (CMAKE_HOST_WIN32 AND _${_PYTHON_PREFIX}_FIND_REGISTRY STREQUAL "LAST")
find_program (_${_PYTHON_PREFIX}_COMPILER
@@ -2123,8 +2150,9 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NAMES_PER_DIR
PATHS ${_${_PYTHON_PREFIX}_REGISTRY_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
- NO_DEFAULT_PATH)
- _python_validate_compiler (${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ ${_${_PYTHON_PREFIX}_REGISTRY_VIEW}
+ NO_DEFAULT_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2134,9 +2162,9 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endwhile()
else()
# try using root dir and registry
- set (_${_PYTHON_PREFIX}_VALIDATE_OPTIONS EXACT)
+ set (_${_PYTHON_PREFIX}_COMMON_VALIDATE_OPTIONS EXACT)
if (${_PYTHON_PREFIX}_FIND_VERSION_RANGE)
- list (APPEND _${_PYTHON_PREFIX}_VALIDATE_OPTIONS IN_RANGE)
+ list (APPEND _${_PYTHON_PREFIX}_COMMON_VALIDATE_OPTIONS IN_RANGE)
endif()
foreach (_${_PYTHON_PREFIX}_VERSION IN LISTS _${_PYTHON_PREFIX}_FIND_VERSIONS)
@@ -2157,6 +2185,8 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
IMPLEMENTATIONS IronPython
VERSION ${_${_PYTHON_PREFIX}_VERSION})
+ set (_${_PYTHON_PREFIX}_VALIDATE_OPTIONS VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_COMMON_VALIDATE_OPTIONS})
+
# Apple frameworks handling
if (CMAKE_HOST_APPLE AND _${_PYTHON_PREFIX}_FIND_FRAMEWORK STREQUAL "FIRST")
find_program (_${_PYTHON_PREFIX}_COMPILER
@@ -2168,8 +2198,8 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_compiler (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2182,9 +2212,10 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
HINTS ${_${_PYTHON_PREFIX}_IRON_ROOT} ${_${_PYTHON_PREFIX}_HINTS}
PATHS ${_${_PYTHON_PREFIX}_REGISTRY_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
+ ${_${_PYTHON_PREFIX}_REGISTRY_VIEW}
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_compiler (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2197,8 +2228,8 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
HINTS ${_${_PYTHON_PREFIX}_IRON_ROOT} ${_${_PYTHON_PREFIX}_HINTS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
NO_SYSTEM_ENVIRONMENT_PATH
- NO_CMAKE_SYSTEM_PATH)
- _python_validate_compiler (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_CMAKE_SYSTEM_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2210,8 +2241,8 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NAMES_PER_DIR
PATHS ${_${_PYTHON_PREFIX}_FRAMEWORK_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
- NO_DEFAULT_PATH)
- _python_validate_compiler (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ NO_DEFAULT_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2223,8 +2254,9 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
NAMES_PER_DIR
PATHS ${_${_PYTHON_PREFIX}_REGISTRY_PATHS}
PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
- NO_DEFAULT_PATH)
- _python_validate_compiler (VERSION ${_${_PYTHON_PREFIX}_VERSION} ${_${_PYTHON_PREFIX}_VALIDATE_OPTIONS})
+ ${_${_PYTHON_PREFIX}_REGISTRY_VIEW}
+ NO_DEFAULT_PATH
+ VALIDATOR _python_validate_find_compiler)
if (_${_PYTHON_PREFIX}_COMPILER)
break()
endif()
@@ -2240,11 +2272,13 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
IMPLEMENTATIONS IronPython
VERSION ${_${_PYTHON_PREFIX}_FIND_VERSIONS}
COMPILER)
+ unset (_${_PYTHON_PREFIX}_VALIDATE_OPTIONS)
find_program (_${_PYTHON_PREFIX}_COMPILER
NAMES ${_${_PYTHON_PREFIX}_COMPILER_NAMES}
+ NAMES_PER_DIR
HINTS ${_${_PYTHON_PREFIX}_IRON_ROOT} ${_${_PYTHON_PREFIX}_HINTS}
- PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES})
- _python_validate_compiler ()
+ PATH_SUFFIXES ${_${_PYTHON_PREFIX}_PATH_SUFFIXES}
+ VALIDATOR _python_validate_find_compiler)
endif()
endif()
@@ -2285,7 +2319,7 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
else()
# compiler not usable
set (_${_PYTHON_PREFIX}_COMPILER_USABLE FALSE)
- set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot run the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
+ set_property (CACHE _${_PYTHON_PREFIX}_Compiler_REASON_FAILURE PROPERTY VALUE "Cannot run the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
endif()
file (REMOVE_RECURSE "${_${_PYTHON_PREFIX}_VERSION_DIR}")
endif()
@@ -2304,7 +2338,7 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
if (${_PYTHON_PREFIX}_Compiler_FOUND)
- unset (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE)
+ unset (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE CACHE)
# compute and save compiler signature
string (MD5 __${_PYTHON_PREFIX}_COMPILER_SIGNATURE "${_${_PYTHON_PREFIX}_SIGNATURE}:${_${_PYTHON_PREFIX}_COMPILER}")
@@ -2786,7 +2820,7 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
set (${_PYTHON_PREFIX}_LIBRARY_RELEASE "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE AND NOT EXISTS "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
endif()
@@ -2837,7 +2871,15 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
if ("INCLUDE_DIR" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS)
while (NOT _${_PYTHON_PREFIX}_INCLUDE_DIR)
- if ("LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS
+ set (_${_PYTHON_PREFIX}_LIBRARY_REQUIRED TRUE)
+ foreach (_${_PYTHON_PREFIX}_COMPONENT IN ITEMS Module Embed)
+ string (TOUPPER "${_${_PYTHON_PREFIX}_COMPONENT}" _${_PYTHON_PREFIX}_ID)
+ if ("Development.${_${_PYTHON_PREFIX}_COMPONENT}" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
+ AND NOT "LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_${_${_PYTHON_PREFIX}_ID}_ARTIFACTS)
+ set (_${_PYTHON_PREFIX}_LIBRARY_REQUIRED FALSE)
+ endif()
+ endforeach()
+ if (_${_PYTHON_PREFIX}_LIBRARY_REQUIRED
AND NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
# Don't search for include dir if no library was founded
break()
@@ -2939,7 +2981,7 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
set (${_PYTHON_PREFIX}_INCLUDE_DIRS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
if (_${_PYTHON_PREFIX}_INCLUDE_DIR AND NOT EXISTS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
- set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
+ set_property (CACHE _${_PYTHON_PREFIX}_Development_REASON_FAILURE PROPERTY VALUE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
endif()
@@ -3033,7 +3075,7 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
AND ${_PYTHON_PREFIX}_Development.Embed_FOUND)
OR (NOT "Development.Embed" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
AND ${_PYTHON_PREFIX}_Development.Module_FOUND))
- unset (_${_PYTHON_PREFIX}_Development_REASON_FAILURE)
+ unset (_${_PYTHON_PREFIX}_Development_REASON_FAILURE CACHE)
endif()
if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
@@ -3144,7 +3186,7 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
set (${_PYTHON_PREFIX}_NumPy_INCLUDE_DIRS "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
if(_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR AND NOT EXISTS "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
- set (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}\"")
+ set_property (CACHE _${_PYTHON_PREFIX}_NumPy_REASON_FAILURE PROPERTY VALUE "Cannot find the directory \"${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}\"")
set_property (CACHE _${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR-NOTFOUND")
endif()
@@ -3166,7 +3208,7 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
endif()
if (${_PYTHON_PREFIX}_NumPy_FOUND)
- unset (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE)
+ unset (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE CACHE)
# compute and save numpy signature
string (MD5 __${_PYTHON_PREFIX}_NUMPY_SIGNATURE "${_${_PYTHON_PREFIX}_INTERPRETER_SIGNATURE}:${_${_PYTHON_PREFIX}_DEVELOPMENT_MODULE_SIGNATURE}:${${_PYTHON_PREFIX}_NumPyINCLUDE_DIR}")
@@ -3196,7 +3238,7 @@ unset (_${_PYTHON_PREFIX}_REASON_FAILURE)
foreach (_${_PYTHON_PREFIX}_COMPONENT IN ITEMS Interpreter Compiler Development NumPy)
if (_${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_REASON_FAILURE)
string (APPEND _${_PYTHON_PREFIX}_REASON_FAILURE "\n ${_${_PYTHON_PREFIX}_COMPONENT}: ${_${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_REASON_FAILURE}")
- unset (_${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_REASON_FAILURE)
+ unset (_${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_REASON_FAILURE CACHE)
endif()
endforeach()
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 0888fad..268acfe 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -302,7 +302,7 @@ Hints
``Anaconda`` or ``ActivePython``, rely on this implementation.
* ``IronPython``: This implementation use the ``CSharp`` language for
``.NET Framework`` on top of the `Dynamic Language Runtime` (``DLR``).
- See `IronPython <http://ironpython.net>`_.
+ See `IronPython <https://ironpython.net>`_.
* ``PyPy``: This implementation use ``RPython`` language and
``RPython translation toolchain`` to produce the python interpreter.
See `PyPy <https://www.pypy.org>`_.
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index 145c95e..4f198bb 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -239,8 +239,8 @@ Hints
``Python3_FIND_ABI``
.. versionadded:: 3.16
- This variable defines which ABIs, as defined in
- `PEP 3149 <https://www.python.org/dev/peps/pep-3149/>`_, should be searched.
+ This variable defines which ABIs, as defined in :pep:`3149`, should be
+ searched.
.. note::
@@ -361,7 +361,7 @@ Hints
``Anaconda`` or ``ActivePython``, rely on this implementation.
* ``IronPython``: This implementation use the ``CSharp`` language for
``.NET Framework`` on top of the `Dynamic Language Runtime` (``DLR``).
- See `IronPython <http://ironpython.net>`_.
+ See `IronPython <https://ironpython.net>`_.
* ``PyPy``: This implementation use ``RPython`` language and
``RPython translation toolchain`` to produce the python interpreter.
See `PyPy <https://www.pypy.org>`_.
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index a80758d..b14349f 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -369,56 +369,17 @@ if(Ruby_EXECUTABLE AND NOT Ruby_VERSION_MAJOR)
set(Ruby_VERSION_MAJOR 1)
set(Ruby_VERSION_MINOR 9)
endif()
- # check whether we found 2.0.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby2\\.?0")
+ # check whether we found 2.[0-7].x
+ if(${Ruby_EXECUTABLE} MATCHES "ruby2")
set(Ruby_VERSION_MAJOR 2)
- set(Ruby_VERSION_MINOR 0)
+ string(REGEX_REPLACE ${Ruby_EXECUTABLE} "ruby2\\.?([0-7])" "\\1" Ruby_VERSION_MINOR)
endif()
- # check whether we found 2.1.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby2\\.?1")
- set(Ruby_VERSION_MAJOR 2)
- set(Ruby_VERSION_MINOR 1)
- endif()
- # check whether we found 2.2.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby2\\.?2")
- set(Ruby_VERSION_MAJOR 2)
- set(Ruby_VERSION_MINOR 2)
- endif()
- # check whether we found 2.3.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby2\\.?3")
- set(Ruby_VERSION_MAJOR 2)
- set(Ruby_VERSION_MINOR 3)
- endif()
- # check whether we found 2.4.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby2\\.?4")
- set(Ruby_VERSION_MAJOR 2)
- set(Ruby_VERSION_MINOR 4)
- endif()
- # check whether we found 2.5.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby2\\.?5")
- set(Ruby_VERSION_MAJOR 2)
- set(Ruby_VERSION_MINOR 5)
- endif()
- # check whether we found 2.6.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby2\\.?6")
- set(Ruby_VERSION_MAJOR 2)
- set(Ruby_VERSION_MINOR 6)
- endif()
- # check whether we found 2.7.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby2\\.?7")
- set(Ruby_VERSION_MAJOR 2)
- set(Ruby_VERSION_MINOR 7)
- endif()
- # check whether we found 3.0.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby3\\.?0")
- set(Ruby_VERSION_MAJOR 3)
- set(Ruby_VERSION_MINOR 0)
- endif()
- # check whether we found 3.1.x
- if(${Ruby_EXECUTABLE} MATCHES "ruby3\\.?1")
+ # check whether we found 3.[0-1].x
+ if(${Ruby_EXECUTABLE} MATCHES "ruby3")
set(Ruby_VERSION_MAJOR 3)
- set(Ruby_VERSION_MINOR 1)
+ string(REGEX_REPLACE ${Ruby_EXECUTABLE} "ruby3\\.?([0-1])" "\\1" Ruby_VERSION_MINOR)
endif()
+
endif()
if(Ruby_VERSION_MAJOR)
diff --git a/Modules/FindSDL_gfx.cmake b/Modules/FindSDL_gfx.cmake
new file mode 100644
index 0000000..2dd96e9
--- /dev/null
+++ b/Modules/FindSDL_gfx.cmake