From 58664688bb50990e7aa416a6d1ac4939fa589198 Mon Sep 17 00:00:00 2001 From: JinWang An Date: Tue, 27 Dec 2022 17:20:24 +0900 Subject: [PATCH] Imported Upstream version 3.25.0 --- Auxiliary/cmake-mode.el | 42 +- Auxiliary/vim/indent/cmake.vim | 4 +- Auxiliary/vim/syntax/cmake.vim | 10 + CMakeLists.txt | 468 +------- CTestCustom.cmake.in | 6 + CompileFlags.cmake | 17 +- Copyright.txt | 1 + Help/command/FIND_XXX.txt | 26 + Help/command/add_custom_command.rst | 4 +- Help/command/add_custom_target.rst | 2 + Help/command/add_subdirectory.rst | 9 +- Help/command/block.rst | 76 ++ Help/command/build_command.rst | 8 +- Help/command/cmake_language.rst | 28 + Help/command/cmake_policy.rst | 41 + Help/command/continue.rst | 6 +- Help/command/ctest_build.rst | 6 +- Help/command/ctest_run_script.rst | 6 +- Help/command/ctest_start.rst | 2 +- Help/command/ctest_test.rst | 10 +- Help/command/enable_language.rst | 9 +- Help/command/endblock.rst | 11 + Help/command/export.rst | 16 +- Help/command/file.rst | 7 +- Help/command/find_package.rst | 53 +- Help/command/foreach.rst | 8 + Help/command/function.rst | 6 + Help/command/get_test_property.rst | 3 +- Help/command/if.rst | 7 + Help/command/install.rst | 49 +- Help/command/message.rst | 7 +- Help/command/return.rst | 85 +- Help/command/set.rst | 19 +- Help/command/target_compile_definitions.rst | 6 +- Help/command/target_compile_options.rst | 6 +- Help/command/target_include_directories.rst | 6 +- Help/command/target_link_directories.rst | 11 +- Help/command/target_link_libraries.rst | 4 +- Help/command/target_link_options.rst | 6 +- Help/command/target_precompile_headers.rst | 6 +- Help/command/target_sources.rst | 85 +- Help/command/try_compile.rst | 151 ++- Help/command/try_run.rst | 96 +- Help/command/while.rst | 8 + Help/cpack_gen/archive.rst | 6 + Help/cpack_gen/deb.rst | 14 +- Help/cpack_gen/external.rst | 4 +- Help/cpack_gen/freebsd.rst | 12 +- Help/cpack_gen/ifw.rst | 2 +- Help/cpack_gen/nsis.rst | 31 + Help/cpack_gen/nuget.rst | 20 +- Help/cpack_gen/rpm.rst | 4 +- Help/cpack_gen/wix.rst | 2 +- Help/dev/experimental.rst | 30 +- Help/envvar/ASM_DIALECTFLAGS.rst | 19 +- Help/envvar/CFLAGS.rst | 11 +- Help/envvar/CMAKE_GENERATOR.rst | 6 +- Help/envvar/CMAKE_GENERATOR_PLATFORM.rst | 2 +- Help/envvar/CMAKE_GENERATOR_TOOLSET.rst | 2 +- Help/envvar/CSFLAGS.rst | 11 +- Help/envvar/CTEST_PROGRESS_OUTPUT.rst | 4 +- Help/envvar/CUDAFLAGS.rst | 11 +- Help/envvar/CXXFLAGS.rst | 11 +- Help/envvar/DESTDIR.rst | 5 +- Help/envvar/FFLAGS.rst | 11 +- Help/envvar/HIPFLAGS.rst | 11 +- Help/envvar/ISPCFLAGS.rst | 11 +- Help/envvar/LANG_FLAGS.txt | 6 + Help/envvar/RCFLAGS.rst | 11 +- Help/envvar/SSL_CERT_DIR.rst | 9 + Help/envvar/SSL_CERT_FILE.rst | 9 + Help/generator/Green Hills MULTI.rst | 12 +- Help/generator/Ninja Multi-Config.rst | 4 +- Help/generator/Visual Studio 10 2010.rst | 54 +- Help/generator/Visual Studio 11 2012.rst | 13 +- Help/generator/Visual Studio 12 2013.rst | 4 +- Help/generator/Visual Studio 14 2015.rst | 4 +- Help/generator/Visual Studio 15 2017.rst | 4 +- Help/generator/Visual Studio 16 2019.rst | 4 +- Help/generator/Visual Studio 17 2022.rst | 4 +- Help/generator/Visual Studio 9 2008.rst | 2 +- Help/generator/Xcode.rst | 14 +- Help/guide/ide-integration/index.rst | 17 +- Help/guide/tutorial/A Basic Starting Point.rst | 468 ++++++-- .../guide/tutorial/Adding Export Configuration.rst | 2 +- .../tutorial/Adding Generator Expressions.rst | 294 ++++- .../Adding Support for a Testing Dashboard.rst | 20 +- .../guide/tutorial/Adding System Introspection.rst | 12 +- .../Adding Usage Requirements for a Library.rst | 151 ++- .../Adding a Custom Command and Generated File.rst | 14 +- Help/guide/tutorial/Adding a Library.rst | 465 +++++-- Help/guide/tutorial/Complete/CMakeLists.txt | 3 +- Help/guide/tutorial/Complete/License.txt | 2 +- .../tutorial/Complete/MathFunctions/CMakeLists.txt | 3 +- Help/guide/tutorial/Installing and Testing.rst | 330 ++++- .../guide/tutorial/Packaging Debug and Release.rst | 8 +- Help/guide/tutorial/Packaging an Installer.rst | 10 +- .../Selecting Static or Shared Libraries.rst | 14 +- Help/guide/tutorial/Step1/CMakeLists.txt | 16 + Help/guide/tutorial/Step1/TutorialConfig.h.in | 2 + Help/guide/tutorial/Step1/tutorial.cxx | 7 +- Help/guide/tutorial/Step10/CMakeLists.txt | 33 +- Help/guide/tutorial/Step10/License.txt | 2 +- .../tutorial/Step10/MathFunctions/CMakeLists.txt | 71 +- .../tutorial/Step10/MathFunctions/MathFunctions.h | 15 +- .../guide/tutorial/Step10/MathFunctions/mysqrt.cxx | 4 - Help/guide/tutorial/Step10/TutorialConfig.h.in | 1 + Help/guide/tutorial/Step10/tutorial.cxx | 15 +- Help/guide/tutorial/Step11/CMakeLists.txt | 6 +- Help/guide/tutorial/Step11/License.txt | 2 +- .../tutorial/Step11/MathFunctions/CMakeLists.txt | 5 +- Help/guide/tutorial/Step11/tutorial.cxx | 1 + Help/guide/tutorial/Step12/CMakeLists.txt | 3 +- Help/guide/tutorial/Step12/License.txt | 2 +- .../tutorial/Step12/MathFunctions/CMakeLists.txt | 3 +- Help/guide/tutorial/Step2/CMakeLists.txt | 23 + .../tutorial/Step2/MathFunctions/CMakeLists.txt | 2 + Help/guide/tutorial/Step2/TutorialConfig.h.in | 2 + Help/guide/tutorial/Step2/tutorial.cxx | 8 + Help/guide/tutorial/Step3/CMakeLists.txt | 4 + .../tutorial/Step3/MathFunctions/CMakeLists.txt | 4 + Help/guide/tutorial/Step4/CMakeLists.txt | 26 + .../tutorial/Step4/MathFunctions/CMakeLists.txt | 2 + Help/guide/tutorial/Step5/CMakeLists.txt | 64 +- .../tutorial/Step5/MathFunctions/CMakeLists.txt | 13 +- Help/guide/tutorial/Step6/CMakeLists.txt | 17 +- Help/guide/tutorial/Step6/CTestConfig.cmake | 7 + .../tutorial/Step6/MathFunctions/CMakeLists.txt | 30 +- .../tutorial/Step6/MathFunctions/MakeTable.cxx | 25 - Help/guide/tutorial/Step6/MathFunctions/mysqrt.cxx | 8 - Help/guide/tutorial/Step7/CMakeLists.txt | 19 +- Help/guide/tutorial/Step7/CTestConfig.cmake | 7 + Help/guide/tutorial/Step7/License.txt | 2 - .../tutorial/Step7/MathFunctions/CMakeLists.txt | 29 +- .../tutorial/Step7/MathFunctions/MakeTable.cxx | 25 - Help/guide/tutorial/Step7/MathFunctions/mysqrt.cxx | 9 - Help/guide/tutorial/Step8/CMakeLists.txt | 28 +- Help/guide/tutorial/Step8/License.txt | 2 - .../tutorial/Step8/MathFunctions/CMakeLists.txt | 52 +- Help/guide/tutorial/Step8/MathFunctions/mysqrt.cxx | 17 +- Help/guide/tutorial/Step9/CMakeLists.txt | 24 +- Help/guide/tutorial/Step9/License.txt | 2 +- .../tutorial/Step9/MathFunctions/CMakeLists.txt | 11 +- .../tutorial/Step9/MathFunctions/MathFunctions.cxx | 19 - Help/guide/tutorial/Step9/MathFunctions/mysqrt.h | 6 - Help/guide/tutorial/index.rst | 4 +- Help/guide/user-interaction/index.rst | 107 +- Help/manual/OPTIONS_BUILD.txt | 103 +- Help/manual/OPTIONS_HELP.txt | 68 +- Help/manual/ccmake.1.rst | 4 +- Help/manual/cmake-buildsystem.7.rst | 8 +- Help/manual/cmake-commands.7.rst | 2 + Help/manual/cmake-env-variables.7.rst | 2 + Help/manual/cmake-generator-expressions.7.rst | 38 +- Help/manual/cmake-generators.7.rst | 16 +- Help/manual/cmake-gui.1.rst | 16 +- Help/manual/cmake-language.7.rst | 2 +- Help/manual/cmake-modules.7.rst | 2 + Help/manual/cmake-policies.7.rst | 10 + Help/manual/cmake-presets.7.rst | 606 +++++----- Help/manual/cmake-properties.7.rst | 24 +- Help/manual/cmake-qt.7.rst | 2 +- Help/manual/cmake-toolchains.7.rst | 72 +- Help/manual/cmake-variables.7.rst | 48 +- Help/manual/cmake.1.rst | 533 ++++++--- Help/manual/cpack.1.rst | 52 +- Help/manual/ctest.1.rst | 465 ++++--- Help/manual/presets/example.json | 34 +- Help/manual/presets/schema.json | 405 ++++++- Help/module/FindOpenSP.rst | 1 + Help/module/FindSDL_gfx.rst | 1 + Help/policy/CMP0058.rst | 5 +- Help/policy/CMP0140.rst | 17 + Help/policy/CMP0141.rst | 55 + Help/policy/CMP0142.rst | 27 + Help/prop_dir/SYSTEM.rst | 10 + Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst | 5 + Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 125 +- Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst | 2 +- Help/prop_test/FIXTURES_REQUIRED.rst | 9 +- Help/prop_test/LABELS.rst | 2 +- Help/prop_tgt/COMPILE_WARNING_AS_ERROR.rst | 8 +- Help/prop_tgt/CONFIG_POSTFIX.rst | 10 +- Help/prop_tgt/CUDA_STANDARD.rst | 6 + Help/prop_tgt/CXX_MODULE_DIRS.rst | 19 + Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst | 19 + Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS.rst | 19 + Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS_NAME.rst | 21 + Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET.rst | 20 + Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SETS.rst | 20 + Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET_NAME.rst | 21 + Help/prop_tgt/CXX_MODULE_SET.rst | 20 + Help/prop_tgt/CXX_MODULE_SETS.rst | 18 + Help/prop_tgt/CXX_MODULE_SET_NAME.rst | 20 + Help/prop_tgt/CXX_STANDARD.rst | 6 + Help/prop_tgt/EXPORT_NO_SYSTEM.rst | 11 + Help/prop_tgt/HIP_STANDARD.rst | 6 + Help/prop_tgt/IMPORTED_NO_SYSTEM.rst | 12 +- .../INTERFACE_CXX_MODULE_HEADER_UNIT_SETS.rst | 18 + Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst | 18 + Help/prop_tgt/LANG_CLANG_TIDY.rst | 18 +- Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst | 5 + .../MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt | 16 + Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst | 33 + Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt | 5 +- Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst | 4 +- Help/prop_tgt/OBJCXX_STANDARD.rst | 6 + Help/prop_tgt/SYSTEM.rst | 22 + Help/prop_tgt/VS_DEBUGGER_COMMAND.rst | 2 +- Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst | 2 +- Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst | 2 +- Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst | 2 +- Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst | 2 +- Help/prop_tgt/VS_KEYWORD.rst | 2 +- Help/prop_tgt/XCODE_GENERATE_SCHEME.rst | 4 + .../XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst | 14 + .../XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst | 14 + .../prop_tgt/XCODE_SCHEME_LAUNCH_CONFIGURATION.rst | 13 + Help/prop_tgt/XCODE_SCHEME_LAUNCH_MODE.rst | 22 + Help/release/3.0.rst | 2 +- Help/release/3.11.rst | 2 +- Help/release/3.12.rst | 4 +- Help/release/3.20.rst | 6 +- Help/release/3.21.rst | 14 +- Help/release/3.23.rst | 11 +- Help/release/3.24.rst | 36 +- Help/release/3.25.rst | 240 ++++ Help/release/3.3.rst | 2 +- Help/release/3.4.rst | 2 +- Help/release/3.7.rst | 2 +- Help/release/index.rst | 1 + Help/variable/BSD.rst | 7 + Help/variable/CMAKE_ANDROID_API.rst | 7 +- Help/variable/CMAKE_BINARY_DIR.rst | 2 +- Help/variable/CMAKE_CFG_INTDIR.rst | 2 +- Help/variable/CMAKE_COMMAND.rst | 2 +- Help/variable/CMAKE_CPACK_COMMAND.rst | 6 +- Help/variable/CMAKE_CTEST_COMMAND.rst | 6 +- Help/variable/CMAKE_CURRENT_BINARY_DIR.rst | 2 +- Help/variable/CMAKE_CURRENT_SOURCE_DIR.rst | 2 +- .../CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst | 2 +- Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst | 2 +- Help/variable/CMAKE_FIND_DEBUG_MODE.rst | 2 +- Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst | 2 +- Help/variable/CMAKE_GENERATOR.rst | 2 +- Help/variable/CMAKE_GENERATOR_PLATFORM.rst | 2 +- Help/variable/CMAKE_GENERATOR_TOOLSET.rst | 2 +- Help/variable/CMAKE_HOST_BSD.rst | 7 + Help/variable/CMAKE_HOST_LINUX.rst | 6 + Help/variable/CMAKE_INSTALL_PREFIX.rst | 5 +- Help/variable/CMAKE_LANG_COMPILER.rst | 3 +- Help/variable/CMAKE_LANG_COMPILER_ID.rst | 93 +- Help/variable/CMAKE_LANG_FLAGS.rst | 10 +- Help/variable/CMAKE_MAKE_PROGRAM.rst | 4 +- Help/variable/CMAKE_MESSAGE_CONTEXT.rst | 2 +- Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst | 10 +- .../CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst | 36 + Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst | 7 +- Help/variable/CMAKE_SCRIPT_MODE_FILE.rst | 4 +- Help/variable/CMAKE_SOURCE_DIR.rst | 2 +- Help/variable/CMAKE_TASKING_TOOLSET.rst | 34 + Help/variable/CMAKE_VS_DEVENV_COMMAND.rst | 2 +- Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst | 2 +- Help/variable/CMAKE_WARN_DEPRECATED.rst | 3 +- Help/variable/CMAKE_XCODE_PLATFORM_TOOLSET.rst | 4 +- ...MAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst | 13 + ...E_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst | 13 + .../CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION.rst | 12 + Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_MODE.rst | 13 + Help/variable/CPACK_CUSTOM_INSTALL_VARIABLES.rst | 2 +- Help/variable/CTEST_CONFIGURATION_TYPE.rst | 2 +- Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst | 2 +- Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt | 9 +- Help/variable/LINUX.rst | 6 + Modules/CMakeCXXCompilerId.cpp.in | 1 + Modules/CMakeCompilerIdDetection.cmake | 1 + Modules/CMakeDependentOption.cmake | 2 +- Modules/CMakeDetermineASMCompiler.cmake | 7 +- Modules/CMakeDetermineCSharpCompiler.cmake | 2 +- Modules/CMakeDetermineCUDACompiler.cmake | 5 +- Modules/CMakeDetermineCompileFeatures.cmake | 19 + Modules/CMakeDetermineCompilerABI.cmake | 10 +- Modules/CMakeDetermineCompilerId.cmake | 10 +- Modules/CMakeDetermineFortranCompiler.cmake | 36 +- Modules/CMakeDetermineHIPCompiler.cmake | 1 + Modules/CMakeDetermineVSServicePack.cmake | 6 +- Modules/CMakeFindBinUtils.cmake | 2 +- Modules/CMakeFindFrameworks.cmake | 9 +- Modules/CMakeHIPInformation.cmake | 2 +- Modules/CMakeParseImplicitLinkInfo.cmake | 7 +- Modules/CMakePlatformId.h.in | 24 + Modules/CMakeSwiftInformation.cmake | 2 +- Modules/CMakeSystemSpecificInformation.cmake | 2 + Modules/CMakeTestCCompiler.cmake | 7 +- Modules/CMakeTestCSharpCompiler.cmake | 18 +- Modules/CMakeTestCUDACompiler.cmake | 7 +- Modules/CMakeTestCXXCompiler.cmake | 11 +- Modules/CMakeTestFortranCompiler.cmake | 14 +- Modules/CMakeTestHIPCompiler.cmake | 7 +- Modules/CMakeTestOBJCCompiler.cmake | 7 +- Modules/CMakeTestOBJCXXCompiler.cmake | 7 +- Modules/CMakeTestSwiftCompiler.cmake | 8 +- Modules/CPack.cmake | 55 +- Modules/CPackComponent.cmake | 2 +- Modules/CPackIFW.cmake | 44 +- Modules/CTest.cmake | 2 +- Modules/CTestTargets.cmake | 2 +- Modules/CTestUseLaunchers.cmake | 7 +- Modules/CheckCXXSymbolExists.cmake | 2 +- Modules/CheckFortranFunctionExists.cmake | 7 +- Modules/CheckFunctionExists.cmake | 8 +- Modules/CheckIPOSupported.cmake | 46 +- Modules/CheckIncludeFile.cmake | 7 +- Modules/CheckIncludeFileCXX.cmake | 7 +- Modules/CheckIncludeFiles.cmake | 17 +- Modules/CheckLibraryExists.cmake | 8 +- Modules/CheckPrototypeDefinition.cmake | 9 +- Modules/CheckSymbolExists.cmake | 28 +- Modules/CheckTypeSize.cmake | 12 +- Modules/CheckVariableExists.cmake | 3 +- Modules/Compiler/Clang-CUDA.cmake | 4 + Modules/Compiler/Clang.cmake | 3 +- Modules/Compiler/IAR-CXX.cmake | 4 +- Modules/Compiler/IntelLLVM-FindBinUtils.cmake | 45 + Modules/Compiler/IntelLLVM.cmake | 21 +- Modules/Compiler/MSVC-CXX.cmake | 13 + Modules/Compiler/NVIDIA-CUDA.cmake | 24 +- Modules/Compiler/Tasking-ASM.cmake | 7 + Modules/Compiler/Tasking-C.cmake | 47 + Modules/Compiler/Tasking-CXX.cmake | 31 + Modules/Compiler/Tasking-DetermineCompiler.cmake | 10 + Modules/Compiler/Tasking-FindBinUtils.cmake | 18 + Modules/Compiler/Tasking.cmake | 54 + Modules/ExternalProject.cmake | 23 +- Modules/ExternalProject/gitupdate.cmake.in | 38 +- Modules/FetchContent.cmake | 26 +- Modules/FindAVIFile.cmake | 2 +- Modules/FindBLAS.cmake | 13 +- Modules/FindBacktrace.cmake | 2 +- Modules/FindCUDA.cmake | 4 +- Modules/FindCUDA/select_compute_arch.cmake | 4 +- Modules/FindCUDAToolkit.cmake | 80 ++ Modules/FindCURL.cmake | 5 +- Modules/FindCoin3D.cmake | 4 +- Modules/FindCxxTest.cmake | 2 +- Modules/FindDCMTK.cmake | 11 +- Modules/FindDevIL.cmake | 2 +- Modules/FindDoxygen.cmake | 60 +- Modules/FindGDAL.cmake | 2 +- Modules/FindGLEW.cmake | 27 +- Modules/FindGLUT.cmake | 74 +- Modules/FindGTK2.cmake | 1 + Modules/FindHDF5.cmake | 6 +- Modules/FindICU.cmake | 12 +- Modules/FindLAPACK.cmake | 14 +- Modules/FindLTTngUST.cmake | 2 +- Modules/FindLibArchive.cmake | 3 + Modules/FindMFC.cmake | 12 +- Modules/FindMPI.cmake | 156 +-- Modules/FindMatlab.cmake | 26 +- Modules/FindOpenACC.cmake | 47 +- Modules/FindOpenAL.cmake | 26 + Modules/FindOpenGL.cmake | 2 +- Modules/FindOpenMP.cmake | 108 +- Modules/FindOpenSP.cmake | 155 +++ Modules/FindOpenSSL.cmake | 24 +- Modules/FindPackageHandleStandardArgs.cmake | 22 +- Modules/FindPython.cmake | 6 +- Modules/FindPython/Support.cmake | 274 +++-- Modules/FindPython2.cmake | 2 +- Modules/FindPython3.cmake | 6 +- Modules/FindRuby.cmake | 53 +- Modules/FindSDL_gfx.cmake | 86 ++ Modules/FindSDL_image.cmake | 4 - Modules/FindSDL_mixer.cmake | 4 - Modules/FindSDL_net.cmake | 4 - Modules/FindSDL_sound.cmake | 31 +- Modules/FindSDL_ttf.cmake | 4 - Modules/FindSWIG.cmake | 2 +- Modules/FindThreads.cmake | 8 +- Modules/FindVulkan.cmake | 117 ++ Modules/FindXCTest.cmake | 2 +- Modules/FindwxWindows.cmake | 3 +- Modules/FortranCInterface.cmake | 8 +- Modules/FortranCInterface/Detect.cmake | 8 +- Modules/GoogleTest.cmake | 6 +- Modules/Internal/CPack/CPackDeb.cmake | 30 +- Modules/Internal/CPack/CPackRPM.cmake | 6 +- Modules/Internal/CheckSourceCompiles.cmake | 6 +- Modules/Internal/CheckSourceRuns.cmake | 6 +- Modules/Internal/FeatureTesting.cmake | 9 +- Modules/Platform/AIX-GNU.cmake | 4 +- Modules/Platform/AIX-XL.cmake | 4 +- Modules/Platform/AIX/ExportImportList | 46 +- Modules/Platform/DragonFly.cmake | 1 + Modules/Platform/FreeBSD.cmake | 1 + Modules/Platform/Linux-IntelLLVM.cmake | 26 - Modules/Platform/Linux-NVHPC.cmake | 16 +- Modules/Platform/Linux.cmake | 12 +- Modules/Platform/NetBSD.cmake | 1 + Modules/Platform/OpenBSD.cmake | 1 + Modules/Platform/SerenityOS-Clang-ASM.cmake | 2 + Modules/Platform/SerenityOS-Clang-C.cmake | 2 + Modules/Platform/SerenityOS-Clang-CXX.cmake | 2 + Modules/Platform/SerenityOS-GNU-ASM.cmake | 2 + Modules/Platform/SerenityOS-GNU-C.cmake | 2 + Modules/Platform/SerenityOS-GNU-CXX.cmake | 2 + Modules/Platform/SerenityOS-GNU.cmake | 24 + Modules/Platform/SerenityOS.cmake | 12 + Modules/Platform/Windows-Clang-HIP.cmake | 19 + Modules/Platform/Windows-Clang.cmake | 85 +- Modules/Platform/Windows-Intel-C.cmake | 11 +- Modules/Platform/Windows-Intel-CXX.cmake | 11 +- Modules/Platform/Windows-Intel-Fortran.cmake | 2 + Modules/Platform/Windows-IntelLLVM-Fortran.cmake | 2 + Modules/Platform/Windows-IntelLLVM.cmake | 51 +- Modules/Platform/Windows-MSVC.cmake | 21 +- Modules/Platform/Windows-NVIDIA-CUDA.cmake | 14 +- Modules/Platform/Windows.cmake | 4 +- Modules/Platform/kFreeBSD.cmake | 3 +- Modules/TestBigEndian.cmake | 18 +- Modules/TestCXXAcceptsFlag.cmake | 3 +- Modules/TestForANSIForScope.cmake | 4 +- Modules/TestForSSTREAM.cmake | 4 +- Modules/TestForSTDNamespace.cmake | 4 +- Modules/UseJava.cmake | 2 +- Modules/UseSWIG.cmake | 4 + Source/CMakeLists.txt | 542 +++++---- Source/CMakeVersion.cmake | 14 +- Source/CPack/cmCPackArchiveGenerator.cxx | 12 + Source/CPack/cmCPackConfigure.h.in | 5 + Source/CPack/cmCPackDragNDropGenerator.cxx | 7 +- Source/CPack/cmCPackFreeBSDGenerator.cxx | 54 +- Source/CPack/cmCPackGeneratorFactory.cxx | 8 +- Source/CPack/cmCPackGeneratorFactory.h | 2 + Source/CPack/cmCPackNSISGenerator.cxx | 34 +- Source/CPack/cpack.cxx | 171 ++- Source/CTest/cmCTestCoverageCommand.cxx | 12 +- Source/CTest/cmCTestCoverageCommand.h | 6 +- Source/CTest/cmCTestHandlerCommand.cxx | 20 +- Source/CTest/cmCTestHandlerCommand.h | 5 +- Source/CTest/cmCTestMemCheckHandler.cxx | 21 +- Source/CTest/cmCTestRunTest.cxx | 146 +-- Source/CTest/cmCTestSubmitCommand.cxx | 65 +- Source/CTest/cmCTestSubmitCommand.h | 13 +- Source/CTest/cmCTestUploadCommand.cxx | 2 +- Source/CTest/cmCTestUploadCommand.h | 5 +- Source/CursesDialog/cmCursesLongMessageForm.cxx | 2 +- Source/CursesDialog/form/CMakeLists.txt | 2 +- Source/CursesDialog/form/fty_int.c | 2 +- Source/CursesDialog/form/fty_num.c | 2 +- Source/LexerParser/cmFortranLexer.cxx | 377 +++--- Source/LexerParser/cmFortranLexer.in.l | 16 +- Source/LexerParser/cmFortranParser.cxx | 324 +++-- Source/LexerParser/cmFortranParser.y | 18 +- Source/Modules/CMakeBuildUtilities.cmake | 379 ++++++ Source/QtDialog/CMakeLists.txt | 88 +- Source/QtDialog/FirstConfigure.cxx | 3 +- Source/cmAddSubDirectoryCommand.cxx | 12 +- Source/cmArgumentParser.cxx | 186 ++- Source/cmArgumentParser.h | 400 ++++++- Source/cmArgumentParserTypes.h | 69 ++ Source/cmBlockCommand.cxx | 197 +++ Source/cmBlockCommand.h | 14 + Source/cmCMakeHostSystemInformationCommand.cxx | 12 +- Source/cmCMakeLanguageCommand.cxx | 35 +- Source/cmCMakePathCommand.cxx | 134 +-- Source/cmCMakePresetsGraph.cxx | 310 ++++- Source/cmCMakePresetsGraph.h | 112 +- Source/cmCMakePresetsGraphInternal.h | 8 + Source/cmCMakePresetsGraphReadJSON.cxx | 92 +- .../cmCMakePresetsGraphReadJSONPackagePresets.cxx | 95 ++ Source/cmCMakePresetsGraphReadJSONTestPresets.cxx | 2 + .../cmCMakePresetsGraphReadJSONWorkflowPresets.cxx | 95 ++ Source/cmCTest.cxx | 18 +- Source/cmCTest.h | 3 + Source/cmCommands.cxx | 16 +- Source/cmCommonTargetGenerator.cxx | 4 + Source/cmComputeLinkInformation.cxx | 48 +- Source/cmConfigure.cmake.h.in | 13 + Source/cmCoreTryCompile.cxx | 937 ++++++++------- Source/cmCoreTryCompile.h | 89 +- Source/cmCreateTestSourceList.cxx | 4 +- Source/cmCurl.cxx | 11 + Source/cmCxxModuleMapper.cxx | 308 +++++ Source/cmCxxModuleMapper.h | 85 ++ Source/cmDefinePropertyCommand.cxx | 5 +- Source/cmDocumentation.cxx | 42 +- Source/cmExecuteProcessCommand.cxx | 12 +- Source/cmExecutionStatus.h | 17 +- Source/cmExperimental.cxx | 63 + Source/cmExperimental.h | 21 + Source/cmExportBuildFileGenerator.cxx | 98 ++ Source/cmExportBuildFileGenerator.h | 16 + Source/cmExportCommand.cxx | 23 +- Source/cmExportFileGenerator.cxx | 33 +- Source/cmExportFileGenerator.h | 5 + Source/cmExportInstallAndroidMKGenerator.cxx | 3 +- Source/cmExportInstallFileGenerator.cxx | 113 +- Source/cmExportInstallFileGenerator.h | 25 + Source/cmExportTryCompileFileGenerator.h | 3 + Source/cmFileAPICodemodel.cxx | 16 + Source/cmFileCommand.cxx | 434 +++---- Source/cmFileCopier.cxx | 44 +- Source/cmFindBase.cxx | 62 +- Source/cmFindBase.h | 7 + Source/cmFindLibraryCommand.cxx | 33 +- Source/cmFindPackageCommand.cxx | 1265 +++++++++----------- Source/cmFindPackageCommand.h | 2 - Source/cmFindPathCommand.cxx | 6 +- Source/cmFindProgramCommand.cxx | 12 +- Source/cmForEachCommand.cxx | 2 +- Source/cmFunctionBlocker.cxx | 18 +- Source/cmFunctionBlocker.h | 2 + Source/cmFunctionCommand.cxx | 1 + Source/cmGeneratedFileStream.cxx | 18 +- Source/cmGeneratedFileStream.h | 10 +- Source/cmGeneratorTarget.cxx | 147 ++- Source/cmGeneratorTarget.h | 35 +- Source/cmGhsMultiTargetGenerator.cxx | 4 +- Source/cmGlobalGenerator.cxx | 19 +- Source/cmGlobalGenerator.h | 57 +- Source/cmGlobalNinjaGenerator.cxx | 546 ++++++++- Source/cmGlobalNinjaGenerator.h | 4 +- Source/cmGlobalVisualStudio10Generator.cxx | 200 +--- Source/cmGlobalVisualStudio10Generator.h | 17 +- Source/cmGlobalVisualStudio11Generator.cxx | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 33 +- Source/cmGlobalVisualStudio7Generator.h | 2 + Source/cmGlobalVisualStudioGenerator.cxx | 13 +- Source/cmGlobalVisualStudioGenerator.h | 1 - Source/cmGlobalVisualStudioVersionedGenerator.cxx | 48 +- Source/cmGlobalXCodeGenerator.cxx | 220 ++-- Source/cmGlobalXCodeGenerator.h | 7 +- Source/cmIfCommand.cxx | 2 +- Source/cmInstallCommand.cxx | 157 ++- Source/cmInstallCommandArguments.h | 5 +- Source/cmInstallCxxModuleBmiGenerator.cxx | 75 ++ Source/cmInstallCxxModuleBmiGenerator.h | 52 + Source/cmInstallExportGenerator.cxx | 73 +- Source/cmInstallExportGenerator.h | 8 +- Source/cmLinkLineDeviceComputer.cxx | 21 +- Source/cmLinkLineDeviceComputer.h | 1 + Source/cmListFileCache.cxx | 11 + Source/cmLocalGenerator.cxx | 104 +- Source/cmLocalGenerator.h | 17 +- Source/cmLocalNinjaGenerator.cxx | 26 +- Source/cmLocalUnixMakefileGenerator3.cxx | 37 +- Source/cmLocalVisualStudio10Generator.h | 4 +- Source/cmLocalVisualStudio7Generator.cxx | 7 +- Source/cmMacroCommand.cxx | 2 +- Source/cmMakefile.cxx | 105 +- Source/cmMakefile.h | 22 +- Source/cmMakefileExecutableTargetGenerator.cxx | 27 +- Source/cmMakefileLibraryTargetGenerator.cxx | 25 +- Source/cmMakefileTargetGenerator.cxx | 136 ++- Source/cmMakefileTargetGenerator.h | 20 +- Source/cmMessageCommand.cxx | 65 +- Source/cmMessageType.h | 16 + Source/cmNinjaNormalTargetGenerator.cxx | 22 +- Source/cmNinjaTargetGenerator.cxx | 327 ++++- Source/cmOutputConverter.cxx | 7 + Source/cmParseArgumentsCommand.cxx | 17 +- Source/cmPolicies.h | 15 +- Source/cmQtAutoGenInitializer.cxx | 25 +- Source/cmQtAutoGenInitializer.h | 2 + Source/cmReturnCommand.cxx | 44 +- Source/cmScanDepFormat.cxx | 15 + Source/cmScanDepFormat.h | 5 + Source/cmScriptGenerator.cxx | 2 +- Source/cmSetPropertyCommand.cxx | 4 +- Source/cmStandardLevelResolver.cxx | 35 +- Source/cmState.cxx | 21 +- Source/cmStatePrivate.h | 2 +- Source/cmStateSnapshot.cxx | 29 +- Source/cmStringCommand.cxx | 5 +- Source/cmSubdirCommand.cxx | 4 +- Source/cmSystemTools.cxx | 289 ++++- Source/cmSystemTools.h | 74 +- Source/cmTarget.cxx | 125 +- Source/cmTarget.h | 10 +- Source/cmTargetCompileDefinitionsCommand.cxx | 4 +- Source/cmTargetExport.h | 2 + Source/cmTargetIncludeDirectoriesCommand.cxx | 3 +- Source/cmTargetLinkLibrariesCommand.cxx | 8 +- Source/cmTargetPrecompileHeadersCommand.cxx | 4 +- Source/cmTargetSourcesCommand.cxx | 47 +- Source/cmTryCompileCommand.cxx | 61 +- Source/cmTryCompileCommand.h | 30 +- Source/cmTryRunCommand.cxx | 355 ++++-- Source/cmTryRunCommand.h | 44 +- Source/cmVisualStudio10TargetGenerator.cxx | 106 +- Source/cmVisualStudio10TargetGenerator.h | 1 + Source/cmVisualStudioGeneratorOptions.cxx | 92 +- Source/cmWhileCommand.cxx | 2 +- Source/cmWindowsRegistry.h | 2 + Source/cmXCodeScheme.cxx | 34 +- Source/cm_codecvt.cxx | 6 + Source/cm_codecvt.hxx | 3 +- Source/cmake.cxx | 297 ++++- Source/cmake.h | 54 +- Source/cmake.version.manifest | 2 +- Source/cmakemain.cxx | 104 +- Source/cmcldeps.cxx | 1 + Source/cmcmd.cxx | 84 +- Source/kwsys/Directory.cxx | 39 +- Source/kwsys/SystemTools.cxx | 103 +- Templates/MSBuild/FlagTables/v10_CSharp.json | 6 +- Templates/MSBuild/FlagTables/v10_Cuda.json | 112 -- Templates/MSBuild/FlagTables/v11_CSharp.json | 6 +- Templates/MSBuild/FlagTables/v12_CSharp.json | 6 +- Templates/MSBuild/FlagTables/v140_CSharp.json | 6 +- Templates/MSBuild/FlagTables/v141_CSharp.json | 6 +- Templates/MSBuild/FlagTables/v142_CSharp.json | 6 +- Templates/MSBuild/FlagTables/v143_CSharp.json | 6 +- Tests/Assembler/CMakeLists.txt | 6 + Tests/CMakeLib/CMakeLists.txt | 6 +- Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt | 6 +- Tests/CMakeLib/testArgumentParser.cxx | 340 +++++- Tests/CMakeLib/testCMExtEnumSet.cxx | 9 + Tests/CMakeLists.txt | 392 +++--- Tests/CMakeOnly/AllFindModules/CMakeLists.txt | 13 +- Tests/CMakeTests/CMakeLists.txt | 15 - Tests/CMakeTests/CheckSourceTreeTest.cmake.in | 365 ------ Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in | 89 +- Tests/CTestCoverageCollectGCOV/test.cmake.in | 5 +- Tests/CTestTestFdSetSize/sleep.c | 14 +- Tests/CTestUpdateCommon.cmake | 6 +- Tests/CTestUpdateP4.cmake.in | 6 +- Tests/CheckSourceTree/CMakeLists.txt | 6 + Tests/CheckSourceTree/check.cmake | 22 + Tests/CheckSwift.cmake | 2 + Tests/CompileFeatures/CMakeLists.txt | 1 + Tests/CompileFeatures/genex_test.cpp | 3 + Tests/Complex/CMakeLists.txt | 8 + Tests/Complex/Executable/complex.cxx | 2 +- Tests/ComplexOneConfig/CMakeLists.txt | 8 + Tests/ComplexOneConfig/Executable/complex.cxx | 2 +- Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt | 5 +- Tests/CudaOnly/CMakeLists.txt | 25 +- Tests/CudaOnly/DeviceLTO/CMakeLists.txt | 37 + Tests/CudaOnly/DeviceLTO/file1.cu | 17 + Tests/CudaOnly/DeviceLTO/file2.cu | 5 + Tests/CudaOnly/DeviceLTO/file3.cu | 4 + Tests/CudaOnly/DeviceLTO/main.cu | 62 + Tests/CudaOnly/ToolkitMultipleDirs/CMakeLists.txt | 22 + Tests/CudaOnly/ToolkitMultipleDirs/main.cu | 8 + .../ToolkitMultipleDirs/subdir/CMakeLists.txt | 2 + Tests/EnforceConfig.cmake.in | 4 +- Tests/ExportImport/Export/CMakeLists.txt | 11 + Tests/ExportImport/Import/A/CMakeLists.txt | 14 +- Tests/ExternalProject/CMakeLists.txt | 6 +- Tests/FindOpenAL/CMakeLists.txt | 10 + Tests/FindOpenAL/Test/CMakeLists.txt | 14 + Tests/FindOpenAL/Test/main.cxx | 13 + Tests/FindOpenSP/CMakeLists.txt | 10 + Tests/FindOpenSP/Test/CMakeLists.txt | 16 + Tests/FindOpenSP/Test/main.cxx | 55 + Tests/FindOpenSP/Test/test.sgml | 7 + Tests/FindPackageTest/CMakeLists.txt | 2 +- Tests/FindVulkan/Test/CMakeLists.txt | 20 + Tests/FindVulkan/Test/Run-dxc_exe.cmake | 20 + Tests/FindVulkan/Test/main-dxc_lib.cxx | 23 + Tests/FindVulkan/Test/main-volk.cxx | 14 + Tests/FortranModules/Submodules/CMakeLists.txt | 1 + Tests/FortranModules/Submodules/main.f90 | 7 +- .../Submodules/obfuscated_parent.f90 | 33 + Tests/FortranModules/test_module_main.f90 | 2 +- Tests/FunctionTest/CMakeLists.txt | 4 +- Tests/IncludeDirectories/CMakeLists.txt | 54 + Tests/LoadCommand/CMakeCommands/cmTestCommand.c | 17 +- .../CMakeCommands/cmTestCommand.c | 17 +- Tests/MSVCDebugInformationFormat/CMakeLists.txt | 81 ++ Tests/MSVCDebugInformationFormat/override-C.cmake | 7 + .../MSVCDebugInformationFormat/override-CUDA.cmake | 6 + .../MSVCDebugInformationFormat/override-CXX.cmake | 7 + .../override-Fortran.cmake | 4 + Tests/MSVCDebugInformationFormat/verify.F90 | 1 + Tests/MSVCDebugInformationFormat/verify.c | 1 + Tests/MSVCDebugInformationFormat/verify.cu | 1 + Tests/MSVCDebugInformationFormat/verify.cxx | 1 + Tests/MSVCDebugInformationFormat/verify.h | 29 + Tests/Module/CheckIPOSupported-CUDA/CMakeLists.txt | 32 + Tests/Module/CheckIPOSupported-CUDA/bar.cu | 12 + Tests/Module/CheckIPOSupported-CUDA/foo.cu | 4 + Tests/Module/CheckIPOSupported-CUDA/main.cu | 62 + Tests/ModuleDefinition/CMakeLists.txt | 12 +- Tests/Preprocess/CMakeLists.txt | 7 +- Tests/Preprocess/preprocess.c | 2 +- Tests/Preprocess/preprocess.cxx | 2 +- Tests/RunCMake/AutoExportDll/AutoExport.cmake | 4 +- Tests/RunCMake/BuildDepends/RunCMakeTest.cmake | 3 +- Tests/RunCMake/CMP0102/CMP0102-OLD-stderr.txt | 10 + .../CMakeDependentOption/RunCMakeTest.cmake | 1 + .../CMakeDependentOption/UseDotSymbol-stdout.txt | 1 + .../CMakeDependentOption/UseDotSymbol.cmake | 4 + Tests/RunCMake/CMakeLists.txt | 45 +- Tests/RunCMake/CMakePresets/Comment-stderr.txt | 9 +- .../DocumentationExampleListAllPresets-stdout.txt | 22 + .../CMakePresets/EmptyPresetName-stderr.txt | 5 +- Tests/RunCMake/CMakePresets/GoodNoSCache.cmake | 1 + .../CMakePresets/IncludeNotFound-stderr.txt | 5 +- .../CMakePresets/JSONParseError-stderr.txt | 9 +- .../CMakePresets/ListAllPresetsNoBuild-stdout.txt | 8 + .../CMakePresets/ListAllPresetsNoBuild.json.in | 14 + .../CMakePresets/ListAllPresetsNoTest-stdout.txt | 8 + .../CMakePresets/ListAllPresetsNoTest.json.in | 14 + .../ListPresetsInvalidType-result.txt} | 0 .../CMakePresets/ListPresetsInvalidType-stderr.txt | 3 + Tests/RunCMake/CMakePresets/RunCMakeTest.cmake | 8 + .../RunCMake/CMakePresetsPackage/CMakeLists.txt.in | 3 + .../Good-package-config-file-check.cmake | 6 + .../Good-package-configurations-check.cmake | 18 + .../Good-package-debug-stdout.txt | 2 + .../Good-package-generators-check.cmake | 1 + .../Good-package-no-environment-check.cmake | 7 + .../Good-package-package-directory-check.cmake | 6 + .../Good-package-package-name-check.cmake | 7 + .../Good-package-package-version-check.cmake | 7 + .../Good-package-variables-check.cmake | 6 + .../Good-package-verbose-stdout.txt | 1 + .../Good-package-with-environment-check.cmake | 7 + Tests/RunCMake/CMakePresetsPackage/Good.cmake | 31 + Tests/RunCMake/CMakePresetsPackage/Good.json.in | 135 +++ .../ListPresets-package-x-stdout.txt | 4 + .../ListPresets.cmake} | 0 .../CMakePresetsPackage/ListPresets.json.in | 20 + .../CMakePresetsPackage/RunCMakeTest.cmake | 102 ++ .../UnsupportedVersion-configure-x-result.txt} | 0 .../UnsupportedVersion-configure-x-stderr.txt | 2 + .../CMakePresetsPackage/UnsupportedVersion.json.in | 4 + Tests/RunCMake/CMakePresetsPackage/check.cmake | 3 + .../Good-test-outputJUnit-check.cmake | 4 + .../Good-test-outputLog-check.cmake | 4 + Tests/RunCMake/CMakePresetsTest/Good.json.in | 16 +- .../OutputJUnitUnsupported-test-x-result.txt} | 0 .../OutputJUnitUnsupported-test-x-stderr.txt | 2 + .../OutputJUnitUnsupported.json.in | 17 + Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake | 4 +- ...tOutputTruncationUnsupported-test-x-result.txt} | 0 ...stOutputTruncationUnsupported-test-x-stderr.txt | 2 + .../TestOutputTruncationUnsupported.json.in | 17 + .../CMakePresetsWorkflow/BadExitCode-result.txt | 1 + .../CMakePresetsWorkflow/BadExitCode-stderr.txt | 4 + .../CMakePresetsWorkflow/BadExitCode-stdout.txt | 17 + .../CMakePresetsWorkflow/BadExitCode.cmake | 8 + .../CMakePresetsWorkflow/BadExitCodeTest.cmake | 1 + .../CMakePresetsWorkflow/CMakeLists.txt.in | 3 + .../ConfigureStepMismatch-result.txt} | 0 .../ConfigureStepMismatch-stderr.txt | 2 + .../ConfigureStepMismatch.json.in | 32 + .../FirstStepNotConfigure-result.txt} | 0 .../FirstStepNotConfigure-stderr.txt | 2 + .../FirstStepNotConfigure.json.in | 27 + Tests/RunCMake/CMakePresetsWorkflow/Fresh.cmake | 4 + Tests/RunCMake/CMakePresetsWorkflow/Fresh.json.in | 21 + .../RunCMake/CMakePresetsWorkflow/Good-stdout.txt | 19 + Tests/RunCMake/CMakePresetsWorkflow/Good.cmake | 8 + Tests/RunCMake/CMakePresetsWorkflow/Good.json.in | 87 ++ .../CMakePresetsWorkflow/GoodUser-stdout.txt | 2 + Tests/RunCMake/CMakePresetsWorkflow/GoodUser.cmake | 1 + .../RunCMake/CMakePresetsWorkflow/GoodUser.json.in | 14 + .../InvalidOption-result.txt} | 0 .../CMakePresetsWorkflow/InvalidOption-stderr.txt | 6 + .../CMakePresetsWorkflow/InvalidOption-stdout.txt | 1 + .../CMakePresetsWorkflow/ListPresets-stdout.txt | 4 + .../CMakePresetsWorkflow/ListPresets.json.in | 30 + .../NoWorkflowSteps-result.txt | 1 + .../NoWorkflowSteps-stderr.txt | 2 + .../CMakePresetsWorkflow/NoWorkflowSteps.json.in | 9 + .../NonexistentStep-result.txt | 1 + .../NonexistentStep-stderr.txt | 2 + .../CMakePresetsWorkflow/NonexistentStep.json.in | 14 + .../CMakePresetsWorkflow/RunCMakeTest.cmake | 89 ++ .../SecondStepConfigure-result.txt | 1 + .../SecondStepConfigure-stderr.txt | 2 + .../SecondStepConfigure.json.in | 25 + .../UnreachableStep-result.txt | 1 + .../UnreachableStep-stderr.txt | 2 + .../CMakePresetsWorkflow/UnreachableStep.json.in | 14 + .../UnreachableStepUser.json.in | 8 + .../UnsupportedVersion-result.txt | 1 + .../UnsupportedVersion-stderr.txt | 2 + .../UnsupportedVersion.json.in | 4 + .../WorkflowStepDisabled-result.txt | 1 + .../WorkflowStepDisabled-stderr.txt | 2 + .../WorkflowStepDisabled.json.in | 23 + .../WorkflowStepHidden-result.txt | 1 + .../WorkflowStepHidden-stderr.txt | 2 + .../WorkflowStepHidden.json.in | 20 + .../WorkflowStepInvalidMacro-result.txt | 1 + .../WorkflowStepInvalidMacro-stderr.txt | 1 + .../WorkflowStepInvalidMacro.json.in | 20 + Tests/RunCMake/CMakePresetsWorkflow/check.cmake | 3 + .../CMakePresetsWorkflow/cpack_staging.cmake.in | 1 + Tests/RunCMake/CPack/DEB/Helpers.cmake | 4 +- Tests/RunCMake/CPack/DEB/Prerequirements.cmake | 6 +- Tests/RunCMake/CPack/RPM/Prerequirements.cmake | 6 +- .../GENERATE_SHLIBS/DEB-Prerequirements.cmake | 2 +- .../DEB-Prerequirements.cmake | 2 +- .../INSTALL_SCRIPTS/RPM-Prerequirements.cmake | 2 +- Tests/RunCMake/CTestTimeout/TestTimeout.c | 1 + .../architectures-suffix-stderr.txt | 2 +- Tests/RunCMake/CXXModules/CMakeLists.txt | 6 + .../CXXModules/ExportBuildCxxModules-check.cmake | 40 + .../CXXModules/ExportBuildCxxModules-stderr.txt | 11 + .../CXXModules/ExportBuildCxxModules.cmake | 22 + .../CXXModules/ExportInstallCxxModules-check.cmake | 35 + .../CXXModules/ExportInstallCxxModules-stderr.txt | 11 + .../CXXModules/ExportInstallCxxModules.cmake | 22 + .../FileSetModuleHeaderUnitsInterface-result.txt | 1 + .../FileSetModuleHeaderUnitsInterface-stderr.txt | 12 + .../FileSetModuleHeaderUnitsInterface.cmake | 8 + ...etModuleHeaderUnitsInterfaceImported-stderr.txt | 6 + ...FileSetModuleHeaderUnitsInterfaceImported.cmake | 8 + .../FileSetModuleHeaderUnitsPrivate-stderr.txt | 11 + .../FileSetModuleHeaderUnitsPrivate.cmake | 13 + .../FileSetModuleHeaderUnitsPublic-stderr.txt | 11 + .../FileSetModuleHeaderUnitsPublic.cmake | 13 + .../CXXModules/FileSetModulesInterface-result.txt | 1 + .../CXXModules/FileSetModulesInterface-stderr.txt | 12 + .../CXXModules/FileSetModulesInterface.cmake | 8 + .../FileSetModulesInterfaceImported-stderr.txt | 6 + .../FileSetModulesInterfaceImported.cmake | 8 + .../CXXModules/FileSetModulesPrivate-stderr.txt | 11 + .../CXXModules/FileSetModulesPrivate.cmake | 12 + .../CXXModules/FileSetModulesPublic-stderr.txt | 11 + .../RunCMake/CXXModules/FileSetModulesPublic.cmake | 12 + Tests/RunCMake/CXXModules/InstallBMI-check.cmake | 24 + Tests/RunCMake/CXXModules/InstallBMI-stderr.txt | 6 + Tests/RunCMake/CXXModules/InstallBMI.cmake | 23 + .../CXXModules/InstallBMIGenericArgs-check.cmake | 8 + .../CXXModules/InstallBMIGenericArgs-stderr.txt | 6 + .../CXXModules/InstallBMIGenericArgs.cmake | 9 + .../CXXModules/InstallBMIIgnore-check.cmake | 13 + .../CXXModules/InstallBMIIgnore-stderr.txt | 6 + Tests/RunCMake/CXXModules/InstallBMIIgnore.cmake | 9 + .../CXXModules/InstallBMINoGenericArgs-check.cmake | 8 + .../NinjaDependInfoBMIInstall-check.cmake | 34 + .../NinjaDependInfoBMIInstall-stderr.txt | 11 + .../CXXModules/NinjaDependInfoBMIInstall.cmake | 76 ++ .../CXXModules/NinjaDependInfoExport-check.cmake | 34 + .../CXXModules/NinjaDependInfoExport-stderr.txt | 11 + .../CXXModules/NinjaDependInfoExport.cmake | 85 ++ .../CXXModules/NinjaDependInfoFileSet-check.cmake | 34 + .../CXXModules/NinjaDependInfoFileSet-stderr.txt | 11 + .../CXXModules/NinjaDependInfoFileSet.cmake | 59 + Tests/RunCMake/CXXModules/NoCXX-result.txt | 1 + Tests/RunCMake/CXXModules/NoCXX-stderr.txt | 20 + Tests/RunCMake/CXXModules/NoCXX.cmake | 9 + Tests/RunCMake/CXXModules/NoCXX20-result.txt | 1 + Tests/RunCMake/CXXModules/NoCXX20-stderr.txt | 20 + Tests/RunCMake/CXXModules/NoCXX20.cmake | 11 + .../CXXModules/NoCXX20ModuleFlag-result.txt | 1 + .../CXXModules/NoCXX20ModuleFlag-stderr.txt | 20 + Tests/RunCMake/CXXModules/NoCXX20ModuleFlag.cmake | 12 + .../RunCMake/CXXModules/NoDyndepSupport-result.txt | 1 + .../RunCMake/CXXModules/NoDyndepSupport-stderr.txt | 30 + Tests/RunCMake/CXXModules/NoDyndepSupport.cmake | 16 + .../NotCXXSourceModuleHeaderUnits-result.txt | 1 + .../NotCXXSourceModuleHeaderUnits-stderr.txt | 22 + .../CXXModules/NotCXXSourceModuleHeaderUnits.cmake | 15 + .../CXXModules/NotCXXSourceModules-result.txt | 1 + .../CXXModules/NotCXXSourceModules-stderr.txt | 17 + .../RunCMake/CXXModules/NotCXXSourceModules.cmake | 13 + Tests/RunCMake/CXXModules/RunCMakeTest.cmake | 170 +++ Tests/RunCMake/CXXModules/check-json.cmake | 160 +++ .../CXXModules/compiler_introspection.cmake | 25 + .../cxx-modules-find-bmi-and-interfaces.cmake | 22 + .../CXXModules/examples/cxx-modules-find-bmi.cmake | 27 + .../CXXModules/examples/cxx-modules-rules.cmake | 18 + .../CXXModules/examples/deep-chain-stderr.txt | 9 + .../CXXModules/examples/deep-chain/CMakeLists.txt | 66 + .../RunCMake/CXXModules/examples/deep-chain/a.cxx | 6 + .../RunCMake/CXXModules/examples/deep-chain/b.cxx | 7 + .../RunCMake/CXXModules/examples/deep-chain/c.cxx | 7 + .../RunCMake/CXXModules/examples/deep-chain/d.cxx | 7 + .../RunCMake/CXXModules/examples/deep-chain/e.cxx | 7 + .../CXXModules/examples/deep-chain/main.cxx | 6 + .../export-bmi-and-interface-build-stderr.txt | 9 + .../export-bmi-and-interface-build/CMakeLists.txt | 56 + .../export-bmi-and-interface-build/forward.cxx | 6 + .../export-bmi-and-interface-build/importable.cxx | 8 + .../export-bmi-and-interface-build/private.cxx | 6 + .../test/CMakeLists.txt | 32 + .../export-bmi-and-interface-install-stderr.txt | 9 + .../CMakeLists.txt | 59 + .../export-bmi-and-interface-install/forward.cxx | 6 + .../importable.cxx | 8 + .../export-bmi-and-interface-install/private.cxx | 6 + .../test/CMakeLists.txt | 32 + .../examples/export-interface-build-stderr.txt | 9 + .../examples/export-interface-build/CMakeLists.txt | 53 + .../examples/export-interface-build/forward.cxx | 6 + .../examples/export-interface-build/importable.cxx | 8 + .../examples/export-interface-build/private.cxx | 6 + .../export-interface-build/test/CMakeLists.txt | 32 + .../examples/export-interface-install-stderr.txt | 9 + .../export-interface-install/CMakeLists.txt | 56 + .../examples/export-interface-install/forward.cxx | 6 + .../export-interface-install/importable.cxx | 8 + .../examples/export-interface-install/private.cxx | 6 + .../export-interface-install/test/CMakeLists.txt | 32 + .../CXXModules/examples/generated-stderr.txt | 9 + .../CXXModules/examples/generated/CMakeLists.txt | 23 + .../examples/generated/importable.cxx.in | 5 + .../CXXModules/examples/generated/main.cxx | 6 + .../examples/install-bmi-and-interfaces-stderr.txt | 9 + .../install-bmi-and-interfaces/CMakeLists.txt | 27 + .../install-bmi-and-interfaces/check-for-bmi.cmake | 7 + .../install-bmi-and-interfaces/importable.cxx | 6 + .../CXXModules/examples/install-bmi-stderr.txt | 9 + .../CXXModules/examples/install-bmi/CMakeLists.txt | 25 + .../examples/install-bmi/check-for-bmi.cmake | 4 + .../CXXModules/examples/install-bmi/importable.cxx | 6 + .../examples/internal-partitions-stderr.txt | 9 + .../examples/internal-partitions/CMakeLists.txt | 31 + .../examples/internal-partitions/importable.cxx | 9 + .../examples/internal-partitions/main.cxx | 6 + .../examples/internal-partitions/partition.cxx | 6 + .../CXXModules/examples/library-shared-stderr.txt | 9 + .../CXXModules/examples/library-static-stderr.txt | 9 + .../CXXModules/examples/library/CMakeLists.txt | 30 + .../CXXModules/examples/library/importable.cxx | 8 + .../RunCMake/CXXModules/examples/library/main.cxx | 6 + .../CXXModules/examples/partitions-stderr.txt | 9 + .../CXXModules/examples/partitions/CMakeLists.txt | 31 + .../CXXModules/examples/partitions/importable.cxx | 9 + .../CXXModules/examples/partitions/main.cxx | 6 + .../CXXModules/examples/partitions/partition.cxx | 8 + .../examples/public-req-private-build-result.txt | 1 + .../examples/public-req-private-build-stdout.txt | 1 + .../examples/public-req-private-stderr.txt | 9 + .../examples/public-req-private/CMakeLists.txt | 22 + .../examples/public-req-private/priv.cxx | 6 + .../CXXModules/examples/public-req-private/pub.cxx | 8 + .../RunCMake/CXXModules/examples/simple-stderr.txt | 9 + .../CXXModules/examples/simple/CMakeLists.txt | 18 + .../CXXModules/examples/simple/importable.cxx | 6 + Tests/RunCMake/CXXModules/examples/simple/main.cxx | 6 + .../expect/NinjaDependInfoBMIInstall-private.json | 45 + .../expect/NinjaDependInfoBMIInstall-public.json | 45 + .../expect/NinjaDependInfoExport-private.json | 73 ++ .../expect/NinjaDependInfoExport-public.json | 73 ++ .../expect/NinjaDependInfoFileSet-private.json | 40 + .../expect/NinjaDependInfoFileSet-public.json | 40 + Tests/RunCMake/CXXModules/sources/c-anchor.c | 4 + Tests/RunCMake/CXXModules/sources/cxx-anchor.cxx | 4 + Tests/RunCMake/CXXModules/sources/module-header.h | 9 + Tests/RunCMake/CXXModules/sources/module-impl.cxx | 6 + .../sources/module-internal-part-impl.cxx | 11 + .../CXXModules/sources/module-internal-part.cxx | 3 + .../CXXModules/sources/module-part-impl.cxx | 13 + Tests/RunCMake/CXXModules/sources/module-part.cxx | 3 + Tests/RunCMake/CXXModules/sources/module-use.cxx | 6 + Tests/RunCMake/CXXModules/sources/module.cxx | 5 + .../CheckCompilerFlag/CheckCCompilerFlag.cmake | 38 +- .../CheckCompilerFlag/CheckCXXCompilerFlag.cmake | 27 +- .../CheckCompilerFlag/CheckCompilerFlagC.cmake | 33 + ...pilerFlag.cmake => CheckCompilerFlagCUDA.cmake} | 0 .../CheckCompilerFlag/CheckCompilerFlagCXX.cmake | 26 + ...erFlag.cmake => CheckCompilerFlagFortran.cmake} | 0 ...mpilerFlag.cmake => CheckCompilerFlagHIP.cmake} | 0 ...pilerFlag.cmake => CheckCompilerFlagISPC.cmake} | 0 ...pilerFlag.cmake => CheckCompilerFlagOBJC.cmake} | 0 ...lerFlag.cmake => CheckCompilerFlagOBJCXX.cmake} | 0 .../RunCMake/CheckCompilerFlag/RunCMakeTest.cmake | 16 +- .../CheckIPOSupported/default-lang-none-stderr.txt | 4 +- ...eckCLinkerFlag.cmake => CheckLinkerFlagC.cmake} | 0 ...ALinkerFlag.cmake => CheckLinkerFlagCUDA.cmake} | 0 ...XXLinkerFlag.cmake => CheckLinkerFlagCXX.cmake} | 0 ...nkerFlag.cmake => CheckLinkerFlagFortran.cmake} | 0 ...IPLinkerFlag.cmake => CheckLinkerFlagHIP.cmake} | 0 ...CLinkerFlag.cmake => CheckLinkerFlagOBJC.cmake} | 0 ...inkerFlag.cmake => CheckLinkerFlagOBJCXX.cmake} | 0 Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake | 14 +- .../CheckSourceCompiles/CheckCSourceCompiles.cmake | 6 +- .../CheckCXXSourceCompiles.cmake | 10 +- .../CheckOBJCSourceCompiles.cmake | 9 +- .../CheckOBJCXXSourceCompiles.cmake | 9 +- .../CheckSourceCompiles/CheckSourceCompilesC.cmake | 15 + ...ompiles.cmake => CheckSourceCompilesCUDA.cmake} | 0 .../CheckSourceCompilesCXX.cmake | 28 + ...iles.cmake => CheckSourceCompilesFortran.cmake} | 0 ...Compiles.cmake => CheckSourceCompilesHIP.cmake} | 0 ...ompiles.cmake => CheckSourceCompilesISPC.cmake} | 0 .../CheckSourceCompilesOBJC.cmake | 16 + .../CheckSourceCompilesOBJCXX.cmake | 19 + .../CheckSourceCompiles/RunCMakeTest.cmake | 12 +- .../CheckSourceRuns/CheckCSourceRuns.cmake | 10 +- .../CheckSourceRuns/CheckCXXSourceRuns.cmake | 10 +- .../CheckSourceRuns/CheckOBJCSourceRuns.cmake | 9 +- .../CheckSourceRuns/CheckOBJCXXSourceRuns.cmake | 9 +- .../CheckSourceRuns/CheckSourceRunsC.cmake | 15 + ...ASourceRuns.cmake => CheckSourceRunsCUDA.cmake} | 0 .../CheckSourceRuns/CheckSourceRunsCXX.cmake | 22 + ...urceRuns.cmake => CheckSourceRunsFortran.cmake} | 0 ...IPSourceRuns.cmake => CheckSourceRunsHIP.cmake} | 0 .../CheckSourceRuns/CheckSourceRunsOBJC.cmake | 16 + .../CheckSourceRuns/CheckSourceRunsOBJCXX.cmake | 19 + Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake | 10 +- Tests/RunCMake/ClangTidy/RunCMakeTest.cmake | 1 + Tests/RunCMake/ClangTidy/compdb.cmake | 7 + .../CommandLine/DeprecateVS10-WARN-ON-stderr.txt | 5 - .../CommandLine/DeprecateVS11-WARN-OFF.cmake | 0 .../CommandLine/DeprecateVS11-WARN-ON-stderr.txt | 5 + .../CommandLine/DeprecateVS11-WARN-ON.cmake | 0 .../RunCMake/CommandLine/E_capabilities-stdout.txt | 2 +- Tests/RunCMake/CommandLine/E_env-equal.cmake | 15 + .../E_env_modify-bad-operation-result.txt | 1 + .../E_env_modify-bad-operation-stderr.txt | 3 + .../CommandLine/E_env_modify-cmake_list-stdout.txt | 1 + .../CommandLine/E_env_modify-path_list-stdout.txt | 1 + .../CommandLine/E_env_modify-reset-stdout.txt | 1 + .../E_env_modify-reset-to-unset-stdout.txt | 1 + .../CommandLine/E_env_modify-set-stdout.txt | 1 + .../CommandLine/E_env_modify-string-stdout.txt | 1 + .../CommandLine/E_env_modify-unset-stdout.txt | 1 + .../E_env_modify-with-double-dash-result.txt | 1 + .../E_env_modify-without-double-dash-result.txt | 1 + .../E_env_modify-without-double-dash-stderr.txt | 1 + Tests/RunCMake/CommandLine/P_working-dir.cmake | 7 +- Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 70 +- .../RunCMake/CommandLine/cmake_depends-stdout.txt | 2 +- .../CommandLine/debug-trycompile-stderr.txt | 11 + Tests/RunCMake/CommandLine/debug-trycompile.cmake | 5 +- Tests/RunCMake/CommandLine/trycompile-clean.cmake | 8 + Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake | 3 +- Tests/RunCMake/CompilerTest/C-stdout.txt | 2 + Tests/RunCMake/CompilerTest/C.cmake | 3 + Tests/RunCMake/CompilerTest/CMakeLists.txt | 3 + Tests/RunCMake/CompilerTest/CUDA-stdout.txt | 2 + Tests/RunCMake/CompilerTest/CUDA.cmake | 3 + Tests/RunCMake/CompilerTest/CXX-stdout.txt | 2 + Tests/RunCMake/CompilerTest/CXX.cmake | 3 + Tests/RunCMake/CompilerTest/Fortran-stdout.txt | 2 + Tests/RunCMake/CompilerTest/Fortran.cmake | 3 + Tests/RunCMake/CompilerTest/HIP-stdout.txt | 2 + Tests/RunCMake/CompilerTest/HIP.cmake | 3 + Tests/RunCMake/CompilerTest/ISPC-stdout.txt | 3 + Tests/RunCMake/CompilerTest/ISPC.cmake | 3 + Tests/RunCMake/CompilerTest/OBJC-stdout.txt | 2 + Tests/RunCMake/CompilerTest/OBJC.cmake | 3 + Tests/RunCMake/CompilerTest/OBJCXX-stdout.txt | 2 + Tests/RunCMake/CompilerTest/OBJCXX.cmake | 3 + Tests/RunCMake/CompilerTest/RunCMakeTest.cmake | 25 + ...I-override.cmake => CopyFileABI-override.cmake} | 3 +- ...pyFileABI-stdout.txt => CopyFileABI-stdout.txt} | 2 +- .../{FailCopyFileABI.cmake => CopyFileABI.cmake} | 2 +- .../RunCMake/Configure/FailCopyFileABI-check.cmake | 14 - Tests/RunCMake/Configure/RunCMakeTest.cmake | 2 +- .../ExternalProject/BUILD_ALWAYS-build1-stdout.txt | 6 + .../ExternalProject/BUILD_ALWAYS-build2-stdout.txt | 2 + Tests/RunCMake/ExternalProject/BUILD_ALWAYS.cmake | 20 + Tests/RunCMake/ExternalProject/RunCMakeTest.cmake | 22 + Tests/RunCMake/FPHSA/RunCMakeTest.cmake | 8 +- Tests/RunCMake/FPHSA/empty_version-result.txt | 1 + Tests/RunCMake/FPHSA/empty_version-stderr.txt | 9 + Tests/RunCMake/FPHSA/empty_version.cmake | 1 + .../FPHSA/exact_1_no_version_var-stdout.txt | 1 + Tests/RunCMake/FPHSA/exact_1_no_version_var.cmake | 1 + .../FetchContent/IncludesNonSystem/CMakeLists.txt | 2 + .../FetchContent/IncludesNonSystem/bar.cpp | 0 .../FetchContent/IncludesNonSystem/foo.cpp | 0 .../FetchContent/IncludesSystem/CMakeLists.txt | 20 + .../IncludesSystem/SubSub1/CMakeLists.txt | 6 + .../FetchContent/IncludesSystem/SubSub1/bar.cpp | 0 .../FetchContent/IncludesSystem/SubSub1/foo.cpp | 0 .../FetchContent/IncludesSystem/SubSub1/zot.cpp | 0 .../IncludesSystem/SubSub2/CMakeLists.txt | 6 + .../FetchContent/IncludesSystem/SubSub2/bar.cpp | 0 .../FetchContent/IncludesSystem/SubSub2/foo.cpp | 0 .../FetchContent/IncludesSystem/SubSub2/zot.cpp | 0 Tests/RunCMake/FetchContent/IncludesSystem/bar.cpp | 0 Tests/RunCMake/FetchContent/IncludesSystem/foo.cpp | 0 Tests/RunCMake/FetchContent/IncludesSystem/zot.cpp | 0 Tests/RunCMake/FetchContent/RunCMakeTest.cmake | 1 + Tests/RunCMake/FetchContent/System.cmake | 37 + Tests/RunCMake/FileAPI/CMakeLists.txt | 2 +- Tests/RunCMake/FileAPI/ClientStateful-check.py | 6 +- Tests/RunCMake/FileAPI/RunCMakeTest.cmake | 4 + Tests/RunCMake/FileAPI/codemodel-v2-check.py | 12 + .../codemodel-v2-data/directories/alias.json | 2 +- .../codemodel-v2-data/directories/custom.json | 2 +- .../FileAPI/codemodel-v2-data/directories/cxx.json | 2 +- .../FileAPI/codemodel-v2-data/directories/dir.json | 2 +- .../codemodel-v2-data/directories/dir_dir.json | 2 +- .../codemodel-v2-data/directories/external.json | 2 +- .../codemodel-v2-data/directories/fileset.json | 2 +- .../codemodel-v2-data/directories/imported.json | 2 +- .../codemodel-v2-data/directories/interface.json | 2 +- .../codemodel-v2-data/directories/subdir.json | 11 + .../FileAPI/codemodel-v2-data/directories/top.json | 32 +- .../codemodel-v2-data/projects/codemodel-v2.json | 4 +- .../codemodel-v2-data/targets/all_build_top.json | 4 + .../codemodel-v2-data/targets/c_object_exe.json | 4 +- .../codemodel-v2-data/targets/c_object_lib.json | 2 +- .../codemodel-v2-data/targets/c_shared_lib.json | 6 +- .../codemodel-v2-data/targets/c_subdir.json | 150 +++ .../FileAPI/codemodel-v2-data/targets/cxx_exe.json | 2 +- .../codemodel-v2-data/targets/cxx_object_exe.json | 4 +- .../codemodel-v2-data/targets/cxx_object_lib.json | 2 +- .../codemodel-v2-data/targets/cxx_shared_lib.json | 6 +- Tests/RunCMake/FileAPI/codemodel-v2.cmake | 3 + Tests/RunCMake/FileAPI/subdir/CMakeLists.txt | 4 + Tests/RunCMake/FileAPI/subdir/empty.c | 0 Tests/RunCMake/File_Archive/RunCMakeTest.cmake | 3 + .../File_Archive/create-missing-args-result.txt | 1 + .../File_Archive/create-missing-args-stderr.txt | 19 + .../File_Archive/create-missing-args.cmake | 8 + .../File_Archive/extract-missing-args-result.txt | 1 + .../File_Archive/extract-missing-args-stderr.txt | 11 + .../File_Archive/extract-missing-args.cmake | 5 + .../File_Configure/BadArgContent-stderr.txt | 5 +- .../File_Configure/BadArgOutput-stderr.txt | 5 +- .../File_Configure/NoArgContent-result.txt | 1 + .../File_Configure/NoArgContent-stderr.txt | 4 + Tests/RunCMake/File_Configure/NoArgContent.cmake | 1 + .../RunCMake/File_Configure/NoArgOutput-result.txt | 1 + .../RunCMake/File_Configure/NoArgOutput-stderr.txt | 4 + Tests/RunCMake/File_Configure/NoArgOutput.cmake | 1 + Tests/RunCMake/File_Configure/RunCMakeTest.cmake | 2 + .../File_Generate/EmptyCondition1-stderr.txt | 5 +- .../File_Generate/InputAndContent-check.cmake | 8 + .../File_Generate/InputAndContent-input.txt | 1 + Tests/RunCMake/File_Generate/InputAndContent.cmake | 10 + .../File_Generate/NewLineStyle-NoArg-stderr.txt | 5 +- Tests/RunCMake/File_Generate/RunCMakeTest.cmake | 1 + Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake | 25 +- .../RunCMake/Framework/FrameworkConsumption.cmake | 18 + Tests/RunCMake/Framework/main2.c | 9 + .../CMP0141-NEW-result.txt | 1 + .../CMP0141-NEW-stderr.txt | 5 + .../MSVCDebugInformationFormat/CMP0141-NEW.cmake | 2 + .../CMP0141-NoEffect.cmake | 4 + .../MSVCDebugInformationFormat/CMP0141-OLD.cmake | 2 + .../MSVCDebugInformationFormat/CMP0141-WARN.cmake | 2 + .../CMP0141-common.cmake | 31 + .../MSVCDebugInformationFormat/CMakeLists.txt | 3 + .../MSVCDebugInformationFormat/RunCMakeTest.cmake | 6 + .../RunCMake/MSVCDebugInformationFormat/empty.cxx | 0 Tests/RunCMake/Ninja/QtAutoMocSkipPch.cmake | 17 + Tests/RunCMake/Ninja/RunCMakeTest.cmake | 25 + .../RunCMake/Ninja/ShowIncludes-54936-check.cmake | 3 + Tests/RunCMake/Ninja/ShowIncludes-54936-stdout.txt | 1 + Tests/RunCMake/Ninja/ShowIncludes-54936.cmake | 2 + .../RunCMake/Ninja/ShowIncludes-65001-check.cmake | 3 + Tests/RunCMake/Ninja/ShowIncludes-65001-stdout.txt | 1 + Tests/RunCMake/Ninja/ShowIncludes-65001.cmake | 2 + Tests/RunCMake/Ninja/ShowIncludes-check.cmake | 17 + Tests/RunCMake/Ninja/ShowIncludes-cmake.cmake | 7 + Tests/RunCMake/Ninja/ShowIncludes.cmake | 22 + .../NinjaMultiConfig/CompileCommands-check.cmake | 28 + .../NinjaMultiConfig/CompileCommands.cmake | 3 + Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake | 5 + .../ParseImplicitLinkInfo.cmake | 1 + Tests/RunCMake/PrecompileHeaders/DisabledPch.cmake | 3 +- .../RunCMake/PrecompileHeaders/PchDebugGenex.cmake | 3 +- .../PchIncludedAllLanguages.cmake | 4 +- .../PrecompileHeaders/PchIncludedOneLanguage.cmake | 4 +- .../RunCMake/PrecompileHeaders/PchInterface.cmake | 3 +- .../PrecompileHeaders/PchLibObjLibExe.cmake | 3 +- .../PrecompileHeaders/PchMultilanguage.cmake | 4 +- .../PrecompileHeaders/PchPrologueEpilogue.cmake | 5 +- .../PchReuseFrom-CMP0141-NEW-empty.cmake | 4 + .../PchReuseFrom-CMP0141-NEW.cmake | 2 + .../PchReuseFrom-CMP0141-OLD.cmake | 2 + ...chReuseFrom.cmake => PchReuseFrom-common.cmake} | 3 +- .../PrecompileHeaders/PchReuseFromObjLib.cmake | 5 +- .../PrecompileHeaders/PchReuseFromPrefixed.cmake | 3 +- .../PrecompileHeaders/PchReuseFromSubdir.cmake | 3 +- .../RunCMake/PrecompileHeaders/RunCMakeTest.cmake | 6 +- .../PrecompileHeaders/SkipPrecompileHeaders.cmake | 5 +- Tests/RunCMake/RunCMake.cmake | 11 +- .../RunCMake/TargetPolicies/PolicyList-stderr.txt | 1 + .../VS10Project/DebugInformationFormat-check.cmake | 46 + .../VS10Project/DebugInformationFormat.cmake | 24 + .../VS10Project/InterfaceLibSources-check.cmake | 9 + Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 1 + .../VerifyHeaderSets/VerifyHeaderSets-check.cmake | 2 +- Tests/RunCMake/VsDotnetSdk/RunCMakeTest.cmake | 1 + Tests/RunCMake/VsDotnetSdk/VsDotnetSdk.cmake | 10 +- .../VsDotnetSdk/VsDotnetSdkDefines-check.cmake | 64 + .../RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake | 19 + .../RunCMake/XcodeProject/Clean-build-check.cmake | 5 + .../RunCMake/XcodeProject/Clean-clean-check.cmake | 5 + Tests/RunCMake/XcodeProject/Clean.cmake | 2 + Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt | 1 + Tests/RunCMake/XcodeProject/Clean/empty.c | 0 .../XcodeProject/EffectivePlatformNameOFF.cmake | 12 + Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 27 + .../RunCMake/XcodeProject/SearchPaths-check.cmake | 14 + Tests/RunCMake/XcodeProject/SearchPaths.cmake | 10 + .../XcodeProject/XcodeSchemaProperty-check.cmake | 4 + .../XcodeProject/XcodeSchemaProperty.cmake | 4 + Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake | 1 + Tests/RunCMake/add_subdirectory/System.cmake | 22 + .../add_subdirectory/System/CMakeLists.txt | 11 + .../add_subdirectory/System/SubSub1/CMakeLists.txt | 6 + .../add_subdirectory/System/SubSub1/bar.cpp | 0 .../add_subdirectory/System/SubSub1/foo.cpp | 0 .../add_subdirectory/System/SubSub1/zot.cpp | 0 .../add_subdirectory/System/SubSub2/CMakeLists.txt | 6 + .../add_subdirectory/System/SubSub2/bar.cpp | 0 .../add_subdirectory/System/SubSub2/foo.cpp | 0 .../add_subdirectory/System/SubSub2/zot.cpp | 0 Tests/RunCMake/add_subdirectory/System/bar.cpp | 0 Tests/RunCMake/add_subdirectory/System/foo.cpp | 0 Tests/RunCMake/add_subdirectory/System/zot.cpp | 0 Tests/RunCMake/block/CMakeLists.txt | 3 + Tests/RunCMake/block/EndAlone-result.txt | 1 + Tests/RunCMake/block/EndAlone-stderr.txt | 4 + Tests/RunCMake/block/EndAlone.cmake | 1 + .../RunCMake/block/EndAloneWithArgument-result.txt | 1 + .../RunCMake/block/EndAloneWithArgument-stderr.txt | 4 + Tests/RunCMake/block/EndAloneWithArgument.cmake | 1 + Tests/RunCMake/block/EndMissing-result.txt | 1 + Tests/RunCMake/block/EndMissing-stderr.txt | 4 + Tests/RunCMake/block/EndMissing.cmake | 1 + Tests/RunCMake/block/EndWithArgument-stderr.txt | 9 + Tests/RunCMake/block/EndWithArgument.cmake | 2 + Tests/RunCMake/block/InvalidArgument-result.txt | 1 + Tests/RunCMake/block/InvalidArgument-stderr.txt | 4 + Tests/RunCMake/block/InvalidArgument.cmake | 2 + Tests/RunCMake/block/InvalidNesting1-result.txt | 1 + Tests/RunCMake/block/InvalidNesting1-stderr.txt | 4 + Tests/RunCMake/block/InvalidNesting1.cmake | 6 + Tests/RunCMake/block/InvalidNesting2-result.txt | 1 + Tests/RunCMake/block/InvalidNesting2-stderr.txt | 4 + Tests/RunCMake/block/InvalidNesting2.cmake | 6 + Tests/RunCMake/block/InvalidNesting3-result.txt | 1 + Tests/RunCMake/block/InvalidNesting3-stderr.txt | 4 + Tests/RunCMake/block/InvalidNesting3.cmake | 5 + Tests/RunCMake/block/InvalidNesting4-result.txt | 1 + Tests/RunCMake/block/InvalidNesting4-stderr.txt | 4 + Tests/RunCMake/block/InvalidNesting4.cmake | 5 + Tests/RunCMake/block/InvalidNesting5-result.txt | 1 + Tests/RunCMake/block/InvalidNesting5-stderr.txt | 4 + Tests/RunCMake/block/InvalidNesting5.cmake | 5 + Tests/RunCMake/block/InvalidNesting6-result.txt | 1 + Tests/RunCMake/block/InvalidNesting6-stderr.txt | 4 + Tests/RunCMake/block/InvalidNesting6.cmake | 5 + Tests/RunCMake/block/MissingArgument-result.txt | 1 + Tests/RunCMake/block/MissingArgument-stderr.txt | 7 + Tests/RunCMake/block/MissingArgument.cmake | 2 + Tests/RunCMake/block/RunCMakeTest.cmake | 22 + Tests/RunCMake/block/Scope-POLICIES.cmake | 40 + Tests/RunCMake/block/Scope-VARIABLES.cmake | 62 + Tests/RunCMake/block/Scope.cmake | 62 + Tests/RunCMake/block/Scope/CMakeLists.txt | 2 + Tests/RunCMake/block/Workflows.cmake | 78 ++ Tests/RunCMake/block/WrongArgument-result.txt | 1 + Tests/RunCMake/block/WrongArgument-stderr.txt | 4 + Tests/RunCMake/block/WrongArgument.cmake | 2 + Tests/RunCMake/block/WrongScope-result.txt | 1 + Tests/RunCMake/block/WrongScope-stderr.txt | 4 + Tests/RunCMake/block/WrongScope.cmake | 2 + .../Registry_BadQuery2-stderr.txt | 6 +- .../Registry_BadView1-stderr.txt | 6 +- Tests/RunCMake/cmake_language/RunCMakeTest.cmake | 60 + .../cmake_language/get_message_log_level.cmake | 5 + .../get_message_log_level_cache-stdout.txt | 1 + .../get_message_log_level_cli-stdout.txt | 1 + .../get_message_log_level_cli_and_cache-stdout.txt | 1 + .../get_message_log_level_cli_and_var-stdout.txt | 1 + .../get_message_log_level_none-stdout.txt | 1 + .../get_message_log_level_var-stdout.txt | 1 + .../get_message_log_level_var_and_cache-stdout.txt | 1 + .../cmake_path/BASE_DIRECTORY-no-arg-stderr.txt | 4 + .../cmake_path/OUTPUT_VARIABLE-empty-stderr.txt | 4 + .../cmake_path/OUTPUT_VARIABLE-no-arg-stderr.txt | 4 +- Tests/RunCMake/cmake_path/RunCMakeTest.cmake | 11 + ...VIRONMENT_MODIFICATION-reset-to-prop-result.txt | 1 + ...VIRONMENT_MODIFICATION-reset-to-prop-stdout.txt | 1 + .../ENVIRONMENT_MODIFICATION-reset-to-prop.cmake | 9 + ...RONMENT_MODIFICATION-reset-to-system-result.txt | 1 + ...RONMENT_MODIFICATION-reset-to-system-stdout.txt | 1 + .../ENVIRONMENT_MODIFICATION-reset-to-system.cmake | 9 + .../RunCMake/ctest_environment/RunCMakeTest.cmake | 4 + .../ctest_memcheck/testCudaSanitizer.cmake | 9 + .../execute_process/EchoCommand3-stderr.txt | 4 +- .../execute_process/EncodingMissing-stderr.txt | 5 +- .../RunCMake/file-CHMOD/CHMOD-all-perms-stderr.txt | 5 - Tests/RunCMake/file-CHMOD/CHMOD-all-perms.cmake | 6 - .../file-CHMOD/CHMOD-invalid-path-stderr.txt | 6 - Tests/RunCMake/file-CHMOD/CHMOD-invalid-path.cmake | 4 - .../file-CHMOD/CHMOD-invalid-perms-stderr.txt | 4 - .../RunCMake/file-CHMOD/CHMOD-invalid-perms.cmake | 5 - .../file-CHMOD/CHMOD-no-keyword-stderr.txt | 4 - Tests/RunCMake/file-CHMOD/CHMOD-no-keyword.cmake | 5 - .../RunCMake/file-CHMOD/CHMOD-no-perms-stderr.txt | 4 - Tests/RunCMake/file-CHMOD/CHMOD-no-perms.cmake | 5 - Tests/RunCMake/file-CHMOD/CHMOD-ok.cmake | 5 - Tests/RunCMake/file-CHMOD/CHMOD-override.cmake | 6 - .../file-CHMOD/CHMOD-write-only-stderr.txt | 6 - Tests/RunCMake/file-CHMOD/CHMOD-write-only.cmake | 6 - Tests/RunCMake/file-CHMOD/RunCMakeTest.cmake | 18 +- Tests/RunCMake/file-CHMOD/all-perms-result.txt | 1 + Tests/RunCMake/file-CHMOD/all-perms-stderr.txt | 4 + Tests/RunCMake/file-CHMOD/all-perms.cmake | 3 + Tests/RunCMake/file-CHMOD/invalid-path-result.txt | 1 + Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt | 6 + Tests/RunCMake/file-CHMOD/invalid-path.cmake | 1 + Tests/RunCMake/file-CHMOD/invalid-perms-result.txt | 1 + Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt | 3 + Tests/RunCMake/file-CHMOD/invalid-perms.cmake | 2 + .../file-CHMOD/missing-dir-perms-result.txt | 1 + .../file-CHMOD/missing-dir-perms-stderr.txt | 5 + Tests/RunCMake/file-CHMOD/missing-dir-perms.cmake | 2 + .../file-CHMOD/missing-file-perms-result.txt | 1 + .../file-CHMOD/missing-file-perms-stderr.txt | 5 + Tests/RunCMake/file-CHMOD/missing-file-perms.cmake | 2 + Tests/RunCMake/file-CHMOD/missing-perms-result.txt | 1 + Tests/RunCMake/file-CHMOD/missing-perms-stderr.txt | 5 + Tests/RunCMake/file-CHMOD/missing-perms.cmake | 2 + Tests/RunCMake/file-CHMOD/no-perms-result.txt | 1 + Tests/RunCMake/file-CHMOD/no-perms-stderr.txt | 3 + Tests/RunCMake/file-CHMOD/no-perms.cmake | 2 + Tests/RunCMake/file-CHMOD/ok.cmake | 2 + Tests/RunCMake/file-CHMOD/override.cmake | 3 + Tests/RunCMake/file-CHMOD/write-only-result.txt | 1 + Tests/RunCMake/file-CHMOD/write-only-stderr.txt | 6 + Tests/RunCMake/file-CHMOD/write-only.cmake | 3 + .../badargs2-stderr.txt | 20 +- .../RunCMake/file/REAL_PATH-no-base-dir-stderr.txt | 9 +- Tests/RunCMake/file/RunCMakeTest.cmake | 1 + Tests/RunCMake/file/TIMESTAMP-stdout.txt | 1 + Tests/RunCMake/file/TIMESTAMP.cmake | 2 + Tests/RunCMake/find_file/RunCMakeTest.cmake | 4 + .../find_file/VALIDATOR-no-function-result.txt | 1 + .../find_file/VALIDATOR-no-function-stderr.txt | 4 + .../RunCMake/find_file/VALIDATOR-no-function.cmake | 2 + .../find_file/VALIDATOR-specify-macro-result.txt | 1 + .../find_file/VALIDATOR-specify-macro-stderr.txt | 4 + .../find_file/VALIDATOR-specify-macro.cmake | 5 + Tests/RunCMake/find_file/VALIDATOR-stderr.txt | 3 + Tests/RunCMake/find_file/VALIDATOR-stdout.txt | 3 + .../VALIDATOR-undefined-function-result.txt | 1 + .../VALIDATOR-undefined-function-stderr.txt | 4 + .../find_file/VALIDATOR-undefined-function.cmake | 2 + Tests/RunCMake/find_file/VALIDATOR.cmake | 39 + Tests/RunCMake/find_library/RunCMakeTest.cmake | 4 + .../find_library/VALIDATOR-no-function-result.txt | 1 + .../find_library/VALIDATOR-no-function-stderr.txt | 4 + .../find_library/VALIDATOR-no-function.cmake | 2 + .../VALIDATOR-specify-macro-result.txt | 1 + .../VALIDATOR-specify-macro-stderr.txt | 4 + .../find_library/VALIDATOR-specify-macro.cmake | 5 + Tests/RunCMake/find_library/VALIDATOR-stderr.txt | 3 + Tests/RunCMake/find_library/VALIDATOR-stdout.txt | 3 + .../VALIDATOR-undefined-function-result.txt | 1 + .../VALIDATOR-undefined-function-stderr.txt | 4 + .../VALIDATOR-undefined-function.cmake | 2 + Tests/RunCMake/find_library/VALIDATOR.cmake | 41 + Tests/RunCMake/find_package/RunCMakeTest.cmake | 16 + Tests/RunCMake/find_package/SearchPaths.cmake | 2 + .../SearchPaths/prefix/SearchPathsConfig.cmake | 0 .../prefix_cmake/cmake/SearchPathsConfig.cmake | 0 .../SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../lib/SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../cmake/SearchPathsConfig.cmake | 0 .../SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../cmake/SearchPathsConfig.cmake | 0 .../SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../lib/SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../cmake/SearchPathsConfig.cmake | 0 .../SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../cmake/SearchPathsConfig.cmake | 0 .../SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../SearchPaths-1.2.3/SearchPathsConfig.cmake | 0 .../cmake/SearchPathsConfig.cmake | 0 .../find_package/SearchPaths_prefix-stderr.txt | 10 + .../RunCMake/find_package/SearchPaths_prefix.cmake | 1 + .../SearchPaths_prefix_cmake-stderr.txt | 12 + .../find_package/SearchPaths_prefix_cmake.cmake | 1 + .../SearchPaths_prefix_lib_cmake_pkg-stderr.txt | 12 + .../SearchPaths_prefix_lib_cmake_pkg.cmake | 1 + .../SearchPaths_prefix_lib_pkg-stderr.txt | 12 + .../find_package/SearchPaths_prefix_lib_pkg.cmake | 1 + .../SearchPaths_prefix_lib_pkg_cmake-stderr.txt | 12 + .../SearchPaths_prefix_lib_pkg_cmake.cmake | 1 + .../find_package/SearchPaths_prefix_pkg-stderr.txt | 12 + .../find_package/SearchPaths_prefix_pkg.cmake | 1 + .../SearchPaths_prefix_pkg_cmake-stderr.txt | 14 + .../SearchPaths_prefix_pkg_cmake.cmake | 1 + .../SearchPaths_prefix_pkg_cmake_pkg-stderr.txt | 14 + .../SearchPaths_prefix_pkg_cmake_pkg.cmake | 1 + ...SearchPaths_prefix_pkg_lib_cmake_pkg-stderr.txt | 14 + .../SearchPaths_prefix_pkg_lib_cmake_pkg.cmake | 1 + .../SearchPaths_prefix_pkg_lib_pkg-stderr.txt | 14 + .../SearchPaths_prefix_pkg_lib_pkg.cmake | 1 + ...SearchPaths_prefix_pkg_lib_pkg_cmake-stderr.txt | 14 + .../SearchPaths_prefix_pkg_lib_pkg_cmake.cmake | 1 + ...archPaths_prefix_pkg_share_cmake_pkg-stderr.txt | 14 + .../SearchPaths_prefix_pkg_share_cmake_pkg.cmake | 1 + .../SearchPaths_prefix_pkg_share_pkg-stderr.txt | 14 + .../SearchPaths_prefix_pkg_share_pkg.cmake | 1 + ...archPaths_prefix_pkg_share_pkg_cmake-stderr.txt | 14 + .../SearchPaths_prefix_pkg_share_pkg_cmake.cmake | 1 + .../SearchPaths_prefix_share_cmake_pkg-stderr.txt | 12 + .../SearchPaths_prefix_share_cmake_pkg.cmake | 1 + .../SearchPaths_prefix_share_pkg-stderr.txt | 12 + .../SearchPaths_prefix_share_pkg.cmake | 1 + .../SearchPaths_prefix_share_pkg_cmake-stderr.txt | 12 + .../SearchPaths_prefix_share_pkg_cmake.cmake | 1 + Tests/RunCMake/find_path/RunCMakeTest.cmake | 4 + .../find_path/VALIDATOR-no-function-result.txt | 1 + .../find_path/VALIDATOR-no-function-stderr.txt | 4 + .../RunCMake/find_path/VALIDATOR-no-function.cmake | 2 + .../find_path/VALIDATOR-specify-macro-result.txt | 1 + .../find_path/VALIDATOR-specify-macro-stderr.txt | 4 + .../find_path/VALIDATOR-specify-macro.cmake | 5 + Tests/RunCMake/find_path/VALIDATOR-stderr.txt | 3 + Tests/RunCMake/find_path/VALIDATOR-stdout.txt | 3 + .../VALIDATOR-undefined-function-result.txt | 1 + .../VALIDATOR-undefined-function-stderr.txt | 4 + .../find_path/VALIDATOR-undefined-function.cmake | 2 + Tests/RunCMake/find_path/VALIDATOR.cmake | 39 + Tests/RunCMake/find_program/RunCMakeTest.cmake | 4 + .../find_program/VALIDATOR-no-function-result.txt | 1 + .../find_program/VALIDATOR-no-function-stderr.txt | 4 + .../find_program/VALIDATOR-no-function.cmake | 2 + .../VALIDATOR-specify-macro-result.txt | 1 + .../VALIDATOR-specify-macro-stderr.txt | 4 + .../find_program/VALIDATOR-specify-macro.cmake | 5 + Tests/RunCMake/find_program/VALIDATOR-stderr.txt | 3 + Tests/RunCMake/find_program/VALIDATOR-stdout.txt | 3 + .../VALIDATOR-undefined-function-result.txt | 1 + .../VALIDATOR-undefined-function-stderr.txt | 4 + .../VALIDATOR-undefined-function.cmake | 2 + Tests/RunCMake/find_program/VALIDATOR.cmake | 39 + .../DIRECTORY-symlink-clobber-all-result.txt | 1 + .../DIRECTORY-symlink-clobber-all-stderr.txt | 12 + .../DIRECTORY-symlink-clobber-all-stdout.txt | 12 + .../install/DIRECTORY-symlink-clobber.cmake | 11 + Tests/RunCMake/install/RunCMakeTest.cmake | 4 + .../project/LanguagesDuplicate-check.cmake | 10 + Tests/RunCMake/project/LanguagesDuplicate.cmake | 11 + Tests/RunCMake/project/RunCMakeTest.cmake | 5 + Tests/RunCMake/pseudo_tidy.c | 10 + Tests/RunCMake/return/CMP0140-NEW.cmake | 13 + Tests/RunCMake/return/CMP0140-OLD.cmake | 8 + Tests/RunCMake/return/CMP0140-WARN-result.txt | 1 + Tests/RunCMake/return/CMP0140-WARN-stderr.txt | 12 + Tests/RunCMake/return/CMP0140-WARN.cmake | 8 + Tests/RunCMake/return/CMakeLists.txt | 2 +- Tests/RunCMake/return/PropagateFromDirectory.cmake | 10 + Tests/RunCMake/return/PropagateFromFunction.cmake | 142 +++ Tests/RunCMake/return/PropagateNothing.cmake | 2 + Tests/RunCMake/return/RunCMakeTest.cmake | 9 + Tests/RunCMake/return/WrongArgument-result.txt | 1 + Tests/RunCMake/return/WrongArgument-stderr.txt | 4 + Tests/RunCMake/return/WrongArgument.cmake | 2 + Tests/RunCMake/return/subdir/CMakeLists.txt | 5 + Tests/RunCMake/showIncludes.c | 33 + Tests/RunCMake/string/JSON.cmake | 6 +- .../CMP0101-BEFORE_keyword-stderr.txt | 10 + .../RunCMakeTest.cmake | 10 + .../apple_framework.cmake | 30 + .../FileSetDefaultWrongTypeExperimental-result.txt | 1 + .../FileSetDefaultWrongTypeExperimental-stderr.txt | 12 + .../FileSetDefaultWrongTypeExperimental.cmake | 6 + .../FileSetWrongTypeExperimental-result.txt | 1 + .../FileSetWrongTypeExperimental-stderr.txt | 12 + .../FileSetWrongTypeExperimental.cmake | 6 + Tests/RunCMake/target_sources/RunCMakeTest.cmake | 2 + .../try_compile/BadLinkLibraries-stderr.txt | 2 +- Tests/RunCMake/try_compile/BadLinkLibraries.cmake | 6 +- Tests/RunCMake/try_compile/BadSources1-stderr.txt | 2 +- Tests/RunCMake/try_compile/BadSources1.cmake | 4 +- Tests/RunCMake/try_compile/BadSources2-stderr.txt | 2 +- Tests/RunCMake/try_compile/BadSources2.cmake | 7 +- Tests/RunCMake/try_compile/BinDirEmpty-result.txt | 1 + Tests/RunCMake/try_compile/BinDirEmpty-stderr.txt | 4 + Tests/RunCMake/try_compile/BinDirEmpty.cmake | 1 + .../RunCMake/try_compile/BinDirRelative-result.txt | 1 + .../RunCMake/try_compile/BinDirRelative-stderr.txt | 6 + Tests/RunCMake/try_compile/BinDirRelative.cmake | 1 + Tests/RunCMake/try_compile/BuildType.cmake | 8 + Tests/RunCMake/try_compile/BuildTypeAsFlag.cmake | 9 + Tests/RunCMake/try_compile/CStandard-stderr.txt | 2 +- Tests/RunCMake/try_compile/CStandard.cmake | 8 +- Tests/RunCMake/try_compile/CStandardGNU.cmake | 15 +- .../RunCMake/try_compile/CStandardNoDefault.cmake | 8 +- .../try_compile/CopyFileErrorNoCopyFile-stderr.txt | 2 +- .../try_compile/CopyFileErrorNoCopyFile.cmake | 4 +- Tests/RunCMake/try_compile/CudaStandard-stderr.txt | 2 +- Tests/RunCMake/try_compile/CudaStandard.cmake | 8 +- Tests/RunCMake/try_compile/CxxStandard-stderr.txt | 15 +- Tests/RunCMake/try_compile/CxxStandard.cmake | 8 +- Tests/RunCMake/try_compile/CxxStandardGNU.cmake | 15 +- .../try_compile/CxxStandardNoDefault.cmake | 8 +- Tests/RunCMake/try_compile/EmptyListArgs.cmake | 11 + .../RunCMake/try_compile/EmptyValueArgs-result.txt | 1 + .../RunCMake/try_compile/EmptyValueArgs-stderr.txt | 9 + Tests/RunCMake/try_compile/EmptyValueArgs.cmake | 7 + Tests/RunCMake/try_compile/EnvConfig.cmake | 6 +- .../RunCMake/try_compile/ISPCDuplicateTarget.cmake | 12 +- .../try_compile/ISPCDuplicateTargetNinja.cmake | 13 +- Tests/RunCMake/try_compile/ISPCInvalidTarget.cmake | 9 +- Tests/RunCMake/try_compile/ISPCTargets.cmake | 9 +- Tests/RunCMake/try_compile/NoArgs-stderr.txt | 4 +- Tests/RunCMake/try_compile/NoCStandard-result.txt | 1 + Tests/RunCMake/try_compile/NoCStandard-stderr.txt | 7 + Tests/RunCMake/try_compile/NoCStandard.cmake | 4 + Tests/RunCMake/try_compile/NoCopyFile-stderr.txt | 7 +- Tests/RunCMake/try_compile/NoCopyFile.cmake | 4 +- Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt | 7 +- Tests/RunCMake/try_compile/NoCopyFile2.cmake | 4 +- .../try_compile/NoCopyFileError-stderr.txt | 7 +- Tests/RunCMake/try_compile/NoCopyFileError.cmake | 4 +- .../try_compile/NoOutputVariable-stderr.txt | 7 +- Tests/RunCMake/try_compile/NoOutputVariable.cmake | 4 +- .../try_compile/NoOutputVariable2-stderr.txt | 7 +- Tests/RunCMake/try_compile/NoOutputVariable2.cmake | 4 +- Tests/RunCMake/try_compile/NoSources-stderr.txt | 7 +- .../NonSourceCompileDefinitions-stderr.txt | 4 +- .../try_compile/NonSourceCopyFile-stderr.txt | 4 +- Tests/RunCMake/try_compile/ObjCStandard-stderr.txt | 2 +- Tests/RunCMake/try_compile/ObjCStandard.cmake | 8 +- .../RunCMake/try_compile/ObjCxxStandard-stderr.txt | 2 +- Tests/RunCMake/try_compile/ObjCxxStandard.cmake | 8 +- .../try_compile/OldProjectBinDirEmpty-result.txt | 1 + .../try_compile/OldProjectBinDirEmpty-stderr.txt | 4 + .../try_compile/OldProjectBinDirEmpty.cmake | 1 + .../try_compile/OldProjectSrcDirEmpty-result.txt | 1 + .../try_compile/OldProjectSrcDirEmpty-stderr.txt | 4 + .../try_compile/OldProjectSrcDirEmpty.cmake | 1 + Tests/RunCMake/try_compile/OneArg-stderr.txt | 4 +- Tests/RunCMake/try_compile/OutputDirAsFlag.cmake | 9 + .../try_compile/PlatformVariables-stderr.txt | 11 + .../try_compile/ProjectBinDirEmpty-result.txt | 1 + .../try_compile/ProjectBinDirEmpty-stderr.txt | 4 + .../RunCMake/try_compile/ProjectBinDirEmpty.cmake | 4 + .../try_compile/ProjectCopyFile-result.txt | 1 + .../try_compile/ProjectCopyFile-stderr.txt | 7 + Tests/RunCMake/try_compile/ProjectCopyFile.cmake | 4 + .../try_compile/ProjectSrcDirEmpty-result.txt | 1 + .../try_compile/ProjectSrcDirEmpty-stderr.txt | 4 + .../RunCMake/try_compile/ProjectSrcDirEmpty.cmake | 1 + .../try_compile/ProjectSrcDirMissing-result.txt | 1 + .../try_compile/ProjectSrcDirMissing-stderr.txt | 4 + .../try_compile/ProjectSrcDirMissing.cmake | 1 + Tests/RunCMake/try_compile/RunCMakeTest.cmake | 72 +- .../try_compile/SourceFromBadFile-result.txt | 1 + .../try_compile/SourceFromBadFile-stderr.txt | 4 + Tests/RunCMake/try_compile/SourceFromBadFile.cmake | 1 + .../try_compile/SourceFromBadName-result.txt | 1 + .../try_compile/SourceFromBadName-stderr.txt | 4 + Tests/RunCMake/try_compile/SourceFromBadName.cmake | 1 + .../try_compile/SourceFromOneArg-result.txt | 1 + .../try_compile/SourceFromOneArg-stderr.txt | 4 + Tests/RunCMake/try_compile/SourceFromOneArg.cmake | 1 + .../try_compile/SourceFromThreeArgs-result.txt | 1 + .../try_compile/SourceFromThreeArgs-stderr.txt | 4 + .../RunCMake/try_compile/SourceFromThreeArgs.cmake | 1 + Tests/RunCMake/try_compile/TargetTypeExe.cmake | 10 +- .../try_compile/TargetTypeInvalid-stderr.txt | 2 +- Tests/RunCMake/try_compile/TargetTypeInvalid.cmake | 6 +- Tests/RunCMake/try_compile/TargetTypeStatic.cmake | 10 +- Tests/RunCMake/try_compile/TryRunArgs-stderr.txt | 18 + Tests/RunCMake/try_compile/TryRunArgs.cmake | 14 + Tests/RunCMake/try_compile/TwoArgs-stderr.txt | 4 +- .../RunCMake/try_compile/WarnDeprecated-stderr.txt | 11 + Tests/RunCMake/try_compile/new_signature.cmake | 2 + .../try_compile/old_and_new_signature_tests.cmake | 66 + Tests/RunCMake/try_compile/old_signature.cmake | 2 + Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt | 2 +- Tests/RunCMake/try_run/BadLinkLibraries.cmake | 7 +- Tests/RunCMake/try_run/BinDirEmpty-result.txt | 1 + Tests/RunCMake/try_run/BinDirEmpty-stderr.txt | 4 + Tests/RunCMake/try_run/BinDirEmpty.cmake | 1 + Tests/RunCMake/try_run/BinDirRelative-result.txt | 1 + Tests/RunCMake/try_run/BinDirRelative-stderr.txt | 6 + Tests/RunCMake/try_run/BinDirRelative.cmake | 1 + .../try_run/NoCompileOutputVariable-result.txt | 1 + .../try_run/NoCompileOutputVariable-stderr.txt | 7 + .../RunCMake/try_run/NoCompileOutputVariable.cmake | 6 + .../try_run/NoOutputCompileVariable-result.txt | 1 + Tests/RunCMake/try_run/NoOutputVariable-result.txt | 1 + Tests/RunCMake/try_run/NoOutputVariable-stderr.txt | 7 + Tests/RunCMake/try_run/NoOutputVariable.cmake | 4 + .../try_run/NoRunOutputVariable-result.txt | 1 + .../try_run/NoRunOutputVariable-stderr.txt | 7 + Tests/RunCMake/try_run/NoRunOutputVariable.cmake | 6 + .../try_run/NoRunStdErrVariable-result.txt | 1 + .../try_run/NoRunStdErrVariable-stderr.txt | 7 + Tests/RunCMake/try_run/NoRunStdErrVariable.cmake | 7 + .../try_run/NoRunStdOutVariable-result.txt | 1 + .../try_run/NoRunStdOutVariable-stderr.txt | 7 + Tests/RunCMake/try_run/NoRunStdOutVariable.cmake | 7 + .../RunCMake/try_run/NoWorkingDirectory-result.txt | 1 + .../RunCMake/try_run/NoWorkingDirectory-stderr.txt | 7 + Tests/RunCMake/try_run/NoWorkingDirectory.cmake | 6 + Tests/RunCMake/try_run/RunCMakeTest.cmake | 14 +- Tests/RunCMake/try_run/WorkingDirArg.cmake | 8 +- Tests/RunCMake/try_run/new_signature.cmake | 2 + .../try_run/old_and_new_signature_tests.cmake | 20 + Tests/RunCMake/try_run/old_signature.cmake | 2 + Tests/SwiftMix/CMain.c | 13 + Tests/SwiftMix/CMakeLists.txt | 1 + Tests/SwiftMix/SwiftMain.swift | 20 + Tests/SwiftMixLib/CMakeLists.txt | 6 + Tests/SwiftMixLib/lib.c | 4 + Tests/SwiftMixLib/lib.cpp | 4 + Tests/SwiftMixLib/lib.swift | 3 + Tests/SwiftMixLib/main.swift | 3 + Tests/SwiftOnly/CMakeLists.txt | 4 + Tests/SwiftOnly/SubA/CMakeLists.txt | 2 + Tests/SwiftOnly/SubA/SubA.swift | 0 Tests/SwiftOnly/SubB/CMakeLists.txt | 2 + Tests/SwiftOnly/SubB/SubB.swift | 1 + Tests/SwiftOnly/main.swift | 6 + Tests/TryCompile/CMakeLists.txt | 457 ++----- Tests/TryCompile/exit_with_error.c | 2 +- Tests/TryCompile/old_and_new_signature_tests.cmake | 276 +++++ Tests/TryCompile/stdout_and_stderr.c | 8 + Tests/VSGNUFortran/CMakeLists.txt | 2 +- Tests/VSWinStorePhone/VerifyAppPackage.cmake | 2 +- Utilities/Doxygen/CMakeLists.txt | 2 +- Utilities/IWYU/mapping.imp | 2 +- Utilities/Release/WiX/CustomAction/CMakeLists.txt | 4 + Utilities/Release/linux/aarch64/Dockerfile | 2 +- Utilities/Release/linux/x86_64/Dockerfile | 2 +- Utilities/Scripts/update-curl.bash | 2 +- Utilities/Scripts/update-libuv.bash | 2 +- Utilities/Sphinx/CMakeLists.txt | 18 +- Utilities/Sphinx/cmake.py | 18 +- Utilities/Sphinx/static/cmake.css | 11 + Utilities/cmThirdPartyChecks.cmake | 8 + Utilities/cmcurl/CMake/CMakeConfigurableFile.in | 4 +- Utilities/cmcurl/CMake/CurlSymbolHiding.cmake | 4 +- Utilities/cmcurl/CMake/CurlTests.c | 60 +- Utilities/cmcurl/CMake/FindBearSSL.cmake | 4 +- Utilities/cmcurl/CMake/FindBrotli.cmake | 4 +- Utilities/cmcurl/CMake/FindCARES.cmake | 4 +- Utilities/cmcurl/CMake/FindGSS.cmake | 4 +- Utilities/cmcurl/CMake/FindLibPSL.cmake | 45 + Utilities/cmcurl/CMake/FindLibSSH2.cmake | 4 +- Utilities/cmcurl/CMake/FindMSH3.cmake | 2 + Utilities/cmcurl/CMake/FindMbedTLS.cmake | 2 + Utilities/cmcurl/CMake/FindNGHTTP2.cmake | 4 +- Utilities/cmcurl/CMake/FindNGHTTP3.cmake | 4 +- Utilities/cmcurl/CMake/FindNGTCP2.cmake | 6 +- Utilities/cmcurl/CMake/FindNSS.cmake | 4 +- Utilities/cmcurl/CMake/FindQUICHE.cmake | 4 +- Utilities/cmcurl/CMake/FindWolfSSL.cmake | 4 +- Utilities/cmcurl/CMake/FindZstd.cmake | 4 +- Utilities/cmcurl/CMake/Macros.cmake | 4 +- Utilities/cmcurl/CMake/OtherTests.cmake | 171 +-- .../cmcurl/CMake/Platforms/WindowsCache.cmake | 41 +- Utilities/cmcurl/CMake/Utilities.cmake | 4 +- Utilities/cmcurl/CMake/cmake_uninstall.cmake.in | 4 +- Utilities/cmcurl/CMake/curl-config.cmake.in | 4 +- Utilities/cmcurl/CMakeLists.txt | 328 ++--- Utilities/cmcurl/include/curl/curl.h | 77 +- Utilities/cmcurl/include/curl/curlver.h | 10 +- Utilities/cmcurl/include/curl/easy.h | 4 +- Utilities/cmcurl/include/curl/header.h | 10 + Utilities/cmcurl/include/curl/mprintf.h | 4 +- Utilities/cmcurl/include/curl/multi.h | 7 +- Utilities/cmcurl/include/curl/options.h | 4 +- Utilities/cmcurl/include/curl/stdcheaders.h | 4 +- Utilities/cmcurl/include/curl/system.h | 2 + Utilities/cmcurl/include/curl/typecheck-gcc.h | 17 +- Utilities/cmcurl/include/curl/urlapi.h | 4 +- Utilities/cmcurl/include/curl/websockets.h | 83 ++ Utilities/cmcurl/lib/CMakeLists.txt | 30 +- Utilities/cmcurl/lib/Makefile.inc | 17 +- Utilities/cmcurl/lib/altsvc.c | 62 +- Utilities/cmcurl/lib/altsvc.h | 4 +- Utilities/cmcurl/lib/amigaos.c | 212 +++- Utilities/cmcurl/lib/amigaos.h | 18 +- Utilities/cmcurl/lib/arpa_telnet.h | 4 +- Utilities/cmcurl/lib/asyn-ares.c | 49 +- Utilities/cmcurl/lib/asyn-thread.c | 21 +- Utilities/cmcurl/lib/asyn.h | 6 +- Utilities/cmcurl/lib/base64.c | 80 +- Utilities/cmcurl/lib/bufref.c | 4 +- Utilities/cmcurl/lib/bufref.h | 4 +- Utilities/cmcurl/lib/c-hyper.c | 69 +- Utilities/cmcurl/lib/c-hyper.h | 5 +- Utilities/cmcurl/lib/conncache.c | 4 +- Utilities/cmcurl/lib/conncache.h | 3 + Utilities/cmcurl/lib/connect.c | 85 +- Utilities/cmcurl/lib/connect.h | 4 +- Utilities/cmcurl/lib/content_encoding.c | 85 +- Utilities/cmcurl/lib/content_encoding.h | 7 +- Utilities/cmcurl/lib/cookie.c | 204 ++-- Utilities/cmcurl/lib/cookie.h | 25 +- Utilities/cmcurl/lib/curl_addrinfo.c | 6 +- Utilities/cmcurl/lib/curl_addrinfo.h | 4 +- Utilities/cmcurl/lib/curl_base64.h | 2 + Utilities/cmcurl/lib/curl_config.h.cmake | 260 +--- Utilities/cmcurl/lib/curl_ctype.c | 130 -- Utilities/cmcurl/lib/curl_ctype.h | 42 +- Utilities/cmcurl/lib/curl_des.c | 4 +- Utilities/cmcurl/lib/curl_des.h | 2 + Utilities/cmcurl/lib/curl_endian.c | 4 +- Utilities/cmcurl/lib/curl_endian.h | 4 +- Utilities/cmcurl/lib/curl_fnmatch.c | 4 +- Utilities/cmcurl/lib/curl_fnmatch.h | 4 +- Utilities/cmcurl/lib/curl_get_line.c | 10 +- Utilities/cmcurl/lib/curl_get_line.h | 4 +- Utilities/cmcurl/lib/curl_gethostname.c | 4 +- Utilities/cmcurl/lib/curl_gethostname.h | 4 +- Utilities/cmcurl/lib/curl_gssapi.c | 14 +- Utilities/cmcurl/lib/curl_gssapi.h | 4 +- Utilities/cmcurl/lib/curl_hmac.h | 6 +- Utilities/cmcurl/lib/curl_krb5.h | 4 +- Utilities/cmcurl/lib/curl_ldap.h | 4 +- Utilities/cmcurl/lib/curl_md4.h | 4 +- Utilities/cmcurl/lib/curl_md5.h | 4 +- Utilities/cmcurl/lib/curl_memory.h | 4 +- Utilities/cmcurl/lib/curl_memrchr.c | 4 +- Utilities/cmcurl/lib/curl_memrchr.h | 4 +- Utilities/cmcurl/lib/curl_multibyte.c | 2 + Utilities/cmcurl/lib/curl_multibyte.h | 4 +- Utilities/cmcurl/lib/curl_ntlm_core.c | 17 +- Utilities/cmcurl/lib/curl_ntlm_core.h | 6 +- Utilities/cmcurl/lib/curl_ntlm_wb.c | 6 +- Utilities/cmcurl/lib/curl_ntlm_wb.h | 4 +- Utilities/cmcurl/lib/curl_path.c | 5 +- Utilities/cmcurl/lib/curl_path.h | 4 +- Utilities/cmcurl/lib/curl_printf.h | 4 +- Utilities/cmcurl/lib/curl_range.c | 6 +- Utilities/cmcurl/lib/curl_range.h | 4 +- Utilities/cmcurl/lib/curl_rtmp.c | 6 +- Utilities/cmcurl/lib/curl_rtmp.h | 4 +- Utilities/cmcurl/lib/curl_sasl.c | 2 + Utilities/cmcurl/lib/curl_sasl.h | 2 + Utilities/cmcurl/lib/curl_setup.h | 58 +- Utilities/cmcurl/lib/curl_setup_once.h | 79 +- Utilities/cmcurl/lib/curl_sha256.h | 3 + Utilities/cmcurl/lib/curl_sspi.c | 4 +- Utilities/cmcurl/lib/curl_sspi.h | 4 +- Utilities/cmcurl/lib/curl_threads.c | 4 +- Utilities/cmcurl/lib/curl_threads.h | 4 +- Utilities/cmcurl/lib/curlx.h | 4 +- Utilities/cmcurl/lib/dict.c | 2 + Utilities/cmcurl/lib/dict.h | 4 +- Utilities/cmcurl/lib/doh.c | 21 +- Utilities/cmcurl/lib/doh.h | 51 +- Utilities/cmcurl/lib/dotdot.c | 182 --- Utilities/cmcurl/lib/dynbuf.c | 21 +- Utilities/cmcurl/lib/dynbuf.h | 10 +- Utilities/cmcurl/lib/easy.c | 136 ++- Utilities/cmcurl/lib/easy_lock.h | 105 ++ Utilities/cmcurl/lib/easygetopt.c | 4 +- Utilities/cmcurl/lib/easyif.h | 7 +- Utilities/cmcurl/lib/easyoptions.c | 20 +- Utilities/cmcurl/lib/easyoptions.h | 4 +- Utilities/cmcurl/lib/escape.c | 8 +- Utilities/cmcurl/lib/escape.h | 2 + Utilities/cmcurl/lib/file.c | 31 +- Utilities/cmcurl/lib/file.h | 4 +- Utilities/cmcurl/lib/fileinfo.c | 4 +- Utilities/cmcurl/lib/fileinfo.h | 4 +- Utilities/cmcurl/lib/fopen.c | 113 ++ Utilities/cmcurl/lib/{vssh/wolfssh.h => fopen.h} | 13 +- Utilities/cmcurl/lib/formdata.c | 8 +- Utilities/cmcurl/lib/formdata.h | 4 +- Utilities/cmcurl/lib/ftp.c | 42 +- Utilities/cmcurl/lib/ftp.h | 7 +- Utilities/cmcurl/lib/ftplistparser.c | 8 +- Utilities/cmcurl/lib/ftplistparser.h | 4 +- Utilities/cmcurl/lib/functypes.h | 115 ++ Utilities/cmcurl/lib/getenv.c | 4 +- Utilities/cmcurl/lib/getinfo.c | 22 +- Utilities/cmcurl/lib/getinfo.h | 4 +- Utilities/cmcurl/lib/gopher.c | 2 + Utilities/cmcurl/lib/gopher.h | 4 +- Utilities/cmcurl/lib/h2h3.c | 7 +- Utilities/cmcurl/lib/h2h3.h | 2 + Utilities/cmcurl/lib/hash.c | 4 +- Utilities/cmcurl/lib/hash.h | 4 +- Utilities/cmcurl/lib/headers.c | 72 +- Utilities/cmcurl/lib/headers.h | 4 +- Utilities/cmcurl/lib/hmac.c | 2 + Utilities/cmcurl/lib/hostasyn.c | 4 +- Utilities/cmcurl/lib/hostip.c | 75 +- Utilities/cmcurl/lib/hostip.h | 6 +- Utilities/cmcurl/lib/hostip4.c | 10 +- Utilities/cmcurl/lib/hostip6.c | 10 +- Utilities/cmcurl/lib/hostsyn.c | 4 +- Utilities/cmcurl/lib/hsts.c | 33 +- Utilities/cmcurl/lib/hsts.h | 4 +- Utilities/cmcurl/lib/http.c | 201 +++- Utilities/cmcurl/lib/http.h | 27 +- Utilities/cmcurl/lib/http2.c | 67 +- Utilities/cmcurl/lib/http2.h | 4 +- Utilities/cmcurl/lib/http_aws_sigv4.c | 542 +++++---- Utilities/cmcurl/lib/http_aws_sigv4.h | 4 +- Utilities/cmcurl/lib/http_chunks.c | 7 +- Utilities/cmcurl/lib/http_chunks.h | 4 +- Utilities/cmcurl/lib/http_digest.c | 8 +- Utilities/cmcurl/lib/http_digest.h | 4 +- Utilities/cmcurl/lib/http_negotiate.c | 4 +- Utilities/cmcurl/lib/http_negotiate.h | 4 +- Utilities/cmcurl/lib/http_ntlm.c | 4 +- Utilities/cmcurl/lib/http_ntlm.h | 4 +- Utilities/cmcurl/lib/http_proxy.c | 12 +- Utilities/cmcurl/lib/http_proxy.h | 2 + Utilities/cmcurl/lib/idn_win32.c | 10 +- Utilities/cmcurl/lib/if2ip.c | 2 + Utilities/cmcurl/lib/if2ip.h | 2 + Utilities/cmcurl/lib/imap.c | 20 +- Utilities/cmcurl/lib/imap.h | 4 +- Utilities/cmcurl/lib/inet_ntop.c | 4 +- Utilities/cmcurl/lib/inet_ntop.h | 4 +- Utilities/cmcurl/lib/inet_pton.c | 4 +- Utilities/cmcurl/lib/inet_pton.h | 4 +- Utilities/cmcurl/lib/krb5.c | 20 +- Utilities/cmcurl/lib/ldap.c | 28 +- Utilities/cmcurl/lib/libcurl.rc | 4 +- Utilities/cmcurl/lib/llist.c | 4 +- Utilities/cmcurl/lib/llist.h | 4 +- Utilities/cmcurl/lib/md4.c | 15 +- Utilities/cmcurl/lib/md5.c | 4 +- Utilities/cmcurl/lib/memdebug.c | 25 +- Utilities/cmcurl/lib/memdebug.h | 49 +- Utilities/cmcurl/lib/mime.c | 11 +- Utilities/cmcurl/lib/mime.h | 7 +- Utilities/cmcurl/lib/mprintf.c | 35 +- Utilities/cmcurl/lib/mqtt.c | 28 +- Utilities/cmcurl/lib/mqtt.h | 4 +- Utilities/cmcurl/lib/multi.c | 90 +- Utilities/cmcurl/lib/multihandle.h | 14 +- Utilities/cmcurl/lib/multiif.h | 7 +- Utilities/cmcurl/lib/netrc.c | 124 +- Utilities/cmcurl/lib/netrc.h | 12 +- Utilities/cmcurl/lib/nonblock.c | 2 + Utilities/cmcurl/lib/nonblock.h | 4 +- Utilities/cmcurl/lib/noproxy.c | 222 ++++ Utilities/cmcurl/lib/{dotdot.h => noproxy.h} | 29 +- Utilities/cmcurl/lib/openldap.c | 6 +- Utilities/cmcurl/lib/parsedate.c | 4 +- Utilities/cmcurl/lib/parsedate.h | 4 +- Utilities/cmcurl/lib/pingpong.c | 7 +- Utilities/cmcurl/lib/pingpong.h | 4 +- Utilities/cmcurl/lib/pop3.c | 2 + Utilities/cmcurl/lib/pop3.h | 4 +- Utilities/cmcurl/lib/progress.c | 4 +- Utilities/cmcurl/lib/progress.h | 4 +- Utilities/cmcurl/lib/psl.c | 4 +- Utilities/cmcurl/lib/psl.h | 4 +- Utilities/cmcurl/lib/quic.h | 3 + Utilities/cmcurl/lib/rand.c | 77 +- Utilities/cmcurl/lib/rand.h | 12 +- Utilities/cmcurl/lib/rename.c | 4 +- Utilities/cmcurl/lib/rename.h | 4 +- Utilities/cmcurl/lib/rtsp.c | 4 +- Utilities/cmcurl/lib/rtsp.h | 4 +- Utilities/cmcurl/lib/select.c | 14 +- Utilities/cmcurl/lib/select.h | 5 +- Utilities/cmcurl/lib/sendf.c | 75 +- Utilities/cmcurl/lib/sendf.h | 6 +- Utilities/cmcurl/lib/setopt.c | 245 ++-- Utilities/cmcurl/lib/setopt.h | 4 +- Utilities/cmcurl/lib/setup-os400.h | 4 +- Utilities/cmcurl/lib/setup-vms.h | 4 +- Utilities/cmcurl/lib/setup-win32.h | 19 +- Utilities/cmcurl/lib/sha256.c | 2 + Utilities/cmcurl/lib/share.c | 6 +- Utilities/cmcurl/lib/share.h | 4 +- Utilities/cmcurl/lib/sigpipe.h | 4 +- Utilities/cmcurl/lib/slist.c | 4 +- Utilities/cmcurl/lib/slist.h | 4 +- Utilities/cmcurl/lib/smb.c | 4 +- Utilities/cmcurl/lib/smb.h | 6 +- Utilities/cmcurl/lib/smtp.c | 10 +- Utilities/cmcurl/lib/smtp.h | 8 +- Utilities/cmcurl/lib/sockaddr.h | 4 +- Utilities/cmcurl/lib/socketpair.c | 4 +- Utilities/cmcurl/lib/socketpair.h | 6 +- Utilities/cmcurl/lib/socks.c | 2 + Utilities/cmcurl/lib/socks.h | 2 + Utilities/cmcurl/lib/socks_gssapi.c | 8 +- Utilities/cmcurl/lib/socks_sspi.c | 6 +- Utilities/cmcurl/lib/speedcheck.c | 4 +- Utilities/cmcurl/lib/speedcheck.h | 4 +- Utilities/cmcurl/lib/splay.c | 8 +- Utilities/cmcurl/lib/splay.h | 4 +- Utilities/cmcurl/lib/strcase.c | 86 +- Utilities/cmcurl/lib/strcase.h | 4 + Utilities/cmcurl/lib/strdup.c | 4 +- Utilities/cmcurl/lib/strdup.h | 4 +- Utilities/cmcurl/lib/strerror.c | 16 +- Utilities/cmcurl/lib/strerror.h | 4 +- Utilities/cmcurl/lib/strtok.c | 4 +- Utilities/cmcurl/lib/strtok.h | 4 +- Utilities/cmcurl/lib/strtoofft.c | 10 +- Utilities/cmcurl/lib/strtoofft.h | 4 +- Utilities/cmcurl/lib/system_win32.c | 4 +- Utilities/cmcurl/lib/system_win32.h | 4 +- Utilities/cmcurl/lib/telnet.c | 2 + Utilities/cmcurl/lib/telnet.h | 4 +- Utilities/cmcurl/lib/tftp.c | 2 + Utilities/cmcurl/lib/tftp.h | 4 +- Utilities/cmcurl/lib/timediff.c | 4 + Utilities/cmcurl/lib/timediff.h | 2 + Utilities/cmcurl/lib/timeval.c | 4 +- Utilities/cmcurl/lib/timeval.h | 2 + Utilities/cmcurl/lib/transfer.c | 112 +- Utilities/cmcurl/lib/transfer.h | 2 + Utilities/cmcurl/lib/url.c | 740 ++++++------ Utilities/cmcurl/lib/url.h | 5 +- Utilities/cmcurl/lib/urlapi-int.h | 10 +- Utilities/cmcurl/lib/urlapi.c | 904 ++++++++------ Utilities/cmcurl/lib/urldata.h | 298 +++-- Utilities/cmcurl/lib/vauth/cleartext.c | 4 +- Utilities/cmcurl/lib/vauth/cram.c | 4 +- Utilities/cmcurl/lib/vauth/digest.c | 185 +-- Utilities/cmcurl/lib/vauth/digest.h | 13 +- Utilities/cmcurl/lib/vauth/digest_sspi.c | 16 +- Utilities/cmcurl/lib/vauth/gsasl.c | 7 +- Utilities/cmcurl/lib/vauth/krb5_gssapi.c | 4 +- Utilities/cmcurl/lib/vauth/krb5_sspi.c | 4 +- Utilities/cmcurl/lib/vauth/ntlm.c | 17 +- Utilities/cmcurl/lib/vauth/ntlm.h | 7 +- Utilities/cmcurl/lib/vauth/ntlm_sspi.c | 4 +- Utilities/cmcurl/lib/vauth/oauth2.c | 4 +- Utilities/cmcurl/lib/vauth/spnego_gssapi.c | 2 + Utilities/cmcurl/lib/vauth/spnego_sspi.c | 2 + Utilities/cmcurl/lib/vauth/vauth.c | 21 +- Utilities/cmcurl/lib/vauth/vauth.h | 10 +- Utilities/cmcurl/lib/version.c | 21 +- Utilities/cmcurl/lib/version_win32.c | 2 + Utilities/cmcurl/lib/version_win32.h | 4 +- Utilities/cmcurl/lib/vquic/msh3.c | 58 +- Utilities/cmcurl/lib/vquic/msh3.h | 2 + Utilities/cmcurl/lib/vquic/ngtcp2.c | 855 +++++++++---- Utilities/cmcurl/lib/vquic/ngtcp2.h | 36 +- Utilities/cmcurl/lib/vquic/quiche.c | 68 +- Utilities/cmcurl/lib/vquic/quiche.h | 4 + Utilities/cmcurl/lib/vquic/vquic.c | 2 + Utilities/cmcurl/lib/vquic/vquic.h | 2 + Utilities/cmcurl/lib/vssh/libssh.c | 60 +- Utilities/cmcurl/lib/vssh/libssh2.c | 127 +- Utilities/cmcurl/lib/vssh/ssh.h | 12 +- Utilities/cmcurl/lib/vssh/wolfssh.c | 2 + Utilities/cmcurl/lib/vtls/bearssl.c | 34 +- Utilities/cmcurl/lib/vtls/bearssl.h | 4 +- Utilities/cmcurl/lib/vtls/gskit.c | 2 + Utilities/cmcurl/lib/vtls/gskit.h | 4 +- Utilities/cmcurl/lib/vtls/gtls.c | 11 +- Utilities/cmcurl/lib/vtls/gtls.h | 4 +- Utilities/cmcurl/lib/vtls/hostcheck.c | 2 + Utilities/cmcurl/lib/vtls/hostcheck.h | 2 + Utilities/cmcurl/lib/vtls/keylog.c | 5 +- Utilities/cmcurl/lib/vtls/keylog.h | 4 +- Utilities/cmcurl/lib/vtls/mbedtls.c | 8 +- Utilities/cmcurl/lib/vtls/mbedtls.h | 4 +- Utilities/cmcurl/lib/vtls/mbedtls_threadlock.c | 4 +- Utilities/cmcurl/lib/vtls/mbedtls_threadlock.h | 4 +- Utilities/cmcurl/lib/vtls/nss.c | 32 +- Utilities/cmcurl/lib/vtls/nssg.h | 4 +- Utilities/cmcurl/lib/vtls/openssl.c | 1014 ++++++++-------- Utilities/cmcurl/lib/vtls/openssl.h | 5 + Utilities/cmcurl/lib/vtls/rustls.c | 8 +- Utilities/cmcurl/lib/vtls/rustls.h | 4 +- Utilities/cmcurl/lib/vtls/schannel.c | 518 ++++++-- Utilities/cmcurl/lib/vtls/schannel.h | 94 +- Utilities/cmcurl/lib/vtls/schannel_verify.c | 2 + Utilities/cmcurl/lib/vtls/sectransp.c | 10 +- Utilities/cmcurl/lib/vtls/sectransp.h | 4 +- Utilities/cmcurl/lib/vtls/vtls.c | 28 +- Utilities/cmcurl/lib/vtls/vtls.h | 7 +- Utilities/cmcurl/lib/vtls/wolfssl.c | 26 +- Utilities/cmcurl/lib/vtls/wolfssl.h | 4 +- Utilities/cmcurl/lib/vtls/x509asn1.c | 7 +- Utilities/cmcurl/lib/vtls/x509asn1.h | 2 + Utilities/cmcurl/lib/warnless.c | 4 + Utilities/cmcurl/lib/warnless.h | 2 + Utilities/cmcurl/lib/wildcard.c | 4 +- Utilities/cmcurl/lib/wildcard.h | 5 +- Utilities/cmcurl/lib/ws.c | 757 ++++++++++++ Utilities/cmcurl/lib/ws.h | 69 ++ Utilities/cmexpat/CMakeLists.txt | 6 + Utilities/cmjsoncpp/CMakeLists.txt | 2 +- Utilities/cmlibarchive/CMakeLists.txt | 2 + Utilities/cmlibuv/CMakeLists.txt | 2 + Utilities/cmlibuv/include/uv.h | 5 +- Utilities/cmlibuv/include/uv/version.h | 8 +- Utilities/cmlibuv/include/uv/win.h | 8 +- Utilities/cmlibuv/src/fs-poll.c | 2 +- Utilities/cmlibuv/src/idna.c | 11 +- Utilities/cmlibuv/src/strscpy.h | 2 +- Utilities/cmlibuv/src/strtok.c | 52 + Utilities/cmlibuv/src/strtok.h | 27 + Utilities/cmlibuv/src/unix/atomic-ops.h | 15 +- Utilities/cmlibuv/src/unix/bsd-ifaddrs.c | 8 +- Utilities/cmlibuv/src/unix/bsd-proctitle.c | 1 + Utilities/cmlibuv/src/unix/cmake-bootstrap.c | 2 + Utilities/cmlibuv/src/unix/core.c | 244 ++-- Utilities/cmlibuv/src/unix/freebsd.c | 15 + Utilities/cmlibuv/src/unix/fs.c | 18 +- Utilities/cmlibuv/src/unix/hurd.c | 167 +++ Utilities/cmlibuv/src/unix/internal.h | 25 +- Utilities/cmlibuv/src/unix/kqueue.c | 23 +- Utilities/cmlibuv/src/unix/linux-core.c | 29 +- Utilities/cmlibuv/src/unix/os390-syscalls.c | 36 +- Utilities/cmlibuv/src/unix/os390.c | 289 ++++- Utilities/cmlibuv/src/unix/pipe.c | 8 +- Utilities/cmlibuv/src/unix/process.c | 786 ++++++++++-- Utilities/cmlibuv/src/unix/stream.c | 99 +- Utilities/cmlibuv/src/unix/sunos.c | 36 +- Utilities/cmlibuv/src/unix/tcp.c | 19 +- Utilities/cmlibuv/src/unix/thread.c | 86 +- Utilities/cmlibuv/src/unix/tty.c | 84 +- Utilities/cmlibuv/src/unix/udp.c | 28 +- Utilities/cmlibuv/src/uv-common.c | 4 +- Utilities/cmlibuv/src/uv-common.h | 5 +- Utilities/cmlibuv/src/win/async.c | 10 +- Utilities/cmlibuv/src/win/core.c | 90 +- Utilities/cmlibuv/src/win/fs-event.c | 36 +- Utilities/cmlibuv/src/win/fs.c | 24 +- Utilities/cmlibuv/src/win/handle-inl.h | 26 +- Utilities/cmlibuv/src/win/handle.c | 26 +- Utilities/cmlibuv/src/win/internal.h | 145 ++- Utilities/cmlibuv/src/win/loop-watcher.c | 4 +- Utilities/cmlibuv/src/win/pipe.c | 556 +++++---- Utilities/cmlibuv/src/win/poll.c | 36 +- Utilities/cmlibuv/src/win/process.c | 20 +- Utilities/cmlibuv/src/win/req-inl.h | 43 +- Utilities/cmlibuv/src/win/signal.c | 12 +- Utilities/cmlibuv/src/win/stream-inl.h | 8 +- Utilities/cmlibuv/src/win/stream.c | 31 +- Utilities/cmlibuv/src/win/tcp.c | 255 ++-- Utilities/cmlibuv/src/win/thread.c | 3 +- Utilities/cmlibuv/src/win/tty.c | 221 ++-- Utilities/cmlibuv/src/win/udp.c | 103 +- Utilities/cmlibuv/src/win/util.c | 106 +- Utilities/cmlibuv/src/win/winapi.c | 8 +- Utilities/cmlibuv/src/win/winsock.c | 28 +- Utilities/std/cmext/enum_set | 13 +- bootstrap | 8 + 2039 files changed, 37732 insertions(+), 14722 deletions(-) create mode 100644 Help/command/block.rst create mode 100644 Help/command/endblock.rst create mode 100644 Help/envvar/LANG_FLAGS.txt create mode 100644 Help/envvar/SSL_CERT_DIR.rst create mode 100644 Help/envvar/SSL_CERT_FILE.rst create mode 100644 Help/guide/tutorial/Step1/CMakeLists.txt create mode 100644 Help/guide/tutorial/Step1/TutorialConfig.h.in create mode 100644 Help/guide/tutorial/Step2/MathFunctions/CMakeLists.txt create mode 100644 Help/guide/tutorial/Step6/CTestConfig.cmake delete mode 100644 Help/guide/tutorial/Step6/MathFunctions/MakeTable.cxx create mode 100644 Help/guide/tutorial/Step7/CTestConfig.cmake delete mode 100644 Help/guide/tutorial/Step7/License.txt delete mode 100644 Help/guide/tutorial/Step7/MathFunctions/MakeTable.cxx delete mode 100644 Help/guide/tutorial/Step8/License.txt delete mode 100644 Help/guide/tutorial/Step9/MathFunctions/MathFunctions.cxx delete mode 100644 Help/guide/tutorial/Step9/MathFunctions/mysqrt.h create mode 100644 Help/module/FindOpenSP.rst create mode 100644 Help/module/FindSDL_gfx.rst create mode 100644 Help/policy/CMP0140.rst create mode 100644 Help/policy/CMP0141.rst create mode 100644 Help/policy/CMP0142.rst create mode 100644 Help/prop_dir/SYSTEM.rst create mode 100644 Help/prop_tgt/CXX_MODULE_DIRS.rst create mode 100644 Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst create mode 100644 Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS.rst create mode 100644 Help/prop_tgt/CXX_MODULE_HEADER_UNIT_DIRS_NAME.rst create mode 100644 Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET.rst create mode 100644 Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SETS.rst create mode 100644 Help/prop_tgt/CXX_MODULE_HEADER_UNIT_SET_NAME.rst create mode 100644 Help/prop_tgt/CXX_MODULE_SET.rst create mode 100644 Help/prop_tgt/CXX_MODULE_SETS.rst create mode 100644 Help/prop_tgt/CXX_MODULE_SET_NAME.rst create mode 100644 Help/prop_tgt/EXPORT_NO_SYSTEM.rst create mode 100644 Help/prop_tgt/INTERFACE_CXX_MODULE_HEADER_UNIT_SETS.rst create mode 100644 Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst create mode 100644 Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt create mode 100644 Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst create mode 100644 Help/prop_tgt/SYSTEM.rst create mode 100644 Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst create mode 100644 Help/prop_tgt/XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst create mode 100644 Help/prop_tgt/XCODE_SCHEME_LAUNCH_CONFIGURATION.rst create mode 100644 Help/prop_tgt/XCODE_SCHEME_LAUNCH_MODE.rst create mode 100644 Help/release/3.25.rst create mode 100644 Help/variable/BSD.rst create mode 100644 Help/variable/CMAKE_HOST_BSD.rst create mode 100644 Help/variable/CMAKE_HOST_LINUX.rst create mode 100644 Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst create mode 100644 Help/variable/CMAKE_TASKING_TOOLSET.rst create mode 100644 Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION.rst create mode 100644 Help/variable/CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION.rst create mode 100644 Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION.rst create mode 100644 Help/variable/CMAKE_XCODE_SCHEME_LAUNCH_MODE.rst create mode 100644 Help/variable/LINUX.rst create mode 100644 Modules/Compiler/IntelLLVM-FindBinUtils.cmake create mode 100644 Modules/Compiler/Tasking-ASM.cmake create mode 100644 Modules/Compiler/Tasking-C.cmake create mode 100644 Modules/Compiler/Tasking-CXX.cmake create mode 100644 Modules/Compiler/Tasking-DetermineCompiler.cmake create mode 100644 Modules/Compiler/Tasking-FindBinUtils.cmake create mode 100644 Modules/Compiler/Tasking.cmake create mode 100644 Modules/FindOpenSP.cmake create mode 100644 Modules/FindSDL_gfx.cmake create mode 100644 Modules/Platform/SerenityOS-Clang-ASM.cmake create mode 100644 Modules/Platform/SerenityOS-Clang-C.cmake create mode 100644 Modules/Platform/SerenityOS-Clang-CXX.cmake create mode 100644 Modules/Platform/SerenityOS-GNU-ASM.cmake create mode 100644 Modules/Platform/SerenityOS-GNU-C.cmake create mode 100644 Modules/Platform/SerenityOS-GNU-CXX.cmake create mode 100644 Modules/Platform/SerenityOS-GNU.cmake create mode 100644 Modules/Platform/SerenityOS.cmake create mode 100644 Modules/Platform/Windows-Clang-HIP.cmake create mode 100644 Source/Modules/CMakeBuildUtilities.cmake create mode 100644 Source/cmArgumentParserTypes.h create mode 100644 Source/cmBlockCommand.cxx create mode 100644 Source/cmBlockCommand.h create mode 100644 Source/cmCMakePresetsGraphReadJSONPackagePresets.cxx create mode 100644 Source/cmCMakePresetsGraphReadJSONWorkflowPresets.cxx create mode 100644 Source/cmCxxModuleMapper.cxx create mode 100644 Source/cmCxxModuleMapper.h create mode 100644 Source/cmExperimental.cxx create mode 100644 Source/cmExperimental.h create mode 100644 Source/cmInstallCxxModuleBmiGenerator.cxx create mode 100644 Source/cmInstallCxxModuleBmiGenerator.h delete mode 100644 Tests/CMakeTests/CheckSourceTreeTest.cmake.in create mode 100644 Tests/CheckSourceTree/CMakeLists.txt create mode 100644 Tests/CheckSourceTree/check.cmake create mode 100644 Tests/CudaOnly/DeviceLTO/CMakeLists.txt create mode 100644 Tests/CudaOnly/DeviceLTO/file1.cu create mode 100644 Tests/CudaOnly/DeviceLTO/file2.cu create mode 100644 Tests/CudaOnly/DeviceLTO/file3.cu create mode 100644 Tests/CudaOnly/DeviceLTO/main.cu create mode 100644 Tests/CudaOnly/ToolkitMultipleDirs/CMakeLists.txt create mode 100644 Tests/CudaOnly/ToolkitMultipleDirs/main.cu create mode 100644 Tests/CudaOnly/ToolkitMultipleDirs/subdir/CMakeLists.txt create mode 100644 Tests/FindOpenAL/CMakeLists.txt create mode 100644 Tests/FindOpenAL/Test/CMakeLists.txt create mode 100644 Tests/FindOpenAL/Test/main.cxx create mode 100644 Tests/FindOpenSP/CMakeLists.txt create mode 100644 Tests/FindOpenSP/Test/CMakeLists.txt create mode 100644 Tests/FindOpenSP/Test/main.cxx create mode 100644 Tests/FindOpenSP/Test/test.sgml create mode 100644 Tests/FindVulkan/Test/Run-dxc_exe.cmake create mode 100644 Tests/FindVulkan/Test/main-dxc_lib.cxx create mode 100644 Tests/FindVulkan/Test/main-volk.cxx create mode 100644 Tests/FortranModules/Submodules/obfuscated_parent.f90 create mode 100644 Tests/MSVCDebugInformationFormat/CMakeLists.txt create mode 100644 Tests/MSVCDebugInformationFormat/override-C.cmake create mode 100644 Tests/MSVCDebugInformationFormat/override-CUDA.cmake create mode 100644 Tests/MSVCDebugInformationFormat/override-CXX.cmake create mode 100644 Tests/MSVCDebugInformationFormat/override-Fortran.cmake create mode 100644 Tests/MSVCDebugInformationFormat/verify.F90 create mode 100644 Tests/MSVCDebugInformationFormat/verify.c create mode 100644 Tests/MSVCDebugInformationFormat/verify.cu create mode 100644 Tests/MSVCDebugInformationFormat/verify.cxx create mode 100644 Tests/MSVCDebugInformationFormat/verify.h create mode 100644 Tests/Module/CheckIPOSupported-CUDA/CMakeLists.txt create mode 100644 Tests/Module/CheckIPOSupported-CUDA/bar.cu create mode 100644 Tests/Module/CheckIPOSupported-CUDA/foo.cu create mode 100644 Tests/Module/CheckIPOSupported-CUDA/main.cu create mode 100644 Tests/RunCMake/CMP0102/CMP0102-OLD-stderr.txt create mode 100644 Tests/RunCMake/CMakeDependentOption/UseDotSymbol-stdout.txt create mode 100644 Tests/RunCMake/CMakeDependentOption/UseDotSymbol.cmake create mode 100644 Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt create mode 100644 Tests/RunCMake/CMakePresets/ListAllPresetsNoBuild-stdout.txt create mode 100644 Tests/RunCMake/CMakePresets/ListAllPresetsNoBuild.json.in create mode 100644 Tests/RunCMake/CMakePresets/ListAllPresetsNoTest-stdout.txt create mode 100644 Tests/RunCMake/CMakePresets/ListAllPresetsNoTest.json.in rename Tests/RunCMake/{file-CHMOD/CHMOD-write-only-result.txt => CMakePresets/ListPresetsInvalidType-result.txt} (100%) create mode 100644 Tests/RunCMake/CMakePresets/ListPresetsInvalidType-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsPackage/CMakeLists.txt.in create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-config-file-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-configurations-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-debug-stdout.txt create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-generators-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-no-environment-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-package-directory-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-package-name-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-package-version-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-variables-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-verbose-stdout.txt create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good-package-with-environment-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good.cmake create mode 100644 Tests/RunCMake/CMakePresetsPackage/Good.json.in create mode 100644 Tests/RunCMake/CMakePresetsPackage/ListPresets-package-x-stdout.txt rename Tests/RunCMake/{CommandLine/DeprecateVS10-WARN-ON.cmake => CMakePresetsPackage/ListPresets.cmake} (100%) create mode 100644 Tests/RunCMake/CMakePresetsPackage/ListPresets.json.in create mode 100644 Tests/RunCMake/CMakePresetsPackage/RunCMakeTest.cmake rename Tests/RunCMake/{file-CHMOD/CHMOD-no-perms-result.txt => CMakePresetsPackage/UnsupportedVersion-configure-x-result.txt} (100%) create mode 100644 Tests/RunCMake/CMakePresetsPackage/UnsupportedVersion-configure-x-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsPackage/UnsupportedVersion.json.in create mode 100644 Tests/RunCMake/CMakePresetsPackage/check.cmake create mode 100644 Tests/RunCMake/CMakePresetsTest/Good-test-outputJUnit-check.cmake create mode 100644 Tests/RunCMake/CMakePresetsTest/Good-test-outputLog-check.cmake rename Tests/RunCMake/{file-CHMOD/CHMOD-no-keyword-result.txt => CMakePresetsTest/OutputJUnitUnsupported-test-x-result.txt} (100%) create mode 100644 Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported.json.in rename Tests/RunCMake/{file-CHMOD/CHMOD-invalid-perms-result.txt => CMakePresetsTest/TestOutputTruncationUnsupported-test-x-result.txt} (100%) create mode 100644 Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/BadExitCode-stdout.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/BadExitCode.cmake create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/BadExitCodeTest.cmake create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/CMakeLists.txt.in rename Tests/RunCMake/{file-CHMOD/CHMOD-invalid-path-result.txt => CMakePresetsWorkflow/ConfigureStepMismatch-result.txt} (100%) create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/ConfigureStepMismatch.json.in rename Tests/RunCMake/{CommandLine/DeprecateVS10-WARN-OFF.cmake => CMakePresetsWorkflow/FirstStepNotConfigure-result.txt} (100%) create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/FirstStepNotConfigure.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/Fresh.cmake create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/Fresh.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/Good-stdout.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/Good.cmake create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/Good.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/GoodUser-stdout.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/GoodUser.cmake create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/GoodUser.json.in rename Tests/RunCMake/{file-CHMOD/CHMOD-all-perms-result.txt => CMakePresetsWorkflow/InvalidOption-result.txt} (100%) create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/InvalidOption-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/InvalidOption-stdout.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/ListPresets-stdout.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/ListPresets.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/NoWorkflowSteps.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/NonexistentStep.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/SecondStepConfigure.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/UnreachableStep.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/UnreachableStepUser.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/UnsupportedVersion.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepDisabled.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepHidden.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-result.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro-stderr.txt create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/WorkflowStepInvalidMacro.json.in create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/check.cmake create mode 100644 Tests/RunCMake/CMakePresetsWorkflow/cpack_staging.cmake.in create mode 100644 Tests/RunCMake/CXXModules/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/ExportBuildCxxModules-check.cmake create mode 100644 Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/ExportBuildCxxModules.cmake create mode 100644 Tests/RunCMake/CXXModules/ExportInstallCxxModules-check.cmake create mode 100644 Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/ExportInstallCxxModules.cmake create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterface-result.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterface-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterface.cmake create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterfaceImported-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsInterfaceImported.cmake create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsPrivate-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsPrivate.cmake create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsPublic-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModuleHeaderUnitsPublic.cmake create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesInterface-result.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesInterface.cmake create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported.cmake create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesPrivate.cmake create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/FileSetModulesPublic.cmake create mode 100644 Tests/RunCMake/CXXModules/InstallBMI-check.cmake create mode 100644 Tests/RunCMake/CXXModules/InstallBMI-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/InstallBMI.cmake create mode 100644 Tests/RunCMake/CXXModules/InstallBMIGenericArgs-check.cmake create mode 100644 Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/InstallBMIGenericArgs.cmake create mode 100644 Tests/RunCMake/CXXModules/InstallBMIIgnore-check.cmake create mode 100644 Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/InstallBMIIgnore.cmake create mode 100644 Tests/RunCMake/CXXModules/InstallBMINoGenericArgs-check.cmake create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-check.cmake create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall.cmake create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoExport-check.cmake create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoExport.cmake create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-check.cmake create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NinjaDependInfoFileSet.cmake create mode 100644 Tests/RunCMake/CXXModules/NoCXX-result.txt create mode 100644 Tests/RunCMake/CXXModules/NoCXX-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NoCXX.cmake create mode 100644 Tests/RunCMake/CXXModules/NoCXX20-result.txt create mode 100644 Tests/RunCMake/CXXModules/NoCXX20-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NoCXX20.cmake create mode 100644 Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-result.txt create mode 100644 Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NoCXX20ModuleFlag.cmake create mode 100644 Tests/RunCMake/CXXModules/NoDyndepSupport-result.txt create mode 100644 Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NoDyndepSupport.cmake create mode 100644 Tests/RunCMake/CXXModules/NotCXXSourceModuleHeaderUnits-result.txt create mode 100644 Tests/RunCMake/CXXModules/NotCXXSourceModuleHeaderUnits-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NotCXXSourceModuleHeaderUnits.cmake create mode 100644 Tests/RunCMake/CXXModules/NotCXXSourceModules-result.txt create mode 100644 Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/NotCXXSourceModules.cmake create mode 100644 Tests/RunCMake/CXXModules/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CXXModules/check-json.cmake create mode 100644 Tests/RunCMake/CXXModules/compiler_introspection.cmake create mode 100644 Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi-and-interfaces.cmake create mode 100644 Tests/RunCMake/CXXModules/examples/cxx-modules-find-bmi.cmake create mode 100644 Tests/RunCMake/CXXModules/examples/cxx-modules-rules.cmake create mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain/a.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain/b.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain/c.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain/d.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain/e.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/deep-chain/main.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/forward.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/private.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build/test/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/forward.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/private.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install/test/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-build-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-build/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-build/forward.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-build/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-build/private.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-build/test/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-install-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-install/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-install/forward.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-install/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-install/private.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/export-interface-install/test/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/generated-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/generated/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/generated/importable.cxx.in create mode 100644 Tests/RunCMake/CXXModules/examples/generated/main.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/check-for-bmi.cmake create mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi/check-for-bmi.cmake create mode 100644 Tests/RunCMake/CXXModules/examples/install-bmi/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/internal-partitions/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/internal-partitions/main.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/library-static-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/library/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/library/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/library/main.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/partitions-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/partitions/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/partitions/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/partitions/main.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/partitions/partition.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/public-req-private-build-result.txt create mode 100644 Tests/RunCMake/CXXModules/examples/public-req-private-build-stdout.txt create mode 100644 Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/public-req-private/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/public-req-private/priv.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/public-req-private/pub.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/simple-stderr.txt create mode 100644 Tests/RunCMake/CXXModules/examples/simple/CMakeLists.txt create mode 100644 Tests/RunCMake/CXXModules/examples/simple/importable.cxx create mode 100644 Tests/RunCMake/CXXModules/examples/simple/main.cxx create mode 100644 Tests/RunCMake/CXXModules/expect/NinjaDependInfoBMIInstall-private.json create mode 100644 Tests/RunCMake/CXXModules/expect/NinjaDependInfoBMIInstall-public.json create mode 100644 Tests/RunCMake/CXXModules/expect/NinjaDependInfoExport-private.json create mode 100644 Tests/RunCMake/CXXModules/expect/NinjaDependInfoExport-public.json create mode 100644 Tests/RunCMake/CXXModules/expect/NinjaDependInfoFileSet-private.json create mode 100644 Tests/RunCMake/CXXModules/expect/NinjaDependInfoFileSet-public.json create mode 100644 Tests/RunCMake/CXXModules/sources/c-anchor.c create mode 100644 Tests/RunCMake/CXXModules/sources/cxx-anchor.cxx create mode 100644 Tests/RunCMake/CXXModules/sources/module-header.h create mode 100644 Tests/RunCMake/CXXModules/sources/module-impl.cxx create mode 100644 Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx create mode 100644 Tests/RunCMake/CXXModules/sources/module-internal-part.cxx create mode 100644 Tests/RunCMake/CXXModules/sources/module-part-impl.cxx create mode 100644 Tests/RunCMake/CXXModules/sources/module-part.cxx create mode 100644 Tests/RunCMake/CXXModules/sources/module-use.cxx create mode 100644 Tests/RunCMake/CXXModules/sources/module.cxx create mode 100644 Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake rename Tests/RunCMake/CheckCompilerFlag/{CheckCUDACompilerFlag.cmake => CheckCompilerFlagCUDA.cmake} (100%) create mode 100644 Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagCXX.cmake rename Tests/RunCMake/CheckCompilerFlag/{CheckFortranCompilerFlag.cmake => CheckCompilerFlagFortran.cmake} (100%) rename Tests/RunCMake/CheckCompilerFlag/{CheckHIPCompilerFlag.cmake => CheckCompilerFlagHIP.cmake} (100%) rename Tests/RunCMake/CheckCompilerFlag/{CheckISPCCompilerFlag.cmake => CheckCompilerFlagISPC.cmake} (100%) rename Tests/RunCMake/CheckCompilerFlag/{CheckOBJCCompilerFlag.cmake => CheckCompilerFlagOBJC.cmake} (100%) rename Tests/RunCMake/CheckCompilerFlag/{CheckOBJCXXCompilerFlag.cmake => CheckCompilerFlagOBJCXX.cmake} (100%) rename Tests/RunCMake/CheckLinkerFlag/{CheckCLinkerFlag.cmake => CheckLinkerFlagC.cmake} (100%) rename Tests/RunCMake/CheckLinkerFlag/{CheckCUDALinkerFlag.cmake => CheckLinkerFlagCUDA.cmake} (100%) rename Tests/RunCMake/CheckLinkerFlag/{CheckCXXLinkerFlag.cmake => CheckLinkerFlagCXX.cmake} (100%) rename Tests/RunCMake/CheckLinkerFlag/{CheckFortranLinkerFlag.cmake => CheckLinkerFlagFortran.cmake} (100%) rename Tests/RunCMake/CheckLinkerFlag/{CheckHIPLinkerFlag.cmake => CheckLinkerFlagHIP.cmake} (100%) rename Tests/RunCMake/CheckLinkerFlag/{CheckOBJCLinkerFlag.cmake => CheckLinkerFlagOBJC.cmake} (100%) rename Tests/RunCMake/CheckLinkerFlag/{CheckOBJCXXLinkerFlag.cmake => CheckLinkerFlagOBJCXX.cmake} (100%) create mode 100644 Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesC.cmake rename Tests/RunCMake/CheckSourceCompiles/{CheckCUDASourceCompiles.cmake => CheckSourceCompilesCUDA.cmake} (100%) create mode 100644 Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesCXX.cmake rename Tests/RunCMake/CheckSourceCompiles/{CheckFortranSourceCompiles.cmake => CheckSourceCompilesFortran.cmake} (100%) rename Tests/RunCMake/CheckSourceCompiles/{CheckHIPSourceCompiles.cmake => CheckSourceCompilesHIP.cmake} (100%) rename Tests/RunCMake/CheckSourceCompiles/{CheckISPCSourceCompiles.cmake => CheckSourceCompilesISPC.cmake} (100%) create mode 100644 Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJC.cmake create mode 100644 Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesOBJCXX.cmake create mode 100644 Tests/RunCMake/CheckSourceRuns/CheckSourceRunsC.cmake rename Tests/RunCMake/CheckSourceRuns/{CheckCUDASourceRuns.cmake => CheckSourceRunsCUDA.cmake} (100%) create mode 100644 Tests/RunCMake/CheckSourceRuns/CheckSourceRunsCXX.cmake rename Tests/RunCMake/CheckSourceRuns/{CheckFortranSourceRuns.cmake => CheckSourceRunsFortran.cmake} (100%) rename Tests/RunCMake/CheckSourceRuns/{CheckHIPSourceRuns.cmake => CheckSourceRunsHIP.cmake} (100%) create mode 100644 Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJC.cmake create mode 100644 Tests/RunCMake/CheckSourceRuns/CheckSourceRunsOBJCXX.cmake create mode 100644 Tests/RunCMake/ClangTidy/compdb.cmake delete mode 100644 Tests/RunCMake/CommandLine/DeprecateVS10-WARN-ON-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/DeprecateVS11-WARN-OFF.cmake create mode 100644 Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/DeprecateVS11-WARN-ON.cmake create mode 100644 Tests/RunCMake/CommandLine/E_env-equal.cmake create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-bad-operation-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-bad-operation-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-cmake_list-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-path_list-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-reset-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-reset-to-unset-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-set-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-string-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-unset-stdout.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-with-double-dash-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-without-double-dash-result.txt create mode 100644 Tests/RunCMake/CommandLine/E_env_modify-without-double-dash-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/debug-trycompile-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/trycompile-clean.cmake create mode 100644 Tests/RunCMake/CompilerTest/C-stdout.txt create mode 100644 Tests/RunCMake/CompilerTest/C.cmake create mode 100644 Tests/RunCMake/CompilerTest/CMakeLists.txt create mode 100644 Tests/RunCMake/CompilerTest/CUDA-stdout.txt create mode 100644 Tests/RunCMake/CompilerTest/CUDA.cmake create mode 100644 Tests/RunCMake/CompilerTest/CXX-stdout.txt create mode 100644 Tests/RunCMake/CompilerTest/CXX.cmake create mode 100644 Tests/RunCMake/CompilerTest/Fortran-stdout.txt create mode 100644 Tests/RunCMake/CompilerTest/Fortran.cmake create mode 100644 Tests/RunCMake/CompilerTest/HIP-stdout.txt create mode 100644 Tests/RunCMake/CompilerTest/HIP.cmake create mode 100644 Tests/RunCMake/CompilerTest/ISPC-stdout.txt create mode 100644 Tests/RunCMake/CompilerTest/ISPC.cmake create mode 100644 Tests/RunCMake/CompilerTest/OBJC-stdout.txt create mode 100644 Tests/RunCMake/CompilerTest/OBJC.cmake create mode 100644 Tests/RunCMake/CompilerTest/OBJCXX-stdout.txt create mode 100644 Tests/RunCMake/CompilerTest/OBJCXX.cmake create mode 100644 Tests/RunCMake/CompilerTest/RunCMakeTest.cmake rename Tests/RunCMake/Configure/{FailCopyFileABI-override.cmake => CopyFileABI-override.cmake} (64%) rename Tests/RunCMake/Configure/{FailCopyFileABI-stdout.txt => CopyFileABI-stdout.txt} (62%) rename Tests/RunCMake/Configure/{FailCopyFileABI.cmake => CopyFileABI.cmake} (71%) delete mode 100644 Tests/RunCMake/Configure/FailCopyFileABI-check.cmake create mode 100644 Tests/RunCMake/ExternalProject/BUILD_ALWAYS-build1-stdout.txt create mode 100644 Tests/RunCMake/ExternalProject/BUILD_ALWAYS-build2-stdout.txt create mode 100644 Tests/RunCMake/ExternalProject/BUILD_ALWAYS.cmake create mode 100644 Tests/RunCMake/FPHSA/empty_version-result.txt create mode 100644 Tests/RunCMake/FPHSA/empty_version-stderr.txt create mode 100644 Tests/RunCMake/FPHSA/empty_version.cmake create mode 100644 Tests/RunCMake/FPHSA/exact_1_no_version_var-stdout.txt create mode 100644 Tests/RunCMake/FPHSA/exact_1_no_version_var.cmake create mode 100644 Tests/RunCMake/FetchContent/IncludesNonSystem/CMakeLists.txt create mode 100644 Tests/RunCMake/FetchContent/IncludesNonSystem/bar.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesNonSystem/foo.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/CMakeLists.txt create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/SubSub1/CMakeLists.txt create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/SubSub1/bar.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/SubSub1/foo.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/SubSub1/zot.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/SubSub2/CMakeLists.txt create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/SubSub2/bar.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/SubSub2/foo.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/SubSub2/zot.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/bar.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/foo.cpp create mode 100644 Tests/RunCMake/FetchContent/IncludesSystem/zot.cpp create mode 100644 Tests/RunCMake/FetchContent/System.cmake create mode 100644 Tests/RunCMake/FileAPI/codemodel-v2-data/directories/subdir.json create mode 100644 Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json create mode 100644 Tests/RunCMake/FileAPI/subdir/CMakeLists.txt create mode 100644 Tests/RunCMake/FileAPI/subdir/empty.c create mode 100644 Tests/RunCMake/File_Archive/create-missing-args-result.txt create mode 100644 Tests/RunCMake/File_Archive/create-missing-args-stderr.txt create mode 100644 Tests/RunCMake/File_Archive/create-missing-args.cmake create mode 100644 Tests/RunCMake/File_Archive/extract-missing-args-result.txt create mode 100644 Tests/RunCMake/File_Archive/extract-missing-args-stderr.txt create mode 100644 Tests/RunCMake/File_Archive/extract-missing-args.cmake create mode 100644 Tests/RunCMake/File_Configure/NoArgContent-result.txt create mode 100644 Tests/RunCMake/File_Configure/NoArgContent-stderr.txt create mode 100644 Tests/RunCMake/File_Configure/NoArgContent.cmake create mode 100644 Tests/RunCMake/File_Configure/NoArgOutput-result.txt create mode 100644 Tests/RunCMake/File_Configure/NoArgOutput-stderr.txt create mode 100644 Tests/RunCMake/File_Configure/NoArgOutput.cmake create mode 100644 Tests/RunCMake/File_Generate/InputAndContent-check.cmake create mode 100644 Tests/RunCMake/File_Generate/InputAndContent-input.txt create mode 100644 Tests/RunCMake/File_Generate/InputAndContent.cmake create mode 100644 Tests/RunCMake/Framework/main2.c create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-NEW-result.txt create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-NEW-stderr.txt create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-NEW.cmake create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-NoEffect.cmake create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-OLD.cmake create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-WARN.cmake create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/CMP0141-common.cmake create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/CMakeLists.txt create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/MSVCDebugInformationFormat/empty.cxx create mode 100644 Tests/RunCMake/Ninja/QtAutoMocSkipPch.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-54936-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-54936-stdout.txt create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-54936.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001-stdout.txt create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-65001.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-check.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes-cmake.cmake create mode 100644 Tests/RunCMake/Ninja/ShowIncludes.cmake create mode 100644 Tests/RunCMake/NinjaMultiConfig/CompileCommands-check.cmake create mode 100644 Tests/RunCMake/NinjaMultiConfig/CompileCommands.cmake create mode 100644 Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-NEW-empty.cmake create mode 100644 Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-NEW.cmake create mode 100644 Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-OLD.cmake rename Tests/RunCMake/PrecompileHeaders/{PchReuseFrom.cmake => PchReuseFrom-common.cmake} (92%) create mode 100644 Tests/RunCMake/VS10Project/DebugInformationFormat-check.cmake create mode 100644 Tests/RunCMake/VS10Project/DebugInformationFormat.cmake create mode 100644 Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines-check.cmake create mode 100644 Tests/RunCMake/VsDotnetSdk/VsDotnetSdkDefines.cmake create mode 100644 Tests/RunCMake/XcodeProject/Clean-build-check.cmake create mode 100644 Tests/RunCMake/XcodeProject/Clean-clean-check.cmake create mode 100644 Tests/RunCMake/XcodeProject/Clean.cmake create mode 100644 Tests/RunCMake/XcodeProject/Clean/CMakeLists.txt create mode 100644 Tests/RunCMake/XcodeProject/Clean/empty.c create mode 100644 Tests/RunCMake/XcodeProject/EffectivePlatformNameOFF.cmake create mode 100644 Tests/RunCMake/add_subdirectory/System.cmake create mode 100644 Tests/RunCMake/add_subdirectory/System/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/System/SubSub1/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/System/SubSub1/bar.cpp create mode 100644 Tests/RunCMake/add_subdirectory/System/SubSub1/foo.cpp create mode 100644 Tests/RunCMake/add_subdirectory/System/SubSub1/zot.cpp create mode 100644 Tests/RunCMake/add_subdirectory/System/SubSub2/CMakeLists.txt create mode 100644 Tests/RunCMake/add_subdirectory/System/SubSub2/bar.cpp create mode 100644 Tests/RunCMake/add_subdirectory/System/SubSub2/foo.cpp create mode 100644 Tests/RunCMake/add_subdirectory/System/SubSub2/zot.cpp create mode 100644 Tests/RunCMake/add_subdirectory/System/bar.cpp create mode 100644 Tests/RunCMake/add_subdirectory/System/foo.cpp create mode 100644 Tests/RunCMake/add_subdirectory/System/zot.cpp create mode 100644 Tests/RunCMake/block/CMakeLists.txt create mode 100644 Tests/RunCMake/block/EndAlone-result.txt create mode 100644 Tests/RunCMake/block/EndAlone-stderr.txt create mode 100644 Tests/RunCMake/block/EndAlone.cmake create mode 100644 Tests/RunCMake/block/EndAloneWithArgument-result.txt create mode 100644 Tests/RunCMake/block/EndAloneWithArgument-stderr.txt create mode 100644 Tests/RunCMake/block/EndAloneWithArgument.cmake create mode 100644 Tests/RunCMake/block/EndMissing-result.txt create mode 100644 Tests/RunCMake/block/EndMissing-stderr.txt create mode 100644 Tests/RunCMake/block/EndMissing.cmake create mode 100644 Tests/RunCMake/block/EndWithArgument-stderr.txt create mode 100644 Tests/RunCMake/block/EndWithArgument.cmake create mode 100644 Tests/RunCMake/block/InvalidArgument-result.txt create mode 100644 Tests/RunCMake/block/InvalidArgument-stderr.txt create mode 100644 Tests/RunCMake/block/InvalidArgument.cmake create mode 100644 Tests/RunCMake/block/InvalidNesting1-result.txt create mode 100644 Tests/RunCMake/block/InvalidNesting1-stderr.txt create mode 100644 Tests/RunCMake/block/InvalidNesting1.cmake create mode 100644 Tests/RunCMake/block/InvalidNesting2-result.txt create mode 100644 Tests/RunCMake/block/InvalidNesting2-stderr.txt create mode 100644 Tests/RunCMake/block/InvalidNesting2.cmake create mode 100644 Tests/RunCMake/block/InvalidNesting3-result.txt create mode 100644 Tests/RunCMake/block/InvalidNesting3-stderr.txt create mode 100644 Tests/RunCMake/block/InvalidNesting3.cmake create mode 100644 Tests/RunCMake/block/InvalidNesting4-result.txt create mode 100644 Tests/RunCMake/block/InvalidNesting4-stderr.txt create mode 100644 Tests/RunCMake/block/InvalidNesting4.cmake create mode 100644 Tests/RunCMake/block/InvalidNesting5-result.txt create mode 100644 Tests/RunCMake/block/InvalidNesting5-stderr.txt create mode 100644 Tests/RunCMake/block/InvalidNesting5.cmake create mode 100644 Tests/RunCMake/block/InvalidNesting6-result.txt create mode 100644 Tests/RunCMake/block/InvalidNesting6-stderr.txt create mode 100644 Tests/RunCMake/block/InvalidNesting6.cmake create mode 100644 Tests/RunCMake/block/MissingArgument-result.txt create mode 100644 Tests/RunCMake/block/MissingArgument-stderr.txt create mode 100644 Tests/RunCMake/block/MissingArgument.cmake create mode 100644 Tests/RunCMake/block/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/block/Scope-POLICIES.cmake create mode 100644 Tests/RunCMake/block/Scope-VARIABLES.cmake create mode 100644 Tests/RunCMake/block/Scope.cmake create mode 100644 Tests/RunCMake/block/Scope/CMakeLists.txt create mode 100644 Tests/RunCMake/block/Workflows.cmake create mode 100644 Tests/RunCMake/block/WrongArgument-result.txt create mode 100644 Tests/RunCMake/block/WrongArgument-stderr.txt create mode 100644 Tests/RunCMake/block/WrongArgument.cmake create mode 100644 Tests/RunCMake/block/WrongScope-result.txt create mode 100644 Tests/RunCMake/block/WrongScope-stderr.txt create mode 100644 Tests/RunCMake/block/WrongScope.cmake create mode 100644 Tests/RunCMake/cmake_language/get_message_log_level.cmake create mode 100644 Tests/RunCMake/cmake_language/get_message_log_level_cache-stdout.txt create mode 100644 Tests/RunCMake/cmake_language/get_message_log_level_cli-stdout.txt create mode 100644 Tests/RunCMake/cmake_language/get_message_log_level_cli_and_cache-stdout.txt create mode 100644 Tests/RunCMake/cmake_language/get_message_log_level_cli_and_var-stdout.txt create mode 100644 Tests/RunCMake/cmake_language/get_message_log_level_none-stdout.txt create mode 100644 Tests/RunCMake/cmake_language/get_message_log_level_var-stdout.txt create mode 100644 Tests/RunCMake/cmake_language/get_message_log_level_var_and_cache-stdout.txt create mode 100644 Tests/RunCMake/cmake_path/BASE_DIRECTORY-no-arg-stderr.txt create mode 100644 Tests/RunCMake/cmake_path/OUTPUT_VARIABLE-empty-stderr.txt create mode 100644 Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-prop-result.txt create mode 100644 Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-prop-stdout.txt create mode 100644 Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-prop.cmake create mode 100644 Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-system-result.txt create mode 100644 Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-system-stdout.txt create mode 100644 Tests/RunCMake/ctest_environment/ENVIRONMENT_MODIFICATION-reset-to-system.cmake delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-all-perms-stderr.txt delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-all-perms.cmake delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-invalid-path-stderr.txt delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-invalid-path.cmake delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-invalid-perms-stderr.txt delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-invalid-perms.cmake delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-no-keyword-stderr.txt delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-no-keyword.cmake delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-no-perms-stderr.txt delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-no-perms.cmake delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-ok.cmake delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-override.cmake delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-write-only-stderr.txt delete mode 100644 Tests/RunCMake/file-CHMOD/CHMOD-write-only.cmake create mode 100644 Tests/RunCMake/file-CHMOD/all-perms-result.txt create mode 100644 Tests/RunCMake/file-CHMOD/all-perms-stderr.txt create mode 100644 Tests/RunCMake/file-CHMOD/all-perms.cmake create mode 100644 Tests/RunCMake/file-CHMOD/invalid-path-result.txt create mode 100644 Tests/RunCMake/file-CHMOD/invalid-path-stderr.txt create mode 100644 Tests/RunCMake/file-CHMOD/invalid-path.cmake create mode 100644 Tests/RunCMake/file-CHMOD/invalid-perms-result.txt create mode 100644 Tests/RunCMake/file-CHMOD/invalid-perms-stderr.txt create mode 100644 Tests/RunCMake/file-CHMOD/invalid-perms.cmake create mode 100644 Tests/RunCMake/file-CHMOD/missing-dir-perms-result.txt create mode 100644 Tests/RunCMake/file-CHMOD/missing-dir-perms-stderr.txt create mode 100644 Tests/RunCMake/file-CHMOD/missing-dir-perms.cmake create mode 100644 Tests/RunCMake/file-CHMOD/missing-file-perms-result.txt create mode 100644 Tests/RunCMake/file-CHMOD/missing-file-perms-stderr.txt create mode 100644 Tests/RunCMake/file-CHMOD/missing-file-perms.cmake create mode 100644 Tests/RunCMake/file-CHMOD/missing-perms-result.txt create mode 100644 Tests/RunCMake/file-CHMOD/missing-perms-stderr.txt create mode 100644 Tests/RunCMake/file-CHMOD/missing-perms.cmake create mode 100644 Tests/RunCMake/file-CHMOD/no-perms-result.txt create mode 100644 Tests/RunCMake/file-CHMOD/no-perms-stderr.txt create mode 100644 Tests/RunCMake/file-CHMOD/no-perms.cmake create mode 100644 Tests/RunCMake/file-CHMOD/ok.cmake create mode 100644 Tests/RunCMake/file-CHMOD/override.cmake create mode 100644 Tests/RunCMake/file-CHMOD/write-only-result.txt create mode 100644 Tests/RunCMake/file-CHMOD/write-only-stderr.txt create mode 100644 Tests/RunCMake/file-CHMOD/write-only.cmake create mode 100644 Tests/RunCMake/file/TIMESTAMP-stdout.txt create mode 100644 Tests/RunCMake/file/TIMESTAMP.cmake create mode 100644 Tests/RunCMake/find_file/VALIDATOR-no-function-result.txt create mode 100644 Tests/RunCMake/find_file/VALIDATOR-no-function-stderr.txt create mode 100644 Tests/RunCMake/find_file/VALIDATOR-no-function.cmake create mode 100644 Tests/RunCMake/find_file/VALIDATOR-specify-macro-result.txt create mode 100644 Tests/RunCMake/find_file/VALIDATOR-specify-macro-stderr.txt create mode 100644 Tests/RunCMake/find_file/VALIDATOR-specify-macro.cmake create mode 100644 Tests/RunCMake/find_file/VALIDATOR-stderr.txt create mode 100644 Tests/RunCMake/find_file/VALIDATOR-stdout.txt create mode 100644 Tests/RunCMake/find_file/VALIDATOR-undefined-function-result.txt create mode 100644 Tests/RunCMake/find_file/VALIDATOR-undefined-function-stderr.txt create mode 100644 Tests/RunCMake/find_file/VALIDATOR-undefined-function.cmake create mode 100644 Tests/RunCMake/find_file/VALIDATOR.cmake create mode 100644 Tests/RunCMake/find_library/VALIDATOR-no-function-result.txt create mode 100644 Tests/RunCMake/find_library/VALIDATOR-no-function-stderr.txt create mode 100644 Tests/RunCMake/find_library/VALIDATOR-no-function.cmake create mode 100644 Tests/RunCMake/find_library/VALIDATOR-specify-macro-result.txt create mode 100644 Tests/RunCMake/find_library/VALIDATOR-specify-macro-stderr.txt create mode 100644 Tests/RunCMake/find_library/VALIDATOR-specify-macro.cmake create mode 100644 Tests/RunCMake/find_library/VALIDATOR-stderr.txt create mode 100644 Tests/RunCMake/find_library/VALIDATOR-stdout.txt create mode 100644 Tests/RunCMake/find_library/VALIDATOR-undefined-function-result.txt create mode 100644 Tests/RunCMake/find_library/VALIDATOR-undefined-function-stderr.txt create mode 100644 Tests/RunCMake/find_library/VALIDATOR-undefined-function.cmake create mode 100644 Tests/RunCMake/find_library/VALIDATOR.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_cmake/cmake/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_lib_cmake_pkg/lib/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_lib_pkg/lib/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_lib_pkg_cmake/lib/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg_cmake_pkg/SearchPaths-1.2.3/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg_lib_cmake_pkg/SearchPaths-1.2.3/lib/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg_lib_pkg/SearchPaths-1.2.3/lib/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg_lib_pkg_cmake/SearchPaths-1.2.3/lib/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg_share_cmake_pkg/SearchPaths-1.2.3/share/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg_share_pkg/SearchPaths-1.2.3/share/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_pkg_share_pkg_cmake/SearchPaths-1.2.3/share/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_share_cmake_pkg/share/cmake/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_share_pkg/share/SearchPaths-1.2.3/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths/prefix_share_pkg_cmake/share/SearchPaths-1.2.3/cmake/SearchPathsConfig.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_cmake-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_cmake.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_lib_cmake_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_lib_cmake_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_lib_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_lib_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_lib_pkg_cmake-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_lib_pkg_cmake.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_cmake_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_cmake_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_cmake_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_pkg_cmake-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_lib_pkg_cmake.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_cmake_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_cmake_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_pkg_cmake-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_pkg_share_pkg_cmake.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_share_cmake_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_share_cmake_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_share_pkg-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_share_pkg.cmake create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_share_pkg_cmake-stderr.txt create mode 100644 Tests/RunCMake/find_package/SearchPaths_prefix_share_pkg_cmake.cmake create mode 100644 Tests/RunCMake/find_path/VALIDATOR-no-function-result.txt create mode 100644 Tests/RunCMake/find_path/VALIDATOR-no-function-stderr.txt create mode 100644 Tests/RunCMake/find_path/VALIDATOR-no-function.cmake create mode 100644 Tests/RunCMake/find_path/VALIDATOR-specify-macro-result.txt create mode 100644 Tests/RunCMake/find_path/VALIDATOR-specify-macro-stderr.txt create mode 100644 Tests/RunCMake/find_path/VALIDATOR-specify-macro.cmake create mode 100644 Tests/RunCMake/find_path/VALIDATOR-stderr.txt create mode 100644 Tests/RunCMake/find_path/VALIDATOR-stdout.txt create mode 100644 Tests/RunCMake/find_path/VALIDATOR-undefined-function-result.txt create mode 100644 Tests/RunCMake/find_path/VALIDATOR-undefined-function-stderr.txt create mode 100644 Tests/RunCMake/find_path/VALIDATOR-undefined-function.cmake create mode 100644 Tests/RunCMake/find_path/VALIDATOR.cmake create mode 100644 Tests/RunCMake/find_program/VALIDATOR-no-function-result.txt create mode 100644 Tests/RunCMake/find_program/VALIDATOR-no-function-stderr.txt create mode 100644 Tests/RunCMake/find_program/VALIDATOR-no-function.cmake create mode 100644 Tests/RunCMake/find_program/VALIDATOR-specify-macro-result.txt create mode 100644 Tests/RunCMake/find_program/VALIDATOR-specify-macro-stderr.txt create mode 100644 Tests/RunCMake/find_program/VALIDATOR-specify-macro.cmake create mode 100644 Tests/RunCMake/find_program/VALIDATOR-stderr.txt create mode 100644 Tests/RunCMake/find_program/VALIDATOR-stdout.txt create mode 100644 Tests/RunCMake/find_program/VALIDATOR-undefined-function-result.txt create mode 100644 Tests/RunCMake/find_program/VALIDATOR-undefined-function-stderr.txt create mode 100644 Tests/RunCMake/find_program/VALIDATOR-undefined-function.cmake create mode 100644 Tests/RunCMake/find_program/VALIDATOR.cmake create mode 100644 Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt create mode 100644 Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt create mode 100644 Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt create mode 100644 Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake create mode 100644 Tests/RunCMake/project/LanguagesDuplicate-check.cmake create mode 100644 Tests/RunCMake/project/LanguagesDuplicate.cmake create mode 100644 Tests/RunCMake/return/CMP0140-NEW.cmake create mode 100644 Tests/RunCMake/return/CMP0140-OLD.cmake create mode 100644 Tests/RunCMake/return/CMP0140-WARN-result.txt create mode 100644 Tests/RunCMake/return/CMP0140-WARN-stderr.txt create mode 100644 Tests/RunCMake/return/CMP0140-WARN.cmake create mode 100644 Tests/RunCMake/return/PropagateFromDirectory.cmake create mode 100644 Tests/RunCMake/return/PropagateFromFunction.cmake create mode 100644 Tests/RunCMake/return/PropagateNothing.cmake create mode 100644 Tests/RunCMake/return/WrongArgument-result.txt create mode 100644 Tests/RunCMake/return/WrongArgument-stderr.txt create mode 100644 Tests/RunCMake/return/WrongArgument.cmake create mode 100644 Tests/RunCMake/return/subdir/CMakeLists.txt create mode 100644 Tests/RunCMake/showIncludes.c create mode 100644 Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-stderr.txt create mode 100644 Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-result.txt create mode 100644 Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental-stderr.txt create mode 100644 Tests/RunCMake/target_sources/FileSetDefaultWrongTypeExperimental.cmake create mode 100644 Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-result.txt create mode 100644 Tests/RunCMake/target_sources/FileSetWrongTypeExperimental-stderr.txt create mode 100644 Tests/RunCMake/target_sources/FileSetWrongTypeExperimental.cmake create mode 100644 Tests/RunCMake/try_compile/BinDirEmpty-result.txt create mode 100644 Tests/RunCMake/try_compile/BinDirEmpty-stderr.txt create mode 100644 Tests/RunCMake/try_compile/BinDirEmpty.cmake create mode 100644 Tests/RunCMake/try_compile/BinDirRelative-result.txt create mode 100644 Tests/RunCMake/try_compile/BinDirRelative-stderr.txt create mode 100644 Tests/RunCMake/try_compile/BinDirRelative.cmake create mode 100644 Tests/RunCMake/try_compile/BuildType.cmake create mode 100644 Tests/RunCMake/try_compile/BuildTypeAsFlag.cmake create mode 100644 Tests/RunCMake/try_compile/EmptyListArgs.cmake create mode 100644 Tests/RunCMake/try_compile/EmptyValueArgs-result.txt create mode 100644 Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt create mode 100644 Tests/RunCMake/try_compile/EmptyValueArgs.cmake create mode 100644 Tests/RunCMake/try_compile/NoCStandard-result.txt create mode 100644 Tests/RunCMake/try_compile/NoCStandard-stderr.txt create mode 100644 Tests/RunCMake/try_compile/NoCStandard.cmake create mode 100644 Tests/RunCMake/try_compile/OldProjectBinDirEmpty-result.txt create mode 100644 Tests/RunCMake/try_compile/OldProjectBinDirEmpty-stderr.txt create mode 100644 Tests/RunCMake/try_compile/OldProjectBinDirEmpty.cmake create mode 100644 Tests/RunCMake/try_compile/OldProjectSrcDirEmpty-result.txt create mode 100644 Tests/RunCMake/try_compile/OldProjectSrcDirEmpty-stderr.txt create mode 100644 Tests/RunCMake/try_compile/OldProjectSrcDirEmpty.cmake create mode 100644 Tests/RunCMake/try_compile/OutputDirAsFlag.cmake create mode 100644 Tests/RunCMake/try_compile/PlatformVariables-stderr.txt create mode 100644 Tests/RunCMake/try_compile/ProjectBinDirEmpty-result.txt create mode 100644 Tests/RunCMake/try_compile/ProjectBinDirEmpty-stderr.txt create mode 100644 Tests/RunCMake/try_compile/ProjectBinDirEmpty.cmake create mode 100644 Tests/RunCMake/try_compile/ProjectCopyFile-result.txt create mode 100644 Tests/RunCMake/try_compile/ProjectCopyFile-stderr.txt create mode 100644 Tests/RunCMake/try_compile/ProjectCopyFile.cmake create mode 100644 Tests/RunCMake/try_compile/ProjectSrcDirEmpty-result.txt create mode 100644 Tests/RunCMake/try_compile/ProjectSrcDirEmpty-stderr.txt create mode 100644 Tests/RunCMake/try_compile/ProjectSrcDirEmpty.cmake create mode 100644 Tests/RunCMake/try_compile/ProjectSrcDirMissing-result.txt create mode 100644 Tests/RunCMake/try_compile/ProjectSrcDirMissing-stderr.txt create mode 100644 Tests/RunCMake/try_compile/ProjectSrcDirMissing.cmake create mode 100644 Tests/RunCMake/try_compile/SourceFromBadFile-result.txt create mode 100644 Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt create mode 100644 Tests/RunCMake/try_compile/SourceFromBadFile.cmake create mode 100644 Tests/RunCMake/try_compile/SourceFromBadName-result.txt create mode 100644 Tests/RunCMake/try_compile/SourceFromBadName-stderr.txt create mode 100644 Tests/RunCMake/try_compile/SourceFromBadName.cmake create mode 100644 Tests/RunCMake/try_compile/SourceFromOneArg-result.txt create mode 100644 Tests/RunCMake/try_compile/SourceFromOneArg-stderr.txt create mode 100644 Tests/RunCMake/try_compile/SourceFromOneArg.cmake create mode 100644 Tests/RunCMake/try_compile/SourceFromThreeArgs-result.txt create mode 100644 Tests/RunCMake/try_compile/SourceFromThreeArgs-stderr.txt create mode 100644 Tests/RunCMake/try_compile/SourceFromThreeArgs.cmake create mode 100644 Tests/RunCMake/try_compile/TryRunArgs-stderr.txt create mode 100644 Tests/RunCMake/try_compile/TryRunArgs.cmake create mode 100644 Tests/RunCMake/try_compile/WarnDeprecated-stderr.txt create mode 100644 Tests/RunCMake/try_compile/new_signature.cmake create mode 100644 Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake create mode 100644 Tests/RunCMake/try_compile/old_signature.cmake create mode 100644 Tests/RunCMake/try_run/BinDirEmpty-result.txt create mode 100644 Tests/RunCMake/try_run/BinDirEmpty-stderr.txt create mode 100644 Tests/RunCMake/try_run/BinDirEmpty.cmake create mode 100644 Tests/RunCMake/try_run/BinDirRelative-result.txt create mode 100644 Tests/RunCMake/try_run/BinDirRelative-stderr.txt create mode 100644 Tests/RunCMake/try_run/BinDirRelative.cmake create mode 100644 Tests/RunCMake/try_run/NoCompileOutputVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoCompileOutputVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoCompileOutputVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoOutputCompileVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoOutputVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoOutputVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoOutputVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoRunOutputVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoRunOutputVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoRunOutputVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoRunStdErrVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoRunStdErrVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoRunStdErrVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoRunStdOutVariable-result.txt create mode 100644 Tests/RunCMake/try_run/NoRunStdOutVariable-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoRunStdOutVariable.cmake create mode 100644 Tests/RunCMake/try_run/NoWorkingDirectory-result.txt create mode 100644 Tests/RunCMake/try_run/NoWorkingDirectory-stderr.txt create mode 100644 Tests/RunCMake/try_run/NoWorkingDirectory.cmake create mode 100644 Tests/RunCMake/try_run/new_signature.cmake create mode 100644 Tests/RunCMake/try_run/old_and_new_signature_tests.cmake create mode 100644 Tests/RunCMake/try_run/old_signature.cmake create mode 100644 Tests/SwiftMixLib/CMakeLists.txt create mode 100644 Tests/SwiftMixLib/lib.c create mode 100644 Tests/SwiftMixLib/lib.cpp create mode 100644 Tests/SwiftMixLib/lib.swift create mode 100644 Tests/SwiftMixLib/main.swift create mode 100644 Tests/SwiftOnly/SubA/CMakeLists.txt create mode 100644 Tests/SwiftOnly/SubA/SubA.swift create mode 100644 Tests/SwiftOnly/SubB/CMakeLists.txt create mode 100644 Tests/SwiftOnly/SubB/SubB.swift create mode 100644 Tests/TryCompile/old_and_new_signature_tests.cmake create mode 100644 Tests/TryCompile/stdout_and_stderr.c create mode 100644 Utilities/cmcurl/CMake/FindLibPSL.cmake create mode 100644 Utilities/cmcurl/include/curl/websockets.h delete mode 100644 Utilities/cmcurl/lib/curl_ctype.c delete mode 100644 Utilities/cmcurl/lib/dotdot.c create mode 100644 Utilities/cmcurl/lib/easy_lock.h create mode 100644 Utilities/cmcurl/lib/fopen.c rename Utilities/cmcurl/lib/{vssh/wolfssh.h => fopen.h} (77%) create mode 100644 Utilities/cmcurl/lib/functypes.h create mode 100644 Utilities/cmcurl/lib/noproxy.c rename Utilities/cmcurl/lib/{dotdot.h => noproxy.h} (57%) create mode 100644 Utilities/cmcurl/lib/ws.c create mode 100644 Utilities/cmcurl/lib/ws.h create mode 100644 Utilities/cmlibuv/src/strtok.c create mode 100644 Utilities/cmlibuv/src/strtok.h create mode 100644 Utilities/cmlibuv/src/unix/hurd.c 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::_mem\\)\\)' may be used uninitialized \\[-Wmaybe-uninitialized\\]" + "cmGlobalNinjaGenerator.cxx:[0-9]*:[0-9]*: note: '.*cm::optional::_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 * Daniel Blezek * Daniel Pfeifer +* Dawid Wróbel * Enrico Scholz * Eran Ifrah * 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 ```` 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 ...]) + + 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 ` 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 ```` to a command-line string as -above but without the ``--target`` option. +above but without the :option:`--target ` option. The ```` 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 ...) cmake_language(`DEFER`_ ... CALL [...]) cmake_language(`SET_DEPENDENCY_PROVIDER`_ SUPPORTED_METHODS ...) + cmake_language(`GET_MESSAGE_LOG_LEVEL`_ ) 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 ) + +Writes the current :command:`message` logging level +into the given ````. + +See :command:`message` for the possible logging levels. + +The current message logging level can be set either using the +:option:`--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 () + ... + cmake_policy(POP) + return() + elseif() + ... + 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 () + ... + return() + elseif() + ... + 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 `` Specify the build configuration (e.g. ``Debug``). If not specified the ``CTEST_BUILD_CONFIGURATION`` variable will be checked. - Otherwise the ``-C `` option given to the :manual:`ctest(1)` - command will be used, if any. + Otherwise the :option:`-C \ ` option given to the + :manual:`ctest(1)` command will be used, if any. ``PARALLEL_LEVEL `` .. 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 `` 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 ` command-line + argument to :manual:`ctest(1)`. See also the ``TestLoad`` setting + in the :ref:`CTest Test Step`. ``REPEAT :`` .. 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 `, +:option:`--test-output-size-failed `, and +:option:`--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( [OPTIONAL] ) + enable_language(... [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 ... [NAMESPACE ] - [APPEND] FILE [EXPORT_LINK_INTERFACE_LIBRARIES]) + [APPEND] FILE [EXPORT_LINK_INTERFACE_LIBRARIES] + [CXX_MODULES_DIRECTORY ]) Creates a file ```` that may be included by outside projects to import targets named by ``...`` 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 `` + + .. 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 [NAMESPACE ] [FILE ]) + export(EXPORT [NAMESPACE ] [FILE ] + [CXX_MODULES_DIRECTORY ]) Creates a file ```` 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()``. - If it does not match, the operation fails with an error. It is an error to - specify this if ``DOWNLOAD`` is not given a ````. + 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 ````. ``EXPECTED_MD5 `` Historical short-hand for ``EXPECTED_HASH MD5=``. 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:: - - / (W) - /(cmake|CMake)/ (W) - /*/ (W) - /*/(cmake|CMake)/ (W) - /(lib/|lib*|share)/cmake/*/ (U) - /(lib/|lib*|share)/*/ (U) - /(lib/|lib*|share)/*/(cmake|CMake)/ (U) - /*/(lib/|lib*|share)/cmake/*/ (W/U) - /*/(lib/|lib*|share)/*/ (W/U) - /*/(lib/|lib*|share)/*/(cmake|CMake)/ (W/U) +(``U``), or Apple (``A``) conventions: + +==================================================================== ========== + Entry Convention +==================================================================== ========== + ``/`` W + ``/(cmake|CMake)/`` W + ``/*/`` W + ``/*/(cmake|CMake)/`` W + ``/*/(cmake|CMake)/*/`` [#]_ W + ``/(lib/|lib*|share)/cmake/*/`` U + ``/(lib/|lib*|share)/*/`` U + ``/(lib/|lib*|share)/*/(cmake|CMake)/`` U + ``/*/(lib/|lib*|share)/cmake/*/`` W/U + ``/*/(lib/|lib*|share)/*/`` W/U + ``/*/(lib/|lib*|share)/*/(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:: - - /.framework/Resources/ (A) - /.framework/Resources/CMake/ (A) - /.framework/Versions/*/Resources/ (A) - /.framework/Versions/*/Resources/CMake/ (A) - /.app/Contents/Resources/ (A) - /.app/Contents/Resources/CMake/ (A) +containing a configuration file: + +=========================================================== ========== + Entry Convention +=========================================================== ========== + ``/.framework/Resources/`` A + ``/.framework/Resources/CMake/`` A + ``/.framework/Versions/*/Resources/`` A + ``/.framework/Versions/*/Resources/CMake/`` A + ``/.app/Contents/Resources/`` A + ``/.app/Contents/Resources/CMake/`` A +=========================================================== ========== In all cases the ```` is treated as case-insensitive and corresponds to any of the names specified (```` 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 `. The values are interpreted as :ref:`semicolon-separated 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{}`` or ``$CACHE{}`` wherever the above-documented condition syntax accepts ````. + +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 ] [RUNTIME_DEPENDENCIES args...|RUNTIME_DEPENDENCY_SET ] [[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE| - PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE|FILE_SET ] + PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE|FILE_SET |CXX_MODULES_BMI] [DESTINATION ] [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 DESTINATION - [NAMESPACE ] [[FILE .cmake]| + [NAMESPACE ] [FILE .cmake] [PERMISSIONS permissions...] - [CONFIGURATIONS [Debug|Release|...]] + [CONFIGURATIONS [Debug|Release|...] + [CXX_MODULES_DIRECTORY ] [EXPORT_LINK_INTERFACE_LIBRARIES] [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 ` displays all messages in its log area. The :manual:`curses interface ` 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 ` +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 ` ``--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 ...]) -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 `, unlike a :command:`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 ```` 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=`` option without +line by a user through the :option:`-D\=\ ` option without specifying a type. In this case the ``set`` command will add the type. Furthermore, if the ```` is ``PATH`` or ``FILEPATH`` and the ```` 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 ```` must have been created by a command such as :ref:`ALIAS target `. 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 -````. ``PUBLIC`` and ``INTERFACE`` items will populate the +specify the :ref:`scope ` of the following arguments. +``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`COMPILE_DEFINITIONS` +property of ````. ``PUBLIC`` and ``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` property of ````. The following arguments specify compile definitions. Repeated calls for the same ```` 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 -````. ``PUBLIC`` and ``INTERFACE`` items will populate the +specify the :ref:`scope ` of the following arguments. +``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`COMPILE_OPTIONS` +property of ````. ``PUBLIC`` and ``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_COMPILE_OPTIONS` property of ````. The following arguments specify compile options. Repeated calls for the same ```` 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 ````. -``PUBLIC`` and ``INTERFACE`` items will populate the +the :ref:`scope ` of the following arguments. +``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`INCLUDE_DIRECTORIES` +property of ````. ``PUBLIC`` and ``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` property of ````. 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 ```` must have been created by a command such as :ref:`ALIAS target `. 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 ````. ``PUBLIC`` and ``INTERFACE`` items will populate the -:prop_tgt:`INTERFACE_LINK_DIRECTORIES` property of ```` -(:ref:`IMPORTED targets ` only support ``INTERFACE`` items). +specify the :ref:`scope ` of the items that follow +them. ``PRIVATE`` and ``PUBLIC`` items will populate the +:prop_tgt:`LINK_DIRECTORIES` property of ````. ``PUBLIC`` and +``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_LINK_DIRECTORIES` +property of ```` (:ref:`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 ```` 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 ... [ ...]...) -The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` keywords can be used to +The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE`` +:ref:`scope ` 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 -````. ``PUBLIC`` and ``INTERFACE`` items will populate the +specify the :ref:`scope ` of the following arguments. +``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`LINK_OPTIONS` +property of ````. ``PUBLIC`` and ``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_LINK_OPTIONS` property of ````. The following arguments specify link options. Repeated calls for the same ```` 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 ```` must have been created by a command such as :ref:`ALIAS target `. 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 -````. ``PUBLIC`` and ``INTERFACE`` items will populate the +specify the :ref:`scope ` of the following arguments. +``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`PRECOMPILE_HEADERS` +property of ````. ``PUBLIC`` and ``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_PRECOMPILE_HEADERS` property of ```` (:ref:`IMPORTED targets ` only support ``INTERFACE`` items). Repeated calls for the same ```` 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 ```` must have been created by a command such as ```` can be a custom target. The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to -specify the scope of the source file paths (````) that follow -them. ``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`SOURCES` -property of ````, which are used when building the target itself. -``PUBLIC`` and ``INTERFACE`` items will populate the +specify the :ref:`scope ` of the source file paths +(````) that follow them. ``PRIVATE`` and ``PUBLIC`` items will +populate the :prop_tgt:`SOURCES` property of ````, which are used when +building the target itself. ``PUBLIC`` and ``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_SOURCES` property of ````, 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 `` - 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 `` 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 `` arguments can be omitted. For all other file set names, ``TYPE`` is required. ``BASE_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_` +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_` +* :prop_tgt:`CXX_MODULE_DIRS` +* :prop_tgt:`CXX_MODULE_DIRS_` + +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_` +* :prop_tgt:`CXX_MODULE_HEADER_UNIT_DIRS` +* :prop_tgt:`CXX_MODULE_HEADER_UNIT_DIRS_` + 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:`$` 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:`$` 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:`$` 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:`$` 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( - [] [CMAKE_FLAGS ...] + try_compile( PROJECT + SOURCE_DIR + [BINARY_DIR ] + [TARGET ] + [NO_CACHE] + [CMAKE_FLAGS ...] [OUTPUT_VARIABLE ]) +.. versionadded:: 3.25 + Try building a project. The success or failure of the ``try_compile``, i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ````. @@ -34,6 +40,17 @@ below for the meaning of other options. Previously this was only done by the :ref:`source file ` signature. +This command also supports an alternate signature +which was present in older versions of CMake: + +.. code-block:: cmake + + try_compile( + [] + [NO_CACHE] + [CMAKE_FLAGS ...] + [OUTPUT_VARIABLE ]) + .. _`Try Compiling Source Files`: Try Compiling Source Files @@ -41,7 +58,12 @@ Try Compiling Source Files .. code-block:: cmake - try_compile( + try_compile( + | + SOURCE_FROM_CONTENT | + SOURCE_FROM_VAR | + SOURCE_FROM_FILE >... + [NO_CACHE] [CMAKE_FLAGS ...] [COMPILE_DEFINITIONS ...] [LINK_OPTIONS ...] @@ -53,15 +75,19 @@ Try Compiling Source Files [_EXTENSIONS ] ) +.. 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 ````. -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 ) 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 ` 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( + [NO_CACHE] + [CMAKE_FLAGS ...] + [COMPILE_DEFINITIONS ...] + [LINK_OPTIONS ...] + [LINK_LIBRARIES ...] + [OUTPUT_VARIABLE ] + [COPY_FILE [COPY_FILE_ERROR ]] + [_STANDARD ] + [_STANDARD_REQUIRED ] + [_EXTENSIONS ] + ) + +In this version, ``try_compile`` will use ``/CMakeFiles/CMakeTmp`` for +its operation, and all such files will be cleaned automatically. +For debugging, :option:`--debug-trycompile ` can be +passed to ``cmake`` to avoid this clean. However, multiple sequential +``try_compile`` operations, if given the same ````, 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 ...`` - 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 ` 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 `` Store the output from the build process in the given variable. +``SOURCE_FROM_CONTENT `` + .. versionadded:: 3.25 + + Write ```` to a file named ```` 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 ```` + is not allowed to contain path components. + + ``SOURCE_FROM_CONTENT`` may be specified multiple times. + +``SOURCE_FROM_FILE `` + .. versionadded:: 3.25 + + Copy ```` to a file named ```` 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 ```` is not allowed to contain path components. + +``SOURCE_FROM_VAR `` + .. versionadded:: 3.25 + + Write the contents of ```` to a file named ```` 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 ```` is not allowed to contain path + components. + + ``SOURCE_FROM_VAR`` may be specified multiple times. + ``_STANDARD `` .. 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 ``/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 )`` 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( - [CMAKE_FLAGS ...] + | + SOURCE_FROM_CONTENT | + SOURCE_FROM_VAR | + SOURCE_FROM_FILE >... + [NO_CACHE] + [CMAKE_FLAGS ...] [COMPILE_DEFINITIONS ...] [LINK_OPTIONS ...] [LINK_LIBRARIES ...] [COMPILE_OUTPUT_VARIABLE ] + [COPY_FILE [COPY_FILE_ERROR ]] + [_STANDARD ] + [_STANDARD_REQUIRED ] + [_EXTENSIONS ] [RUN_OUTPUT_VARIABLE ] + [RUN_OUTPUT_STDOUT_VARIABLE ] + [RUN_OUTPUT_STDERR_VARIABLE ] [OUTPUT_VARIABLE ] [WORKING_DIRECTORY ] - [ARGS ...]) + [ARGS ...] + ) + +.. versionadded:: 3.25 Try compiling a ````. Returns ``TRUE`` or ``FALSE`` for success or failure in ````. If the compile succeeded, runs the executable and returns its exit code in ````. If the executable was built, but failed to run, then ```` 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 ...`` - 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 ...`` - Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions` - in the generated test project. - -``COMPILE_OUTPUT_VARIABLE `` - 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 ...`` - .. 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 ` 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( + + [NO_CACHE] + [CMAKE_FLAGS ...] + [COMPILE_DEFINITIONS ...] + [LINK_OPTIONS ...] + [LINK_LIBRARIES ...] + [COMPILE_OUTPUT_VARIABLE ] + [COPY_FILE [COPY_FILE_ERROR ]] + [_STANDARD ] + [_STANDARD_REQUIRED ] + [_EXTENSIONS ] + [RUN_OUTPUT_VARIABLE ] + [RUN_OUTPUT_STDOUT_VARIABLE ] + [RUN_OUTPUT_STDERR_VARIABLE ] + [OUTPUT_VARIABLE ] + [WORKING_DIRECTORY ] + [ARGS ...] + ) -``LINK_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 `` + Report the compile step build output in a given variable. ``OUTPUT_VARIABLE `` 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 `` Report the output from running the executable in a given variable. +``RUN_OUTPUT_STDOUT_VARIABLE `` + .. versionadded:: 3.25 + + Report the output of stdout from running the executable in a given variable. + +``RUN_OUTPUT_STDERR_VARIABLE `` + .. versionadded:: 3.25 + + Report the output of stderr from running the executable in a given variable. + ``WORKING_DIRECTORY `` .. versionadded:: 3.20 Run the executable in the given directory. If no ``WORKING_DIRECTORY`` is - specified, the executable will run in ````. + specified, the executable will run in ```` or the current build + directory. + +``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 ```` 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__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__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__FILE_NAME @@ -399,7 +399,7 @@ List of CPack DEB generator specific variables: .. versionadded:: 3.4 Per-component ``CPACK_DEBIAN__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__PACKAGE_ENHANCES @@ -419,7 +419,7 @@ List of CPack DEB generator specific variables: .. versionadded:: 3.4 Per-component ``CPACK_DEBIAN__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__PACKAGE_BREAKS @@ -508,7 +508,7 @@ List of CPack DEB generator specific variables: .. versionadded:: 3.4 Per-component ``CPACK_DEBIAN__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__PACKAGE_RECOMMENDS @@ -527,7 +527,7 @@ List of CPack DEB generator specific variables: .. versionadded:: 3.4 Per-component ``CPACK_DEBIAN__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__PACKAGE_SUGGESTS @@ -545,7 +545,7 @@ List of CPack DEB generator specific variables: .. versionadded:: 3.4 Per-component ``CPACK_DEBIAN__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 ` generates configuration and meta information for the `Qt Installer Framework -`_ (QtIFW), +`_ (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 ` 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 ... "nsisFileName.nsi" ... + + where ``...`` is constructed from ``CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS`` + and ``...`` 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 ` 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 ... "nsisFileName.nsi" ... + + where ``...`` is constructed from ``CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS`` + and ``...`` 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__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..336137f 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 ```` 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_`` 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 @@ -73,5 +89,5 @@ the GCC documentation, but the relevant section for the purposes of CMake is: -- GCC module mapper documentation .. _`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 @@ ASMFLAGS .. include:: ENV_VAR.txt -Default compilation flags to be used when compiling a specific dialect of an -assembly language. ``ASMFLAGS`` can be ``ASMFLAGS``, ``ASM_NASMFLAGS``, -``ASM_MASMFLAGS`` or ``ASM-ATTFLAGS``. Will only be used by CMake on the -first configuration to determine ``ASM_`` default compilation -flags, after which the value for ``ASMFLAGS`` is stored in the cache -as ``CMAKE_ASM_FLAGS _FLAGS>``. For any configuration -run (including the first), the environment variable will be ignored, if the -``CMAKE_ASM_FLAGS _FLAGS>`` variable is defined. +Add default compilation flags to be used when compiling a specific dialect +of an assembly language. ``ASMFLAGS`` can be one of: + +* ``ASMFLAGS`` +* ``ASM_NASMFLAGS`` +* ``ASM_MASMFLAGS`` +* ``ASM-ATTFLAGS`` + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_ASM_FLAGS _FLAGS>` +.. |LANG| replace:: ``ASM`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_ASM_FLAGS_INIT _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 _FLAGS>`. For any configuration run -(including the first), the environment variable will be ignored if the -:variable:`CMAKE_C_FLAGS _FLAGS>` variable is defined. +Add default compilation flags to be used when compiling ``C`` files. + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_C_FLAGS _FLAGS>` +.. |LANG| replace:: ``C`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_C_FLAGS_INIT _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 `. 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 _FLAGS>`. For any configuration -run (including the first), the environment variable will be ignored if the -:variable:`CMAKE_CSharp_FLAGS _FLAGS>` variable is defined. +Add default compilation flags to be used when compiling ``CSharp`` files. + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CSharp_FLAGS _FLAGS>` +.. |LANG| replace:: ``CSharp`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_CSharp_FLAGS_INIT _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 ` overrides this -environment variable if both are given. +The :option:`--progress ` option to :manual:`ctest ` +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 _FLAGS>`. For any configuration -run (including the first), the environment variable will be ignored if -the :variable:`CMAKE_CUDA_FLAGS _FLAGS>` variable is defined. +Add default compilation flags to be used when compiling ``CUDA`` files. + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CUDA_FLAGS _FLAGS>` +.. |LANG| replace:: ``CUDA`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_CUDA_FLAGS_INIT _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 _FLAGS>`. For any configuration run ( -including the first), the environment variable will be ignored if -the :variable:`CMAKE_CXX_FLAGS _FLAGS>` variable is defined. +Add default compilation flags to be used when compiling ``CXX`` (C++) files. + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CXX_FLAGS _FLAGS>` +.. |LANG| replace:: ``CXX`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_CXX_FLAGS_INIT _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 ` +mode, one may specify a different prefix using the +:option:`--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 _FLAGS>`. For any configuration -run (including the first), the environment variable will be ignored if -the :variable:`CMAKE_Fortran_FLAGS _FLAGS>` variable is defined. +Add default compilation flags to be used when compiling ``Fortran`` files. + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_Fortran_FLAGS _FLAGS>` +.. |LANG| replace:: ``Fortran`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_Fortran_FLAGS_INIT _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 _FLAGS>`. For any configuration -run (including the first), the environment variable will be ignored if -the :variable:`CMAKE_HIP_FLAGS _FLAGS>` variable is defined. +Add default compilation flags to be used when compiling ``HIP`` files. + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_HIP_FLAGS _FLAGS>` +.. |LANG| replace:: ``HIP`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_HIP_FLAGS_INIT _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 _FLAGS>`. For any configuration -run (including the first), the environment variable will be ignored if -the :variable:`CMAKE_ISPC_FLAGS _FLAGS>` variable is defined. +Add default compilation flags to be used when compiling ``ISPC`` files. + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_ISPC_FLAGS _FLAGS>` +.. |LANG| replace:: ``ISPC`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_ISPC_FLAGS_INIT _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 _FLAGS>`. For any -configuration run (including the first), the environment variable will be ignored -if the :variable:`CMAKE_RC_FLAGS _FLAGS>` variable is defined. +Add default compilation flags to be used when compiling ``RC`` (resource) files. + +.. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_RC_FLAGS _FLAGS>` +.. |LANG| replace:: ``RC`` +.. include:: LANG_FLAGS.txt See also :variable:`CMAKE_RC_FLAGS_INIT _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-.ninja``. A :variable:`CMAKE_CONFIGURATION_TYPES`. ``cmake --build . --config `` will always use ``build-.ninja`` -to build. If no ``--config`` argument is specified, ``cmake --build .`` will -use ``build.ninja``. +to build. If no :option:`--config ` argument is +specified, :option:`cmake --build . ` will use ``build.ninja``. Each ``build-.ninja`` file contains ```` targets as well as ``:`` targets, where ```` 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 `. 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-$.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= ` option directly. The +:option:`--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 ` 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 ` 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 ` 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 ` 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 ` executable or the :manual:`cmake-gui ` 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 ` 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. +
TODO 1: Click to show/hide answer .. 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 +
+ +The next step to make a basic project is to use the :command:`project` +command as follows to set the project name: + +.. raw:: html + +
TODO 2: Click to show/hide answer + +.. 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: +
+ +The last command to call for a basic project is +:command:`add_executable`. We call it as follows: + +.. raw:: html + +
TODO 3: Click to show/hide answer .. 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++ +
-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 ``. +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 + +
TODO 4: Click to show/hide answer .. 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 + +
+ +To complete ``TODO 5``, simply remove ``#include ``. 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 + +
TODO 6: Click to show/hide answer .. 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 -------- +
-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:`_VERSION_MAJOR` +* :variable:`_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 + +
TODO 7: Click to show/hide answer + +.. 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 + +
+ +Then we used :command:`configure_file` to copy the input file with the +specified CMake variables replaced: + +.. raw:: html + +
TODO 8: Click to show/hide answer + +.. 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 + +
+ +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 + +
TODO 9: Click to show/hide answer + +.. 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 + +
+ +``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 + +
TODO 10: Click to show/hide answer + +.. literalinclude:: Step2/TutorialConfig.h.in + :caption: TODO 10: TutorialConfig.h.in + :name: TutorialConfig.h.in + :language: c++ + :end-before: // TODO 13: + +.. raw:: html + +
+ +Next, we need to modify ``tutorial.cxx`` to include the configured header file, +``TutorialConfig.h``. + +.. raw:: html + +
TODO 11: Click to show/hide answer + +.. code-block:: c++ + :caption: TODO 11: tutorial.cxx + + #include "TutorialConfig.h" + +.. raw:: html + +
+ +Finally, we print out the executable name and version number by updating +``tutorial.cxx`` as follows: + +.. raw:: html + +
TODO 12: Click to show/hide answer + +.. 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. +
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 ` 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 ` +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 `. + +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 ` +executable or the :manual:`cmake-gui ` 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 + +
TODO 1: Click to show/hide answer + +.. 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 + +
+ +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 + +
TODO 2: Click to show/hide answer + +.. 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 + +
+ +and this: + +.. raw:: html + +
TODO 3: Click to show/hide answer + +.. 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 + +
+ +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 ` 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 + +
TODO 4: Click to show/hide answer + +.. 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 +
+ +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 + +
TODO 5: Click to show/hide answer + +.. 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 + +
+ +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 + +
TODO 6: Click to show/hide answer .. 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 +
+ +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 + +
TODO 7: Click to show/hide answer + +.. 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 "$") + :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``. +
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 ` 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 +` executable or the :manual:`cmake-gui ` to +configure the project and then build it with your chosen build tool or by +using :option:`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 + +
TODO 1: Click to show/hide answer .. 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 + +
-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 + +
TODO 2: Click to show/hide answer + .. 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 + +
+ And here: +.. raw:: html + +
TODO 3: Click to show/hide answer + .. 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 ` executable or the -:manual:`cmake-gui ` to configure the project and then build it -with your chosen build tool or by using ``cmake --build .`` from the build -directory. +.. raw:: html + +
+ +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 ` executable or the +:manual:`cmake-gui ` 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 + +
TODO 1: Click to show/hide answer .. 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 + +
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 + +
TODO 2: Click to show/hide answer + +.. code-block:: cmake + :caption: TODO 2: CMakeLists.txt + :name: CMakeLists.txt-add_subdirectory + + add_subdirectory(MathFunctions) + +.. raw:: html + +
+ +Next, the new library target is linked to the executable target using +:command:`target_link_libraries`. + +.. raw:: html + +
TODO 3: Click to show/hide answer + +.. code-block:: cmake + :caption: TODO 3: CMakeLists.txt + :name: CMakeLists.txt-target_link_libraries + + target_link_libraries(Tutorial PUBLIC MathFunctions) + +.. raw:: html + +
+ +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 + +
TODO 4: Click to show/hide answer .. 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 + +
+ +Now let's use our library. In ``tutorial.cxx``, include ``MathFunctions.h``: + +.. raw:: html + +
TODO 5: Click to show/hide answer - # 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" - ) +
-Now let us make the ``MathFunctions`` library optional. While for the tutorial +Lastly, replace ``sqrt`` with our library function ``mysqrt``. + +.. raw:: html + +
TODO 6: Click to show/hide answer + +.. code-block:: c++ + :caption: TODO 6 : tutorial.cxx + :name: tutorial.cxx-call_mysqrt + + const double outputValue = mysqrt(inputValue); + +.. raw:: html + +
+ +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 ` + +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 ` or :manual:`ccmake ` +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 ` and +:manual:`ccmake ` with a default value of ``ON`` that can be +changed by the user. + +.. raw:: html + +
TODO 7: Click to show/hide answer .. 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 ` and -:manual:`ccmake ` -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 + +
+ +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 + +
TODO 8: Click to show/hide answer .. 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 + +
-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 + +
TODO 9: Click to show/hide answer + +.. 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 + +
+ +Then, we do the same thing with :command:`target_include_directories` and +``EXTRA_INCLUDES``. + +.. raw:: html + +
TODO 10: Click to show/hide answer + +.. 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 + +
+ +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 + +
TODO 11: Click to show/hide answer .. 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 + +
+ +Then, in the same file, we make ``USE_MYMATH`` control which square root function is used: +.. raw:: html + +
TODO 12: Click to show/hide answer + .. 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 + +
+ Since the source code now requires ``USE_MYMATH`` we can add it to ``TutorialConfig.h.in`` with the following line: +.. raw:: html + +
TODO 13: Click to show/hide answer + .. 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 + +
+ +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 ` executable or the -:manual:`cmake-gui ` 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 ` or :manual:`ccmake ` 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 +
Click to show/hide answer - 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``? +
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 ` executable or the +Make a new directory called ``Step5_build``. Run the +:manual:`cmake ` executable or the :manual:`cmake-gui ` 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 ` 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 ` +option of the :manual:`cmake ` 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 ` 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 ` 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 + +
TODO 1: Click to show/hide answer + +.. 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 + +
+ +and + +.. raw:: html + +
TODO 2: Click to show/hide answer + +.. 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 + +
+ +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 + +
TODO 3,4: Click to show/hide answer + +.. 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 + +
-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 ` 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 ` + +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 `` flag. For example, to run tests in Debug -mode use ``ctest -C Debug -VV`` from the binary directory +specified with the :option:`-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 + +
TODO 5: Click to show/hide answer + +.. 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 + +
+ +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 + +
TODO 6: Click to show/hide answer + +.. 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 + +
+ +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 + +
TODO 7: Click to show/hide answer + +.. 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 + +
+ +The next test we will add verifies the computed value is truly the +square root. + +.. raw:: html + +
TODO 8: Click to show/hide answer + +.. 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 + +
+ +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 + +
TODO 9: Click to show/hide answer + +.. 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 + +
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 ` option. For multi-config builds, +use :option:`-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 ` +:option:`cpack --help`. An :cpack_gen:`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 -#include +#include // TODO 5: Remove this line #include #include +// 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 "$") +set(msvc_cxx "$") +target_compile_options(tutorial_compiler_flags INTERFACE + "$<${gcc_like_cxx}:$>" + "$<${msvc_cxx}:$>" +) -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 #include -#include #include -#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 +#include #include #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 "$") +set(msvc_cxx "$") +target_compile_options(tutorial_compiler_flags INTERFACE + "$<${gcc_like_cxx}:$>" + "$<${msvc_cxx}:$>" +) # 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 "$") +set(msvc_cxx "$") +target_compile_options(tutorial_compiler_flags INTERFACE + "$<${gcc_like_cxx}:$>" + "$<${msvc_cxx}:$>" +) # 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 - int main() { - std::log(1.0); - return 0; - } -" HAVE_LOG) -check_cxx_source_compiles(" - #include - 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 -#include -#include - -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(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 #include #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 "$") +set(msvc_cxx "$") +target_compile_options(tutorial_compiler_flags INTERFACE + "$<${gcc_like_cxx}:$>" + "$<${msvc_cxx}:$>" +) # 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 -#include -#include - -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(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(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 "$") +set(msvc_cxx "$") +target_compile_options(tutorial_compiler_flags INTERFACE + "$<${gcc_like_cxx}:$>" + "$<${msvc_cxx}:$>" +) + # 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 + int main() { + std::log(1.0); + return 0; + } +" HAVE_LOG) +check_cxx_source_compiles(" + #include + 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 #include #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(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 "$") +set(msvc_cxx "$") +target_compile_options(tutorial_compiler_flags INTERFACE + "$<${gcc_like_cxx}:$>" + "$<${msvc_cxx}:$>" +) # 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 - -#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 ` +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 ` 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 ` 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 ` 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 ` 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 ` option specifies the _target_ +architecture, the :option:`-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 ` 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 ` 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 ` +option. If :option:`--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 `, or +The :option:`--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 `, 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 ` mode also accepts +the parameter :option:`--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 ` mode also accepts a +:option:`--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 ` 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 ` +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 ` 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 ` +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 ` 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 ` +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 `. 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 ` +(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 ` +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 ` +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 `` +.. option:: -S + Path to root directory of the CMake project to build. -``-B `` +.. option:: -B + 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 `` +.. option:: -C + 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 :=, -D =`` +.. option:: -D :=, -D = + 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:=`` or ``-D=``. -``-U `` + 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 + 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 `` +.. option:: -G + 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 `` +.. option:: -T + 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 `` +.. option:: -A + 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 `` +.. option:: --toolchain + Specify the cross compiling toolchain file, equivalent to setting :variable:`CMAKE_TOOLCHAIN_FILE` variable. -``--install-prefix `` +.. option:: --install-prefix + 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= + + Treat CMake warnings as errors. ```` 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= - 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. ```` 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 ile if given. +.. |file| replace:: The output is printed to a named ```` if given. + +.. option:: -version [], --version [], /V [] + + 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 []`` - Show program name/version banner and exit. +.. option:: --help-full [] - If a file is specified, the version is written into it. - |file| - -``--help-full []`` Print all help manuals and exit. All manuals are printed in a human-readable text format. |file| -``--help-manual []`` +.. option:: --help-manual [] + Print one help manual and exit. The specified manual is printed in a human-readable text format. |file| -``--help-manual-list []`` +.. option:: --help-manual-list [] + 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 []`` +.. option:: --help-command [] + Print help for one command and exit. The :manual:`cmake-commands(7)` manual entry for ```` is printed in a human-readable text format. |file| -``--help-command-list []`` +.. option:: --help-command-list [] + 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 []`` +.. option:: --help-commands [] + Print cmake-commands manual and exit. The :manual:`cmake-commands(7)` manual is printed in a human-readable text format. |file| -``--help-module []`` +.. option:: --help-module [] + Print help for one module and exit. The :manual:`cmake-modules(7)` manual entry for ```` is printed in a human-readable text format. |file| -``--help-module-list []`` +.. option:: --help-module-list [] + 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 []`` +.. option:: --help-modules [] + Print cmake-modules manual and exit. The :manual:`cmake-modules(7)` manual is printed in a human-readable text format. |file| -``--help-policy []`` +.. option:: --help-policy [] + Print help for one policy and exit. The :manual:`cmake-policies(7)` manual entry for ```` is printed in a human-readable text format. |file| -``--help-policy-list []`` +.. option:: --help-policy-list [] + 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 []`` +.. option:: --help-policies [] + Print cmake-policies manual and exit. The :manual:`cmake-policies(7)` manual is printed in a human-readable text format. |file| -``--help-property []`` +.. option:: --help-property [] + Print help for one property and exit. The :manual:`cmake-properties(7)` manual entries for ```` are printed in a human-readable text format. |file| -``--help-property-list []`` +.. option:: --help-property-list [] + 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 []`` +.. option:: --help-properties [] + Print cmake-properties manual and exit. The :manual:`cmake-properties(7)` manual is printed in a human-readable text format. |file| -``--help-variable []`` +.. option:: --help-variable [] + Print help for one variable and exit. The :manual:`cmake-variables(7)` manual entry for ```` is printed in a human-readable text format. |file| -``--help-variable-list []`` +.. option:: --help-variable-list [] + 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 []`` +.. option:: --help-variables [] + 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 [] { | } + ccmake [] 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:: $ .. versionadded:: 3.20 @@ -627,9 +631,8 @@ Platform .. genex:: $ - 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 ``$`` and + comma-separated entries in ``compiler_ids``, otherwise ``0``. This expression + is a short form for the combination of ``$`` and ``$``. 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 ``$`` 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 ``$`` and ``$``. 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 ` output lists available generators on the +current platform. Use its :option:`-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 `` - ``. +command-line tool :option:`--help ` output may have +variants that specify an extra generator for an auxiliary IDE tool. +Such generator names have the form `` - ``. 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 [] - cmake-gui [] { | } + cmake-gui [] cmake-gui [] -S -B cmake-gui [] --browse-manual @@ -29,19 +29,25 @@ native tool on their platform. Options ======= -``-S `` +.. program:: cmake-gui + +.. option:: -S + Path to root directory of the CMake project to build. -``-B `` +.. option:: -B + 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=`` +.. option:: --preset= + Name of the preset to use from the project's :manual:`presets ` 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. + CMP0141: MSVC debug information format flags are selected by an abstraction. + CMP0140: The return() command checks its arguments. + 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 ` +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 ` 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 `, 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 ` 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 ` 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 ` + or :option:`-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 ` or + :option:`-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 ` 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 ` 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 ` 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 ` + or :option:`-Wno-error=dev ` 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 ` or + :option:`-Wno-error=deprecated ` 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 ` 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 ` 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 ` 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 ` 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 ` 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 ` 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 ` 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 ` 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 ` 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 ` + 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 ` 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 ` 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 ` 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 ` 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 ` 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 ` 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 ` on + the command line. ``extra`` - - Equivalent to passing ``--extra-verbose`` on the command line. + Equivalent to passing :option:`--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 ` on the command line. ``outputOnFailure`` - An optional bool. If true, equivalent to passing - ``--output-on-failure`` on the command line. + :option:`--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 ` 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 ` 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 ` 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 ` on the command + line. ``subprojectSummary`` - An optional bool. If false, equivalent to passing - ``--no-subproject-summary`` on the command line. + :option:`--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 ` + 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 ` + 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 ` 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 ` + 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) `. - + passing :option:`--tests-regex ` on the command + line. This field supports macro expansion. CMake regex syntax is + described under :ref:`string(REGEX) `. ``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 ` 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 ` + 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 `. + 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 ` 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 ` 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 ` 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 ` 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 ` + 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 ` 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 ` + on the command line. ``jobs`` - - An optional integer. Equivalent to passing ``--parallel`` on the - command line. + An optional integer. Equivalent to passing + :option:`--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 ` 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 ` on the command line. ``showOnly`` - - An optional string. Equivalent to passing ``--show-only`` on the + An optional string. Equivalent to passing + :option:`--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 ` 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 ` + on the command line. If false, equivalent to passing + :option:`--interactive-debug-mode 0 ` + 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 ` on the command + line. ``timeout`` - - An optional integer. Equivalent to passing ``--timeout`` on the - command line. + An optional integer. Equivalent to passing + :option:`--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 ` + on the command line. ``ignore`` + Equivalent to passing :option:`--no-tests=ignore ` + 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 ` 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 ` 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 ` 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 ` + 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 ` 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{}`` - Environment variable with 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{}`` - Similar to ``$env{}``, 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{}`` - An extension point for vendors to insert their own macros. CMake will not be able to use presets which have a ``$vendor{}`` 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 `_ +see `the Qt cmake manual `_ 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__COMPILER` is the full path to the compiler used -for ````. :variable:`CMAKE__COMPILER_ID` is the identifier used -by CMake for the compiler and :variable:`CMAKE__COMPILER_VERSION` is the -version of the compiler. - -The :variable:`CMAKE__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__COMPILER` + The full path to the compiler used for ```` +:variable:`CMAKE__COMPILER_ID` + The compiler identifier used by CMake +:variable:`CMAKE__COMPILER_VERSION` + The version of the compiler. +:variable:`CMAKE__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 `, 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 ` or +:option:`-DCMAKE_TOOLCHAIN_FILE=path/to/file `, 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__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__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 [] - cmake [] + cmake [] cmake [] -S -B `Build a Project`_ @@ -23,7 +22,7 @@ Synopsis cmake --open `Run a Script`_ - cmake [{-D =}...] -P + cmake [-D =]... -P `Run a Command-Line Tool`_ cmake -E [] @@ -31,6 +30,9 @@ Synopsis `Run the Find-Package Tool`_ cmake --find-package [] + `Run a Workflow Preset`_ + cmake --workflow [] + `View Help`_ cmake --help[-] @@ -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 ` 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 [] -S -B `` + + .. versionadded:: 3.13 + Uses ```` as the build tree and ```` 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 ```` 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 ` or :option:`-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 ` 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= + 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=`` - Set the log level. +.. option:: --log-level= + + Set the log ````. 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 `. + +.. 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=[,...]`` +.. option:: --debug-find-pkg=[,...] + Put cmake find commands in a debug mode when running under calls to :command:`find_package(\) `, where ```` 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 `, but limiting scope + to the specified packages. + +.. option:: --debug-find-var=[,...] -``--debug-find-var=[,...]`` Put cmake find commands in a debug mode when called with ```` as the result variable, where ```` is an entry in the given comma-separated list. - Like ``--debug-find``, but limiting scope to the specified variable names. + Like :option:`--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 `, but with variables expanded. + +.. option:: --trace-format= -``--trace-format=`` Put cmake in trace mode and sets the trace output 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=`` +.. option:: --trace-source= + Put cmake in trace mode, but output only lines of a specified file. Multiple options are allowed. -``--trace-redirect=`` +.. option:: --trace-redirect= + 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=`` - Used in conjunction with ``--profiling-format`` to output to a given path. +.. option:: --profiling-output= + + Used in conjunction with + :option:`--profiling-format ` to output to a + given path. + +.. option:: --profiling-format= -``--profiling-format=`` 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=`` +.. option:: --preset , --preset= + Reads a :manual:`preset ` from ``/CMakePresets.json`` and ``/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[=] + + Lists the available presets of the specified ````. Valid values for + ```` are ``configure``, ``build``, ``test``, ``package``, or ``all``. + If ```` 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 `` +.. option:: --build + Project binary directory to be built. This is required (unless a preset is specified) and must be first. -``--preset ``, ``--preset=`` +.. program:: cmake--build + +.. option:: --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 ` for more details. -``--list-presets`` +.. option:: --list-presets + Lists the available build presets. The current working directory must contain CMake preset files. -``--parallel [], -j []`` +.. option:: -j [], --parallel [] + + .. versionadded:: 3.12 + The maximum number of concurrent processes to use when building. If ```` 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 ```` value of ``1`` can be used to limit to a single job. -``--target ..., -t ...`` +.. option:: -t ..., --target ... + Build ```` instead of the default target. Multiple targets may be given, separated by spaces. -``--config `` +.. option:: --config + For multi-configuration tools, choose configuration ````. -``--clean-first`` +.. option:: --clean-first + Build target ``clean`` first, then build. - (To clean only, use ``--target clean``.) + (To clean only, use :option:`--target clean `.) + +.. option:: --resolve-package-references= -``--resolve-package-references=`` .. 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 ```` is set to ``on`` (default), packages will be + restored before building a target. When ```` is set to ``only``, the + packages will be restored, but no build will be performed. When + ```` 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 `` +.. option:: --install + Project binary directory to install. This is required and must be first. -``--config `` +.. program:: cmake--install + +.. option:: --config + For multi-configuration generators, choose configuration ````. -``--component `` +.. option:: --component + Component-based install. Only install component ````. -``--default-directory-permissions `` +.. option:: --default-directory-permissions + Default directory install permissions. Permissions in format ````. -``--prefix `` +.. option:: --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 @@ -610,14 +695,26 @@ supported by some generators. Run a Script ============ +.. program:: cmake + .. code-block:: shell - cmake [{-D =}...] -P [-- ...] + cmake [-D =]... -P [-- ...] + +.. program:: cmake-P + +.. option:: -D = + + 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 + + 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 ` 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 [] -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 `. ``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 ... `). 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 [--] ...`` + ``tls`` + .. versionadded:: 3.25 + + ``true`` if TLS support is enabled and ``false`` otherwise. + +.. option:: cat [--] ... + .. 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 [...]`` +.. program:: cmake-E + +.. option:: chdir [...] + Change the current working directory and run a command. -``compare_files [--ignore-eol] `` +.. option:: compare_files [--ignore-eol] + Check if ```` is same as ````. 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 ... -``copy ... `` Copy files to ```` (either file or directory). If multiple files are specified, the ```` 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 ... `` +.. option:: copy_directory ... + Copy content of ``...`` directories to ```` directory. If ```` 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 ... `` +.. option:: copy_if_different ... + Copy files to ```` (either file or directory) if they have changed. If multiple files are specified, the ```` must be @@ -755,7 +885,8 @@ Available commands are: .. versionadded:: 3.5 Support for multiple input files. -``create_symlink `` +.. option:: create_symlink + Create a symbolic link ```` naming ````. .. versionadded:: 3.13 @@ -764,7 +895,8 @@ Available commands are: .. note:: Path to where ```` symbolic link will be created has to exist beforehand. -``create_hardlink `` +.. option:: create_hardlink + .. versionadded:: 3.19 Create a hard link ```` naming ````. @@ -773,31 +905,65 @@ Available commands are: Path to where ```` hard link will be created has to exist beforehand. ```` has to exist beforehand. -``echo [...]`` +.. option:: echo [...] + Displays arguments as text. -``echo_append [...]`` +.. option:: echo_append [...] + Displays arguments as text but no new line. -``env [--unset=NAME ...] [NAME=VALUE ...] [--] [...]`` +.. option:: env [] [--] [...] + .. 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 ...`` +.. option:: make_directory ... + Create ```` 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 ...`` +.. option:: md5sum ... + Create MD5 checksum of files in ``md5sum`` compatible format:: 351abe79cd3800b38cdfb25d45015a15 file1.txt 052f86c15bbde68af55c7f7b340ab639 file2.txt -``sha1sum ...`` +.. option:: sha1sum ... + .. 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 ...`` +.. option:: sha224sum ... + .. 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 ...`` +.. option:: sha256sum ... + .. 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 ...`` +.. option:: sha384sum ... + .. 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 ...`` +.. option:: sha512sum ... + .. 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] ...`` +.. option:: remove [-f] ... + .. 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 ...`` +.. option:: remove_directory ... + .. deprecated:: 3.17 Remove ```` directories and their contents. If a directory does @@ -877,11 +1051,13 @@ Available commands are: .. versionadded:: 3.16 If ```` is a symlink to a directory, just the symlink will be removed. -``rename `` +.. option:: rename + Rename a file or directory (on one volume). If file with the ```` name already exists, then it will be silently replaced. -``rm [-rRf] [--] ...`` +.. option:: rm [-rRf] [--] ... + .. versionadded:: 3.17 Remove the files ```` or directories ````. @@ -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 ...`` +.. option:: sleep ... + .. versionadded:: 3.0 Sleep for given number of seconds. -``tar [cxt][vf][zjJ] file.tar [] [--] [...]`` +.. option:: tar [cxt][vf][zjJ] file.tar [] [--] [...] + 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 ``...`` 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 ``...`` 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=`` + .. option:: --files-from= + .. versionadded:: 3.1 Read file names from the given file, one per line. @@ -950,25 +1140,29 @@ Available commands are: except for ``--add-file=`` to add files whose names start in ``-``. - ``--format=`` + .. option:: --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=`` + .. option:: --mtime= + .. 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 [...]`` +.. program:: cmake-E + +.. option:: time [...] + 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 ...`` +.. option:: touch ... + Creates ```` if file do not exist. If ```` exists, it is changing ```` access and modification times. -``touch_nocreate ...`` +.. option:: touch_nocreate ... + 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 `` +.. option:: delete_regv + Delete Windows registry value. -``env_vs8_wince `` +.. option:: env_vs8_wince + .. versionadded:: 3.2 Displays a batch file which sets the environment for the provided Windows CE SDK installed in VS2005. -``env_vs9_wince `` +.. option:: env_vs9_wince + .. versionadded:: 3.2 Displays a batch file which sets the environment for the provided Windows CE SDK installed in VS2008. -``write_regv `` +.. option:: write_regv + 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 ` provides a way to execute multiple +build steps in order: + +.. code-block:: shell + + cmake --workflow [] + +The options are: + +.. option:: --workflow + + Select a :ref:`Workflow Preset` using one of the following options. + +.. program:: cmake--workflow + +.. option:: --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 ` 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 ` 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 `. The **cpack** program is steered by a configuration file written in the :manual:`CMake language `. 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 `, 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 ` executable, provided the :module:`CPack` @@ -40,7 +40,10 @@ module is included by the project's ``CMakeLists.txt`` file. Options ======= -``-G `` +.. program:: cpack + +.. option:: -G + ```` is a :ref:`semicolon-separated list ` 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 `` +.. option:: -C + Specify the project configuration(s) to be packaged (e.g. ``Debug``, ``Release``, etc.), where ```` is a :ref:`semicolon-separated list `. @@ -58,36 +62,44 @@ Options The user is responsible for ensuring that the configuration(s) listed have already been built before invoking ``cpack``. -``-D =`` +.. option:: -D = + Set a CPack variable. This will override any value set for ```` in the input file read by ``cpack``. -``--config `` +.. option:: --config + 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 `` +.. option:: -P + 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 `` +.. option:: -R + 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 `` +.. option:: -B + 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 `` +.. option:: --vendor + Override/define :variable:`CPACK_PACKAGE_VENDOR`. +.. option:: --preset + + 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 [] - ctest --build-and-test - --build-generator [...] - [--build-options ...] [--test-command [...]] - ctest {-D | -M -T | -S