summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.gitlab/ci/cmake.ps14
-rwxr-xr-x.gitlab/ci/cmake.sh6
-rwxr-xr-x.gitlab/ci/docker/fedora31/install_deps.sh2
-rw-r--r--.gitlab/ci/download_qt.cmake15
-rw-r--r--.gitlab/ci/download_qt_hashes.cmake10
-rw-r--r--.gitlab/os-linux.yml2
-rwxr-xr-xAuxiliary/vim/extract-upper-case.pl24
-rw-r--r--Auxiliary/vim/syntax/cmake.vim750
-rw-r--r--Help/command/cmake_language.rst14
-rw-r--r--Help/command/cmake_path.rst249
-rw-r--r--Help/command/configure_file.rst11
-rw-r--r--Help/command/execute_process.rst14
-rw-r--r--Help/command/file.rst51
-rw-r--r--Help/command/find_package.rst3
-rw-r--r--Help/command/separate_arguments.rst2
-rw-r--r--Help/command/site_name.rst4
-rw-r--r--Help/command/string.rst33
-rw-r--r--Help/command/target_sources.rst6
-rw-r--r--Help/cpack_gen/external.rst6
-rw-r--r--Help/manual/cmake-gui.1.rst9
-rw-r--r--Help/manual/cmake-presets.7.rst43
-rw-r--r--Help/manual/cmake-variables.7.rst3
-rw-r--r--Help/manual/cmake.1.rst32
-rw-r--r--Help/manual/ctest.1.rst14
-rw-r--r--Help/manual/presets/schema.json60
-rw-r--r--Help/policy/CMP0112.rst6
-rw-r--r--Help/policy/CMP0114.rst2
-rw-r--r--Help/release/3.19.rst65
-rw-r--r--Help/release/dev/ExternalData-suppress-progress.rst6
-rw-r--r--Help/release/dev/FindPython-FIND_UNVERSIONED_NAMES.rst6
-rw-r--r--Help/release/dev/abi-byte-order.rst5
-rw-r--r--Help/release/dev/cmake_path.rst5
-rw-r--r--Help/release/dev/configure_file-user-permissions.rst6
-rw-r--r--Help/release/dev/target-sources-supports-custom-target.rst4
-rw-r--r--Help/variable/CMAKE_ANDROID_EXCEPTIONS.rst7
-rw-r--r--Help/variable/CMAKE_ANDROID_RTTI.rst7
-rw-r--r--Help/variable/CMAKE_BUILD_TYPE.rst5
-rw-r--r--Help/variable/CMAKE_LANG_BYTE_ORDER.rst20
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_TYPE.rst6
-rw-r--r--Modules/CMakeCCompiler.cmake.in1
-rw-r--r--Modules/CMakeCCompilerABI.c2
-rw-r--r--Modules/CMakeCUDACompiler.cmake.in1
-rw-r--r--Modules/CMakeCUDACompilerABI.cu2
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in1
-rw-r--r--Modules/CMakeCXXCompilerABI.cpp2
-rw-r--r--Modules/CMakeCompilerABI.h12
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake23
-rw-r--r--Modules/CMakeOBJCCompiler.cmake.in1
-rw-r--r--Modules/CMakeOBJCCompilerABI.m2
-rw-r--r--Modules/CMakeOBJCXXCompiler.cmake.in1
-rw-r--r--Modules/CMakeOBJCXXCompilerABI.mm2
-rw-r--r--Modules/CMakePackageConfigHelpers.cmake4
-rw-r--r--Modules/CPack.cmake44
-rw-r--r--Modules/CTest.cmake11
-rw-r--r--Modules/CheckCCompilerFlag.cmake4
-rw-r--r--Modules/CheckCSourceCompiles.cmake4
-rw-r--r--Modules/CheckCSourceRuns.cmake6
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake4
-rw-r--r--Modules/CheckCXXSourceCompiles.cmake4
-rw-r--r--Modules/CheckCXXSourceRuns.cmake6
-rw-r--r--Modules/CheckCompilerFlag.cmake78
-rw-r--r--Modules/CheckFortranCompilerFlag.cmake4
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake4
-rw-r--r--Modules/CheckFortranSourceRuns.cmake4
-rw-r--r--Modules/CheckLinkerFlag.cmake15
-rw-r--r--Modules/CheckOBJCCompilerFlag.cmake4
-rw-r--r--Modules/CheckOBJCSourceCompiles.cmake4
-rw-r--r--Modules/CheckOBJCSourceRuns.cmake6
-rw-r--r--Modules/CheckOBJCXXCompilerFlag.cmake4
-rw-r--r--Modules/CheckOBJCXXSourceCompiles.cmake4
-rw-r--r--Modules/CheckOBJCXXSourceRuns.cmake6
-rw-r--r--Modules/CheckSourceCompiles.cmake123
-rw-r--r--Modules/CheckSourceRuns.cmake132
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake17
-rw-r--r--Modules/DartConfiguration.tcl.in2
-rw-r--r--Modules/ExternalData.cmake40
-rw-r--r--Modules/FindBoost.cmake19
-rw-r--r--Modules/FindCUDA.cmake4
-rw-r--r--Modules/FindCUDAToolkit.cmake4
-rw-r--r--Modules/FindGTest.cmake93
-rw-r--r--Modules/FindICU.cmake12
-rw-r--r--Modules/FindPostgreSQL.cmake2
-rw-r--r--Modules/FindPython.cmake16
-rw-r--r--Modules/FindPython/Support.cmake20
-rw-r--r--Modules/FindPython2.cmake16
-rw-r--r--Modules/FindPython3.cmake16
-rw-r--r--Modules/FindRuby.cmake1
-rw-r--r--Modules/GNUInstallDirs.cmake29
-rw-r--r--Modules/Internal/CheckCompilerFlag.cmake79
-rw-r--r--Modules/Internal/CheckSourceCompiles.cmake127
-rw-r--r--Modules/Internal/CheckSourceRuns.cmake142
-rw-r--r--Modules/Platform/Android-Clang.cmake12
-rw-r--r--Modules/Platform/Android-Common.cmake12
-rw-r--r--Modules/Platform/Android-Determine.cmake12
-rw-r--r--Modules/Platform/Android-Initialize.cmake12
-rw-r--r--Modules/Platform/Android.cmake86
-rw-r--r--Modules/Platform/Android/Determine-Compiler.cmake12
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake12
-rw-r--r--Modules/Platform/Windows-Clang.cmake4
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackGenerator.cxx2
-rw-r--r--Source/QtDialog/CMakeSetup.cxx13
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx33
-rw-r--r--Source/QtDialog/QCMake.cxx6
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx13
-rw-r--r--Source/QtDialog/QCMakeCacheView.h1
-rw-r--r--Source/QtDialog/QCMakePreset.cxx17
-rw-r--r--Source/QtDialog/QCMakePreset.h3
-rw-r--r--Source/cmAddCustomCommandCommand.cxx13
-rw-r--r--Source/cmCMakePresetsFile.cxx70
-rw-r--r--Source/cmCMakePresetsFile.h9
-rw-r--r--Source/cmCacheManager.cxx1
-rw-r--r--Source/cmCacheManager.h4
-rw-r--r--Source/cmCommands.cxx17
-rw-r--r--Source/cmConfigureFileCommand.cxx109
-rw-r--r--Source/cmCreateTestSourceList.cxx2
-rw-r--r--Source/cmCustomCommandGenerator.cxx43
-rw-r--r--Source/cmCustomCommandGenerator.h11
-rw-r--r--Source/cmFunctionCommand.cxx7
-rw-r--r--Source/cmGeneratorTarget.cxx82
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGetPropertyCommand.cxx2
-rw-r--r--Source/cmGetSourceFilePropertyCommand.cxx5
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx4
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx7
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx20
-rw-r--r--Source/cmListFileCache.cxx118
-rw-r--r--Source/cmListFileCache.h8
-rw-r--r--Source/cmLoadCommandCommand.cxx11
-rw-r--r--Source/cmLocalGenerator.cxx15
-rw-r--r--Source/cmLocalGenerator.h3
-rw-r--r--Source/cmLocalNinjaGenerator.cxx5
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx4
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx5
-rw-r--r--Source/cmMacroCommand.cxx7
-rw-r--r--Source/cmMakefile.cxx20
-rw-r--r--Source/cmMakefile.h5
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx13
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx13
-rw-r--r--Source/cmMakefileTargetGenerator.cxx6
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx8
-rw-r--r--Source/cmNinjaTargetGenerator.cxx4
-rw-r--r--Source/cmQtAutoGenInitializer.cxx2
-rw-r--r--Source/cmSourceFile.cxx19
-rw-r--r--Source/cmSourceFile.h4
-rw-r--r--Source/cmSourceFileLocation.cxx3
-rw-r--r--Source/cmState.cxx36
-rw-r--r--Source/cmState.h10
-rw-r--r--Source/cmTarget.cxx5
-rw-r--r--Source/cmTarget.h1
-rw-r--r--Source/cmTargetPropCommandBase.cxx34
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx8
-rw-r--r--Source/cmake.cxx28
-rw-r--r--Source/cmake.h2
-rw-r--r--Source/cmakemain.cxx5
-rw-r--r--Source/cmcmd.cxx46
-rw-r--r--Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx6
-rw-r--r--Tests/CMakeGUI/QCMakePresetItemModelTest.cxx12
-rw-r--r--Tests/CMakeGUI/QCMakePresetTest.cxx11
-rw-r--r--Tests/CMakeLib/testOptional.cxx28
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx4
-rw-r--r--Tests/CMakeTests/EndStuffTestScript.cmake60
-rw-r--r--Tests/ConfigSources/CMakeLists.txt13
-rw-r--r--Tests/FindPython/CMakeLists.txt12
-rw-r--r--Tests/FindPython/UnversionedNames/CMakeLists.txt66
-rw-r--r--Tests/RunCMake/ABI/C.cmake4
-rw-r--r--Tests/RunCMake/ABI/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ABI/CUDA.cmake4
-rw-r--r--Tests/RunCMake/ABI/CXX.cmake4
-rw-r--r--Tests/RunCMake/ABI/OBJC.cmake4
-rw-r--r--Tests/RunCMake/ABI/OBJCXX.cmake4
-rw-r--r--Tests/RunCMake/ABI/RunCMakeTest.cmake13
-rw-r--r--Tests/RunCMake/CMP0104/CMP0104-Common.cmake4
-rw-r--r--Tests/RunCMake/CMP0104/main.cxx3
-rw-r--r--Tests/RunCMake/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-result.txt (renamed from Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-stderr.txt (renamed from Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-stderr.txt)0
-rw-r--r--Tests/RunCMake/CMakePresets/ArchToolsetStrategyIgnore.cmake (renamed from Tests/RunCMake/CMakePresets/CMakeGeneratorConfigIgnore.cmake)0
-rw-r--r--Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-result.txt (renamed from Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-stderr.txt (renamed from Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-stderr.txt)0
-rw-r--r--Tests/RunCMake/CMakePresets/CMakePresets.json.in46
-rw-r--r--Tests/RunCMake/CMakePresets/Good-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePresets/Good.cmake1
-rw-r--r--Tests/RunCMake/CMakePresets/GoodNoS.cmake3
-rw-r--r--Tests/RunCMake/CMakePresets/GoodNoSCache.cmake4
-rw-r--r--Tests/RunCMake/CMakePresets/GoodNoSCachePrep.cmake4
-rw-r--r--Tests/RunCMake/CMakePresets/GoodNoSourceArg.cmake3
-rw-r--r--Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-result.txt (renamed from Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy.json.in13
-rw-r--r--Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-result.txt (renamed from Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-result.txt)0
-rw-r--r--Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/InvalidToolsetStrategy.json.in (renamed from Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig.json.in)6
-rw-r--r--Tests/RunCMake/CMakePresets/RunCMakeTest.cmake35
-rw-r--r--Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy.json.in13
-rw-r--r--Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/UnknownToolsetStrategy.json.in (renamed from Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig.json.in)6
-rw-r--r--Tests/RunCMake/CTest/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CTest/Site.cmake5
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt4
-rw-r--r--Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt19
-rw-r--r--Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake4
-rw-r--r--Tests/RunCMake/CommandLine/NoArgs-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/ExternalData/BadArguments-stderr.txt7
-rw-r--r--Tests/RunCMake/ExternalData/BadArguments.cmake5
-rw-r--r--Tests/RunCMake/ExternalData/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt12
-rw-r--r--Tests/RunCMake/GNUInstallDirs/GetAbs.cmake11
-rw-r--r--Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target-check.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target-check.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target-check.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target.cmake4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-again-ninja-check.cmake (renamed from Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake)0
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/PerConfigSources.cmake8
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt10
-rw-r--r--Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt10
-rw-r--r--Tests/RunCMake/Syntax/ImproperNesting-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/ImproperNesting-stderr.txt4
-rw-r--r--Tests/RunCMake/Syntax/ImproperNesting.cmake7
-rw-r--r--Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt10
-rw-r--r--Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt10
-rw-r--r--Tests/RunCMake/Syntax/Override.cmake6
-rw-r--r--Tests/RunCMake/Syntax/OverrideBreak-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideContinue-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideElse-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideElseIf-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndForeach-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndFunction-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndIf-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndMacro-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndWhile-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideForeach-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideFunction-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideIf-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideMacro-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideReturn-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideWhile-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/RunCMakeTest.cmake28
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake16
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt4
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt4
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt4
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/configure_file/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissions-result.txt0
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissions-stderr.txt0
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissions.cmake34
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-stderr.txt5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1.cmake5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-stderr.txt5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2.cmake5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-stderr.txt5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3.cmake5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-stderr.txt4
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4.cmake4
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-stderr.txt4
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5.cmake6
-rw-r--r--Tests/RunCMake/configure_file/UseSourcePermissions.cmake40
-rw-r--r--Tests/RunCMake/configure_file/sourcefile.txt1
-rw-r--r--Tests/RunCMake/if/duplicate-deep-else-stderr.txt6
-rw-r--r--Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt6
-rw-r--r--Tests/RunCMake/if/duplicate-else-stderr.txt6
-rw-r--r--Tests/RunCMake/if/misplaced-elseif-stderr.txt6
-rw-r--r--Tests/RunCMake/pseudo_llvm-rc.c30
-rw-r--r--Tests/RunCMake/while/EndAlone-stderr.txt7
-rw-r--r--Tests/RunCMake/while/EndAloneArgs-stderr.txt7
-rw-r--r--Tests/RunCMake/while/EndMissing-stderr.txt10
-rw-r--r--Tests/RunCMake/while/MissingArgument-stderr.txt11
-rw-r--r--Tests/RunCMake/while/MissingArgument.cmake1
-rw-r--r--Utilities/std/cm/optional48
294 files changed, 3557 insertions, 1189 deletions
diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1
index 3b42cae..e73aab7 100755
--- a/.gitlab/ci/cmake.ps1
+++ b/.gitlab/ci/cmake.ps1
@@ -1,7 +1,7 @@
$erroractionpreference = "stop"
-$version = "3.17.2"
-$sha256sum = "CF82B1EB20B6FBE583487656FCD496490FFCCDFBCBBA0F26E19F1C9C63B0B041"
+$version = "3.18.4"
+$sha256sum = "A932BC0C8EE79F1003204466C525B38A840424D4AE29F9E5FB88959116F2407D"
$filename = "cmake-$version-win64-x64"
$tarball = "$filename.zip"
diff --git a/.gitlab/ci/cmake.sh b/.gitlab/ci/cmake.sh
index 658a62a..b4c6ddf 100755
--- a/.gitlab/ci/cmake.sh
+++ b/.gitlab/ci/cmake.sh
@@ -2,17 +2,17 @@
set -e
-readonly version="3.17.2"
+readonly version="3.18.4"
case "$( uname -s )" in
Linux)
shatool="sha256sum"
- sha256sum="dc57f3cc448ca67fc8776b4ad4c22b087b9c6a8e459938b9622b8c7f4ef6b21e"
+ sha256sum="149e0cee002e59e0bb84543cf3cb099f108c08390392605e944daeb6594cbc29"
platform="Linux"
;;
Darwin)
shatool="shasum -a 256"
- sha256sum="139500e20b080444fcafe57f24f57248c691c5187cce6695bee2b9aad6792c7d"
+ sha256sum="9d27049660474cf134ab46fa0e0db771b263313fcb8ba82ee8b2d1a1a62f8f20"
platform="Darwin"
;;
*)
diff --git a/.gitlab/ci/docker/fedora31/install_deps.sh b/.gitlab/ci/docker/fedora31/install_deps.sh
index fa57f61..c1391e3 100755
--- a/.gitlab/ci/docker/fedora31/install_deps.sh
+++ b/.gitlab/ci/docker/fedora31/install_deps.sh
@@ -39,8 +39,10 @@ dnf install --setopt=install_weak_deps=False -y \
fontconfig-devel \
freetype-devel \
gdal-devel \
+ gettext \
giflib-devel \
glew-devel \
+ gmock \
gnutls-devel \
gsl-devel \
gtest-devel \
diff --git a/.gitlab/ci/download_qt.cmake b/.gitlab/ci/download_qt.cmake
index 31ce6c3..c7e3717 100644
--- a/.gitlab/ci/download_qt.cmake
+++ b/.gitlab/ci/download_qt.cmake
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.12)
# Input variables.
set(qt_version_major "5")
set(qt_version_minor "15")
-set(qt_version_patch "0")
+set(qt_version_patch "1")
# This URL is only visible inside of Kitware's network. Please use your own Qt
# Account to obtain these files.
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "package")
@@ -20,7 +20,7 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2015")
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2017" OR
"$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2019")
set(qt_platform "windows_x86")
- set(msvc_year "2017")
+ set(msvc_year "2019")
set(qt_abi "win64_msvc${msvc_year}_64")
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos")
set(qt_platform "mac_x64")
@@ -37,14 +37,7 @@ set(qt_version_nodot "${qt_version_major}${qt_version_minor}${qt_version_patch}"
# Files needed to download.
set(qt_files)
if (qt_platform STREQUAL "windows_x86")
- if (msvc_year STREQUAL "2017")
- set(qt_build_stamp "202002260536")
- elseif (msvc_year STREQUAL "2015")
- set(qt_build_stamp "202005150700")
- else ()
- message(FATAL_ERROR
- "Build stamp for MSVC ${msvc_year} is unknown")
- endif ()
+ set(qt_build_stamp "202009071110")
set(qt_file_name_prefix "${qt_version}-0-${qt_build_stamp}")
@@ -60,7 +53,7 @@ elseif (qt_platform STREQUAL "mac_x64")
"qt-5.6.2-macosx10.7-x86_64.tar.xz")
set(qt_subdir "qt-5.6.2-macosx10.7-x86_64")
else ()
- set(qt_build_stamp "202005140805")
+ set(qt_build_stamp "202009071110")
set(qt_file_name_prefix "${qt_version}-0-${qt_build_stamp}")
foreach (qt_component IN ITEMS qtbase)
diff --git a/.gitlab/ci/download_qt_hashes.cmake b/.gitlab/ci/download_qt_hashes.cmake
index 28837dc..02a6fdd 100644
--- a/.gitlab/ci/download_qt_hashes.cmake
+++ b/.gitlab/ci/download_qt_hashes.cmake
@@ -2,12 +2,12 @@
#
# sha256sum $files | awk '{ print "set(\"" $2 "_hash\" " $1 ")" }' >> $thisfile
-set("5.15.0-0-202002260536qtbase-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z_hash" c041596be8f7a16c7be9ea6757c14766ff3200ab6d56f7db8f865dbfe039fe20)
-set("5.15.0-0-202002260536qtwinextras-Windows-Windows_10-MSVC2017-Windows-Windows_10-X86_64.7z_hash" 10796128fac54f146767e33f6872975ba238858547de7a9650ec4cd9581fe71a)
+set("5.15.1-0-202009071110qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z_hash" a5635124a135f383d9fb92bf628b018cff9f781addfd388926a367cda5b7cd38)
+set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z_hash" 908947855b5d7a854886746365ac29e9296b5d64d4e18089641a6988167807d3)
-set("5.15.0-0-202005150700qtbase-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 0c2653c5eca256f59c0b48b537cd633b05560e4241c0226856d2ae22ab066df4)
-set("5.15.0-0-202005150700qtwinextras-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 4bca3a8d8c7611e211a82d86b3396f8a622abe7859d5052452414642ec191844)
+set("5.15.1-0-202009071110qtbase-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 5d0d2e71e3b00cf88ac4c616b4b314a7e73871f325512821f53c464cdfee961f)
+set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 803e0234169464babb5305dedc21382e90c3266c6f9414ff0cff04be578681e1)
-set("5.15.0-0-202005140805qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z_hash" 04d867c81d2431f288c42c9752642759460b9468477de349368dcc8de0c8ddc4)
+set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z_hash" df2813ce7c6cb4287abd7956cd1cb9d08312e4ac1208b6cb57af4df11b8ebba1)
set("qt-5.6.2-macosx10.7-x86_64.tar.xz_hash" 2b60373ea60037ce356d4c9f5a8c1df9854127a2c55118252e1a2f5a5f4e0010)
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml
index 315552b..bab4f5a 100644
--- a/.gitlab/os-linux.yml
+++ b/.gitlab/os-linux.yml
@@ -49,7 +49,7 @@
### Fedora
.fedora31:
- image: "kitware/cmake:ci-fedora31-x86_64-2020-10-20"
+ image: "kitware/cmake:ci-fedora31-x86_64-2020-10-22"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"
diff --git a/Auxiliary/vim/extract-upper-case.pl b/Auxiliary/vim/extract-upper-case.pl
index 204b496..1179199 100755
--- a/Auxiliary/vim/extract-upper-case.pl
+++ b/Auxiliary/vim/extract-upper-case.pl
@@ -3,6 +3,8 @@
use strict;
use warnings;
use POSIX qw(strftime);
+use JSON;
+use File::Basename;
#my $cmake = "/home/pboettch/devel/upstream/cmake/build/bin/cmake";
my $cmake = "cmake";
@@ -96,6 +98,28 @@ close(CMAKE);
# transform all properties in a hash
my %properties = map { $_ => 1 } @properties;
+# read in manually written files
+my $modules_dir = dirname(__FILE__) . "/modules";
+opendir(DIR, $modules_dir) || die "can't opendir $modules_dir: $!";
+my @json_files = grep { /\.json$/ && -f "$modules_dir/$_" } readdir(DIR);
+closedir DIR;
+
+foreach my $file (@json_files) {
+ local $/; # Enable 'slurp' mode
+ open my $fh, "<", $modules_dir."/".$file;
+ my $json = <$fh>;
+ close $fh;
+
+ my $mod = decode_json($json);
+ foreach my $var (@{$mod->{variables}}) {
+ $variables{$var} = 1;
+ }
+
+ while (my ($cmd, $keywords) = each %{$mod->{commands}}) {
+ $keywords{$cmd} = [ sort @{$keywords} ];
+ }
+}
+
# version
open(CMAKE, "$cmake --version|");
my $version = 'unknown';
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index 2dd3174..8103040 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -1,13 +1,13 @@
" Vim syntax file
" Program: CMake - Cross-Platform Makefile Generator
-" Version: cmake version 3.14.20190529-g067a4f
+" Version: cmake version 3.19.20201028-gdab947f
" Language: CMake
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>,
" Nicholas Hutchinson <nshutchinson@gmail.com>,
" Patrick Boettcher <patrick.boettcher@posteo.de>
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
-" Last Change: 2019 May 29
+" Last Change: 2020 oct. 28
"
" Licence: The CMake license applies to this file. See
" https://cmake.org/licensing
@@ -44,7 +44,9 @@ syn keyword cmakeProperty contained
\ ADDITIONAL_CLEAN_FILES
\ ADDITIONAL_MAKE_CLEAN_FILES
\ ADVANCED
+ \ AIX_EXPORT_ALL_SYMBOLS
\ ALIASED_TARGET
+ \ ALIAS_GLOBAL
\ ALLOW_DUPLICATE_CUSTOM_TARGETS
\ ANDROID_ANT_ADDITIONAL_OPTIONS
\ ANDROID_API
@@ -79,6 +81,7 @@ syn keyword cmakeProperty contained
\ AUTOMOC_EXECUTABLE
\ AUTOMOC_MACRO_NAMES
\ AUTOMOC_MOC_OPTIONS
+ \ AUTOMOC_PATH_PREFIX
\ AUTOMOC_SOURCE_GROUP
\ AUTOMOC_TARGETS_FOLDER
\ AUTORCC
@@ -100,8 +103,8 @@ syn keyword cmakeProperty contained
\ CACHE_VARIABLES
\ CLEAN_NO_CUSTOM
\ CMAKE_CONFIGURE_DEPENDS
- \ CMAKE_CXX_KNOWN_FEATURES
\ CMAKE_CUDA_KNOWN_FEATURES
+ \ CMAKE_CXX_KNOWN_FEATURES
\ CMAKE_C_KNOWN_FEATURES
\ CMAKE_ROLE
\ COMMON_LANGUAGE_RUNTIME
@@ -123,9 +126,11 @@ syn keyword cmakeProperty contained
\ CPACK_START_MENU_SHORTCUTS
\ CPACK_WIX_ACL
\ CROSSCOMPILING_EMULATOR
+ \ CUDA_ARCHITECTURES
\ CUDA_EXTENSIONS
\ CUDA_PTX_COMPILATION
\ CUDA_RESOLVE_DEVICE_SYMBOLS
+ \ CUDA_RUNTIME_LIBRARY
\ CUDA_SEPARABLE_COMPILATION
\ CUDA_STANDARD
\ CUDA_STANDARD_REQUIRED
@@ -142,8 +147,11 @@ syn keyword cmakeProperty contained
\ DEPENDS
\ DEPLOYMENT_ADDITIONAL_FILES
\ DEPLOYMENT_REMOTE_DIRECTORY
+ \ DEPRECATION
\ DISABLED
\ DISABLED_FEATURES
+ \ DISABLE_PRECOMPILE_HEADERS
+ \ DOTNET_TARGET_FRAMEWORK
\ DOTNET_TARGET_FRAMEWORK_VERSION
\ ECLIPSE_EXTRA_CPROJECT_CONTENTS
\ ECLIPSE_EXTRA_NATURES
@@ -202,6 +210,7 @@ syn keyword cmakeProperty contained
\ INCLUDE_DIRECTORIES
\ INCLUDE_REGULAR_EXPRESSION
\ INSTALL_NAME_DIR
+ \ INSTALL_REMOVE_ENVIRONMENT_RPATH
\ INSTALL_RPATH
\ INSTALL_RPATH_USE_LINK_PATH
\ INTERFACE_AUTOUIC_OPTIONS
@@ -214,11 +223,14 @@ syn keyword cmakeProperty contained
\ INTERFACE_LINK_LIBRARIES
\ INTERFACE_LINK_OPTIONS
\ INTERFACE_POSITION_INDEPENDENT_CODE
+ \ INTERFACE_PRECOMPILE_HEADERS
\ INTERFACE_SOURCES
\ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
\ INTERPROCEDURAL_OPTIMIZATION
\ IN_TRY_COMPILE
\ IOS_INSTALL_COMBINED
+ \ ISPC_HEADER_DIRECTORY
+ \ ISPC_INSTRUCTION_SETS
\ JOB_POOLS
\ JOB_POOL_COMPILE
\ JOB_POOL_LINK
@@ -242,6 +254,8 @@ syn keyword cmakeProperty contained
\ LINK_WHAT_YOU_USE
\ LISTFILE_STACK
\ LOCATION
+ \ MACHO_COMPATIBILITY_VERSION
+ \ MACHO_CURRENT_VERSION
\ MACOSX_BUNDLE
\ MACOSX_BUNDLE_INFO_PLIST
\ MACOSX_FRAMEWORK_INFO_PLIST
@@ -255,18 +269,29 @@ syn keyword cmakeProperty contained
\ NAME
\ NO_SONAME
\ NO_SYSTEM_FROM_IMPORTED
+ \ OBJCXX_EXTENSIONS
+ \ OBJCXX_STANDARD
+ \ OBJCXX_STANDARD_REQUIRED
+ \ OBJC_EXTENSIONS
+ \ OBJC_STANDARD
+ \ OBJC_STANDARD_REQUIRED
\ OBJECT_DEPENDS
\ OBJECT_OUTPUTS
+ \ OPTIMIZE_DEPENDENCIES
\ OSX_ARCHITECTURES
\ OUTPUT_NAME
\ PACKAGES_FOUND
\ PACKAGES_NOT_FOUND
\ PARENT_DIRECTORY
\ PASS_REGULAR_EXPRESSION
+ \ PCH_INSTANTIATE_TEMPLATES
+ \ PCH_WARN_INVALID
\ PDB_NAME
\ PDB_OUTPUT_DIRECTORY
\ POSITION_INDEPENDENT_CODE
\ POST_INSTALL_SCRIPT
+ \ PRECOMPILE_HEADERS
+ \ PRECOMPILE_HEADERS_REUSE_FROM
\ PREDEFINED_TARGETS_FOLDER
\ PREFIX
\ PRE_INSTALL_SCRIPT
@@ -278,6 +303,7 @@ syn keyword cmakeProperty contained
\ REPORT_UNDEFINED_PROPERTIES
\ REQUIRED_FILES
\ RESOURCE
+ \ RESOURCE_GROUPS
\ RESOURCE_LOCK
\ RULE_LAUNCH_COMPILE
\ RULE_LAUNCH_CUSTOM
@@ -291,8 +317,10 @@ syn keyword cmakeProperty contained
\ SKIP_AUTORCC
\ SKIP_AUTOUIC
\ SKIP_BUILD_RPATH
+ \ SKIP_PRECOMPILE_HEADERS
\ SKIP_REGULAR_EXPRESSION
\ SKIP_RETURN_CODE
+ \ SKIP_UNITY_BUILD_INCLUSION
\ SOURCES
\ SOURCE_DIR
\ SOVERSION
@@ -304,6 +332,7 @@ syn keyword cmakeProperty contained
\ SYMBOLIC
\ Swift_DEPENDENCIES_FILE
\ Swift_DIAGNOSTICS_FILE
+ \ Swift_LANGUAGE_VERSION
\ Swift_MODULE_DIRECTORY
\ Swift_MODULE_NAME
\ TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
@@ -315,6 +344,12 @@ syn keyword cmakeProperty contained
\ TIMEOUT
\ TIMEOUT_AFTER_MATCH
\ TYPE
+ \ UNITY_BUILD
+ \ UNITY_BUILD_BATCH_SIZE
+ \ UNITY_BUILD_CODE_AFTER_INCLUDE
+ \ UNITY_BUILD_CODE_BEFORE_INCLUDE
+ \ UNITY_BUILD_MODE
+ \ UNITY_GROUP
\ USE_FOLDERS
\ VALUE
\ VARIABLES
@@ -329,9 +364,11 @@ syn keyword cmakeProperty contained
\ VS_DEPLOYMENT_CONTENT
\ VS_DEPLOYMENT_LOCATION
\ VS_DESKTOP_EXTENSIONS_VERSION
+ \ VS_DOTNET_DOCUMENTATION_FILE
\ VS_DOTNET_REFERENCES
\ VS_DOTNET_REFERENCES_COPY_LOCAL
\ VS_DOTNET_TARGET_FRAMEWORK_VERSION
+ \ VS_DPI_AWARE
\ VS_GLOBAL_KEYWORD
\ VS_GLOBAL_PROJECT_TYPES
\ VS_GLOBAL_ROOTNAMESPACE
@@ -342,6 +379,8 @@ syn keyword cmakeProperty contained
\ VS_KEYWORD
\ VS_MOBILE_EXTENSIONS_VERSION
\ VS_NO_SOLUTION_DEPLOY
+ \ VS_PACKAGE_REFERENCES
+ \ VS_PLATFORM_TOOLSET
\ VS_PROJECT_IMPORT
\ VS_RESOURCE_GENERATOR
\ VS_SCC_AUXPATH
@@ -349,6 +388,7 @@ syn keyword cmakeProperty contained
\ VS_SCC_PROJECTNAME
\ VS_SCC_PROVIDER
\ VS_SDK_REFERENCES
+ \ VS_SETTINGS
\ VS_SHADER_DISABLE_OPTIMIZATIONS
\ VS_SHADER_ENABLE_DEBUG
\ VS_SHADER_ENTRYPOINT
@@ -358,6 +398,7 @@ syn keyword cmakeProperty contained
\ VS_SHADER_OUTPUT_HEADER_FILE
\ VS_SHADER_TYPE
\ VS_SHADER_VARIABLE_NAME
+ \ VS_SOLUTION_DEPLOY
\ VS_STARTUP_PROJECT
\ VS_TOOL_OVERRIDE
\ VS_USER_PROPS
@@ -376,11 +417,13 @@ syn keyword cmakeProperty contained
\ XCODE_FILE_ATTRIBUTES
\ XCODE_GENERATE_SCHEME
\ XCODE_LAST_KNOWN_FILE_TYPE
+ \ XCODE_LINK_BUILD_PHASE_MODE
\ XCODE_PRODUCT_TYPE
\ XCODE_SCHEME_ADDRESS_SANITIZER
\ XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
\ XCODE_SCHEME_ARGUMENTS
\ XCODE_SCHEME_DEBUG_AS_ROOT
+ \ XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
\ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
\ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
\ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
@@ -395,6 +438,7 @@ syn keyword cmakeProperty contained
\ XCODE_SCHEME_THREAD_SANITIZER_STOP
\ XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
\ XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
+ \ XCODE_SCHEME_WORKING_DIRECTORY
\ XCODE_SCHEME_ZOMBIE_OBJECTS
\ XCTEST
@@ -405,6 +449,7 @@ syn keyword cmakeVariable contained
\ BUILD_SHARED_LIBS
\ CACHE
\ CMAKE_ABSOLUTE_DESTINATION_FILES
+ \ CMAKE_AIX_EXPORT_ALL_SYMBOLS
\ CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS
\ CMAKE_ANDROID_API
\ CMAKE_ANDROID_API_MIN
@@ -485,6 +530,9 @@ syn keyword cmakeVariable contained
\ CMAKE_ASM_LINKER_WRAPPER_FLAG
\ CMAKE_ASM_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_ASM_LINK_EXECUTABLE
+ \ CMAKE_ASM_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_ASM_LINK_LIBRARY_FLAG
+ \ CMAKE_ASM_LINK_LIBRARY_SUFFIX
\ CMAKE_ASM_MASM
\ CMAKE_ASM_MASM_ANDROID_TOOLCHAIN_MACHINE
\ CMAKE_ASM_MASM_ANDROID_TOOLCHAIN_PREFIX
@@ -535,6 +583,9 @@ syn keyword cmakeVariable contained
\ CMAKE_ASM_MASM_LINKER_WRAPPER_FLAG
\ CMAKE_ASM_MASM_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_ASM_MASM_LINK_EXECUTABLE
+ \ CMAKE_ASM_MASM_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_ASM_MASM_LINK_LIBRARY_FLAG
+ \ CMAKE_ASM_MASM_LINK_LIBRARY_SUFFIX
\ CMAKE_ASM_MASM_OUTPUT_EXTENSION
\ CMAKE_ASM_MASM_PLATFORM_ID
\ CMAKE_ASM_MASM_SIMULATE_ID
@@ -594,6 +645,9 @@ syn keyword cmakeVariable contained
\ CMAKE_ASM_NASM_LINKER_WRAPPER_FLAG
\ CMAKE_ASM_NASM_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_ASM_NASM_LINK_EXECUTABLE
+ \ CMAKE_ASM_NASM_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_ASM_NASM_LINK_LIBRARY_FLAG
+ \ CMAKE_ASM_NASM_LINK_LIBRARY_SUFFIX
\ CMAKE_ASM_NASM_OUTPUT_EXTENSION
\ CMAKE_ASM_NASM_PLATFORM_ID
\ CMAKE_ASM_NASM_SIMULATE_ID
@@ -620,6 +674,7 @@ syn keyword cmakeVariable contained
\ CMAKE_AUTOMOC_DEPEND_FILTERS
\ CMAKE_AUTOMOC_MACRO_NAMES
\ CMAKE_AUTOMOC_MOC_OPTIONS
+ \ CMAKE_AUTOMOC_PATH_PREFIX
\ CMAKE_AUTOMOC_RELAXED_MODE
\ CMAKE_AUTORCC
\ CMAKE_AUTORCC_OPTIONS
@@ -640,6 +695,7 @@ syn keyword cmakeVariable contained
\ CMAKE_CACHE_MINOR_VERSION
\ CMAKE_CACHE_PATCH_VERSION
\ CMAKE_CFG_INTDIR
+ \ CMAKE_CLANG_VFS_OVERLAY
\ CMAKE_CL_64
\ CMAKE_CODEBLOCKS_COMPILER_ID
\ CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES
@@ -655,6 +711,7 @@ syn keyword cmakeVariable contained
\ CMAKE_CPACK_COMMAND
\ CMAKE_CROSSCOMPILING
\ CMAKE_CROSSCOMPILING_EMULATOR
+ \ CMAKE_CROSS_CONFIGS
\ CMAKE_CSharp
\ CMAKE_CSharp_ANDROID_TOOLCHAIN_MACHINE
\ CMAKE_CSharp_ANDROID_TOOLCHAIN_PREFIX
@@ -705,6 +762,9 @@ syn keyword cmakeVariable contained
\ CMAKE_CSharp_LINKER_WRAPPER_FLAG
\ CMAKE_CSharp_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_CSharp_LINK_EXECUTABLE
+ \ CMAKE_CSharp_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_CSharp_LINK_LIBRARY_FLAG
+ \ CMAKE_CSharp_LINK_LIBRARY_SUFFIX
\ CMAKE_CSharp_OUTPUT_EXTENSION
\ CMAKE_CSharp_PLATFORM_ID
\ CMAKE_CSharp_SIMULATE_ID
@@ -714,11 +774,13 @@ syn keyword cmakeVariable contained
\ CMAKE_CSharp_STANDARD_INCLUDE_DIRECTORIES
\ CMAKE_CSharp_STANDARD_LIBRARIES
\ CMAKE_CSharp_VISIBILITY_PRESET
+ \ CMAKE_CTEST_ARGUMENTS
\ CMAKE_CTEST_COMMAND
\ CMAKE_CUDA
\ CMAKE_CUDA_ANDROID_TOOLCHAIN_MACHINE
\ CMAKE_CUDA_ANDROID_TOOLCHAIN_PREFIX
\ CMAKE_CUDA_ANDROID_TOOLCHAIN_SUFFIX
+ \ CMAKE_CUDA_ARCHITECTURES
\ CMAKE_CUDA_ARCHIVE_APPEND
\ CMAKE_CUDA_ARCHIVE_CREATE
\ CMAKE_CUDA_ARCHIVE_FINISH
@@ -728,7 +790,6 @@ syn keyword cmakeVariable contained
\ CMAKE_CUDA_COMPILER_AR
\ CMAKE_CUDA_COMPILER_ARCHITECTURE_ID
\ CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN
- \ CMAKE_CUDA_COMPILE_FEATURES
\ CMAKE_CUDA_COMPILER_ID
\ CMAKE_CUDA_COMPILER_LAUNCHER
\ CMAKE_CUDA_COMPILER_LOADED
@@ -737,6 +798,7 @@ syn keyword cmakeVariable contained
\ CMAKE_CUDA_COMPILER_TARGET
\ CMAKE_CUDA_COMPILER_VERSION
\ CMAKE_CUDA_COMPILER_VERSION_INTERNAL
+ \ CMAKE_CUDA_COMPILE_FEATURES
\ CMAKE_CUDA_COMPILE_OBJECT
\ CMAKE_CUDA_CPPCHECK
\ CMAKE_CUDA_CPPLINT
@@ -768,8 +830,13 @@ syn keyword cmakeVariable contained
\ CMAKE_CUDA_LINKER_WRAPPER_FLAG
\ CMAKE_CUDA_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_CUDA_LINK_EXECUTABLE
+ \ CMAKE_CUDA_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_CUDA_LINK_LIBRARY_FLAG
+ \ CMAKE_CUDA_LINK_LIBRARY_SUFFIX
\ CMAKE_CUDA_OUTPUT_EXTENSION
\ CMAKE_CUDA_PLATFORM_ID
+ \ CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
+ \ CMAKE_CUDA_RUNTIME_LIBRARY
\ CMAKE_CUDA_SEPARABLE_COMPILATION
\ CMAKE_CUDA_SIMULATE_ID
\ CMAKE_CUDA_SIMULATE_VERSION
@@ -782,6 +849,10 @@ syn keyword cmakeVariable contained
\ CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
\ CMAKE_CUDA_VISIBILITY_PRESET
\ CMAKE_CURRENT_BINARY_DIR
+ \ CMAKE_CURRENT_FUNCTION
+ \ CMAKE_CURRENT_FUNCTION_LIST_DIR
+ \ CMAKE_CURRENT_FUNCTION_LIST_FILE
+ \ CMAKE_CURRENT_FUNCTION_LIST_LINE
\ CMAKE_CURRENT_LIST_DIR
\ CMAKE_CURRENT_LIST_FILE
\ CMAKE_CURRENT_LIST_LINE
@@ -838,6 +909,9 @@ syn keyword cmakeVariable contained
\ CMAKE_CXX_LINKER_WRAPPER_FLAG
\ CMAKE_CXX_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_CXX_LINK_EXECUTABLE
+ \ CMAKE_CXX_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_CXX_LINK_LIBRARY_FLAG
+ \ CMAKE_CXX_LINK_LIBRARY_SUFFIX
\ CMAKE_CXX_OUTPUT_EXTENSION
\ CMAKE_CXX_PLATFORM_ID
\ CMAKE_CXX_SIMULATE_ID
@@ -900,6 +974,9 @@ syn keyword cmakeVariable contained
\ CMAKE_C_LINKER_WRAPPER_FLAG
\ CMAKE_C_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_C_LINK_EXECUTABLE
+ \ CMAKE_C_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_C_LINK_LIBRARY_FLAG
+ \ CMAKE_C_LINK_LIBRARY_SUFFIX
\ CMAKE_C_OUTPUT_EXTENSION
\ CMAKE_C_PLATFORM_ID
\ CMAKE_C_SIMULATE_ID
@@ -913,9 +990,13 @@ syn keyword cmakeVariable contained
\ CMAKE_C_VISIBILITY_PRESET
\ CMAKE_DEBUG_POSTFIX
\ CMAKE_DEBUG_TARGET_PROPERTIES
+ \ CMAKE_DEFAULT_BUILD_TYPE
+ \ CMAKE_DEFAULT_CONFIGS
\ CMAKE_DEPENDS_IN_PROJECT_ONLY
\ CMAKE_DIRECTORY_LABELS
+ \ CMAKE_DISABLE_PRECOMPILE_HEADERS
\ CMAKE_DL_LIBS
+ \ CMAKE_DOTNET_TARGET_FRAMEWORK
\ CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION
\ CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
\ CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
@@ -936,6 +1017,7 @@ syn keyword cmakeVariable contained
\ CMAKE_EXTRA_GENERATOR
\ CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
\ CMAKE_FIND_APPBUNDLE
+ \ CMAKE_FIND_DEBUG_MODE
\ CMAKE_FIND_FRAMEWORK
\ CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX
\ CMAKE_FIND_LIBRARY_PREFIXES
@@ -960,6 +1042,7 @@ syn keyword cmakeVariable contained
\ CMAKE_FIND_USE_PACKAGE_REGISTRY
\ CMAKE_FIND_USE_PACKAGE_ROOT_PATH
\ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH
+ \ CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY
\ CMAKE_FOLDER
\ CMAKE_FRAMEWORK
\ CMAKE_FRAMEWORK_PATH
@@ -1014,6 +1097,9 @@ syn keyword cmakeVariable contained
\ CMAKE_Fortran_LINKER_WRAPPER_FLAG
\ CMAKE_Fortran_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_Fortran_LINK_EXECUTABLE
+ \ CMAKE_Fortran_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_Fortran_LINK_LIBRARY_FLAG
+ \ CMAKE_Fortran_LINK_LIBRARY_SUFFIX
\ CMAKE_Fortran_MODDIR_DEFAULT
\ CMAKE_Fortran_MODDIR_FLAG
\ CMAKE_Fortran_MODOUT_FLAG
@@ -1048,7 +1134,6 @@ syn keyword cmakeVariable contained
\ CMAKE_HOST_UNIX
\ CMAKE_HOST_WIN32
\ CMAKE_IGNORE_PATH
- \ CMAKE_ISPC_HEADER_DIRECTORY
\ CMAKE_IMPORT_LIBRARY_PREFIX
\ CMAKE_IMPORT_LIBRARY_SUFFIX
\ CMAKE_INCLUDE_CURRENT_DIR
@@ -1062,11 +1147,14 @@ syn keyword cmakeVariable contained
\ CMAKE_INSTALL_NAME_DIR
\ CMAKE_INSTALL_PREFIX
\ CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
+ \ CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH
\ CMAKE_INSTALL_RPATH
\ CMAKE_INSTALL_RPATH_USE_LINK_PATH
\ CMAKE_INTERNAL_PLATFORM_ABI
\ CMAKE_INTERPROCEDURAL_OPTIMIZATION
\ CMAKE_IOS_INSTALL_COMBINED
+ \ CMAKE_ISPC_HEADER_DIRECTORY
+ \ CMAKE_ISPC_INSTRUCTION_SETS
\ CMAKE_JOB_POOLS
\ CMAKE_JOB_POOL_COMPILE
\ CMAKE_JOB_POOL_LINK
@@ -1121,6 +1209,9 @@ syn keyword cmakeVariable contained
\ CMAKE_Java_LINKER_WRAPPER_FLAG
\ CMAKE_Java_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_Java_LINK_EXECUTABLE
+ \ CMAKE_Java_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_Java_LINK_LIBRARY_FLAG
+ \ CMAKE_Java_LINK_LIBRARY_SUFFIX
\ CMAKE_Java_OUTPUT_EXTENSION
\ CMAKE_Java_PLATFORM_ID
\ CMAKE_Java_SIMULATE_ID
@@ -1151,6 +1242,10 @@ syn keyword cmakeVariable contained
\ CMAKE_MAKE_PROGRAM
\ CMAKE_MATCH_COUNT
\ CMAKE_MAXIMUM_RECURSION_DEPTH
+ \ CMAKE_MESSAGE_CONTEXT
+ \ CMAKE_MESSAGE_CONTEXT_SHOW
+ \ CMAKE_MESSAGE_INDENT
+ \ CMAKE_MESSAGE_LOG_LEVEL
\ CMAKE_MFC_FLAG
\ CMAKE_MINIMUM_REQUIRED_VERSION
\ CMAKE_MINOR_VERSION
@@ -1165,12 +1260,21 @@ syn keyword cmakeVariable contained
\ CMAKE_NOT_USING_CONFIG_FLAGS
\ CMAKE_NO_BUILTIN_CHRPATH
\ CMAKE_NO_SYSTEM_FROM_IMPORTED
+ \ CMAKE_OBJCXX_EXTENSIONS
+ \ CMAKE_OBJCXX_STANDARD
+ \ CMAKE_OBJCXX_STANDARD_REQUIRED
+ \ CMAKE_OBJC_EXTENSIONS
+ \ CMAKE_OBJC_STANDARD
+ \ CMAKE_OBJC_STANDARD_REQUIRED
\ CMAKE_OBJECT_PATH_MAX
+ \ CMAKE_OPTIMIZE_DEPENDENCIES
\ CMAKE_OSX_ARCHITECTURES
\ CMAKE_OSX_DEPLOYMENT_TARGET
\ CMAKE_OSX_SYSROOT
\ CMAKE_PARENT_LIST_FILE
\ CMAKE_PATCH_VERSION
+ \ CMAKE_PCH_INSTANTIATE_TEMPLATES
+ \ CMAKE_PCH_WARN_INVALID
\ CMAKE_PDB_OUTPUT_DIRECTORY
\ CMAKE_POSITION_INDEPENDENT_CODE
\ CMAKE_PREFIX_PATH
@@ -1236,6 +1340,9 @@ syn keyword cmakeVariable contained
\ CMAKE_RC_LINKER_WRAPPER_FLAG
\ CMAKE_RC_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_RC_LINK_EXECUTABLE
+ \ CMAKE_RC_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_RC_LINK_LIBRARY_FLAG
+ \ CMAKE_RC_LINK_LIBRARY_SUFFIX
\ CMAKE_RC_OUTPUT_EXTENSION
\ CMAKE_RC_PLATFORM_ID
\ CMAKE_RC_SIMULATE_ID
@@ -1335,7 +1442,11 @@ syn keyword cmakeVariable contained
\ CMAKE_Swift_LINKER_WRAPPER_FLAG
\ CMAKE_Swift_LINKER_WRAPPER_FLAG_SEP
\ CMAKE_Swift_LINK_EXECUTABLE
+ \ CMAKE_Swift_LINK_LIBRARY_FILE_FLAG
+ \ CMAKE_Swift_LINK_LIBRARY_FLAG
+ \ CMAKE_Swift_LINK_LIBRARY_SUFFIX
\ CMAKE_Swift_MODULE_DIRECTORY
+ \ CMAKE_Swift_NUM_THREADS
\ CMAKE_Swift_OUTPUT_EXTENSION
\ CMAKE_Swift_PLATFORM_ID
\ CMAKE_Swift_SIMULATE_ID
@@ -1350,6 +1461,8 @@ syn keyword cmakeVariable contained
\ CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
\ CMAKE_TRY_COMPILE_TARGET_TYPE
\ CMAKE_TWEAK_VERSION
+ \ CMAKE_UNITY_BUILD
+ \ CMAKE_UNITY_BUILD_BATCH_SIZE
\ CMAKE_USER_MAKE_RULES_OVERRIDE
\ CMAKE_USER_MAKE_RULES_OVERRIDE_ASM
\ CMAKE_USER_MAKE_RULES_OVERRIDE_ASM_MASM
@@ -1378,6 +1491,7 @@ syn keyword cmakeVariable contained
\ CMAKE_VS_PLATFORM_NAME_DEFAULT
\ CMAKE_VS_PLATFORM_TOOLSET
\ CMAKE_VS_PLATFORM_TOOLSET_CUDA
+ \ CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR
\ CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
\ CMAKE_VS_PLATFORM_TOOLSET_VERSION
\ CMAKE_VS_SDK_EXCLUDE_DIRECTORIES
@@ -1388,19 +1502,24 @@ syn keyword cmakeVariable contained
\ CMAKE_VS_SDK_REFERENCE_DIRECTORIES
\ CMAKE_VS_SDK_SOURCE_DIRECTORIES
\ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
+ \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM
\ CMAKE_VS_WINRT_BY_DEFAULT
\ CMAKE_WARN_DEPRECATED
\ CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
\ CMAKE_WIN32_EXECUTABLE
\ CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
+ \ CMAKE_XCODE_BUILD_SYSTEM
\ CMAKE_XCODE_GENERATE_SCHEME
\ CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY
+ \ CMAKE_XCODE_LINK_BUILD_PHASE_MODE
\ CMAKE_XCODE_PLATFORM_TOOLSET
\ CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER
\ CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
+ \ CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
\ CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
\ CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
\ CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
+ \ CMAKE_XCODE_SCHEME_ENVIRONMENT
\ CMAKE_XCODE_SCHEME_GUARD_MALLOC
\ CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
\ CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
@@ -1410,13 +1529,13 @@ 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_WORKING_DIRECTORY
\ CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS
\ CPACK_ABSOLUTE_DESTINATION_FILES
\ CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY
\ CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
\ CPACK_INCLUDE_TOPLEVEL_DIRECTORY
\ CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
- \ CPACK_INSTALL_SCRIPT
\ CPACK_PACKAGING_INSTALL_PREFIX
\ CPACK_SET_DESTDIR
\ CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
@@ -1476,6 +1595,7 @@ syn keyword cmakeVariable contained
\ CTEST_P4_COMMAND
\ CTEST_P4_OPTIONS
\ CTEST_P4_UPDATE_OPTIONS
+ \ CTEST_RESOURCE_SPEC_FILE
\ CTEST_RUN_CURRENT_SCRIPT
\ CTEST_SCP_COMMAND
\ CTEST_SITE
@@ -1493,6 +1613,283 @@ syn keyword cmakeVariable contained
\ CTEST_UPDATE_VERSION_OVERRIDE
\ CTEST_USE_LAUNCHERS
\ CYGWIN
+ \ DOXYGEN_ABBREVIATE_BRIEF
+ \ DOXYGEN_ALIASES
+ \ DOXYGEN_ALLEXTERNALS
+ \ DOXYGEN_ALLOW_UNICODE_NAMES
+ \ DOXYGEN_ALPHABETICAL_INDEX
+ \ DOXYGEN_ALWAYS_DETAILED_SEC
+ \ DOXYGEN_AUTOLINK_SUPPORT
+ \ DOXYGEN_BINARY_TOC
+ \ DOXYGEN_BRIEF_MEMBER_DESC
+ \ DOXYGEN_BUILTIN_STL_SUPPORT
+ \ DOXYGEN_CALLER_GRAPH
+ \ DOXYGEN_CALL_GRAPH
+ \ DOXYGEN_CASE_SENSE_NAMES
+ \ DOXYGEN_CHM_FILE
+ \ DOXYGEN_CHM_INDEX_ENCODING
+ \ DOXYGEN_CITE_BIB_FILES
+ \ DOXYGEN_CLANG_ASSISTED_PARSING
+ \ DOXYGEN_CLANG_DATABASE_PATH
+ \ DOXYGEN_CLANG_OPTIONS
+ \ DOXYGEN_CLASS_DIAGRAMS
+ \ DOXYGEN_CLASS_GRAPH
+ \ DOXYGEN_COLLABORATION_GRAPH
+ \ DOXYGEN_COLS_IN_ALPHA_INDEX
+ \ DOXYGEN_COMPACT_LATEX
+ \ DOXYGEN_COMPACT_RTF
+ \ DOXYGEN_CPP_CLI_SUPPORT
+ \ DOXYGEN_CREATE_SUBDIRS
+ \ DOXYGEN_DIAFILE_DIRS
+ \ DOXYGEN_DIA_PATH
+ \ DOXYGEN_DIRECTORY_GRAPH
+ \ DOXYGEN_DISABLE_INDEX
+ \ DOXYGEN_DISTRIBUTE_GROUP_DOC
+ \ DOXYGEN_DOCBOOK_OUTPUT
+ \ DOXYGEN_DOCBOOK_PROGRAMLISTING
+ \ DOXYGEN_DOCSET_BUNDLE_ID
+ \ DOXYGEN_DOCSET_FEEDNAME
+ \ DOXYGEN_DOCSET_PUBLISHER_ID
+ \ DOXYGEN_DOCSET_PUBLISHER_NAME
+ \ DOXYGEN_DOTFILE_DIRS
+ \ DOXYGEN_DOT_CLEANUP
+ \ DOXYGEN_DOT_FONTNAME
+ \ DOXYGEN_DOT_FONTPATH
+ \ DOXYGEN_DOT_FONTSIZE
+ \ DOXYGEN_DOT_GRAPH_MAX_NODES
+ \ DOXYGEN_DOT_IMAGE_FORMAT
+ \ DOXYGEN_DOT_MULTI_TARGETS
+ \ DOXYGEN_DOT_NUM_THREADS
+ \ DOXYGEN_DOT_PATH
+ \ DOXYGEN_DOT_TRANSPARENT
+ \ DOXYGEN_DOXYFILE_ENCODING
+ \ DOXYGEN_ECLIPSE_DOC_ID
+ \ DOXYGEN_ENABLED_SECTIONS
+ \ DOXYGEN_ENABLE_PREPROCESSING
+ \ DOXYGEN_ENUM_VALUES_PER_LINE
+ \ DOXYGEN_EXAMPLE_PATH
+ \ DOXYGEN_EXAMPLE_PATTERNS
+ \ DOXYGEN_EXAMPLE_RECURSIVE
+ \ DOXYGEN_EXCLUDE
+ \ DOXYGEN_EXCLUDE_PATTERNS
+ \ DOXYGEN_EXCLUDE_SYMBOLS
+ \ DOXYGEN_EXCLUDE_SYMLINKS
+ \ DOXYGEN_EXPAND_AS_DEFINED
+ \ DOXYGEN_EXPAND_ONLY_PREDEF
+ \ DOXYGEN_EXTENSION_MAPPING
+ \ DOXYGEN_EXTERNAL_GROUPS
+ \ DOXYGEN_EXTERNAL_PAGES
+ \ DOXYGEN_EXTERNAL_SEARCH
+ \ DOXYGEN_EXTERNAL_SEARCH_ID
+ \ DOXYGEN_EXTRACT_ALL
+ \ DOXYGEN_EXTRACT_ANON_NSPACES
+ \ DOXYGEN_EXTRACT_LOCAL_CLASSES
+ \ DOXYGEN_EXTRACT_LOCAL_METHODS
+ \ DOXYGEN_EXTRACT_PACKAGE
+ \ DOXYGEN_EXTRACT_PRIVATE
+ \ DOXYGEN_EXTRACT_PRIV_VIRTUAL
+ \ DOXYGEN_EXTRACT_STATIC
+ \ DOXYGEN_EXTRA_PACKAGES
+ \ DOXYGEN_EXTRA_SEARCH_MAPPINGS
+ \ DOXYGEN_EXT_LINKS_IN_WINDOW
+ \ DOXYGEN_FILE_PATTERNS
+ \ DOXYGEN_FILE_VERSION_FILTER
+ \ DOXYGEN_FILTER_PATTERNS
+ \ DOXYGEN_FILTER_SOURCE_FILES
+ \ DOXYGEN_FILTER_SOURCE_PATTERNS
+ \ DOXYGEN_FORCE_LOCAL_INCLUDES
+ \ DOXYGEN_FORMULA_FONTSIZE
+ \ DOXYGEN_FORMULA_TRANSPARENT
+ \ DOXYGEN_FULL_PATH_NAMES
+ \ DOXYGEN_GENERATE_AUTOGEN_DEF
+ \ DOXYGEN_GENERATE_BUGLIST
+ \ DOXYGEN_GENERATE_CHI
+ \ DOXYGEN_GENERATE_DEPRECATEDLIST
+ \ DOXYGEN_GENERATE_DOCBOOK
+ \ DOXYGEN_GENERATE_DOCSET
+ \ DOXYGEN_GENERATE_ECLIPSEHELP
+ \ DOXYGEN_GENERATE_HTML
+ \ DOXYGEN_GENERATE_HTMLHELP
+ \ DOXYGEN_GENERATE_LATEX
+ \ DOXYGEN_GENERATE_LEGEND
+ \ DOXYGEN_GENERATE_MAN
+ \ DOXYGEN_GENERATE_PERLMOD
+ \ DOXYGEN_GENERATE_QHP
+ \ DOXYGEN_GENERATE_RTF
+ \ DOXYGEN_GENERATE_TAGFILE
+ \ DOXYGEN_GENERATE_TESTLIST
+ \ DOXYGEN_GENERATE_TODOLIST
+ \ DOXYGEN_GENERATE_TREEVIEW
+ \ DOXYGEN_GENERATE_XML
+ \ DOXYGEN_GRAPHICAL_HIERARCHY
+ \ DOXYGEN_GROUP_GRAPHS
+ \ DOXYGEN_GROUP_NESTED_COMPOUNDS
+ \ DOXYGEN_HAVE_DOT
+ \ DOXYGEN_HHC_LOCATION
+ \ DOXYGEN_HIDE_COMPOUND_REFERENCE
+ \ DOXYGEN_HIDE_FRIEND_COMPOUNDS
+ \ DOXYGEN_HIDE_IN_BODY_DOCS
+ \ DOXYGEN_HIDE_SCOPE_NAMES
+ \ DOXYGEN_HIDE_UNDOC_CLASSES
+ \ DOXYGEN_HIDE_UNDOC_MEMBERS
+ \ DOXYGEN_HIDE_UNDOC_RELATIONS
+ \ DOXYGEN_HTML_COLORSTYLE_GAMMA
+ \ DOXYGEN_HTML_COLORSTYLE_HUE
+ \ DOXYGEN_HTML_COLORSTYLE_SAT
+ \ DOXYGEN_HTML_DYNAMIC_MENUS
+ \ DOXYGEN_HTML_DYNAMIC_SECTIONS
+ \ DOXYGEN_HTML_EXTRA_FILES
+ \ DOXYGEN_HTML_EXTRA_STYLESHEET
+ \ DOXYGEN_HTML_FILE_EXTENSION
+ \ DOXYGEN_HTML_FOOTER
+ \ DOXYGEN_HTML_HEADER
+ \ DOXYGEN_HTML_INDEX_NUM_ENTRIES
+ \ DOXYGEN_HTML_OUTPUT
+ \ DOXYGEN_HTML_STYLESHEET
+ \ DOXYGEN_HTML_TIMESTAMP
+ \ DOXYGEN_IDL_PROPERTY_SUPPORT
+ \ DOXYGEN_IGNORE_PREFIX
+ \ DOXYGEN_IMAGE_PATH
+ \ DOXYGEN_INCLUDED_BY_GRAPH
+ \ DOXYGEN_INCLUDE_FILE_PATTERNS
+ \ DOXYGEN_INCLUDE_GRAPH
+ \ DOXYGEN_INCLUDE_PATH
+ \ DOXYGEN_INHERIT_DOCS
+ \ DOXYGEN_INLINE_GROUPED_CLASSES
+ \ DOXYGEN_INLINE_INFO
+ \ DOXYGEN_INLINE_INHERITED_MEMB
+ \ DOXYGEN_INLINE_SIMPLE_STRUCTS
+ \ DOXYGEN_INLINE_SOURCES
+ \ DOXYGEN_INPUT
+ \ DOXYGEN_INPUT_ENCODING
+ \ DOXYGEN_INPUT_FILTER
+ \ DOXYGEN_INTERACTIVE_SVG
+ \ DOXYGEN_INTERNAL_DOCS
+ \ DOXYGEN_JAVADOC_AUTOBRIEF
+ \ DOXYGEN_JAVADOC_BANNER
+ \ DOXYGEN_LATEX_BATCHMODE
+ \ DOXYGEN_LATEX_BIB_STYLE
+ \ DOXYGEN_LATEX_CMD_NAME
+ \ DOXYGEN_LATEX_EMOJI_DIRECTORY
+ \ DOXYGEN_LATEX_EXTRA_FILES
+ \ DOXYGEN_LATEX_EXTRA_STYLESHEET
+ \ DOXYGEN_LATEX_FOOTER
+ \ DOXYGEN_LATEX_HEADER
+ \ DOXYGEN_LATEX_HIDE_INDICES
+ \ DOXYGEN_LATEX_MAKEINDEX_CMD
+ \ DOXYGEN_LATEX_OUTPUT
+ \ DOXYGEN_LATEX_SOURCE_CODE
+ \ DOXYGEN_LATEX_TIMESTAMP
+ \ DOXYGEN_LAYOUT_FILE
+ \ DOXYGEN_LOOKUP_CACHE_SIZE
+ \ DOXYGEN_MACRO_EXPANSION
+ \ DOXYGEN_MAKEINDEX_CMD_NAME
+ \ DOXYGEN_MAN_EXTENSION
+ \ DOXYGEN_MAN_LINKS
+ \ DOXYGEN_MAN_OUTPUT
+ \ DOXYGEN_MAN_SUBDIR
+ \ DOXYGEN_MARKDOWN_SUPPORT
+ \ DOXYGEN_MATHJAX_CODEFILE
+ \ DOXYGEN_MATHJAX_EXTENSIONS
+ \ DOXYGEN_MATHJAX_FORMAT
+ \ DOXYGEN_MATHJAX_RELPATH
+ \ DOXYGEN_MAX_DOT_GRAPH_DEPTH
+ \ DOXYGEN_MAX_INITIALIZER_LINES
+ \ DOXYGEN_MSCFILE_DIRS
+ \ DOXYGEN_MULTILINE_CPP_IS_BRIEF
+ \ DOXYGEN_OPTIMIZE_FOR_FORTRAN
+ \ DOXYGEN_OPTIMIZE_OUTPUT_FOR_C
+ \ DOXYGEN_OPTIMIZE_OUTPUT_JAVA
+ \ DOXYGEN_OPTIMIZE_OUTPUT_SLICE
+ \ DOXYGEN_OPTIMIZE_OUTPUT_VHDL
+ \ DOXYGEN_OUTPUT_DIRECTORY
+ \ DOXYGEN_OUTPUT_LANGUAGE
+ \ DOXYGEN_OUTPUT_TEXT_DIRECTION
+ \ DOXYGEN_PAPER_TYPE
+ \ DOXYGEN_PDF_HYPERLINKS
+ \ DOXYGEN_PERLMOD_LATEX
+ \ DOXYGEN_PERLMOD_MAKEVAR_PREFIX
+ \ DOXYGEN_PERLMOD_PRETTY
+ \ DOXYGEN_PLANTUML_CFG_FILE
+ \ DOXYGEN_PLANTUML_INCLUDE_PATH
+ \ DOXYGEN_PLANTUML_JAR_PATH
+ \ DOXYGEN_PREDEFINED
+ \ DOXYGEN_PROJECT_BRIEF
+ \ DOXYGEN_PROJECT_LOGO
+ \ DOXYGEN_PROJECT_NAME
+ \ DOXYGEN_PROJECT_NUMBER
+ \ DOXYGEN_QCH_FILE
+ \ DOXYGEN_QHG_LOCATION
+ \ DOXYGEN_QHP_CUST_FILTER_ATTRS
+ \ DOXYGEN_QHP_CUST_FILTER_NAME
+ \ DOXYGEN_QHP_NAMESPACE
+ \ DOXYGEN_QHP_SECT_FILTER_ATTRS
+ \ DOXYGEN_QHP_VIRTUAL_FOLDER
+ \ DOXYGEN_QT_AUTOBRIEF
+ \ DOXYGEN_QUIET
+ \ DOXYGEN_RECURSIVE
+ \ DOXYGEN_REFERENCED_BY_RELATION
+ \ DOXYGEN_REFERENCES_LINK_SOURCE
+ \ DOXYGEN_REFERENCES_RELATION
+ \ DOXYGEN_REPEAT_BRIEF
+ \ DOXYGEN_RTF_EXTENSIONS_FILE
+ \ DOXYGEN_RTF_HYPERLINKS
+ \ DOXYGEN_RTF_OUTPUT
+ \ DOXYGEN_RTF_SOURCE_CODE
+ \ DOXYGEN_RTF_STYLESHEET_FILE
+ \ DOXYGEN_SEARCHDATA_FILE
+ \ DOXYGEN_SEARCHENGINE
+ \ DOXYGEN_SEARCHENGINE_URL
+ \ DOXYGEN_SEARCH_INCLUDES
+ \ DOXYGEN_SEPARATE_MEMBER_PAGES
+ \ DOXYGEN_SERVER_BASED_SEARCH
+ \ DOXYGEN_SHORT_NAMES
+ \ DOXYGEN_SHOW_FILES
+ \ DOXYGEN_SHOW_GROUPED_MEMB_INC
+ \ DOXYGEN_SHOW_INCLUDE_FILES
+ \ DOXYGEN_SHOW_NAMESPACES
+ \ DOXYGEN_SHOW_USED_FILES
+ \ DOXYGEN_SIP_SUPPORT
+ \ DOXYGEN_SKIP_FUNCTION_MACROS
+ \ DOXYGEN_SORT_BRIEF_DOCS
+ \ DOXYGEN_SORT_BY_SCOPE_NAME
+ \ DOXYGEN_SORT_GROUP_NAMES
+ \ DOXYGEN_SORT_MEMBERS_CTORS_1ST
+ \ DOXYGEN_SORT_MEMBER_DOCS
+ \ DOXYGEN_SOURCE_BROWSER
+ \ DOXYGEN_SOURCE_TOOLTIPS
+ \ DOXYGEN_STRICT_PROTO_MATCHING
+ \ DOXYGEN_STRIP_CODE_COMMENTS
+ \ DOXYGEN_STRIP_FROM_INC_PATH
+ \ DOXYGEN_STRIP_FROM_PATH
+ \ DOXYGEN_SUBGROUPING
+ \ DOXYGEN_TAB_SIZE
+ \ DOXYGEN_TAGFILES
+ \ DOXYGEN_TCL_SUBST
+ \ DOXYGEN_TEMPLATE_RELATIONS
+ \ DOXYGEN_TOC_EXPAND
+ \ DOXYGEN_TOC_INCLUDE_HEADINGS
+ \ DOXYGEN_TREEVIEW_WIDTH
+ \ DOXYGEN_TYPEDEF_HIDES_STRUCT
+ \ DOXYGEN_UML_LIMIT_NUM_FIELDS
+ \ DOXYGEN_UML_LOOK
+ \ DOXYGEN_USE_HTAGS
+ \ DOXYGEN_USE_MATHJAX
+ \ DOXYGEN_USE_MDFILE_AS_MAINPAGE
+ \ DOXYGEN_USE_PDFLATEX
+ \ DOXYGEN_VERBATIM_HEADERS
+ \ DOXYGEN_VERBATIM_VARS
+ \ DOXYGEN_VERSION
+ \ DOXYGEN_WARNINGS
+ \ DOXYGEN_WARN_AS_ERROR
+ \ DOXYGEN_WARN_FORMAT
+ \ DOXYGEN_WARN_IF_DOC_ERROR
+ \ DOXYGEN_WARN_IF_UNDOCUMENTED
+ \ DOXYGEN_WARN_LOGFILE
+ \ DOXYGEN_WARN_NO_PARAMDOC
+ \ DOXYGEN_XML_NS_MEMB_FILE_SCOPE
+ \ DOXYGEN_XML_OUTPUT
+ \ DOXYGEN_XML_PROGRAMLISTING
\ ENV
\ EXECUTABLE_OUTPUT_PATH
\ GHS-MULTI
@@ -1541,9 +1938,11 @@ syn keyword cmakeKWExternalProject contained
\ BUILD_BYPRODUCTS
\ BUILD_COMMAND
\ BUILD_IN_SOURCE
+ \ CHECKOUT
\ CMAKE_ARGS
\ CMAKE_CACHE_ARGS
\ CMAKE_CACHE_DEFAULT_ARGS
+ \ CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY
\ CMAKE_TLS_CAINFO
\ CMAKE_TLS_VERIFY
\ COMMENT
@@ -1568,14 +1967,17 @@ syn keyword cmakeKWExternalProject contained
\ EP_STEP_TARGETS
\ EP_UPDATE_DISCONNECTED
\ EXCLUDE_FROM_ALL
+ \ FALSE
\ FORCE
\ GHS
\ GIT_CONFIG
\ GIT_PROGRESS
\ GIT_REMOTE_NAME
+ \ GIT_REMOTE_UPDATE_STRATEGY
\ GIT_REPOSITORY
\ GIT_SHALLOW
\ GIT_SUBMODULES
+ \ GIT_SUBMODULES_RECURSE
\ GIT_TAG
\ HG_REPOSITORY
\ HG_TAG
@@ -1583,6 +1985,7 @@ syn keyword cmakeKWExternalProject contained
\ HTTP_PASSWORD
\ HTTP_USERNAME
\ IGNORED
+ \ INACTIVITY_TIMEOUT
\ INDEPENDENT_STEP_TARGETS
\ INSTALL_COMMAND
\ INSTALL_DIR
@@ -1609,6 +2012,8 @@ syn keyword cmakeKWExternalProject contained
\ PATCH_COMMAND
\ PREFIX
\ PROPERTY
+ \ REBASE
+ \ REBASE_CHECKOUT
\ REQUIRED
\ SOURCE_DIR
\ SOURCE_SUBDIR
@@ -1671,12 +2076,16 @@ syn keyword cmakeKWadd_custom_command contained
\ MAIN_DEPENDENCY
\ NOT
\ OUTPUT
+ \ PATH
\ POST_BUILD
\ PRE_BUILD
\ PRE_LINK
\ SYMBOLIC
\ TARGET_FILE
+ \ TARGET_LINKER_FILE
+ \ TARGET_PDB_FILE
\ TARGET_PROPERTY
+ \ TARGET_SONAME_FILE
\ USES_TERMINAL
\ VERBATIM
\ WORKING_DIRECTORY
@@ -1695,8 +2104,13 @@ syn keyword cmakeKWadd_custom_target contained
\ JOB_POOL
\ JOB_POOLS
\ JOIN
+ \ PATH
\ SOURCES
+ \ TARGET_FILE
+ \ TARGET_LINKER_FILE
+ \ TARGET_PDB_FILE
\ TARGET_PROPERTY
+ \ TARGET_SONAME_FILE
\ USES_TERMINAL
\ VERBATIM
\ WORKING_DIRECTORY
@@ -1710,6 +2124,7 @@ syn keyword cmakeKWadd_dependencies contained
syn keyword cmakeKWadd_executable contained
\ ALIAS
+ \ ALIAS_GLOBAL
\ CONFIG
\ EXCLUDE_FROM_ALL
\ GLOBAL
@@ -1725,6 +2140,7 @@ syn keyword cmakeKWadd_executable contained
syn keyword cmakeKWadd_library contained
\ ALIAS
+ \ ALIAS_GLOBAL
\ ARCHIVE_OUTPUT_DIRECTORY
\ CLI
\ CONFIG
@@ -1735,11 +2151,15 @@ syn keyword cmakeKWadd_library contained
\ HEADER_FILE_ONLY
\ IMPORTED
\ IMPORTED_
+ \ IMPORTED_IMPLIB
+ \ IMPORTED_IMPLIB_
\ IMPORTED_LOCATION
\ IMPORTED_LOCATION_
\ IMPORTED_OBJECTS
\ IMPORTED_OBJECTS_
+ \ INTERFACE
\ INTERFACE_
+ \ INTERFACE_SOURCES
\ LIBRARY_OUTPUT_DIRECTORY
\ MODULE
\ OBJECT
@@ -1749,17 +2169,23 @@ syn keyword cmakeKWadd_library contained
\ POST_BUILD
\ PRE_BUILD
\ PRE_LINK
- \ PUBLIC_HEADER
+ \ PRIVATE
+ \ PUBLIC
\ RUNTIME_OUTPUT_DIRECTORY
\ SHARED
+ \ SOURCES
\ STATIC
\ TARGET_OBJECTS
\ UNKNOWN
syn keyword cmakeKWadd_link_options contained
\ CMAKE_
+ \ CUDA_RESOLVE_DEVICE_SYMBOLS
+ \ CUDA_SEPARABLE_COMPILATION
+ \ DEVICE_LINK
\ GCC
\ GNU
+ \ HOST_LINK
\ LANG
\ LINKER
\ LINK_OPTIONS
@@ -1775,6 +2201,7 @@ syn keyword cmakeKWadd_subdirectory contained
syn keyword cmakeKWadd_test contained
\ BUILD_TESTING
\ COMMAND
+ \ COMMAND_EXPAND_LISTS
\ CONFIGURATIONS
\ FAIL_REGULAR_EXPRESSION
\ NAME
@@ -1816,6 +2243,23 @@ syn keyword cmakeKWcmake_host_system_information contained
\ TOTAL_PHYSICAL_MEMORY
\ TOTAL_VIRTUAL_MEMORY
+syn keyword cmakeKWcmake_language contained
+ \ AND
+ \ CALL
+ \ CANCEL_CALL
+ \ CODE
+ \ DEFER
+ \ DIRECTORY
+ \ EVAL
+ \ FALSE
+ \ GET_CALL_IDS
+ \ ID
+ \ ID_VAR
+ \ OR
+ \ STATUS
+ \ TRUE
+ \ WRITE
+
syn keyword cmakeKWcmake_minimum_required contained
\ FATAL_ERROR
\ VERSION
@@ -1845,6 +2289,72 @@ syn keyword cmakeKWcmake_parse_arguments contained
\ _KEYWORDS_MISSING_VALUES
\ _UNPARSED_ARGUMENTS
+syn keyword cmakeKWcmake_path contained
+ \ ABSOLUTE_PATH
+ \ AND
+ \ APPEND
+ \ BASE_DIRECTORY
+ \ CMAKE_PATH
+ \ COMPARE
+ \ CONCAT
+ \ CONVERT
+ \ ELSEIF
+ \ ENDIF
+ \ EXTENSION
+ \ EXTENSION_DEF
+ \ FALSE
+ \ FILENAME_DEF
+ \ GET
+ \ GET_EXTENSION
+ \ GET_FILENAME
+ \ GET_PARENT_PATH
+ \ GET_RELATIVE_PATH
+ \ GET_ROOT_DIRECTORY
+ \ GET_ROOT_NAME
+ \ GET_ROOT_PATH
+ \ GET_STEM
+ \ HASH
+ \ HAS_EXTENSION
+ \ HAS_FILENAME
+ \ HAS_PARENT_PATH
+ \ HAS_RELATIVE_PATH
+ \ HAS_ROOT_DIRECTORY
+ \ HAS_ROOT_NAME
+ \ HAS_ROOT_PATH
+ \ HAS_STEM
+ \ IF
+ \ IS_ABSOLUTE
+ \ IS_PREFIX
+ \ IS_RELATIVE
+ \ LAST_ONLY
+ \ MATCHES
+ \ NATIVE_PATH
+ \ NORMALIZE
+ \ NORMAL_PATH
+ \ NOT
+ \ NOT_EQUAL
+ \ OP
+ \ OS
+ \ OUTPUT_VARIABLE
+ \ PARENT_PATH
+ \ PROXIMATE_PATH
+ \ REAL_PATH
+ \ RELATIVE_PATH
+ \ REMOVE_EXTENSION
+ \ REMOVE_FILENAME
+ \ REPLACE_EXTENSION
+ \ REPLACE_FILENAME
+ \ RETURN
+ \ ROOT_DIRECTORY
+ \ ROOT_NAME
+ \ ROOT_PATH
+ \ STEM
+ \ STREQUAL
+ \ TO_CMAKE_PATH_LIST
+ \ TO_NATIVE_PATH_LIST
+ \ TRUE
+ \ XOR
+
syn keyword cmakeKWcmake_policy contained
\ CMAKE_POLICY_DEFAULT_CMP
\ CMP
@@ -1862,10 +2372,13 @@ syn keyword cmakeKWconfigure_file contained
\ CRLF
\ DOS
\ ESCAPE_QUOTES
+ \ FILE_PERMISSIONS
\ FOO_ENABLE
\ FOO_STRING
\ LF
\ NEWLINE_STYLE
+ \ NO_SOURCE_PERMISSIONS
+ \ USE_SOURCE_PERMISSIONS
\ VAR
syn keyword cmakeKWcreate_test_sourcelist contained
@@ -1935,6 +2448,7 @@ syn keyword cmakeKWctest_run_script contained
syn keyword cmakeKWctest_start contained
\ APPEND
+ \ GROUP
\ QUIET
\ TAG
\ TRACK
@@ -1957,6 +2471,7 @@ syn keyword cmakeKWctest_submit contained
\ SUBMIT_URL
syn keyword cmakeKWctest_test contained
+ \ AFTER_TIMEOUT
\ APPEND
\ BUILD
\ CAPTURE_CMAKE_ERROR
@@ -1972,12 +2487,17 @@ syn keyword cmakeKWctest_test contained
\ ON
\ PARALLEL_LEVEL
\ QUIET
+ \ REPEAT
+ \ RESOURCE_SPEC_FILE
\ RETURN_VALUE
\ SCHEDULE_RANDOM
\ START
+ \ STOP_ON_FAILURE
\ STOP_TIME
\ STRIDE
\ TEST_LOAD
+ \ UNTIL_FAIL
+ \ UNTIL_PASS
syn keyword cmakeKWctest_update contained
\ CAPTURE_CMAKE_ERROR
@@ -2005,9 +2525,18 @@ syn keyword cmakeKWdefine_property contained
\ TEST
\ VARIABLE
+syn keyword cmakeKWdoxygen_add_docs contained
+ \ ALL
+ \ COMMENT
+ \ USE_STAMP_FILE
+ \ WORKING_DIRECTORY
+
syn keyword cmakeKWenable_language contained
\ ASM
\ CUDA
+ \ ISPC
+ \ OBJC
+ \ OBJCXX
\ OPTIONAL
syn keyword cmakeKWenable_testing contained
@@ -2020,15 +2549,20 @@ syn keyword cmakeKWexec_program contained
syn keyword cmakeKWexecute_process contained
\ ANSI
+ \ ANY
\ AUTO
\ COMMAND
\ COMMAND_ECHO
+ \ COMMAND_ERROR_IS_FATAL
+ \ ECHO_ERROR_VARIABLE
+ \ ECHO_OUTPUT_VARIABLE
\ ENCODING
\ ERROR_FILE
\ ERROR_QUIET
\ ERROR_STRIP_TRAILING_WHITESPACE
\ ERROR_VARIABLE
\ INPUT_FILE
+ \ LAST
\ NONE
\ OEM
\ OUTPUT_FILE
@@ -2070,63 +2604,107 @@ syn keyword cmakeKWexport_library_dependencies contained
syn keyword cmakeKWfile contained
\ ALGO
\ APPEND
+ \ ARCHIVE_CREATE
+ \ ARCHIVE_EXTRACT
\ ASCII
+ \ BASE_DIRECTORY
+ \ BUNDLE_EXECUTABLE
+ \ CHMOD
+ \ CHMOD_RECURSE
+ \ CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND
+ \ CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM
+ \ CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL
+ \ CMAKE_OBJDUMP
\ CMAKE_TLS_CAINFO
\ CMAKE_TLS_VERIFY
+ \ CODE
+ \ COMPILE_FEATURES
+ \ COMPRESSION
+ \ COMPRESSION_LEVEL
\ CONDITION
- \ CONFIG
+ \ CONFIGURE
\ CONFIGURE_DEPENDS
+ \ CONFLICTING_DEPENDENCIES_PREFIX
\ CONTENT
+ \ CONVERT
\ COPY
\ COPY_ON_ERROR
\ CREATE_LINK
+ \ CRLF
\ DESTINATION
+ \ DIRECTORIES
\ DIRECTORY_PERMISSIONS
+ \ DLL
+ \ DOS
\ DOWNLOAD
\ ENCODING
- \ EXCLUDE
+ \ ESCAPE_QUOTES
+ \ EXECUTABLES
\ EXPECTED_HASH
\ FILES_MATCHING
\ FILE_PERMISSIONS
\ FOLLOW_SYMLINKS
\ FOLLOW_SYMLINK_CHAIN
+ \ FORMAT
\ FUNCTION
\ GENERATE
+ \ GET_RUNTIME_DEPENDENCIES
\ GLOB
\ GLOB_RECURSE
+ \ GROUP_EXECUTE
+ \ GROUP_READ
+ \ GROUP_WRITE
\ GUARD
\ HASH
\ HEX
\ HTTPHEADER
\ IGNORED
\ INACTIVITY_TIMEOUT
+ \ INPUT
\ INSTALL
\ IS_ABSOLUTE
\ LENGTH_MAXIMUM
\ LENGTH_MINIMUM
\ LF
+ \ LIBRARIES
\ LIMIT
\ LIMIT_COUNT
\ LIMIT_INPUT
\ LIMIT_OUTPUT
\ LIST_DIRECTORIES
+ \ LIST_ONLY
\ LOCK
\ LOG
\ MAKE_DIRECTORY
+ \ MODULES
+ \ MTIME
+ \ MYLIBRARY
\ NETRC
\ NETRC_FILE
\ NEWLINE_CONSUME
+ \ NEWLINE_STYLE
\ NOT
\ NO_HEX_CONVERSION
\ NO_SOURCE_PERMISSIONS
\ OFFSET
- \ OLD
+ \ ONLY
\ OPTIONAL
\ OUTPUT
+ \ OWNER_EXECUTE
+ \ OWNER_READ
+ \ OWNER_WRITE
+ \ PATHS
\ PATTERN
+ \ PATTERNS
+ \ PERMISSIONS
+ \ POST_EXCLUDE_REGEXES
+ \ POST_INCLUDE_REGEXES
+ \ PRE_EXCLUDE_REGEXES
+ \ PRE_INCLUDE_REGEXES
\ PROCESS
\ READ
\ READ_SYMLINK
+ \ REAL_PATH
\ REGEX
\ RELATIVE_PATH
\ RELEASE
@@ -2134,33 +2712,51 @@ syn keyword cmakeKWfile contained
\ REMOVE_RECURSE
\ RENAME
\ REQUIRED
+ \ RESOLVED_DEPENDENCIES_VAR
\ RESULT
\ RESULT_VARIABLE
+ \ RPATH
+ \ RUNPATH
+ \ SCRIPT
+ \ SHARED
\ SHOW_PROGRESS
\ SIZE
\ SSL
+ \ STATIC
\ STATUS
\ STRINGS
\ SYMBOLIC
+ \ TARGET
+ \ TARGET_PROPERTY
\ TIMESTAMP
\ TLS_CAINFO
\ TLS_VERIFY
\ TOUCH
\ TOUCH_NOCREATE
\ TO_CMAKE_PATH
+ \ TO_CMAKE_PATH_LIST
\ TO_NATIVE_PATH
+ \ TO_NATIVE_PATH_LIST
+ \ UNRESOLVED_DEPENDENCIES_VAR
\ UPLOAD
\ URL
\ USERPWD
\ USE_SOURCE_PERMISSIONS
\ UTC
\ UTF
+ \ VERBOSE
+ \ WORLD_EXECUTE
+ \ WORLD_READ
+ \ WORLD_WRITE
\ WRITE
+ \ XZ
+ \ _FILENAMES
syn keyword cmakeKWfind_file contained
\ CMAKE_FIND_ROOT_PATH_BOTH
\ DOC
\ DVAR
+ \ FALSE
\ HINTS
\ INCLUDE
\ NAMES
@@ -2174,14 +2770,16 @@ syn keyword cmakeKWfind_file contained
\ ONLY_CMAKE_FIND_ROOT_PATH
\ PATHS
\ PATH_SUFFIXES
+ \ REQUIRED
\ VAR
syn keyword cmakeKWfind_library contained
\ CMAKE_FIND_ROOT_PATH_BOTH
\ DOC
\ DVAR
+ \ FALSE
\ HINTS
- \ LIB
+ \ INCLUDE
\ NAMES
\ NAMES_PER_DIR
\ NO_CMAKE_ENVIRONMENT_PATH
@@ -2194,6 +2792,7 @@ syn keyword cmakeKWfind_library contained
\ ONLY_CMAKE_FIND_ROOT_PATH
\ PATHS
\ PATH_SUFFIXES
+ \ REQUIRED
\ VAR
syn keyword cmakeKWfind_package contained
@@ -2207,8 +2806,12 @@ syn keyword cmakeKWfind_package contained
\ DEC
\ DVAR
\ EXACT
+ \ EXCLUDE
+ \ FALSE
+ \ FIND_PACKAGE_VERSION_FORMAT
\ FRAMEWORK
\ HINTS
+ \ INCLUDE
\ MODULE
\ NAMES
\ NATURAL
@@ -2228,12 +2831,26 @@ syn keyword cmakeKWfind_package contained
\ OPTIONAL_COMPONENTS
\ PACKAGE_FIND_NAME
\ PACKAGE_FIND_VERSION
+ \ PACKAGE_FIND_VERSION_COMPLETE
\ PACKAGE_FIND_VERSION_COUNT
\ PACKAGE_FIND_VERSION_MAJOR
+ \ PACKAGE_FIND_VERSION_MAX
+ \ PACKAGE_FIND_VERSION_MAX_COUNT
+ \ PACKAGE_FIND_VERSION_MAX_MAJOR
+ \ PACKAGE_FIND_VERSION_MAX_MINOR
+ \ PACKAGE_FIND_VERSION_MAX_PATCH
+ \ PACKAGE_FIND_VERSION_MAX_TWEAK
\ PACKAGE_FIND_VERSION_MINOR
+ \ PACKAGE_FIND_VERSION_MIN_COUNT
+ \ PACKAGE_FIND_VERSION_MIN_MAJOR
+ \ PACKAGE_FIND_VERSION_MIN_MINOR
+ \ PACKAGE_FIND_VERSION_MIN_PATCH
+ \ PACKAGE_FIND_VERSION_MIN_TWEAK
\ PACKAGE_FIND_VERSION_PATCH
+ \ PACKAGE_FIND_VERSION_RANGE
+ \ PACKAGE_FIND_VERSION_RANGE_MAX
+ \ PACKAGE_FIND_VERSION_RANGE_MIN
\ PACKAGE_FIND_VERSION_TWEAK
- \ PACKAGE_VERSION
\ PACKAGE_VERSION_COMPATIBLE
\ PACKAGE_VERSION_EXACT
\ PACKAGE_VERSION_UNSUITABLE
@@ -2258,6 +2875,7 @@ syn keyword cmakeKWfind_path contained
\ CMAKE_FIND_ROOT_PATH_BOTH
\ DOC
\ DVAR
+ \ FALSE
\ HINTS
\ INCLUDE
\ NAMES
@@ -2271,12 +2889,14 @@ syn keyword cmakeKWfind_path contained
\ ONLY_CMAKE_FIND_ROOT_PATH
\ PATHS
\ PATH_SUFFIXES
+ \ REQUIRED
\ VAR
syn keyword cmakeKWfind_program contained
\ CMAKE_FIND_ROOT_PATH_BOTH
\ DOC
\ DVAR
+ \ FALSE
\ HINTS
\ NAMES
\ NAMES_PER_DIR
@@ -2290,22 +2910,26 @@ syn keyword cmakeKWfind_program contained
\ ONLY_CMAKE_FIND_ROOT_PATH
\ PATHS
\ PATH_SUFFIXES
+ \ REQUIRED
\ VAR
syn keyword cmakeKWfltk_wrap_ui contained
\ FLTK
syn keyword cmakeKWforeach contained
+ \ APPEND
\ IN
\ ITEMS
\ LISTS
\ RANGE
\ STATUS
+ \ ZIP_LISTS
syn keyword cmakeKWfunction contained
\ ARGC
\ ARGN
\ ARGV
+ \ CALL
\ FOO
\ PARENT_SCOPE
@@ -2333,6 +2957,7 @@ syn keyword cmakeKWget_filename_component contained
\ PROGRAM
\ PROGRAM_ARGS
\ REALPATH
+ \ REAL_PATH
syn keyword cmakeKWget_property contained
\ BRIEF_DOCS
@@ -2345,13 +2970,15 @@ syn keyword cmakeKWget_property contained
\ SET
\ SOURCE
\ TARGET
+ \ TARGET_DIRECTORY
\ TEST
\ VARIABLE
syn keyword cmakeKWget_source_file_property contained
+ \ DIRECTORY
\ INHERITED
\ LOCATION
- \ VAR
+ \ TARGET_DIRECTORY
syn keyword cmakeKWget_target_property contained
\ INHERITED
@@ -2427,6 +3054,7 @@ syn keyword cmakeKWinclude_guard contained
syn keyword cmakeKWinstall contained
\ AFTER
+ \ AIX
\ APT
\ ARCHIVE
\ BEFORE
@@ -2460,6 +3088,7 @@ syn keyword cmakeKWinstall contained
\ DIRECTORY_PERMISSIONS
\ DLL
\ DOC
+ \ ENABLE_EXPORTS
\ EXCLUDE_FROM_ALL
\ EXPORT
\ EXPORT_ANDROID_MK
@@ -2565,6 +3194,7 @@ syn keyword cmakeKWlist contained
\ INTERNAL
\ JOIN
\ LENGTH
+ \ NATURAL
\ ORDER
\ OUTPUT_VARIABLE
\ PARENT_SCOPE
@@ -2600,6 +3230,7 @@ syn keyword cmakeKWmacro contained
\ ARGC
\ ARGN
\ ARGV
+ \ CALL
\ DEFINED
\ FOO
\ GREATER
@@ -2616,12 +3247,18 @@ syn keyword cmakeKWmath contained
\ OUTPUT_FORMAT
syn keyword cmakeKWmessage contained
+ \ APPEND
\ AUTHOR_WARNING
+ \ CHECK_
+ \ CHECK_FAIL
+ \ CHECK_PASS
+ \ CHECK_START
\ DEBUG
\ DEPRECATION
\ FATAL_ERROR
\ GUI
\ NOTICE
+ \ POP_BACK
\ SEND_ERROR
\ STATUS
\ TRACE
@@ -2638,15 +3275,18 @@ syn keyword cmakeKWproject contained
\ CUDA
\ DESCRIPTION
\ HOMEPAGE_URL
+ \ ISPC
\ LANGUAGES
\ NAME
\ NONE
+ \ OBJC
+ \ OBJCXX
\ PROJECT
\ VERSION
\ _BINARY_DIR
\ _DESCRIPTION
\ _HOMEPAGE_URL
- \ _INCLUDE
+ \ _INCLUDE_BEFORE
\ _SOURCE_DIR
\ _VERSION
\ _VERSION_MAJOR
@@ -2664,9 +3304,14 @@ syn keyword cmakeKWremove contained
\ VALUE
\ VAR
+syn keyword cmakeKWreturn contained
+ \ DEFER
+
syn keyword cmakeKWseparate_arguments contained
\ MSDN
\ NATIVE_COMMAND
+ \ PROGRAM
+ \ SEPARATE_ARGS
\ UNIX_COMMAND
\ WINDOWS_COMMAND
@@ -2695,12 +3340,15 @@ syn keyword cmakeKWset_property contained
\ PROPERTY
\ SOURCE
\ TARGET
+ \ TARGET_DIRECTORY
\ TEST
\ WIX
syn keyword cmakeKWset_source_files_properties contained
+ \ DIRECTORY
\ PROPERTIES
\ SOURCE
+ \ TARGET_DIRECTORY
syn keyword cmakeKWset_target_properties contained
\ PROPERTIES
@@ -2710,6 +3358,9 @@ syn keyword cmakeKWset_tests_properties contained
\ PROPERTIES
\ TEST
+syn keyword cmakeKWsite_name contained
+ \ HOSTNAME
+
syn keyword cmakeKWsource_group contained
\ FILES
\ PREFIX
@@ -2719,20 +3370,27 @@ syn keyword cmakeKWsource_group contained
syn keyword cmakeKWstring contained
\ ALPHABET
\ APPEND
+ \ ARRAY
\ ASCII
+ \ BOOLEAN
\ CMAKE_MATCH_
\ COMPARE
\ CONCAT
\ CONFIGURE
\ EQUAL
+ \ ERROR_VARIABLE
\ ESCAPE_QUOTES
\ FIND
\ GENEX_STRIP
+ \ GET
\ GREATER
\ GREATER_EQUAL
\ GUID
\ HASH
+ \ HEX
\ JOIN
+ \ JSON
+ \ JSONLENGTH
\ LENGTH
\ LESS
\ LESS_EQUAL
@@ -2740,17 +3398,24 @@ syn keyword cmakeKWstring contained
\ MATCH
\ MATCHALL
\ MATCHES
+ \ MEMBER
\ NAMESPACE
\ NOTEQUAL
+ \ NULL
+ \ NUMBER
+ \ OBJECT
+ \ OFF
\ ONLY
\ PREPEND
\ RANDOM
\ RANDOM_SEED
\ REGEX
+ \ REMOVE
\ REPEAT
\ REPLACE
\ REVERSE
\ RFC
+ \ SET
\ SHA
\ SOURCE_DATE_EPOCH
\ STRIP
@@ -2853,8 +3518,12 @@ syn keyword cmakeKWtarget_link_options contained
\ ALIAS
\ BEFORE
\ CMAKE_
+ \ CUDA_RESOLVE_DEVICE_SYMBOLS
+ \ CUDA_SEPARABLE_COMPILATION
+ \ DEVICE_LINK
\ GCC
\ GNU
+ \ HOST_LINK
\ IMPORTED
\ INTERFACE
\ INTERFACE_LINK_OPTIONS
@@ -2870,9 +3539,23 @@ syn keyword cmakeKWtarget_link_options contained
\ _LINKER_WRAPPER_FLAG_SEP
syn keyword cmakeKWtarget_precompile_headers contained
+ \ ALIAS
+ \ ANGLE
+ \ BUILD_INTERFACE
+ \ COMPILE_LANGUAGE
+ \ DISABLE_PRECOMPILE_HEADERS
+ \ EXPORT
+ \ FI
+ \ GCC
+ \ IMPORTED
\ INTERFACE
+ \ INTERFACE_PRECOMPILE_HEADERS
+ \ PRECOMPILE_HEADERS
+ \ PRECOMPILE_HEADERS_REUSE_FROM
\ PRIVATE
\ PUBLIC
+ \ REUSE_FROM
+ \ SKIP_PRECOMPILE_HEADERS
syn keyword cmakeKWtarget_sources contained
\ ALIAS
@@ -2911,6 +3594,12 @@ syn keyword cmakeKWtry_compile contained
\ LINK_OPTIONS
\ MULTI
\ NOT
+ \ OBJCXX_EXTENSIONS
+ \ OBJCXX_STANDARD
+ \ OBJCXX_STANDARD_REQUIRED
+ \ OBJC_EXTENSIONS
+ \ OBJC_STANDARD
+ \ OBJC_STANDARD_REQUIRED
\ OUTPUT_VARIABLE
\ PRIVATE
\ SOURCES
@@ -2956,7 +3645,14 @@ syn keyword cmakeKWvariable_requires contained
\ TEST_VARIABLE
syn keyword cmakeKWvariable_watch contained
+ \ APPEND
\ COMMAND
+ \ DEFINED
+ \ MODIFIED_ACCESS
+ \ READ_ACCESS
+ \ REMOVED_ACCESS
+ \ UNKNOWN_MODIFIED_ACCESS
+ \ UNKNOWN_READ_ACCESS
syn keyword cmakeKWwrite_file contained
\ APPEND
@@ -2988,39 +3684,49 @@ syn keyword cmakeGeneratorExpressions contained
\ CONFIGURATION
\ CUDA_COMPILER_ID
\ CUDA_COMPILER_VERSION
+ \ CUDA_RESOLVE_DEVICE_SYMBOLS
+ \ CUDA_SEPARABLE_COMPILATION
\ CUSTOM_KEYS
\ CXX_COMPILER_ID
\ CXX_COMPILER_VERSION
+ \ CXX_CONFIG
\ CXX_STANDARD
\ C_COMPILER_ID
\ C_COMPILER_VERSION
\ C_STANDARD
\ DEBUG_MODE
\ DEBUG_POSTFIX
+ \ DEVICE_LINK
+ \ DLL
\ EXCLUDE
\ EXPORT
\ FALSE
\ FILTER
\ FOO_EXTRA_THINGS
- \ Fortran_COMPILER_ID
- \ Fortran_COMPILER_VERSION
\ GENERATE
\ GENEX_EVAL
\ GNU
+ \ HOST_LINK
\ IF
\ IGNORE
\ IMPORT_PREFIX
\ IMPORT_SUFFIX
\ INCLUDE_DIRECTORIES
\ INSTALL_INTERFACE
+ \ INSTALL_NAME_DIR
\ INSTALL_PREFIX
+ \ INTERFACE
\ INTERFACE_LINK_LIBRARIES
\ IN_LIST
+ \ ISPC_COMPILER_ID
+ \ ISPC_COMPILER_VERSION
\ JOIN
\ LANG
\ LANG_COMPILER_ID
\ LIBRARY_OUTPUT_NAME
\ LIBRARY_OUTPUT_NAME_
+ \ LINK_LANGUAGE
+ \ LINK_LANG_AND_ID
\ LINK_LIBRARIES
\ LINK_ONLY
\ LOWER_CASE
@@ -3028,6 +3734,10 @@ syn keyword cmakeGeneratorExpressions contained
\ MAP_IMPORTED_CONFIG_
\ NO
\ NOT
+ \ OBJCXX_COMPILER_ID
+ \ OBJCXX_COMPILER_VERSION
+ \ OBJC_COMPILER_ID
+ \ OBJC_COMPILER_VERSION
\ OFF
\ OLD_COMPILER
\ OUTPUT_NAME
@@ -3046,6 +3756,7 @@ syn keyword cmakeGeneratorExpressions contained
\ SDK
\ SEMICOLON
\ SHELL_PATH
+ \ STATIC
\ STREQUAL
\ TARGET_BUNDLE_CONTENT_DIR
\ TARGET_BUNDLE_DIR
@@ -3100,8 +3811,10 @@ syn keyword cmakeCommand
\ break
\ build_command
\ cmake_host_system_information
+ \ cmake_language
\ cmake_minimum_required
\ cmake_parse_arguments
+ \ cmake_path
\ cmake_policy
\ configure_file
\ continue
@@ -3258,8 +3971,10 @@ hi def link cmakeKWadd_subdirectory ModeMsg
hi def link cmakeKWadd_test ModeMsg
hi def link cmakeKWbuild_command ModeMsg
hi def link cmakeKWcmake_host_system_information ModeMsg
+hi def link cmakeKWcmake_language ModeMsg
hi def link cmakeKWcmake_minimum_required ModeMsg
hi def link cmakeKWcmake_parse_arguments ModeMsg
+hi def link cmakeKWcmake_path ModeMsg
hi def link cmakeKWcmake_policy ModeMsg
hi def link cmakeKWconfigure_file ModeMsg
hi def link cmakeKWcreate_test_sourcelist ModeMsg
@@ -3274,6 +3989,7 @@ hi def link cmakeKWctest_test ModeMsg
hi def link cmakeKWctest_update ModeMsg
hi def link cmakeKWctest_upload ModeMsg
hi def link cmakeKWdefine_property ModeMsg
+hi def link cmakeKWdoxygen_add_docs ModeMsg
hi def link cmakeKWenable_language ModeMsg
hi def link cmakeKWenable_testing ModeMsg
hi def link cmakeKWexec_program ModeMsg
@@ -3318,6 +4034,7 @@ hi def link cmakeKWproject ModeMsg
hi def link cmakeKWqt_wrap_cpp ModeMsg
hi def link cmakeKWqt_wrap_ui ModeMsg
hi def link cmakeKWremove ModeMsg
+hi def link cmakeKWreturn ModeMsg
hi def link cmakeKWseparate_arguments ModeMsg
hi def link cmakeKWset ModeMsg
hi def link cmakeKWset_directory_properties ModeMsg
@@ -3325,6 +4042,7 @@ hi def link cmakeKWset_property ModeMsg
hi def link cmakeKWset_source_files_properties ModeMsg
hi def link cmakeKWset_target_properties ModeMsg
hi def link cmakeKWset_tests_properties ModeMsg
+hi def link cmakeKWsite_name ModeMsg
hi def link cmakeKWsource_group ModeMsg
hi def link cmakeKWstring ModeMsg
hi def link cmakeKWsubdirs ModeMsg
diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst
index 00e1a69..40a45e3 100644
--- a/Help/command/cmake_language.rst
+++ b/Help/command/cmake_language.rst
@@ -134,14 +134,14 @@ The options are:
``ID <id>``
Specify an identification for the deferred call.
- The id may not be empty and may not begin in a capital letter ``A-Z``.
- The id may begin in a ``_`` only if it was generated by another call
- that used ``ID_VAR`` to get the id.
+ The ``<id>`` may not be empty and may not begin with a capital letter ``A-Z``.
+ The ``<id>`` may begin with an underscore (``_``) only if it was generated
+ automatically by an earlier call that used ``ID_VAR`` to get the id.
``ID_VAR <var>``
- Sepcify a variable in which to store the identification for the
+ Specify a variable in which to store the identification for the
deferred call. If ``ID <id>`` is not given, a new identification
- will be generated starting in a ``_``.
+ will be generated and the generated id will start with an underscore (``_``).
The currently scheduled list of deferred calls may be retrieved:
@@ -149,7 +149,7 @@ The currently scheduled list of deferred calls may be retrieved:
cmake_language(DEFER [DIRECTORY <dir>] GET_CALL_IDS <var>)
-This will store in ``<var>`` a :ref:`Semicolon-separated list <CMake Language
+This will store in ``<var>`` a :ref:`semicolon-separated list <CMake Language
Lists>` of deferred call ids.
Details of a specific call may be retrieved from its id:
@@ -158,7 +158,7 @@ Details of a specific call may be retrieved from its id:
cmake_language(DEFER [DIRECTORY <dir>] GET_CALL <id> <var>)
-This will store in ``<var>`` a :ref:`Semicolon-separated list <CMake Language
+This will store in ``<var>`` a :ref:`semicolon-separated list <CMake Language
Lists>` in which the first element is the name of the command to be
called, and the remaining elements are its unevaluated arguments (any
contained ``;`` characters are included literally and cannot be distinguished
diff --git a/Help/command/cmake_path.rst b/Help/command/cmake_path.rst
index 555926b..cb84dd1 100644
--- a/Help/command/cmake_path.rst
+++ b/Help/command/cmake_path.rst
@@ -65,15 +65,15 @@ The following exceptions apply:
the target system. So this is not generally applicable to the target system
in cross-compiling environment.
-For all commands, ``<path>`` placeholder expect a variable name. An error will
-be raised if the variable does not exist, except for `APPEND`_ and
+For all commands, ``<path-var>`` placeholder expect a variable name. An error
+will be raised if the variable does not exist, except for `APPEND`_ and
`CMAKE_PATH`_ sub-commands. ``<input>`` placeholder expect a string literal.
-``[<input>...]`` placeholder expect zero or more arguments. ``<output>``
+``[<input>...]`` placeholder expect zero or more arguments. ``<out-var>``
placeholder expect a variable name.
.. note::
- ``cmake_path`` command does not support list of paths. The ``<path>``
+ ``cmake_path`` command does not support list of paths. The ``<path-var>``
placeholder must store only one path name.
To initialize a path variable, three possibilities can be used:
@@ -96,7 +96,7 @@ To initialize a path variable, three possibilities can be used:
`Modification`_ and `Generation`_ sub-commands store the result in-place or in
the variable specified by ``OUTPUT_VARIABLE`` option. All other sub-commands,
-except `CMAKE_PATH`_, store the result in the required ``<output>`` variable.
+except `CMAKE_PATH`_, store the result in the required ``<out-var>`` variable.
Sub-commands supporting ``NORMALIZE`` option will :ref:`normalize <NORMAL_PATH>`
the path.
@@ -107,58 +107,58 @@ Synopsis
.. parsed-literal::
`Decomposition`_
- cmake_path(`GET`_ <path> :ref:`ROOT_NAME <GET_ROOT_NAME>` <output>)
- cmake_path(`GET`_ <path> :ref:`ROOT_DIRECTORY <GET_ROOT_DIRECTORY>` <output>)
- cmake_path(`GET`_ <path> :ref:`ROOT_PATH <GET_ROOT_PATH>` <output>)
- cmake_path(`GET`_ <path> :ref:`FILENAME <GET_FILENAME>` <output>)
- cmake_path(`GET`_ <path> :ref:`EXTENSION <GET_EXTENSION>` [LAST_ONLY] <output>)
- cmake_path(`GET`_ <path> :ref:`STEM <GET_STEM>` [LAST_ONLY] <output>)
- cmake_path(`GET`_ <path> :ref:`RELATIVE_PATH <GET_RELATIVE_PATH>` <output>)
- cmake_path(`GET`_ <path> :ref:`PARENT_PATH <GET_PARENT_PATH>` <output>)
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_NAME <GET_ROOT_NAME>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_DIRECTORY <GET_ROOT_DIRECTORY>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`ROOT_PATH <GET_ROOT_PATH>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`FILENAME <GET_FILENAME>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`EXTENSION <GET_EXTENSION>` [LAST_ONLY] <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`STEM <GET_STEM>` [LAST_ONLY] <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`RELATIVE_PATH <GET_RELATIVE_PATH>` <out-var>)
+ cmake_path(`GET`_ <path-var> :ref:`PARENT_PATH <GET_PARENT_PATH>` <out-var>)
`Modification`_
- cmake_path(`APPEND`_ <path> [<input>...] [OUTPUT_VARIABLE <output>])
- cmake_path(`CONCAT`_ <path> [<input>...] [OUTPUT_VARIABLE <output>])
- cmake_path(`REMOVE_FILENAME`_ <path> [OUTPUT_VARIABLE <output>])
- cmake_path(`REPLACE_FILENAME`_ <path> <input> [OUTPUT_VARIABLE <output>])
- cmake_path(`REMOVE_EXTENSION`_ <path> [LAST_ONLY]
- [OUTPUT_VARIABLE <output>])
- cmake_path(`REPLACE_EXTENSION`_ <path> [LAST_ONLY] <input>
- [OUTPUT_VARIABLE <output>])
+ cmake_path(`APPEND`_ <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`CONCAT`_ <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REMOVE_FILENAME`_ <path-var> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REPLACE_FILENAME`_ <path-var> <input> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REMOVE_EXTENSION`_ <path-var> [LAST_ONLY]
+ [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`REPLACE_EXTENSION`_ <path-var> [LAST_ONLY] <input>
+ [OUTPUT_VARIABLE <out-var>])
`Generation`_
- cmake_path(`NORMAL_PATH`_ <path> [OUTPUT_VARIABLE <output>])
- cmake_path(`RELATIVE_PATH`_ <path> [BASE_DIRECTORY <path>]
- [OUTPUT_VARIABLE <output>])
- cmake_path(`PROXIMATE_PATH`_ <path> [BASE_DIRECTORY <path>]
- [OUTPUT_VARIABLE <output>])
- cmake_path(`ABSOLUTE_PATH`_ <path> [BASE_DIRECTORY <path>] [NORMALIZE]
- [OUTPUT_VARIABLE <output>])
+ cmake_path(`NORMAL_PATH`_ <path-var> [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`RELATIVE_PATH`_ <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`PROXIMATE_PATH`_ <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
+ cmake_path(`ABSOLUTE_PATH`_ <path-var> [BASE_DIRECTORY <input>] [NORMALIZE]
+ [OUTPUT_VARIABLE <out-var>])
`Conversion`_
- cmake_path(`CMAKE_PATH`_ <path> [NORMALIZE] <input>)
- cmake_path(`NATIVE_PATH`_ <path> [NORMALIZE] <output>)
- cmake_path(`CONVERT`_ <input> `TO_CMAKE_PATH_LIST`_ <output>)
- cmake_path(`CONVERT`_ <input> `TO_NATIVE_PATH_LIST`_ <output>)
+ cmake_path(`CMAKE_PATH`_ <path-var> [NORMALIZE] <input>)
+ cmake_path(`NATIVE_PATH`_ <path-var> [NORMALIZE] <out-var>)
+ cmake_path(`CONVERT`_ <input> `TO_CMAKE_PATH_LIST`_ <out-var>)
+ cmake_path(`CONVERT`_ <input> `TO_NATIVE_PATH_LIST`_ <out-var>)
`Comparison`_
- cmake_path(`COMPARE`_ <path> <OP> <input> <output>)
+ cmake_path(`COMPARE`_ <path-var> <OP> <input> <out-var>)
`Query`_
- cmake_path(`HAS_ROOT_NAME`_ <path> <output>)
- cmake_path(`HAS_ROOT_DIRECTORY`_ <path> <output>)
- cmake_path(`HAS_ROOT_PATH`_ <path> <output>)
- cmake_path(`HAS_FILENAME`_ <path> <output>)
- cmake_path(`HAS_EXTENSION`_ <path> <output>)
- cmake_path(`HAS_STEM`_ <path> <output>)
- cmake_path(`HAS_RELATIVE_PATH`_ <path> <output>)
- cmake_path(`HAS_PARENT_PATH`_ <path> <output>)
- cmake_path(`IS_ABSOLUTE`_ <path> <output>)
- cmake_path(`IS_RELATIVE`_ <path> <output>)
- cmake_path(`IS_PREFIX`_ <path> <input> [NORMALIZE] <output>)
+ cmake_path(`HAS_ROOT_NAME`_ <path-var> <out-var>)
+ cmake_path(`HAS_ROOT_DIRECTORY`_ <path-var> <out-var>)
+ cmake_path(`HAS_ROOT_PATH`_ <path-var> <out-var>)
+ cmake_path(`HAS_FILENAME`_ <path-var> <out-var>)
+ cmake_path(`HAS_EXTENSION`_ <path-var> <out-var>)
+ cmake_path(`HAS_STEM`_ <path-var> <out-var>)
+ cmake_path(`HAS_RELATIVE_PATH`_ <path-var> <out-var>)
+ cmake_path(`HAS_PARENT_PATH`_ <path-var> <out-var>)
+ cmake_path(`IS_ABSOLUTE`_ <path-var> <out-var>)
+ cmake_path(`IS_RELATIVE`_ <path-var> <out-var>)
+ cmake_path(`IS_PREFIX`_ <path-var> <input> [NORMALIZE] <out-var>)
`Hashing`_
- cmake_path(`HASH`_ <path> [NORMALIZE] <output>)
+ cmake_path(`HASH`_ <path-var> [NORMALIZE] <out-var>)
Decomposition
^^^^^^^^^^^^^
@@ -168,7 +168,7 @@ Decomposition
.. code-block:: cmake
- cmake_path(GET <path> ROOT_NAME <output>)
+ cmake_path(GET <path-var> ROOT_NAME <out-var>)
Returns the root name of the path. If the path does not include a root name,
returns an empty path.
@@ -194,7 +194,7 @@ For example:
.. code-block:: cmake
- cmake_path(GET <path> ROOT_DIRECTORY <output>)
+ cmake_path(GET <path-var> ROOT_DIRECTORY <out-var>)
Returns the root directory of the path. If the path does not include a root
directory, returns an empty path.
@@ -215,7 +215,7 @@ For example:
.. code-block:: cmake
- cmake_path(GET <path> ROOT_PATH <output>)
+ cmake_path(GET <path-var> ROOT_PATH <out-var>)
Returns the root path of the path. If the path does not include a root path,
returns an empty path.
@@ -238,7 +238,7 @@ For example:
.. code-block:: cmake
- cmake_path(GET <path> FILENAME <output>)
+ cmake_path(GET <path-var> FILENAME <out-var>)
Returns the :ref:`filename <FILENAME_DEF>` component of the path. If the path
ends with a ``directory-separator``, there is no filename, so returns an empty
@@ -265,7 +265,7 @@ For example:
.. code-block:: cmake
- cmake_path(GET <path> EXTENSION [LAST_ONLY] <output>)
+ cmake_path(GET <path-var> EXTENSION [LAST_ONLY] <out-var>)
Returns the :ref:`extension <EXTENSION_DEF>` of the filename component.
@@ -301,7 +301,7 @@ The following exceptions apply:
.. code-block:: cmake
- cmake_path(GET <path> STEM [LAST_ONLY] <output>)
+ cmake_path(GET <path-var> STEM [LAST_ONLY] <out-var>)
Returns the :ref:`filename <FILENAME_DEF>` component of the path stripped of
its :ref:`extension <EXTENSION_DEF>`.
@@ -334,11 +334,11 @@ The following exceptions apply:
.. code-block:: cmake
- cmake_path(GET <path> RELATIVE_PATH <output>)
+ cmake_path(GET <path-var> RELATIVE_PATH <out-var>)
Returns path relative to ``root-path``, that is, a pathname composed of
-every component of ``<path>`` after ``root-path``. If ``<path>`` is an empty
-path, returns an empty path.
+every component of ``<path-var>`` after ``root-path``. If ``<path-var>`` is
+an empty path, returns an empty path.
For Example:
@@ -361,12 +361,12 @@ For Example:
.. code-block:: cmake
- cmake_path(GET <path> PARENT_PATH <output>)
+ cmake_path(GET <path-var> PARENT_PATH <out-var>)
Returns the path to the parent directory.
If `HAS_RELATIVE_PATH`_ sub-command returns false, the result is a copy of
-``<path>``. Otherwise, the result is ``<path>`` with one fewer element.
+``<path-var>``. Otherwise, the result is ``<path-var>`` with one fewer element.
For Example:
@@ -392,15 +392,17 @@ Modification
.. code-block:: cmake
- cmake_path(APPEND <path> [<input>...] [OUTPUT_VARIABLE <output>])
+ cmake_path(APPEND <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
-Append all the ``<input>`` arguments to the ``<path>`` using ``/`` as
+Append all the ``<input>`` arguments to the ``<path-var>`` using ``/`` as
``directory-separator``.
For each ``<input>`` argument, the following algorithm (pseudo-code) applies:
.. code-block:: cmake
+ # <path> is the contents of <path-var>
+
IF (<input>.is_absolute() OR
(<input>.has_root_name() AND
NOT <input>.root_name() STREQUAL <path>.root_name()))
@@ -411,7 +413,7 @@ For each ``<input>`` argument, the following algorithm (pseudo-code) applies:
IF (<input>.has_root_directory())
remove any root-directory and the entire relative path from <path>
ELSEIF (<path>.has_filename() OR
- (NOT <path>.has_root_directory() OR <path>.is_absolute()))
+ (NOT <path-var>.has_root_directory() OR <path>.is_absolute()))
appends directory-separator to <path>
ENDIF()
@@ -421,22 +423,22 @@ For each ``<input>`` argument, the following algorithm (pseudo-code) applies:
.. code-block:: cmake
- cmake_path(CONCAT <path> [<input>...] [OUTPUT_VARIABLE <output>])
+ cmake_path(CONCAT <path-var> [<input>...] [OUTPUT_VARIABLE <out-var>])
-Concatenates all the ``<input>`` arguments to the ``<path>`` without
+Concatenates all the ``<input>`` arguments to the ``<path-var>`` without
``directory-separator``.
.. _REMOVE_FILENAME:
.. code-block:: cmake
- cmake_path(REMOVE_FILENAME <path> [OUTPUT_VARIABLE <output>])
+ cmake_path(REMOVE_FILENAME <path-var> [OUTPUT_VARIABLE <out-var>])
Removes the :ref:`filename <FILENAME_DEF>` component (as returned by
-:ref:`GET ... FILENAME <GET_FILENAME>`) from ``<path>``.
+:ref:`GET ... FILENAME <GET_FILENAME>`) from ``<path-var>``.
After this function returns, if change is done in-place, `HAS_FILENAME`_
-returns false for ``<path>``.
+returns false for ``<path-var>``.
For Example:
@@ -458,13 +460,13 @@ For Example:
.. code-block:: cmake
- cmake_path(REPLACE_FILENAME <path> <input> [OUTPUT_VARIABLE <output>])
+ cmake_path(REPLACE_FILENAME <path-var> <input> [OUTPUT_VARIABLE <out-var>])
-Replaces the :ref:`filename <FILENAME_DEF>` component from ``<path>`` with
+Replaces the :ref:`filename <FILENAME_DEF>` component from ``<path-var>`` with
``<input>``.
-If ``<path>`` has no filename component (`HAS_FILENAME`_ returns false), the
-path is unchanged.
+If ``<path-var>`` has no filename component (`HAS_FILENAME`_ returns false),
+the path is unchanged.
Equivalent to the following:
@@ -480,23 +482,24 @@ Equivalent to the following:
.. code-block:: cmake
- cmake_path(REMOVE_EXTENSION <path> [LAST_ONLY] [OUTPUT_VARIABLE <output>])
+ cmake_path(REMOVE_EXTENSION <path-var> [LAST_ONLY]
+ [OUTPUT_VARIABLE <out-var>])
-Removes the :ref:`extension <EXTENSION_DEF>`, if any, from ``<path>``.
+Removes the :ref:`extension <EXTENSION_DEF>`, if any, from ``<path-var>``.
.. _REPLACE_EXTENSION:
.. code-block:: cmake
- cmake_path(REPLACE_EXTENSION <path> [LAST_ONLY] <input>
- [OUTPUT_VARIABLE <output>])
+ cmake_path(REPLACE_EXTENSION <path-var> [LAST_ONLY] <input>
+ [OUTPUT_VARIABLE <out-var>])
Replaces the :ref:`extension <EXTENSION_DEF>` with ``<input>``.
- 1. If ``<path>`` has an :ref:`extension <EXTENSION_DEF>`
+ 1. If ``<path-var>`` has an :ref:`extension <EXTENSION_DEF>`
(`HAS_EXTENSION`_ is true), it is removed.
- 2. A ``dot`` character is appended to ``<path>``, if ``<input>`` is not empty
- or does not begin with a ``dot`` character.
+ 2. A ``dot`` character is appended to ``<path-var>``, if ``<input>`` is not
+ empty or does not begin with a ``dot`` character.
3. ``<input>`` is appended as if `CONCAT`_ was used.
@@ -517,9 +520,9 @@ Generation
.. code-block:: cmake
- cmake_path(NORMAL_PATH <path> [OUTPUT_VARIABLE <output>])
+ cmake_path(NORMAL_PATH <path-var> [OUTPUT_VARIABLE <out-var>])
-Normalize ``<path>``.
+Normalize ``<path-var>``.
A path can be normalized by following this algorithm:
@@ -544,10 +547,10 @@ A path can be normalized by following this algorithm:
.. code-block:: cmake
- cmake_path(RELATIVE_PATH <path> [BASE_DIRECTORY <path>]
- [OUTPUT_VARIABLE <output>])
+ cmake_path(RELATIVE_PATH <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
-Returns ``<path>`` made relative to ``BASE_DIRECTORY`` argument. If
+Returns ``<path-var>`` made relative to ``BASE_DIRECTORY`` argument. If
``BASE_DIRECTORY`` is not specified, the default base directory will be
:variable:`CMAKE_CURRENT_SOURCE_DIR`.
@@ -558,11 +561,11 @@ For reference, the algorithm used to compute the relative path is described
.. code-block:: cmake
- cmake_path(PROXIMATE_PATH <path> [BASE_DIRECTORY <path>]
- [OUTPUT_VARIABLE <output>])
+ cmake_path(PROXIMATE_PATH <path-var> [BASE_DIRECTORY <input>]
+ [OUTPUT_VARIABLE <out-var>])
If the value of `RELATIVE_PATH`_ is not an empty path, return
-it. Otherwise return ``<path>``.
+it. Otherwise return ``<path-var>``.
If ``BASE_DIRECTORY`` is not specified, the default base directory will be
:variable:`CMAKE_CURRENT_SOURCE_DIR`.
@@ -571,10 +574,10 @@ If ``BASE_DIRECTORY`` is not specified, the default base directory will be
.. code-block:: cmake
- cmake_path(ABSOLUTE_PATH <path> [BASE_DIRECTORY <path>] [NORMALIZE]
- [OUTPUT_VARIABLE <output>])
+ cmake_path(ABSOLUTE_PATH <path-var> [BASE_DIRECTORY <input>] [NORMALIZE]
+ [OUTPUT_VARIABLE <out-var>])
-If ``<path>`` is a relative path (`IS_RELATIVE`_ is true), it is evaluated
+If ``<path-var>`` is a relative path (`IS_RELATIVE`_ is true), it is evaluated
relative to the given base directory specified by ``BASE_DIRECTORY`` option.
If ``BASE_DIRECTORY`` is not specifired, the default base directory will be
@@ -595,7 +598,7 @@ Conversion
.. code-block:: cmake
- cmake_path(CMAKE_PATH <path> [NORMALIZE] <input>)
+ cmake_path(CMAKE_PATH <path-var> [NORMALIZE] <input>)
Converts a native ``<input>`` path into cmake-style path with forward-slashes
(``/``). On Windows, the long filename marker is taken into account.
@@ -624,9 +627,9 @@ For Example:
.. code-block:: cmake
- cmake_path(NATIVE_PATH <path> [NORMALIZE] <output>)
+ cmake_path(NATIVE_PATH <path-var> [NORMALIZE] <out-var>)
-Converts a cmake-style ``<path>`` into a native
+Converts a cmake-style ``<path-var>`` into a native
path with platform-specific slashes (``\`` on Windows and ``/`` elsewhere).
When ``NORMALIZE`` option is specified, the path is :ref:`normalized
@@ -638,13 +641,13 @@ When ``NORMALIZE`` option is specified, the path is :ref:`normalized
.. code-block:: cmake
- cmake_path(CONVERT <input> TO_CMAKE_PATH_LIST <output> [NORMALIZE])
+ cmake_path(CONVERT <input> TO_CMAKE_PATH_LIST <out-var> [NORMALIZE])
Converts a native ``<input>`` path into cmake-style path with forward-slashes
(``/``). On Windows, the long filename marker is taken into account. The input can
be a single path or a system search path like ``$ENV{PATH}``. A search path
will be converted to a cmake-style list separated by ``;`` characters. The
-result of the conversion is stored in the ``<output>`` variable.
+result of the conversion is stored in the ``<out-var>`` variable.
When ``NORMALIZE`` option is specified, the path is :ref:`normalized
<NORMAL_PATH>` before the conversion.
@@ -654,12 +657,12 @@ When ``NORMALIZE`` option is specified, the path is :ref:`normalized
.. code-block:: cmake
- cmake_path(CONVERT <input> TO_NATIVE_PATH_LIST <output> [NORMALIZE])
+ cmake_path(CONVERT <input> TO_NATIVE_PATH_LIST <out-var> [NORMALIZE])
Converts a cmake-style ``<input>`` path into a native path with
platform-specific slashes (``\`` on Windows and ``/`` elsewhere). The input can
be a single path or a cmake-style list. A list will be converted into a native
-search path. The result of the conversion is stored in the ``<output>``
+search path. The result of the conversion is stored in the ``<out-var>``
variable.
When ``NORMALIZE`` option is specified, the path is :ref:`normalized
@@ -688,8 +691,8 @@ Comparison
.. code-block:: cmake
- cmake_path(COMPARE <path> EQUAL <input> <output>)
- cmake_path(COMPARE <path> NOT_EQUAL <input> <output>)
+ cmake_path(COMPARE <path-var> EQUAL <input> <out-var>)
+ cmake_path(COMPARE <path-var> NOT_EQUAL <input> <out-var>)
Compares the lexical representations of the path and another path.
@@ -697,6 +700,8 @@ For testing equality, the following algorithm (pseudo-code) apply:
.. code-block:: cmake
+ # <path> is the contents of <path-var>
+
IF (NOT <path>.root_name() STREQUAL <input>.root_name())
returns FALSE
ELSEIF (<path>.has_root_directory() XOR <input>.has_root_directory())
@@ -714,43 +719,43 @@ Query
.. code-block:: cmake
- cmake_path(HAS_ROOT_NAME <path> <output>)
+ cmake_path(HAS_ROOT_NAME <path-var> <out-var>)
-Checks if ``<path>`` has ``root-name``.
+Checks if ``<path-var>`` has ``root-name``.
.. _HAS_ROOT_DIRECTORY:
.. code-block:: cmake
- cmake_path(HAS_ROOT_DIRECTORY <path> <output>)
+ cmake_path(HAS_ROOT_DIRECTORY <path-var> <out-var>)
-Checks if ``<path>`` has ``root-directory``.
+Checks if ``<path-var>`` has ``root-directory``.
.. _HAS_ROOT_PATH:
.. code-block:: cmake
- cmake_path(HAS_ROOT_PATH <path> <output>)
+ cmake_path(HAS_ROOT_PATH <path-var> <out-var>)
-Checks if ``<path>`` has root path.
+Checks if ``<path-var>`` has root path.
-Effectively, checks if ``<path>`` has ``root-name`` and ``root-directory``.
+Effectively, checks if ``<path-var>`` has ``root-name`` and ``root-directory``.
.. _HAS_FILENAME:
.. code-block:: cmake
- cmake_path(HAS_FILENAME <path> <output>)
+ cmake_path(HAS_FILENAME <path-var> <out-var>)
-Checks if ``<path>`` has a :ref:`filename <FILENAME_DEF>`.
+Checks if ``<path-var>`` has a :ref:`filename <FILENAME_DEF>`.
.. _HAS_EXTENSION:
.. code-block:: cmake
- cmake_path(HAS_EXTENSION <path> <output>)
+ cmake_path(HAS_EXTENSION <path-var> <out-var>)
-Checks if ``<path>`` has an :ref:`extension <EXTENSION_DEF>`. If the first
+Checks if ``<path-var>`` has an :ref:`extension <EXTENSION_DEF>`. If the first
character in the filename is a period, it is not treated as an extension (for
example ".profile").
@@ -758,36 +763,36 @@ example ".profile").
.. code-block:: cmake
- cmake_path(HAS_STEM <path> <output>)
+ cmake_path(HAS_STEM <path-var> <out-var>)
-Checks if ``<path>`` has stem (:ref:`GET ... STEM <GET_STEM>` returns a non
+Checks if ``<path-var>`` has stem (:ref:`GET ... STEM <GET_STEM>` returns a non
empty path).
.. _HAS_RELATIVE_PATH:
.. code-block:: cmake
- cmake_path(HAS_RELATIVE_PATH <path> <output>)
+ cmake_path(HAS_RELATIVE_PATH <path-var> <out-var>)
-Checks if ``<path>`` has relative path (`GET_RELATIVE_PATH`_ returns a
+Checks if ``<path-var>`` has relative path (`GET_RELATIVE_PATH`_ returns a
non-empty path).
.. _HAS_PARENT_PATH:
.. code-block:: cmake
- cmake_path(HAS_PARENT_PATH <path> <output>)
+ cmake_path(HAS_PARENT_PATH <path-var> <out-var>)
-Checks if ``<path>`` has parent path. The result is true except if the path is
-only composed of a :ref:`filename <FILENAME_DEF>`.
+Checks if ``<path-var>`` has parent path. The result is true except if the path
+is only composed of a :ref:`filename <FILENAME_DEF>`.
.. _IS_ABSOLUTE:
.. code-block:: cmake
- cmake_path(IS_ABSOLUTE <path> <output>)
+ cmake_path(IS_ABSOLUTE <path-var> <out-var>)
-Checks if ``<path>`` is absolute.
+Checks if ``<path-var>`` is absolute.
An absolute path is a path that unambiguously identifies the location of a file
without reference to an additional starting location.
@@ -796,7 +801,7 @@ without reference to an additional starting location.
.. code-block:: cmake
- cmake_path(IS_RELATIVE <path> <output>)
+ cmake_path(IS_RELATIVE <path-var> <out-var>)
Checks if path is relative (i.e. not :ref:`absolute <IS_ABSOLUTE>`).
@@ -804,9 +809,9 @@ Checks if path is relative (i.e. not :ref:`absolute <IS_ABSOLUTE>`).
.. code-block:: cmake
- cmake_path(IS_PREFIX <path> <input> [NORMALIZE] <output>)
+ cmake_path(IS_PREFIX <path-var> <input> [NORMALIZE] <out-var>)
-Checks if ``<path>`` is the prefix of ``<input>``.
+Checks if ``<path-var>`` is the prefix of ``<input>``.
When ``NORMALIZE`` option is specified, the paths are :ref:`normalized
<NORMAL_PATH>` before the check.
@@ -818,11 +823,11 @@ Hashing
.. code-block:: cmake
- cmake_path(HASH <path> [NORMALIZE] <output>)
+ cmake_path(HASH <path-var> [NORMALIZE] <out-var>)
-Compute hash value of ``<path>`` such that if for two paths (``p1`` and ``p2``)
-are equal (:ref:`COMPARE ... EQUAL <COMPARE>`) then hash value of p1 is equal
-to hash value of p2.
+Compute hash value of ``<path-var>`` such that if for two paths (``p1`` and
+``p2``) are equal (:ref:`COMPARE ... EQUAL <COMPARE>`) then hash value of p1 is
+equal to hash value of p2.
When ``NORMALIZE`` option is specified, the paths are :ref:`normalized
<NORMAL_PATH>` before the check.
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index 46d1a05..8d66a9b 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -6,8 +6,9 @@ Copy a file to another location and modify its contents.
.. code-block:: cmake
configure_file(<input> <output>
+ [FILE_PERMISSIONS <permissions>...]
[COPYONLY] [ESCAPE_QUOTES] [@ONLY]
- [NO_SOURCE_PERMISSIONS]
+ [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
[NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
Copies an ``<input>`` file to an ``<output>`` file and substitutes
@@ -72,6 +73,9 @@ The arguments are:
If the path names an existing directory the output file is placed
in that directory with the same file name as the input file.
+``FILE_PERMISSIONS <permissions>...``
+ Use user provided permissions for the output file.
+
``COPYONLY``
Copy the file without replacing any variable references or other
content. This option may not be used with ``NEWLINE_STYLE``.
@@ -83,11 +87,14 @@ The arguments are:
Restrict variable replacement to references of the form ``@VAR@``.
This is useful for configuring scripts that use ``${VAR}`` syntax.
- ``NO_SOURCE_PERMISSIONS``
+``NO_SOURCE_PERMISSIONS``
Does not transfer the file permissions of the original file to the copy.
The copied file permissions default to the standard 644 value
(-rw-r--r--).
+``USE_SOURCE_PERMISSIONS``
+ Transfer the file permissions of the original file to the output file.
+
``NEWLINE_STYLE <style>``
Specify the newline style for the output file. Specify
``UNIX`` or ``LF`` for ``\n`` newlines, or specify
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index a6f141a..268c307 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -118,9 +118,17 @@ Options:
This is analogous to the ``tee`` Unix command.
``COMMAND_ERROR_IS_FATAL <ANY|LAST>``
- ``COMMAND_ERROR_IS_FATAL ANY`` option stops processing if any command fails.
- ``COMMAND_ERROR_IS_FATAL LAST`` option stops processing if the last command
- in the command list fails.
+ The option following ``COMMAND_ERROR_IS_FATAL`` determines the behavior when
+ an error is encountered:
+
+ ``ANY``
+ If any of the commands in the list of commands fail, the
+ ``execute_process()`` command halts with an error.
+
+ ``LAST``
+ If the last command in the list of commands fails, the
+ ``execute_process()`` command halts with an error. Commands earlier in the
+ list will not cause a fatal error.
If more than one ``OUTPUT_*`` or ``ERROR_*`` option is given for the
same pipe the precedence is not specified.
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 4210bd4..b406e10 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -54,7 +54,7 @@ Synopsis
file({`TO_CMAKE_PATH`_ | `TO_NATIVE_PATH`_} <path> <out-var>)
`Transfer`_
- file(`DOWNLOAD`_ <url> <file> [...])
+ file(`DOWNLOAD`_ <url> [<file>] [...])
file(`UPLOAD`_ <file> <url> [...])
`Locking`_
@@ -498,8 +498,9 @@ from the input content to produce the output content. The options are:
See policy :policy:`CMP0070`.
``TARGET <target>``
- Specify target which to use when evaluating generator expressions. Enables
- use of generator expressions requiring a target.
+ Specify which target to use when evaluating generator expressions that
+ require a target for evaluation (e.g. ``$<COMPILE_FEATURES:...>``,
+ ``$<TARGET_PROPERTY:prop>``).
Exactly one ``CONTENT`` or ``INPUT`` option must be given. A specific
``OUTPUT`` file may be named by at most one invocation of ``file(GENERATE)``.
@@ -763,7 +764,8 @@ which would make them unable to support a hard link.
.. code-block:: cmake
- file(CHMOD <files>... <directories>... [PERMISSIONS <permissions>...]
+ file(CHMOD <files>... <directories>...
+ [PERMISSIONS <permissions>...]
[FILE_PERMISSIONS <permissions>...]
[DIRECTORY_PERMISSIONS <permissions>...])
@@ -775,34 +777,36 @@ Valid permissions are ``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``,
Valid combination of keywords are:
``PERMISSIONS``
- all items are changed
+ All items are changed.
``FILE_PERMISSIONS``
- only files are changed
+ Only files are changed.
``DIRECTORY_PERMISSIONS``
- only directories are changed
+ Only directories are changed.
``PERMISSIONS`` and ``FILE_PERMISSIONS``
- ``FILE_PERMISSIONS`` overrides ``PERMISSIONS`` for files
+ ``FILE_PERMISSIONS`` overrides ``PERMISSIONS`` for files.
``PERMISSIONS`` and ``DIRECTORY_PERMISSIONS``
- ``DIRECTORY_PERMISSIONS`` overrides ``PERMISSIONS`` for directories
+ ``DIRECTORY_PERMISSIONS`` overrides ``PERMISSIONS`` for directories.
``FILE_PERMISSIONS`` and ``DIRECTORY_PERMISSIONS``
- use ``FILE_PERMISSIONS`` for files and ``DIRECTORY_PERMISSIONS`` for
- directories
+ Use ``FILE_PERMISSIONS`` for files and ``DIRECTORY_PERMISSIONS`` for
+ directories.
.. _CHMOD_RECURSE:
.. code-block:: cmake
- file(CHMOD_RECURSE <files>... <directories>... PERMISSIONS <permissions>...
- FILE_PERMISSIONS <permissions>... DIRECTORY_PERMISSIONS <permissions>...)
+ file(CHMOD_RECURSE <files>... <directories>...
+ [PERMISSIONS <permissions>...]
+ [FILE_PERMISSIONS <permissions>...]
+ [DIRECTORY_PERMISSIONS <permissions>...])
Same as `CHMOD`_, but change the permissions of files and directories present in
-the ``<directories>..`` recursively.
+the ``<directories>...`` recursively.
Path Conversion
^^^^^^^^^^^^^^^
@@ -859,11 +863,11 @@ Transfer
file(DOWNLOAD <url> [<file>] [<options>...])
file(UPLOAD <file> <url> [<options>...])
-The ``DOWNLOAD`` mode downloads the given ``<url>`` to a local ``<file>``. If
-``<file>`` is not specified for ``file(DOWNLOAD)``, the file is not saved. This
-can be useful if you want to know if a file can be downloaded (for example, to
-check that it exists) without actually saving it anywhere. The ``UPLOAD`` mode
-uploads a local ``<file>`` to a given ``<url>``.
+The ``DOWNLOAD`` subcommand downloads the given ``<url>`` to a local ``<file>``.
+If ``<file>`` is not specified for ``file(DOWNLOAD)``, the file is not saved.
+This can be useful if you want to know if a file can be downloaded (for example,
+to check that it exists) without actually saving it anywhere. The ``UPLOAD``
+mode uploads a local ``<file>`` to a given ``<url>``.
Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
@@ -986,8 +990,7 @@ Archiving
file(ARCHIVE_CREATE OUTPUT <archive>
PATHS <paths>...
[FORMAT <format>]
- [COMPRESSION <compression>]
- [COMPRESSION_LEVEL <compression level>]
+ [COMPRESSION <compression> [COMPRESSION_LEVEL <compression-level>]]
[MTIME <mtime>]
[VERBOSE])
@@ -1005,9 +1008,9 @@ compression. The other formats use no compression by default, but can be
directed to do so with the ``COMPRESSION`` option. Valid values for
``<compression>`` are ``None``, ``BZip2``, ``GZip``, ``XZ``, and ``Zstd``.
-Compression level can be specied by using ``COMPRESSION_LEVEL`` option.
-Compression level should be between 0-9. 0 is the default compression.
-``COMPRESSION`` option must be specified for ``COMPRESSION_LEVEL``.
+The compression level can be specified with the ``COMPRESSION_LEVEL`` option.
+The ``<compression-level>`` should be between 0-9, with the default being 0.
+The ``COMPRESSION`` option must be present when ``COMPRESSION_LEVEL`` is given.
.. note::
With ``FORMAT`` set to ``raw`` only one file will be compressed with the
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 87265ce..1be2e09 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -44,7 +44,8 @@ specified:
* A version range with the format ``versionMin...[<]versionMax`` where
``versionMin`` and ``versionMax`` have the same format as the single
version. By default, both end points are included. By specifying ``<``,
- the upper end point will be excluded.
+ the upper end point will be excluded. Version ranges are only supported
+ with CMake 3.19 or later.
The ``EXACT`` option requests that the version be matched exactly. This option
is incompatible with the specification of a version range.
diff --git a/Help/command/separate_arguments.rst b/Help/command/separate_arguments.rst
index 3c094aa..69fb726 100644
--- a/Help/command/separate_arguments.rst
+++ b/Help/command/separate_arguments.rst
@@ -37,7 +37,7 @@ be one of the following keywords:
``PROGRAM``
The first item in ``<args>`` is assumed to be an executable and will be
- search in the system search path or left as a full path. If not found,
+ searched in the system search path or left as a full path. If not found,
``<variable>`` will be empty. Otherwise, ``<variable>`` is a list of 2
elements:
diff --git a/Help/command/site_name.rst b/Help/command/site_name.rst
index 1bcaead..09b5a9f 100644
--- a/Help/command/site_name.rst
+++ b/Help/command/site_name.rst
@@ -6,3 +6,7 @@ Set the given variable to the name of the computer.
.. code-block:: cmake
site_name(variable)
+
+On UNIX-like platforms, if the variable ``HOSTNAME`` is set, its value
+will be executed as a command expected to print out the host name,
+much like the ``hostname`` command-line tool.
diff --git a/Help/command/string.rst b/Help/command/string.rst
index 0bc2b48..51f8d82 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -484,12 +484,22 @@ where each ``x`` represents a lower case hexadecimal character.
Where required, an uppercase representation can be requested
with the optional ``UPPER`` flag.
+.. _JSON:
+
JSON
^^^^
-.. _JSON:
+Functionality for querying a JSON string.
-Functionality for querying a JSON string
+.. note::
+ In each of the following JSON-related subcommands, if the optional
+ ``ERROR_VARIABLE`` argument is given, errors will be reported in
+ ``<error-variable>`` and the ``<out-var>`` will be set to
+ ``<member|index>-[<member|index>...]-NOTFOUND`` with the path elements
+ up to the point where the error occurred, or just ``NOTFOUND`` if there
+ is no relevant path. If an error occurs but the ``ERROR_VARIABLE``
+ option is not present, a fatal error message is generated. If no error
+ occurs, the ``<error-variable>`` will be set to ``NOTFOUND``.
.. _GET:
.. code-block:: cmake
@@ -522,7 +532,7 @@ will be set to one of ``NULL``, ``NUMBER``, ``STRING``, ``BOOLEAN``,
MEMBER <json-string>
[<member|index> ...] <index>)
-Get the name of the ``<index>``:th member in ``<json-string>`` at the location
+Get the name of the ``<index>``-th member in ``<json-string>`` at the location
given by the list of ``<member|index>`` arguments.
Requires an element of object type.
@@ -534,7 +544,7 @@ Requires an element of object type.
Get the length of an element in ``<json-string>`` at the location
given by the list of ``<member|index>`` arguments.
-Required an element of array or object type.
+Requires an element of array or object type.
.. _REMOVE:
.. code-block:: cmake
@@ -544,7 +554,7 @@ Required an element of array or object type.
Remove an element from ``<json-string>`` at the location
given by the list of ``<member|index>`` arguments. The JSON string
-without the removed element will we written in ``<out-var>``.
+without the removed element will be stored in ``<out-var>``.
.. _SET:
.. code-block:: cmake
@@ -563,13 +573,6 @@ The contents of ``<value>`` should be valid JSON.
EQUAL <json-string1> <json-string2>)
Compare the two JSON objects given by ``<json-string1>`` and ``<json-string2>``
-for equality
-
-
-If the optional ``ERROR_VARIABLE`` argument is given errors will be
-reported in ``<error-variable>``. If no error occurs the ``<error-variable>``
-will be set to ``NOTFOUND``. If ``ERROR_VARIABLE`` is not set a CMake error
-will be issued.
-When an error occurs the ``<out-var>`` will be set to
-``<member|index>-[<member|index>...]-NOTFOUND`` with the path elements up to
-the point where the error occurred.
+for equality. The contents of ``<json-string1>`` and ``<json-string2>``
+should be valid JSON. The ``<out-var>`` will be set to a true value if the
+JSON objects are considered equal, or a false value otherwise.
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
index 653b8d7..07fb937 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -15,7 +15,8 @@ Specifies sources to use when building a target and/or its dependents.
Relative source file paths are interpreted as being relative to the current
source directory (i.e. :variable:`CMAKE_CURRENT_SOURCE_DIR`). The
named ``<target>`` must have been created by a command such as
-:command:`add_executable` or :command:`add_library` and must not be an
+:command:`add_executable` or :command:`add_library` or
+:command:`add_custom_target` and must not be an
:ref:`ALIAS target <Alias Targets>`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
@@ -27,7 +28,8 @@ items will populate the :prop_tgt:`SOURCES` property of
when building dependents. (:ref:`IMPORTED targets <Imported Targets>`
only support ``INTERFACE`` items because they are not build targets.)
The following arguments specify sources. Repeated calls for the same
-``<target>`` append items in the order called.
+``<target>`` append items in the order called. The targets created by
+:command:`add_custom_target` can only have ``PRIVATE`` scope.
Arguments to ``target_sources`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
diff --git a/Help/cpack_gen/external.rst b/Help/cpack_gen/external.rst
index 7ef1071..e54b356 100644
--- a/Help/cpack_gen/external.rst
+++ b/Help/cpack_gen/external.rst
@@ -285,6 +285,6 @@ Variables specific to CPack External generator
.. variable:: CPACK_EXTERNAL_BUILT_PACKAGES
The ``CPACK_EXTERNAL_PACKAGE_SCRIPT`` script may set this list variable to the
- full paths of generated package files. CPack copy these files from the stage
- directory back to the top build directory and possibly produce checksum files
- if the :variable:`CPACK_PACKAGE_CHECKSUM` is set.
+ full paths of generated package files. CPack will copy these files from the
+ staging directory back to the top build directory and possibly produce
+ checksum files if the :variable:`CPACK_PACKAGE_CHECKSUM` is set.
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index d9c8ed7..281986f 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -11,7 +11,7 @@ Synopsis
cmake-gui [<options>]
cmake-gui [<options>] {<path-to-source> | <path-to-existing-build>}
cmake-gui [<options>] -S <path-to-source> -B <path-to-build>
- cmake-gui [<options>] -S <path-to-source> --preset=<preset-name>
+ cmake-gui [<options>] --browse-manual
Description
===========
@@ -38,8 +38,11 @@ Options
If the directory doesn't already exist CMake will make it.
``--preset=<preset-name>``
- Name of the preset to use from the project's ``CMakePresets.json`` file, if it
- has one.
+ Name of the preset to use from the project's
+ :manual:`presets <cmake-presets(7)>` files, if it has them.
+
+``--browse-manual``
+ Open the CMake reference manual in a browser and immediately exit.
.. include:: OPTIONS_HELP.txt
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index 7040ad5..62c4b7c 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -130,34 +130,34 @@ Format
the ``architecture`` field instead.
``architecture``
+ ``toolset``
- An optional string representing the platform name to use for generators
- that support platforms.
+ 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:
- ``toolset``
+ ``value``
- An optional string representing the toolset name to use for generators
- that support toolsets.
+ An optional string representing the value.
- ``cmakeGeneratorConfig``
+ ``strategy``
- An optional string telling CMake how to handle the ``architecture`` and
- ``toolset`` fields. Valid values are:
+ An optional string telling CMake how to handle the ``architecture`` or
+ ``toolset`` field. Valid values are:
- ``"default"``
+ ``"set"``
- Set the platform and toolset using the ``architecture`` and ``toolset``
- fields respectively. On non-Visual Studio generators, this will result
- in an error if ``architecture`` or ``toolset`` are set.
+ Set the respective value. This will result in an error for generators
+ that do not support the respective field.
- ``"ignore"``
+ ``"external"``
- Do not set the platform or toolset at all, even on Visual Studio
- generators. 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 ``architecture`` and ``toolset`` fields. In that case, CMake
- will ignore ``architecture`` and ``toolset``, but the IDE can use them
- to set up the environment before invoking CMake.
+ 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
+ ``architecture`` and ``toolset`` fields. In that case, CMake will
+ ignore the field, but the IDE can use them to set up the environment
+ before invoking CMake.
``binaryDir``
@@ -308,6 +308,11 @@ Format
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.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 17d0882..f0c9d99 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -336,6 +336,7 @@ Variables that Control the Build
/variable/CMAKE_ANDROID_ARM_MODE
/variable/CMAKE_ANDROID_ARM_NEON
/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES
+ /variable/CMAKE_ANDROID_EXCEPTIONS
/variable/CMAKE_ANDROID_GUI
/variable/CMAKE_ANDROID_JAR_DEPENDENCIES
/variable/CMAKE_ANDROID_JAR_DIRECTORIES
@@ -349,6 +350,7 @@ Variables that Control the Build
/variable/CMAKE_ANDROID_PROCESS_MAX
/variable/CMAKE_ANDROID_PROGUARD
/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH
+ /variable/CMAKE_ANDROID_RTTI
/variable/CMAKE_ANDROID_SECURE_PROPS_PATH
/variable/CMAKE_ANDROID_SKIP_ANT_STEP
/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN
@@ -521,6 +523,7 @@ Variables for Languages
/variable/CMAKE_LANG_ARCHIVE_APPEND
/variable/CMAKE_LANG_ARCHIVE_CREATE
/variable/CMAKE_LANG_ARCHIVE_FINISH
+ /variable/CMAKE_LANG_BYTE_ORDER
/variable/CMAKE_LANG_COMPILER
/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN
/variable/CMAKE_LANG_COMPILER_ID
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index b581e48..7efe0cd 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -12,7 +12,6 @@ Synopsis
cmake [<options>] <path-to-source>
cmake [<options>] <path-to-existing-build>
cmake [<options>] -S <path-to-source> -B <path-to-build>
- cmake [<options>] -S <path-to-source> --preset=<preset-name>
`Build a Project`_
cmake --build <dir> [<options>] [-- <build-tool-options>]
@@ -149,22 +148,6 @@ source and build trees and generate a buildsystem:
$ cmake -S src -B build
-``cmake [<options>] -S <path-to-source> --preset=<preset-name>``
- Uses ``<path-to-source>`` as the source tree and reads a
- :manual:`preset <cmake-presets(7)>` from
- ``<path-to-source>/CMakePresets.json`` and
- ``<path-to-source>/CMakeUserPresets.json``. The preset specifies the
- generator and the build directory, and optionally a list of variables and
- other arguments to pass to CMake. The :manual:`CMake GUI <cmake-gui(1)>` can
- also recognize ``CMakePresets.json`` and ``CMakeUserPresets.json`` files. For
- full details on these files, see :manual:`cmake-presets(7)`.
-
- The presets are read before all other command line options. The options
- specified by the preset (variables, generator, etc.) can all be overridden by
- manually specifying them on the command line. For example, if the preset sets
- a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a
- ``-D`` argument, the value ``2`` is preferred.
-
In all cases the ``<options>`` may be zero or more of the `Options`_ below.
After generating a buildsystem one may use the corresponding native
@@ -394,6 +377,21 @@ Options
about:tracing tab of Google Chrome or using a plugin for a tool like Trace
Compass.
+``--preset=<preset>``
+ Reads a :manual:`preset <cmake-presets(7)>` from
+ ``<path-to-source>/CMakePresets.json`` and
+ ``<path-to-source>/CMakeUserPresets.json``. The preset specifies the
+ generator and the build directory, and optionally a list of variables and
+ other arguments to pass to CMake. The :manual:`CMake GUI <cmake-gui(1)>` can
+ also recognize ``CMakePresets.json`` and ``CMakeUserPresets.json`` files. For
+ full details on these files, see :manual:`cmake-presets(7)`.
+
+ The presets are read before all other command line options. The options
+ specified by the preset (variables, generator, etc.) can all be overridden by
+ manually specifying them on the command line. For example, if the preset sets
+ a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a
+ ``-D`` argument, the value ``2`` is preferred.
+
.. _`Build Tool Mode`:
Build a Project
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index b5bb1c1..e947232 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -1142,6 +1142,20 @@ Additional configuration settings include:
* `CTest Script`_ variable: none
* :module:`CTest` module variable: ``DRMEMORY_COMMAND_OPTIONS``
+``CudaMemcheckCommand``
+ Specify a ``MemoryCheckCommand`` that is known to be a command-line
+ compatible with cuda-memcheck or compute-sanitizer.
+
+ * `CTest Script`_ variable: none
+ * :module:`CTest` module variable: ``CUDA_MEMCHECK_COMMAND``
+
+``CudaMemcheckCommandOptions``
+ Specify command-line options to the ``CudaMemcheckCommand`` tool.
+ They will be placed prior to the test command line.
+
+ * `CTest Script`_ variable: none
+ * :module:`CTest` module variable: ``CUDA_MEMCHECK_COMMAND_OPTIONS``
+
.. _`CTest Submit Step`:
CTest Submit Step
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json
index ba4568f..57b063e 100644
--- a/Help/manual/presets/schema.json
+++ b/Help/manual/presets/schema.json
@@ -85,19 +85,57 @@
"description": "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). 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."
},
"architecture": {
- "type": "string",
- "description": "An optional string representing the platform name to use for Visual Studio generators."
+ "anyOf": [
+ {
+ "type": "string",
+ "description": "An optional string representing the platform for generators that support it."
+ },
+ {
+ "type": "object",
+ "description": "An optional object representing the platform for generators that support it.",
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "An optional string representing the value."
+ },
+ "strategy": {
+ "type": "string",
+ "description": "An optional string telling CMake how to handle the 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 architecture and toolset fields. In that case, CMake will ignore the field, but the IDE can use them to set up the environment before invoking CMake.",
+ "enum": [
+ "set",
+ "external"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
},
"toolset": {
- "type": "string",
- "description": "An optional string representing the toolset name to use for Visual Studio generators."
- },
- "cmakeGeneratorConfig": {
- "type": "string",
- "description": "An optional string telling CMake how to handle the architecture and toolset fields. Valid values are: \"default\": Set the platform and toolset using the architecture and toolset fields respectively. On non-Visual Studio generators, this will result in an error if architecture or toolset are set. \"ignore\": Do not set the platform or toolset at all, even on Visual Studio generators. 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 architecture and toolset fields. In that case, CMake will ignore architecture and toolset, but the IDE can use them to set up the environment before invoking CMake.",
- "enum": [
- "default",
- "ignore"
+ "anyOf": [
+ {
+ "type": "string",
+ "description": "An optional string representing the toolset for generators that support it."
+ },
+ {
+ "type": "object",
+ "description": "An optional object representing the toolset for generators that support it.",
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "An optional string representing the value."
+ },
+ "strategy": {
+ "type": "string",
+ "description": "An optional string telling CMake how to handle the 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 architecture and toolset fields. In that case, CMake will ignore the field, but the IDE can use them to set up the environment before invoking CMake.",
+ "enum": [
+ "set",
+ "external"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
]
},
"binaryDir": {
diff --git a/Help/policy/CMP0112.rst b/Help/policy/CMP0112.rst
index 3eab6d2..78a9055 100644
--- a/Help/policy/CMP0112.rst
+++ b/Help/policy/CMP0112.rst
@@ -21,13 +21,13 @@ file name components no longer add a dependency on the evaluated target.
In CMake 3.18 and lower a dependency on the evaluated target of the above
-generator expressions would be always added. CMake 3.19 and above prefer
+generator expressions would always be added. CMake 3.19 and above prefer
to not add this dependency. This policy provides compatibility for projects
that have not been updated to expect the new behavior.
The ``OLD`` behavior for this policy is to add a dependency on the evaluated
-target for the the above generator expressions. The ``NEW`` behavior of
-this policy is to not add a dependency on the evaluated target for the the
+target for the above generator expressions. The ``NEW`` behavior of
+this policy is to not add a dependency on the evaluated target for the
above generator expressions.
This policy was introduced in CMake version 3.19. Unlike many policies,
diff --git a/Help/policy/CMP0114.rst b/Help/policy/CMP0114.rst
index 1bc1216..ae48478 100644
--- a/Help/policy/CMP0114.rst
+++ b/Help/policy/CMP0114.rst
@@ -47,7 +47,7 @@ a revised design to address these problems:
* The ``download``, ``update``, and ``patch`` steps are independent.
* The ``configure``, ``build``, ``test``, and ``install`` steps are not.
- For custom steps, the :command:`ExternalProject_Add_Step` command provies
+ For custom steps, the :command:`ExternalProject_Add_Step` command provides
an ``INDEPENDENT`` option to mark them as independent. It is an error to
mark a step as independent if it depends on other steps that are not. Note
that this use of the term "independent" refers only to independence from
diff --git a/Help/release/3.19.rst b/Help/release/3.19.rst
index 93e060e..be63e9d 100644
--- a/Help/release/3.19.rst
+++ b/Help/release/3.19.rst
@@ -14,7 +14,8 @@ Presets
-------
* :manual:`cmake(1)` and :manual:`cmake-gui(1)` now recognize
- ``CMakePresets.json`` and ``CMakeUserPresets.json`` files.
+ ``CMakePresets.json`` and ``CMakeUserPresets.json`` files (see
+ :manual:`cmake-presets(7)`).
Generators
----------
@@ -50,6 +51,8 @@ Languages
- separable compilation (:prop_tgt:`CUDA_SEPARABLE_COMPILATION`), and
- finding scattered toolkit installations when cross-compiling.
+* ``CUDA`` language support now works on QNX.
+
File-Based API
--------------
@@ -84,9 +87,6 @@ Commands
* The :command:`cmake_language` command gained a ``DEFER`` mode to
schedule command calls to occur at the end of processing a directory.
-* The :command:`cmake_path` command was added for operations on
- filesystem paths.
-
* The :command:`configure_file` command gained a ``NO_SOURCE_PERMISSIONS``
option to suppress copying the input file's permissions to the output file.
@@ -105,21 +105,22 @@ Commands
* The :command:`file(GENERATE)` command gained a new ``TARGET`` keyword to
support resolving target-dependent generator expressions.
-* The :command:`file` gained sub-command `REAL_PATH` to compute a path with
- symlinks resolved.
+* The :command:`file` command gained a new ``REAL_PATH`` sub-command to
+ compute a path with symlinks resolved.
* The :command:`find_package` command learned to handle a version range.
-* The :command:`separate_arguments` command gained new ``PROGRAM`` option to
- search program.
+* The :command:`separate_arguments` command gained a new ``PROGRAM`` option.
+ It allows the arguments to be treated as a program invocation and will
+ resolve the executable to a full path if it can be found.
-* The :command:`set_property`, :command:`get_property`,
- and :command:`get_directory_property` commands' ``DIRECTORY``
- options now accept references to binary directory paths,
- such as the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
+* The ``DIRECTORY`` option of the :command:`set_property`,
+ :command:`get_property`, and :command:`get_directory_property` commands
+ now accepts references to binary directory paths, such as the value of
+ :variable:`CMAKE_CURRENT_BINARY_DIR`.
-* The :command:`string` command gained set of new ``JSON`` sub commands
- to provide JSON parsing capabilities.
+* The :command:`string` command gained a set of new ``JSON`` sub commands
+ that provide JSON parsing capabilities.
Variables
---------
@@ -134,6 +135,9 @@ Variables
initialize the new :prop_tgt:`OPTIMIZE_DEPENDENCIES` target property and
avoid unnecessarily building dependencies for a static library.
+* The :variable:`CMAKE_PCH_INSTANTIATE_TEMPLATES` variable was added to
+ initialize the new :prop_tgt:`PCH_INSTANTIATE_TEMPLATES` target property.
+
* The :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` variable
was added to tell the :ref:`Visual Studio Generators` what maximum
version of the Windows SDK to choose.
@@ -149,8 +153,8 @@ Properties
* The :prop_tgt:`PCH_INSTANTIATE_TEMPLATES` target property was added to enable
template instantiation in the precompiled header. This is enabled by default
- and offers a roughly 20% compile time improvement. Currently only supported
- by Clang 11.
+ and may significantly improve compile times. Currently only supported for
+ Clang (version 11 or later).
* The :prop_tgt:`WIN32_EXECUTABLE` target property now supports
:manual:`generator expressions <cmake-generator-expressions(7)>`.
@@ -175,19 +179,20 @@ Modules
:module:`CheckCXXSourceRuns` to more languages.
It also supports the ``CUDA`` language.
-* :module:`CMakePackageConfigHelpers` module learned to manage version range.
+* The :module:`CMakePackageConfigHelpers` module gained support for version
+ ranges.
* The :module:`FindCUDAToolkit` module gained support for finding CUDA
toolkits that do not contain ``nvcc``, as well as for finding scattered
toolkit installations when cross-compiling.
* The :module:`FindPackageHandleStandardArgs` module learned to handle
- version range. It also gained the ``find_package_check_version()`` command to
- check the validity of a version against version-related arguments of
+ version ranges. It also gained the ``find_package_check_version()`` command
+ to check the validity of a version against version-related arguments of
:command:`find_package` command.
* The :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
- modules gained the capability to manage a version range.
+ modules gained the ability to handle a version range.
* The :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
modules provide, respectively, the variable ``Python3_LINK_OPTIONS``,
@@ -195,14 +200,14 @@ Modules
* The :module:`FindSDL` module now provides:
- * imported target ``SDL::SDL``,
+ * An imported target ``SDL::SDL``.
- * result variables ``SDL_LIBRARIES`` and ``SDL_INCLUDE_DIRS``,
+ * Result variables ``SDL_LIBRARIES`` and ``SDL_INCLUDE_DIRS``.
- * version variables ``SDL_VERSION``, ``SDL_VERSION_MAJOR``
+ * Version variables ``SDL_VERSION``, ``SDL_VERSION_MAJOR``,
``SDL_VERSION_MINOR``, and ``SDL_VERSION_PATCH``.
-* :module:`FindSWIG` module gains the capability to manage a version range.
+* The :module:`FindSWIG` module gained the ability to handle a version range.
* The :module:`FindTIFF` module gained a ``CXX`` component to
find the ``tiffxx`` library containing C++ bindings.
@@ -211,15 +216,17 @@ Modules
target and associated ``Vulkan_GLSLC_EXECUTABLE`` variable which contain
the path to the GLSL SPIR-V compiler.
-* :module:`UseSWIG` module gains new source file properties ``OUTPUT_DIR`` and
- ``OUTFILE_DIR`` to manage output directories on per source basis.
+* The :module:`UseSWIG` module gained support for new source file properties
+ ``OUTPUT_DIR`` and ``OUTFILE_DIR`` to manage output directories on a
+ per-source basis.
CTest
-----
-* :manual:`ctest(1)` now supports ``compute-sanitizer`` (``cuda-memcheck``) as
- ``CTEST_MEMORYCHECK_COMMAND``. The different tools (memcheck, racecheck,
- synccheck, initcheck) supplied by ``compute-sanitizer`` can be selected by
+* :manual:`ctest(1)` now supports the CUDA ``compute-sanitizer`` checker
+ (previously known as ``cuda-memcheck``) as the ``CTEST_MEMORYCHECK_COMMAND``.
+ The different tools (``memcheck``, ``racecheck``, ``synccheck`` and
+ ``initcheck``) supported by ``compute-sanitizer`` can be selected by
adding appropriate flags to the ``CTEST_MEMORYCHECK_COMMAND_OPTIONS``
variable. The default flags are ``--tool memcheck --leak-check full``.
diff --git a/Help/release/dev/ExternalData-suppress-progress.rst b/Help/release/dev/ExternalData-suppress-progress.rst
new file mode 100644
index 0000000..bf4183f
--- /dev/null
+++ b/Help/release/dev/ExternalData-suppress-progress.rst
@@ -0,0 +1,6 @@
+ExternalData-suppress-progress
+------------------------------
+
+* The :module:`ExternalData` module ``ExternalData_add_target`` now supports a
+ ``SHOW_PROGRESS <bool>`` argument to suppress progress output during the
+ build.
diff --git a/Help/release/dev/FindPython-FIND_UNVERSIONED_NAMES.rst b/Help/release/dev/FindPython-FIND_UNVERSIONED_NAMES.rst
new file mode 100644
index 0000000..a0b5838
--- /dev/null
+++ b/Help/release/dev/FindPython-FIND_UNVERSIONED_NAMES.rst
@@ -0,0 +1,6 @@
+FindPython-FIND_UNVERSIONED_NAMES
+---------------------------------
+
+* Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
+ gain the capability to control how interpreter unversioned names are
+ searched.
diff --git a/Help/release/dev/abi-byte-order.rst b/Help/release/dev/abi-byte-order.rst
new file mode 100644
index 0000000..e8beebc
--- /dev/null
+++ b/Help/release/dev/abi-byte-order.rst
@@ -0,0 +1,5 @@
+abi-byte-order
+--------------
+
+* The :variable:`CMAKE_<LANG>_BYTE_ORDER` variable was added to provide the
+ target architecture byte order detected from the toolchain.
diff --git a/Help/release/dev/cmake_path.rst b/Help/release/dev/cmake_path.rst
new file mode 100644
index 0000000..9d252ae
--- /dev/null
+++ b/Help/release/dev/cmake_path.rst
@@ -0,0 +1,5 @@
+cmake_path
+----------
+
+* The :command:`cmake_path` command was added for operations on
+ filesystem paths.
diff --git a/Help/release/dev/configure_file-user-permissions.rst b/Help/release/dev/configure_file-user-permissions.rst
new file mode 100644
index 0000000..b757fb1
--- /dev/null
+++ b/Help/release/dev/configure_file-user-permissions.rst
@@ -0,0 +1,6 @@
+configure_file-user-permissions
+-------------------------------
+
+* The :command:`configure_file` command gained a ``USE_SOURCE_PERMISSIONS``
+ and ``FILE_PERMISSIONS`` option to support copying of permissions of source
+ file and specifying user defined permissions.
diff --git a/Help/release/dev/target-sources-supports-custom-target.rst b/Help/release/dev/target-sources-supports-custom-target.rst
new file mode 100644
index 0000000..131fb3a
--- /dev/null
+++ b/Help/release/dev/target-sources-supports-custom-target.rst
@@ -0,0 +1,4 @@
+target-sources-supports-custom-target
+-------------------------------------
+
+* The :command:`target_sources` now supports custom targets.
diff --git a/Help/variable/CMAKE_ANDROID_EXCEPTIONS.rst b/Help/variable/CMAKE_ANDROID_EXCEPTIONS.rst
new file mode 100644
index 0000000..6dd44f8
--- /dev/null
+++ b/Help/variable/CMAKE_ANDROID_EXCEPTIONS.rst
@@ -0,0 +1,7 @@
+CMAKE_ANDROID_EXCEPTIONS
+------------------------
+
+.. versionadded:: 3.20
+
+When :ref:`Cross Compiling for Android with the NDK`, this variable may be set
+to specify whether exceptions are enabled.
diff --git a/Help/variable/CMAKE_ANDROID_RTTI.rst b/Help/variable/CMAKE_ANDROID_RTTI.rst
new file mode 100644
index 0000000..0e98206
--- /dev/null
+++ b/Help/variable/CMAKE_ANDROID_RTTI.rst
@@ -0,0 +1,7 @@
+CMAKE_ANDROID_RTTI
+------------------
+
+.. versionadded:: 3.20
+
+When :ref:`Cross Compiling for Android with the NDK`, this variable may be set
+to specify whether RTTI is enabled.
diff --git a/Help/variable/CMAKE_BUILD_TYPE.rst b/Help/variable/CMAKE_BUILD_TYPE.rst
index 2d35635..405f7d5 100644
--- a/Help/variable/CMAKE_BUILD_TYPE.rst
+++ b/Help/variable/CMAKE_BUILD_TYPE.rst
@@ -18,3 +18,8 @@ in a build tree configured to build type ``Debug``, CMake will see to
having :variable:`CMAKE_C_FLAGS_DEBUG <CMAKE_<LANG>_FLAGS_DEBUG>` settings get
added to the :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>` settings. See
also :variable:`CMAKE_CONFIGURATION_TYPES`.
+
+Note that configuration names are case-insensitive. The value of this
+variable will be the same as it is specified when invoking CMake.
+For instance, if ``-DCMAKE_BUILD_TYPE=ReLeAsE`` is specified, then the
+value of ``CMAKE_BUILD_TYPE`` will be ``ReLeAsE``.
diff --git a/Help/variable/CMAKE_LANG_BYTE_ORDER.rst b/Help/variable/CMAKE_LANG_BYTE_ORDER.rst
new file mode 100644
index 0000000..78f0ae6
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_BYTE_ORDER.rst
@@ -0,0 +1,20 @@
+CMAKE_<LANG>_BYTE_ORDER
+-----------------------
+
+.. versionadded:: 3.20
+
+Byte order of ``<LANG>`` compiler target architecture, if known.
+If defined and not empty, the value is one of:
+
+``BIG_ENDIAN``
+ The target architecture is Big Endian.
+
+``LITTLE_ENDIAN``
+ The target architecture is Little Endian.
+
+This is defined for languages ``C``, ``CXX``, ``OBJC``, ``OBJCXX``,
+and ``CUDA``.
+
+If :variable:`CMAKE_OSX_ARCHITECTURES` specifies multiple architectures, the
+value of ``CMAKE_<LANG>_BYTE_ORDER`` is non-empty only if all architectures
+share the same byte order.
diff --git a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
index 2452228..5204389 100644
--- a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
+++ b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
@@ -5,6 +5,6 @@ CTEST_MEMORYCHECK_TYPE
Specify the CTest ``MemoryCheckType`` setting
in a :manual:`ctest(1)` dashboard client script.
-Valid values are ``Valgrind``, ``Purify``, ``BoundsChecker``, ``DrMemory`` and
-``ThreadSanitizer``, ``AddressSanitizer``, ``LeakSanitizer``, ``MemorySanitizer``, and
-``UndefinedBehaviorSanitizer``.
+Valid values are ``Valgrind``, ``Purify``, ``BoundsChecker``, ``DrMemory``,
+``CudaMemcheck``, ``ThreadSanitizer``, ``AddressSanitizer``, ``LeakSanitizer``,
+``MemorySanitizer`` and ``UndefinedBehaviorSanitizer``.
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index eea3f5d..7f73891 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -48,6 +48,7 @@ set(CMAKE_C_LINKER_PREFERENCE 10)
# Save compiler ABI information.
set(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
set(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
+set(CMAKE_C_BYTE_ORDER "@CMAKE_C_BYTE_ORDER@")
set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
if(CMAKE_C_SIZEOF_DATA_PTR)
diff --git a/Modules/CMakeCCompilerABI.c b/Modules/CMakeCCompilerABI.c
index 08cf39b..f0ee21a 100644
--- a/Modules/CMakeCCompilerABI.c
+++ b/Modules/CMakeCCompilerABI.c
@@ -17,6 +17,8 @@ int main(int argc, char* argv[])
{
int require = 0;
require += info_sizeof_dptr[argc];
+ require += info_byte_order_big_endian[argc];
+ require += info_byte_order_little_endian[argc];
#if defined(ABI_ID)
require += info_abi[argc];
#endif
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 871e18e..d4e6e2e 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -31,6 +31,7 @@ set(CMAKE_CUDA_LINKER_PREFERENCE_PROPAGATES 1)
set(CMAKE_CUDA_SIZEOF_DATA_PTR "@CMAKE_CUDA_SIZEOF_DATA_PTR@")
set(CMAKE_CUDA_COMPILER_ABI "@CMAKE_CUDA_COMPILER_ABI@")
+set(CMAKE_CUDA_BYTE_ORDER "@CMAKE_CUDA_BYTE_ORDER@")
set(CMAKE_CUDA_LIBRARY_ARCHITECTURE "@CMAKE_CUDA_LIBRARY_ARCHITECTURE@")
if(CMAKE_CUDA_SIZEOF_DATA_PTR)
diff --git a/Modules/CMakeCUDACompilerABI.cu b/Modules/CMakeCUDACompilerABI.cu
index 702a7c5..449a079 100644
--- a/Modules/CMakeCUDACompilerABI.cu
+++ b/Modules/CMakeCUDACompilerABI.cu
@@ -8,6 +8,8 @@ int main(int argc, char* argv[])
{
int require = 0;
require += info_sizeof_dptr[argc];
+ require += info_byte_order_big_endian[argc];
+ require += info_byte_order_little_endian[argc];
#if defined(ABI_ID)
require += info_abi[argc];
#endif
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 09bdc23..a235ebb 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -60,6 +60,7 @@ set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information.
set(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
set(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
+set(CMAKE_CXX_BYTE_ORDER "@CMAKE_CXX_BYTE_ORDER@")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
if(CMAKE_CXX_SIZEOF_DATA_PTR)
diff --git a/Modules/CMakeCXXCompilerABI.cpp b/Modules/CMakeCXXCompilerABI.cpp
index 2360534..036b96e 100644
--- a/Modules/CMakeCXXCompilerABI.cpp
+++ b/Modules/CMakeCXXCompilerABI.cpp
@@ -8,6 +8,8 @@ int main(int argc, char* argv[])
{
int require = 0;
require += info_sizeof_dptr[argc];
+ require += info_byte_order_big_endian[argc];
+ require += info_byte_order_little_endian[argc];
#if defined(ABI_ID)
require += info_abi[argc];
#endif
diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h
index 45532af..c5ce4dd 100644
--- a/Modules/CMakeCompilerABI.h
+++ b/Modules/CMakeCompilerABI.h
@@ -9,6 +9,18 @@ const char info_sizeof_dptr[] = {
/* clang-format on */
};
+/* Byte order. Only one of these will have bytes in the right order. */
+static unsigned short const info_byte_order_big_endian[] = {
+ /* INFO:byte_order string for BIG_ENDIAN */
+ 0x494E, 0x464F, 0x3A62, 0x7974, 0x655F, 0x6F72, 0x6465, 0x725B,
+ 0x4249, 0x475F, 0x454E, 0x4449, 0x414E, 0x5D00, 0x0000
+};
+static unsigned short const info_byte_order_little_endian[] = {
+ /* INFO:byte_order string for LITTLE_ENDIAN */
+ 0x4E49, 0x4F46, 0x623A, 0x7479, 0x5F65, 0x726F, 0x6564, 0x5B72,
+ 0x494C, 0x5454, 0x454C, 0x455F, 0x444E, 0x4149, 0x5D4E, 0x0000
+};
+
/* Application Binary Interface. */
/* Check for (some) ARM ABIs.
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 7e5b375..67c42a2a 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -75,12 +75,25 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
message(CHECK_PASS "done")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
- file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
+ file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 32 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
+ set(ABI_SIZEOF_DPTR "NOTFOUND")
+ set(ABI_BYTE_ORDER "NOTFOUND")
+ set(ABI_NAME "NOTFOUND")
foreach(info ${ABI_STRINGS})
- if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]")
+ if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]" AND NOT ABI_SIZEOF_DPTR)
set(ABI_SIZEOF_DPTR "${CMAKE_MATCH_1}")
endif()
- if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]")
+ if("${info}" MATCHES "INFO:byte_order\\[(BIG_ENDIAN|LITTLE_ENDIAN)\\]")
+ set(byte_order "${CMAKE_MATCH_1}")
+ if(ABI_BYTE_ORDER STREQUAL "NOTFOUND")
+ # Tentatively use the value because this is the first occurrence.
+ set(ABI_BYTE_ORDER "${byte_order}")
+ elseif(NOT ABI_BYTE_ORDER STREQUAL "${byte_order}")
+ # Drop value because multiple occurrences do not match.
+ set(ABI_BYTE_ORDER "")
+ endif()
+ endif()
+ if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]" AND NOT ABI_NAME)
set(ABI_NAME "${CMAKE_MATCH_1}")
endif()
endforeach()
@@ -91,6 +104,10 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
endif()
+ if(ABI_BYTE_ORDER)
+ set(CMAKE_${lang}_BYTE_ORDER "${ABI_BYTE_ORDER}" PARENT_SCOPE)
+ endif()
+
if(ABI_NAME)
set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
endif()
diff --git a/Modules/CMakeOBJCCompiler.cmake.in b/Modules/CMakeOBJCCompiler.cmake.in
index 1555517..608adce 100644
--- a/Modules/CMakeOBJCCompiler.cmake.in
+++ b/Modules/CMakeOBJCCompiler.cmake.in
@@ -45,6 +45,7 @@ endforeach()
# Save compiler ABI information.
set(CMAKE_OBJC_SIZEOF_DATA_PTR "@CMAKE_OBJC_SIZEOF_DATA_PTR@")
set(CMAKE_OBJC_COMPILER_ABI "@CMAKE_OBJC_COMPILER_ABI@")
+set(CMAKE_OBJC_BYTE_ORDER "@CMAKE_OBJC_BYTE_ORDER@")
set(CMAKE_OBJC_LIBRARY_ARCHITECTURE "@CMAKE_OBJC_LIBRARY_ARCHITECTURE@")
if(CMAKE_OBJC_SIZEOF_DATA_PTR)
diff --git a/Modules/CMakeOBJCCompilerABI.m b/Modules/CMakeOBJCCompilerABI.m
index 8fa8511..0726cd3 100644
--- a/Modules/CMakeOBJCCompilerABI.m
+++ b/Modules/CMakeOBJCCompilerABI.m
@@ -12,6 +12,8 @@ int main(int argc, char *argv[])
{
int require = 0;
require += info_sizeof_dptr[argc];
+ require += info_byte_order_big_endian[argc];
+ require += info_byte_order_little_endian[argc];
#if defined(ABI_ID)
require += info_abi[argc];
#endif
diff --git a/Modules/CMakeOBJCXXCompiler.cmake.in b/Modules/CMakeOBJCXXCompiler.cmake.in
index b6452c4..18eb7ff 100644
--- a/Modules/CMakeOBJCXXCompiler.cmake.in
+++ b/Modules/CMakeOBJCXXCompiler.cmake.in
@@ -55,6 +55,7 @@ set(CMAKE_OBJCXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information.
set(CMAKE_OBJCXX_SIZEOF_DATA_PTR "@CMAKE_OBJCXX_SIZEOF_DATA_PTR@")
set(CMAKE_OBJCXX_COMPILER_ABI "@CMAKE_OBJCXX_COMPILER_ABI@")
+set(CMAKE_OBJCXX_BYTE_ORDER "@CMAKE_OBJCXX_BYTE_ORDER@")
set(CMAKE_OBJCXX_LIBRARY_ARCHITECTURE "@CMAKE_OBJCXX_LIBRARY_ARCHITECTURE@")
if(CMAKE_OBJCXX_SIZEOF_DATA_PTR)
diff --git a/Modules/CMakeOBJCXXCompilerABI.mm b/Modules/CMakeOBJCXXCompilerABI.mm
index 288a58c..7b9fefc 100644
--- a/Modules/CMakeOBJCXXCompilerABI.mm
+++ b/Modules/CMakeOBJCXXCompilerABI.mm
@@ -12,6 +12,8 @@ int main(int argc, char *argv[])
{
int require = 0;
require += info_sizeof_dptr[argc];
+ require += info_byte_order_big_endian[argc];
+ require += info_byte_order_little_endian[argc];
#if defined(ABI_ID)
require += info_abi[argc];
#endif
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 50d7605..1a7f9cf 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -161,8 +161,8 @@ macro.
.. note:: ``COMPATIBILITY_MODE`` ``AnyNewerVersion`` handles the version range
if any is specified (see :command:`find_package` command for the details).
- All other modes are incompatible with version range and will display an
- author warning if a one is specified.
+ All other modes are incompatible with version ranges and will display an
+ author warning if one is specified.
If ``ARCH_INDEPENDENT`` is given, the installed package version will be
considered compatible even if it was built for a different architecture than
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 8a0ef30..7529a1f 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -357,7 +357,7 @@ The following variables are for advanced uses of CPack:
.. variable:: CPACK_INSTALL_SCRIPTS
Extra CMake scripts executed by CPack during its local staging
- installation, which is done right before packaging the files.
+ installation. They are executed before installing the files to be packaged.
The scripts are not called by a standalone install (e.g.: ``make install``).
For every script, the following variables will be set:
:variable:`CMAKE_CURRENT_SOURCE_DIR`, :variable:`CMAKE_CURRENT_BINARY_DIR`
@@ -366,6 +366,33 @@ The following variables are for advanced uses of CPack:
an alternative variable for historical reasons, but its value is ignored if
``CMAKE_INSTALL_SCRIPTS`` is set and a warning will be issued.
+ See also :variable:`CPACK_PRE_BUILD_SCRIPTS` and
+ :variable:`CPACK_POST_BUILD_SCRIPTS` which can be used to specify scripts
+ to be executed later in the packaging process.
+
+.. variable:: CPACK_PRE_BUILD_SCRIPTS
+
+ List of CMake scripts to execute after CPack has installed the files to
+ be packaged into a staging directory and before producing the package(s)
+ from those files. See also :variable:`CPACK_INSTALL_SCRIPTS` and
+ :variable:`CPACK_POST_BUILD_SCRIPTS`.
+
+.. variable:: CPACK_POST_BUILD_SCRIPTS
+
+ List of CMake scripts to execute after CPack has produced the resultant
+ packages and before copying them back to the build directory.
+ See also :variable:`CPACK_INSTALL_SCRIPTS`,
+ :variable:`CPACK_PRE_BUILD_SCRIPTS` and :variable:`CPACK_PACKAGE_FILES`.
+
+.. variable:: CPACK_PACKAGE_FILES
+
+ List of package files created in the staging directory, with each file
+ provided as a full absolute path. This variable is populated by CPack
+ just before invoking the post-build scripts listed in
+ :variable:`CPACK_POST_BUILD_SCRIPTS`. It is the preferred way for the
+ post-build scripts to know the set of package files to operate on.
+ Projects should not try to set this variable themselves.
+
.. variable:: CPACK_INSTALLED_DIRECTORIES
Extra directories to install.
@@ -390,21 +417,6 @@ The following variables are for advanced uses of CPack:
select the CPack generator(s) to be used when building the ``package``
target or when running :manual:`cpack <cpack(1)>` without the ``-G`` option.
-.. variable:: CPACK_PRE_BUILD_SCRIPTS
-
- List of CMake scripts to execute after CPack has installed the files to
- be packed into a staging directory and before producing the result
- packages.
-
-.. variable:: CPACK_POST_BUILD_SCRIPTS
-
- List of CMake scripts to execute after CPack has produced the result
- packages and before copying them back to a build directory.
-
-.. variable:: CPACK_PACKAGE_FILES
-
- List of resulting package files passed to the ``CPACK_POST_BUILD_SCRIPTS``.
-
#]=======================================================================]
# Define this var in order to avoid (or warn) concerning multiple inclusion
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 8109108..8d04be3 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -174,7 +174,7 @@ if(BUILD_TESTING)
"How many times to retry timed-out CTest submissions.")
find_program(MEMORYCHECK_COMMAND
- NAMES purify valgrind boundscheck drmemory
+ NAMES purify valgrind boundscheck drmemory cuda-memcheck compute-sanitizer
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
DOC "Path to the memory checking command, used for memory error detection."
@@ -194,7 +194,14 @@ if(BUILD_TESTING)
"Extra command line flags to pass to the coverage tool")
# set the site name
- site_name(SITE)
+ if(COMMAND cmake_host_system_information)
+ cmake_host_system_information(RESULT _ctest_hostname QUERY HOSTNAME)
+ set(SITE "${_ctest_hostname}" CACHE STRING "Name of the computer/site where compile is being run")
+ unset(_ctest_hostname)
+ else()
+ # This code path is needed for CMake itself during bootstrap.
+ site_name(SITE)
+ endif()
# set the build name
if(NOT BUILDNAME)
set(DART_COMPILER "${CMAKE_CXX_COMPILER}")
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index f835f29..335b437 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -34,8 +34,8 @@ effect or even a specific one is beyond the scope of this module.
include_guard(GLOBAL)
include(CheckCSourceCompiles)
-include(CheckCompilerFlag)
+include(Internal/CheckCompilerFlag)
macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
- check_compiler_flag(C "${_FLAG}" ${_RESULT})
+ cmake_check_compiler_flag(C "${_FLAG}" ${_RESULT})
endmacro ()
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index 975e653..698a007 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -66,8 +66,8 @@ Check if given C source compiles and links into an executable.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceCompiles)
+include(Internal/CheckSourceCompiles)
macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
- check_source_compiles(C "${SOURCE}" ${VAR} ${ARGN})
+ cmake_check_source_compiles(C "${SOURCE}" ${VAR} ${ARGN})
endmacro()
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index 86ad248..a99e47e 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -65,8 +65,10 @@ subsequently be run.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceRuns)
+include(Internal/CheckSourceRuns)
macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
- check_source_runs(C "${SOURCE}" ${VAR} ${ARGN})
+ set(_CheckSourceRuns_old_signature 1)
+ cmake_check_source_runs(C "${SOURCE}" ${VAR} ${ARGN})
+ unset(_CheckSourceRuns_old_signature)
endmacro()
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index ce49ae3..3bc3463 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -34,8 +34,8 @@ effect or even a specific one is beyond the scope of this module.
include_guard(GLOBAL)
include(CheckCXXSourceCompiles)
-include(CheckCompilerFlag)
+include(Internal/CheckCompilerFlag)
macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
- check_compiler_flag(CXX "${_FLAG}" ${_RESULT})
+ cmake_check_compiler_flag(CXX "${_FLAG}" ${_RESULT})
endmacro ()
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index f7f9d0b..dc209b2 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -66,8 +66,8 @@ Check if given C++ source compiles and links into an executable.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceCompiles)
+include(Internal/CheckSourceCompiles)
macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
- check_source_compiles(CXX "${SOURCE}" ${VAR} ${ARGN})
+ cmake_check_source_compiles(CXX "${SOURCE}" ${VAR} ${ARGN})
endmacro()
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 70511ee..c8ff3d7 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -65,8 +65,10 @@ subsequently be run.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceRuns)
+include(Internal/CheckSourceRuns)
macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
- check_source_runs(CXX "${SOURCE}" ${VAR} ${ARGN})
+ set(_CheckSourceRuns_old_signature 1)
+ cmake_check_source_runs(CXX "${SOURCE}" ${VAR} ${ARGN})
+ unset(_CheckSourceRuns_old_signature)
endmacro()
diff --git a/Modules/CheckCompilerFlag.cmake b/Modules/CheckCompilerFlag.cmake
index 3ce1b9b..77c07b9 100644
--- a/Modules/CheckCompilerFlag.cmake
+++ b/Modules/CheckCompilerFlag.cmake
@@ -19,7 +19,7 @@ Check that the ``<flag>`` is accepted by the compiler without a diagnostic.
Stores the result in an internal cache entry named ``<var>``.
This command temporarily sets the ``CMAKE_REQUIRED_DEFINITIONS`` variable
-and calls the ``check_source_compiles(<LANG>`` function from the
+and calls the ``check_source_compiles(<LANG>)`` function from the
:module:`CheckSourceCompiles` module. See documentation of that
module for a listing of variables that can otherwise modify the build.
@@ -34,78 +34,8 @@ effect or even a specific one is beyond the scope of this module.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceCompiles)
-include(CMakeCheckCompilerFlagCommonPatterns)
-
-cmake_policy(PUSH)
-cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
-cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
+include(Internal/CheckCompilerFlag)
function(CHECK_COMPILER_FLAG _lang _flag _var)
-
- if(_lang STREQUAL C)
- set(_lang_src "int main(void) { return 0; }")
- set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C")
- elseif(_lang STREQUAL CXX)
- set(_lang_src "int main() { return 0; }")
- set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+")
- elseif(_lang STREQUAL CUDA)
- set(_lang_src "__host__ int main() { return 0; }")
- set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU
- FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL Fortran)
- set(_lang_src " program test\n stop\n end program")
- set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran")
- elseif(_lang STREQUAL OBJC)
- set(_lang_src [=[
-#ifndef __OBJC__
-# error "Not an Objective-C compiler"
-#endif
-int main(void) { return 0; }]=])
- set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU
- FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL OBJCXX)
- set(_lang_src [=[
-#ifndef __OBJC__
-# error "Not an Objective-C++ compiler"
-#endif
-int main(void) { return 0; }]=])
- set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU
- FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL ISPC)
- set(_lang_src "float func(uniform int32, float a) { return a / 2.25; }")
- else()
- message (SEND_ERROR "check_compiler_flag: ${_lang}: unknown language.")
- return()
- endif()
-
- get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
- if (NOT _lang IN_LIST _supported_languages)
- message (SEND_ERROR "check_compiler_flag: ${_lang}: needs to be enabled before use.")
- return()
- endif()
-
- set(CMAKE_REQUIRED_DEFINITIONS ${_flag})
-
- # Normalize locale during test compilation.
- set(_locale_vars LC_ALL LC_MESSAGES LANG)
- foreach(v IN LISTS _locale_vars)
- set(_locale_vars_saved_${v} "$ENV{${v}}")
- set(ENV{${v}} C)
- endforeach()
-
- check_compiler_flag_common_patterns(_common_patterns)
- check_source_compiles(${_lang}
- "${_lang_src}"
- ${_var}
- ${_lang_fail_regex}
- ${_common_patterns}
- )
-
- foreach(v IN LISTS _locale_vars)
- set(ENV{${v}} ${_locale_vars_saved_${v}})
- endforeach()
- set(${_var} "${${_var}}" PARENT_SCOPE)
-endfunction ()
-
-cmake_policy(POP)
+ cmake_check_compiler_flag(${_lang} "${_flag}" ${_var})
+endfunction()
diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake
index 0f5cf9a..5b1cd02 100644
--- a/Modules/CheckFortranCompilerFlag.cmake
+++ b/Modules/CheckFortranCompilerFlag.cmake
@@ -36,8 +36,8 @@ effect or even a specific one is beyond the scope of this module.
include_guard(GLOBAL)
include(CheckFortranSourceCompiles)
-include(CheckCompilerFlag)
+include(Internal/CheckCompilerFlag)
macro (CHECK_FORTRAN_COMPILER_FLAG _FLAG _RESULT)
- check_compiler_flag(Fortran "${_FLAG}" ${_RESULT})
+ cmake_check_compiler_flag(Fortran "${_FLAG}" ${_RESULT})
endmacro ()
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index 169b829..5ede284 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -87,10 +87,10 @@ Check if given Fortran source compiles and links into an executable.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceCompiles)
+include(Internal/CheckSourceCompiles)
macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
# Pass the SRC_EXT we used by default historically.
# A user-provided SRC_EXT argument in ARGN will override ours.
- check_source_compiles(Fortran "${SOURCE}" ${VAR} SRC_EXT "F" ${ARGN})
+ cmake_check_source_compiles(Fortran "${SOURCE}" ${VAR} SRC_EXT "F" ${ARGN})
endmacro()
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index 5276709..28f713f 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -83,10 +83,10 @@ subsequently be run.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceRuns)
+include(Internal/CheckSourceRuns)
macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
# Pass the SRC_EXT we used by default historically.
# A user-provided SRC_EXT argument in ARGN will override ours.
- check_source_runs(Fortran "${SOURCE}" ${VAR} SRC_EXT "F90" ${ARGN})
+ cmake_check_source_runs(Fortran "${SOURCE}" ${VAR} SRC_EXT "F90" ${ARGN})
endmacro()
diff --git a/Modules/CheckLinkerFlag.cmake b/Modules/CheckLinkerFlag.cmake
index f56d365..3c7a828 100644
--- a/Modules/CheckLinkerFlag.cmake
+++ b/Modules/CheckLinkerFlag.cmake
@@ -19,15 +19,12 @@ Check that the link ``<flag>`` is accepted by the ``<lang>`` compiler without
a diagnostic. Stores the result in an internal cache entry named ``<var>``.
This command temporarily sets the ``CMAKE_REQUIRED_LINK_OPTIONS`` variable
-and calls the ``check_<lang>_source_compiles`` macro from the
-``Check<lang>SourceCompiles`` module (:module:`CheckCSourceCompiles`,
-:module:`CheckCSourceCompiles`, :module:`CheckCXXSourceCompiles`,
-:module:`CheckOBJCSourceCompiles`, :module:`CheckOBJCXXSourceCompiles` or
-:module:`CheckFortranSourceCompiles`). See documentation of these
-modules for a listing of variables that can otherwise modify the build.
-
-The underlying implementation rely on :prop_tgt:`LINK_OPTIONS` property to
-check the specified flag. The ``LINKER:`` prefix, as described in
+and calls the :command:`check_source_compiles` command from the
+:module:`CheckSourceCompiles` module. See that module's documentation
+for a listing of variables that can otherwise modify the build.
+
+The underlying implementation relies on the :prop_tgt:`LINK_OPTIONS` property
+to check the specified flag. The ``LINKER:`` prefix, as described in the
:command:`target_link_options` command, can be used as well.
A positive result from this check indicates only that the compiler did not
diff --git a/Modules/CheckOBJCCompilerFlag.cmake b/Modules/CheckOBJCCompilerFlag.cmake
index df9d724..d8d8741 100644
--- a/Modules/CheckOBJCCompilerFlag.cmake
+++ b/Modules/CheckOBJCCompilerFlag.cmake
@@ -36,8 +36,8 @@ effect or even a specific one is beyond the scope of this module.
include_guard(GLOBAL)
include(CheckOBJCSourceCompiles)
-include(CheckCompilerFlag)
+include(Internal/CheckCompilerFlag)
macro (CHECK_OBJC_COMPILER_FLAG _FLAG _RESULT)
- check_compiler_flag(OBJC "${_FLAG}" ${_RESULT})
+ cmake_check_compiler_flag(OBJC "${_FLAG}" ${_RESULT})
endmacro ()
diff --git a/Modules/CheckOBJCSourceCompiles.cmake b/Modules/CheckOBJCSourceCompiles.cmake
index aad2bdc..c268ef9 100644
--- a/Modules/CheckOBJCSourceCompiles.cmake
+++ b/Modules/CheckOBJCSourceCompiles.cmake
@@ -68,8 +68,8 @@ Check if given Objective-C source compiles and links into an executable.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceCompiles)
+include(Internal/CheckSourceCompiles)
macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
- check_source_compiles(OBJC "${SOURCE}" ${VAR} ${ARGN})
+ cmake_check_source_compiles(OBJC "${SOURCE}" ${VAR} ${ARGN})
endmacro()
diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake
index dadab21..dd03309 100644
--- a/Modules/CheckOBJCSourceRuns.cmake
+++ b/Modules/CheckOBJCSourceRuns.cmake
@@ -67,8 +67,10 @@ subsequently be run.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceRuns)
+include(Internal/CheckSourceRuns)
macro(CHECK_OBJC_SOURCE_RUNS SOURCE VAR)
- check_source_runs(OBJC "${SOURCE}" ${VAR} ${ARGN})
+ set(_CheckSourceRuns_old_signature 1)
+ cmake_check_source_runs(OBJC "${SOURCE}" ${VAR} ${ARGN})
+ unset(_CheckSourceRuns_old_signature)
endmacro()
diff --git a/Modules/CheckOBJCXXCompilerFlag.cmake b/Modules/CheckOBJCXXCompilerFlag.cmake
index 6e01bcc..3f3f8fe 100644
--- a/Modules/CheckOBJCXXCompilerFlag.cmake
+++ b/Modules/CheckOBJCXXCompilerFlag.cmake
@@ -36,8 +36,8 @@ effect or even a specific one is beyond the scope of this module.
include_guard(GLOBAL)
include(CheckOBJCXXSourceCompiles)
-include(CheckCompilerFlag)
+include(Internal/CheckCompilerFlag)
macro (CHECK_OBJCXX_COMPILER_FLAG _FLAG _RESULT)
- check_compiler_flag(OBJCXX "${_FLAG}" ${_RESULT})
+ cmake_check_compiler_flag(OBJCXX "${_FLAG}" ${_RESULT})
endmacro ()
diff --git a/Modules/CheckOBJCXXSourceCompiles.cmake b/Modules/CheckOBJCXXSourceCompiles.cmake
index 37dabfe..1186934 100644
--- a/Modules/CheckOBJCXXSourceCompiles.cmake
+++ b/Modules/CheckOBJCXXSourceCompiles.cmake
@@ -68,8 +68,8 @@ Check if given Objective-C++ source compiles and links into an executable.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceCompiles)
+include(Internal/CheckSourceCompiles)
macro(CHECK_OBJCXX_SOURCE_COMPILES SOURCE VAR)
- check_source_compiles(OBJCXX "${SOURCE}" ${VAR} ${ARGN})
+ cmake_check_source_compiles(OBJCXX "${SOURCE}" ${VAR} ${ARGN})
endmacro()
diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake
index 200e799..05a5e4c 100644
--- a/Modules/CheckOBJCXXSourceRuns.cmake
+++ b/Modules/CheckOBJCXXSourceRuns.cmake
@@ -67,8 +67,10 @@ subsequently be run.
#]=======================================================================]
include_guard(GLOBAL)
-include(CheckSourceRuns)
+include(Internal/CheckSourceRuns)
macro(CHECK_OBJCXX_SOURCE_RUNS SOURCE VAR)
- check_source_runs(OBJCXX "${SOURCE}" ${VAR} ${ARGN})
+ set(_CheckSourceRuns_old_signature 1)
+ cmake_check_source_runs(OBJCXX "${SOURCE}" ${VAR} ${ARGN})
+ unset(_CheckSourceRuns_old_signature)
endmacro()
diff --git a/Modules/CheckSourceCompiles.cmake b/Modules/CheckSourceCompiles.cmake
index 4ed9a5c..ad74c3c 100644
--- a/Modules/CheckSourceCompiles.cmake
+++ b/Modules/CheckSourceCompiles.cmake
@@ -75,127 +75,8 @@ Check if given source compiles and links into an executable.
include_guard(GLOBAL)
-
-cmake_policy(PUSH)
-cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
-cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
+include(Internal/CheckSourceCompiles)
function(CHECK_SOURCE_COMPILES _lang _source _var)
- if(NOT DEFINED "${_var}")
-
- if(_lang STREQUAL C)
- set(_lang_textual "C")
- set(_lang_ext "c")
- elseif(_lang STREQUAL CXX)
- set(_lang_textual "C++")
- set(_lang_ext "cxx")
- elseif(_lang STREQUAL CUDA)
- set(_lang_textual "CUDA")
- set(_lang_ext "cu")
- elseif(_lang STREQUAL Fortran)
- set(_lang_textual "Fortran")
- set(_lang_ext "F90")
- elseif(_lang STREQUAL ISPC)
- set(_lang_textual "ISPC")
- set(_lang_ext "ispc")
- elseif(_lang STREQUAL OBJC)
- set(_lang_textual "Objective-C")
- set(_lang_ext "m")
- elseif(_lang STREQUAL OBJCXX)
- set(_lang_textual "Objective-C++")
- set(_lang_ext "mm")
- else()
- message (SEND_ERROR "check_source_compiles: ${_lang}: unknown language.")
- return()
- endif()
-
- get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
- if (NOT _lang IN_LIST _supported_languages)
- message (SEND_ERROR "check_source_compiles: ${_lang}: needs to be enabled before use.")
- return()
- endif()
-
- set(_FAIL_REGEX)
- set(_SRC_EXT)
- set(_key)
- foreach(arg ${ARGN})
- if("${arg}" MATCHES "^(FAIL_REGEX|SRC_EXT)$")
- set(_key "${arg}")
- elseif(_key STREQUAL "FAIL_REGEX")
- list(APPEND _FAIL_REGEX "${arg}")
- elseif(_key STREQUAL "SRC_EXT")
- set(_SRC_EXT "${arg}")
- set(_key "")
- else()
- message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
- endif()
- endforeach()
-
- if(NOT _SRC_EXT)
- set(_SRC_EXT ${_lang_ext})
- endif()
-
- if(CMAKE_REQUIRED_LINK_OPTIONS)
- set(CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS
- LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
- else()
- set(CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS)
- endif()
- if(CMAKE_REQUIRED_LIBRARIES)
- set(CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES
- LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
- else()
- set(CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES)
- endif()
- if(CMAKE_REQUIRED_INCLUDES)
- set(CHECK_${LANG}_SOURCE_COMPILES_ADD_INCLUDES
- "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- else()
- set(CHECK_${LANG}_SOURCE_COMPILES_ADD_INCLUDES)
- endif()
- file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
- "${_source}\n")
-
- if(NOT CMAKE_REQUIRED_QUIET)
- message(CHECK_START "Performing Test ${_var}")
- endif()
- try_compile(${_var}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
- COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS}
- ${CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS}
- ${CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES}
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}
- "${CHECK_${LANG}_SOURCE_COMPILES_ADD_INCLUDES}"
- OUTPUT_VARIABLE OUTPUT)
-
- foreach(_regex ${_FAIL_REGEX})
- if("${OUTPUT}" MATCHES "${_regex}")
- set(${_var} 0)
- endif()
- endforeach()
-
- if(${_var})
- set(${_var} 1 CACHE INTERNAL "Test ${_var}")
- if(NOT CMAKE_REQUIRED_QUIET)
- message(CHECK_PASS "Success")
- endif()
- file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Performing ${_lang_textual} SOURCE FILE Test ${_var} succeeded with the following output:\n"
- "${OUTPUT}\n"
- "Source file was:\n${_source}\n")
- else()
- if(NOT CMAKE_REQUIRED_QUIET)
- message(CHECK_FAIL "Failed")
- endif()
- set(${_var} "" CACHE INTERNAL "Test ${_var}")
- file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Performing ${_lang_textual} SOURCE FILE Test ${_var} failed with the following output:\n"
- "${OUTPUT}\n"
- "Source file was:\n${_source}\n")
- endif()
- endif()
-
+ cmake_check_source_compiles(${_lang} "${_source}" ${_var} ${ARGN})
endfunction()
-
-cmake_policy(POP)
diff --git a/Modules/CheckSourceRuns.cmake b/Modules/CheckSourceRuns.cmake
index 033793d..8f1cf01 100644
--- a/Modules/CheckSourceRuns.cmake
+++ b/Modules/CheckSourceRuns.cmake
@@ -73,136 +73,8 @@ subsequently be run.
#]=======================================================================]
include_guard(GLOBAL)
-
-cmake_policy(PUSH)
-cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
-cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
+include(Internal/CheckSourceRuns)
function(CHECK_SOURCE_RUNS _lang _source _var)
- if(NOT DEFINED "${_var}")
-
- if(_lang STREQUAL C)
- set(_lang_textual "C")
- set(_lang_ext "c")
- elseif(_lang STREQUAL CXX)
- set(_lang_textual "C++")
- set(_lang_ext "cxx")
- elseif(_lang STREQUAL CUDA)
- set(_lang_textual "CUDA")
- set(_lang_ext "cu")
- elseif(_lang STREQUAL Fortran)
- set(_lang_textual "Fortran")
- set(_lang_ext "F90")
- elseif(_lang STREQUAL OBJC)
- set(_lang_textual "Objective-C")
- set(_lang_ext "m")
- elseif(_lang STREQUAL OBJCXX)
- set(_lang_textual "Objective-C++")
- set(_lang_ext "mm")
- else()
- message (SEND_ERROR "check_source_runs: ${_lang}: unknown language.")
- return()
- endif()
-
- get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
- if (NOT _lang IN_LIST _supported_languages)
- message (SEND_ERROR "check_source_runs: ${_lang}: needs to be enabled before use.")
- return()
- endif()
-
- set(_FAIL_REGEX)
- set(_SRC_EXT)
- set(_key)
- foreach(arg ${ARGN})
- if("${arg}" MATCHES "^(FAIL_REGEX|SRC_EXT)$")
- set(_key "${arg}")
- elseif(_key STREQUAL "FAIL_REGEX")
- list(APPEND _FAIL_REGEX "${arg}")
- elseif(_key STREQUAL "SRC_EXT")
- set(_SRC_EXT "${arg}")
- set(_key "")
- else()
- message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
- endif()
- endforeach()
-
- if(NOT _SRC_EXT)
- set(_SRC_EXT ${_lang_ext})
- endif()
-
- if(CMAKE_REQUIRED_LINK_OPTIONS)
- set(CHECK_${_lang}_SOURCE_COMPILES_ADD_LINK_OPTIONS
- LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
- else()
- set(CHECK_${_lang}_SOURCE_COMPILES_ADD_LINK_OPTIONS)
- endif()
- if(CMAKE_REQUIRED_LIBRARIES)
- set(CHECK_${_lang}_SOURCE_COMPILES_ADD_LIBRARIES
- LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
- else()
- set(CHECK_${_lang}_SOURCE_COMPILES_ADD_LIBRARIES)
- endif()
- if(CMAKE_REQUIRED_INCLUDES)
- set(CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES
- "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
- else()
- set(CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES)
- endif()
- file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
- "${_source}\n")
-
- if(NOT CMAKE_REQUIRED_QUIET)
- message(CHECK_START "Performing Test ${_var}")
- endif()
- try_run(${_var}_EXITCODE ${_var}_COMPILED
- ${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
- COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS}
- ${CHECK_${_lang}_SOURCE_COMPILES_ADD_LINK_OPTIONS}
- ${CHECK_${_lang}_SOURCE_COMPILES_ADD_LIBRARIES}
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}
- -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
- "${CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT
- RUN_OUTPUT_VARIABLE RUN_OUTPUT)
- # if it did not compile make the return value fail code of 1
- if(NOT ${_var}_COMPILED)
- set(${_var}_EXITCODE 1)
- set(${_var}_EXITCODE 1 PARENT_SCOPE)
- endif()
- # if the return value was 0 then it worked
- if("${${_var}_EXITCODE}" EQUAL 0)
- set(${_var} 1 CACHE INTERNAL "Test ${_var}")
- if(NOT CMAKE_REQUIRED_QUIET)
- message(CHECK_PASS "Success")
- endif()
- file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
- "Performing ${_lang_textual} SOURCE FILE Test ${_var} succeeded with the following compile output:\n"
- "${OUTPUT}\n"
- "...and run output:\n"
- "${RUN_OUTPUT}\n"
- "Return value: ${${_var}}\n"
- "Source file was:\n${_source}\n")
- else()
- if(CMAKE_CROSSCOMPILING AND "${${_var}_EXITCODE}" MATCHES "FAILED_TO_RUN")
- set(${_var} "${${_var}_EXITCODE}" PARENT_SCOPE)
- else()
- set(${_var} "" CACHE INTERNAL "Test ${_var}")
- endif()
-
- if(NOT CMAKE_REQUIRED_QUIET)
- message(CHECK_FAIL "Failed")
- endif()
- file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
- "Performing ${_lang_textual} SOURCE FILE Test ${_var} failed with the following compile output:\n"
- "${OUTPUT}\n"
- "...and run output:\n"
- "${RUN_OUTPUT}\n"
- "Return value: ${${_var}_EXITCODE}\n"
- "Source file was:\n${_source}\n")
-
- endif()
- endif()
+ cmake_check_source_runs(${_lang} "${_source}" ${_var} ${ARGN})
endfunction()
-
-cmake_policy(POP)
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index 7c24373..95a51f6 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -64,7 +64,7 @@ set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static")
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt;cudart")
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_NONE "")
-if(UNIX)
+if(UNIX AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX"))
list(APPEND CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl")
endif()
@@ -78,13 +78,20 @@ if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "")
if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0)
- set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
- set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
+ if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
+ set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14")
+ set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14")
+ else()
+ set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "")
+ endif()
endif()
if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0)
- set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17")
- set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17")
+ if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505)
+ set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17")
+ set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17")
+ endif()
endif()
else()
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index 086ba07..d318c26 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -71,6 +71,8 @@ ValgrindCommand: @VALGRIND_COMMAND@
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
DrMemoryCommand: @DRMEMORY_COMMAND@
DrMemoryCommandOptions: @DRMEMORY_COMMAND_OPTIONS@
+CudaMemcheckCommand: @CUDA_MEMCHECK_COMMAND@
+CudaMemcheckCommandOptions: @CUDA_MEMCHECK_COMMAND_OPTIONS@
MemoryCheckType: @MEMORYCHECK_TYPE@
MemoryCheckSanitizerOptions: @MEMORYCHECK_SANITIZER_OPTIONS@
MemoryCheckCommand: @MEMORYCHECK_COMMAND@
diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 6fe8685..294167c 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -78,7 +78,8 @@ Module Functions
manage local instances of data files stored externally::
ExternalData_Add_Target(
- <target> # Name of data management target
+ <target> # Name of data management target
+ [SHOW_PROGRESS <ON|OFF>] # Show progress during the download
)
It creates custom commands in the target as necessary to make data
@@ -89,6 +90,11 @@ Module Functions
in one of the paths specified in the ``ExternalData_OBJECT_STORES``
variable.
+ The ``SHOW_PROGRESS`` argument may be passed to suppress progress information
+ during the download of objects. If not provided, it defaults to ``OFF`` for
+ :generator:`Ninja` and :generator:`Ninja Multi-Config` generators and ``ON``
+ otherwise.
+
Typically only one target is needed to manage all external data within
a project. Call this function once at the end of configuration after
all data references have been processed.
@@ -344,6 +350,30 @@ function(ExternalData_add_target target)
endif()
set(_ExternalData_CONFIG_CODE "")
+ cmake_parse_arguments(PARSE_ARGV 1 _ExternalData_add_target
+ ""
+ "SHOW_PROGRESS"
+ "")
+ if (_ExternalData_add_target_UNPARSED_ARGUMENTS)
+ message(AUTHOR_WARNING
+ "Ignoring unrecognized arguments passed to ExternalData_add_target: "
+ "`${_ExternalData_add_target_UNPARSED_ARGUMENTS}`")
+ endif ()
+
+ # Turn `SHOW_PROGRESS` into a boolean
+ if (NOT DEFINED _ExternalData_add_target_SHOW_PROGRESS)
+ # The default setting
+ if (CMAKE_GENERATOR MATCHES "Ninja")
+ set(_ExternalData_add_target_SHOW_PROGRESS OFF)
+ else ()
+ set(_ExternalData_add_target_SHOW_PROGRESS ON)
+ endif ()
+ elseif (_ExternalData_add_target_SHOW_PROGRESS)
+ set(_ExternalData_add_target_SHOW_PROGRESS ON)
+ else ()
+ set(_ExternalData_add_target_SHOW_PROGRESS OFF)
+ endif ()
+
# Store custom script configuration.
foreach(url_template IN LISTS ExternalData_URL_TEMPLATES)
if("${url_template}" MATCHES "^ExternalDataCustomScript://([^/]*)/(.*)$")
@@ -423,6 +453,7 @@ function(ExternalData_add_target target)
COMMAND ${CMAKE_COMMAND} -Drelative_top=${CMAKE_BINARY_DIR}
-Dfile=${file} -Dname=${name}
-DExternalData_ACTION=local
+ -DExternalData_SHOW_PROGRESS=${_ExternalData_add_target_SHOW_PROGRESS}
-DExternalData_CONFIG=${config}
-P ${_ExternalData_SELF}
MAIN_DEPENDENCY "${name}"
@@ -459,6 +490,7 @@ function(ExternalData_add_target target)
COMMAND ${CMAKE_COMMAND} -Drelative_top=${CMAKE_BINARY_DIR}
-Dfile=${file} -Dname=${name} -Dexts=${exts}
-DExternalData_ACTION=fetch
+ -DExternalData_SHOW_PROGRESS=${_ExternalData_add_target_SHOW_PROGRESS}
-DExternalData_CONFIG=${config}
-P ${_ExternalData_SELF}
# Update whenever the object hash changes.
@@ -925,7 +957,11 @@ function(_ExternalData_download_file url file err_var msg_var)
else()
set(absolute_timeout "")
endif()
- file(DOWNLOAD "${url}" "${file}" STATUS status LOG log ${inactivity_timeout} ${absolute_timeout} SHOW_PROGRESS)
+ set(show_progress_args)
+ if (ExternalData_SHOW_PROGRESS)
+ list(APPEND show_progress_args SHOW_PROGRESS)
+ endif ()
+ file(DOWNLOAD "${url}" "${file}" STATUS status LOG log ${inactivity_timeout} ${absolute_timeout} ${show_progress_args})
list(GET status 0 err)
list(GET status 1 msg)
if(err)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 6154dd6..00e4ff1 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -442,10 +442,27 @@ if (NOT Boost_NO_BOOST_CMAKE)
endif()
endif()
+ set(_boost_FIND_PACKAGE_ARGS "")
+ if(Boost_NO_SYSTEM_PATHS)
+ list(APPEND _boost_FIND_PACKAGE_ARGS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
+ endif()
+
# Do the same find_package call but look specifically for the CMake version.
# Note that args are passed in the Boost_FIND_xxxxx variables, so there is no
# need to delegate them to this find_package call.
- find_package(Boost QUIET NO_MODULE)
+ if(BOOST_ROOT AND NOT Boost_ROOT)
+ # Honor BOOST_ROOT by setting Boost_ROOT with CMP0074 NEW behavior.
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0074 NEW)
+ set(Boost_ROOT "${BOOST_ROOT}")
+ set(_Boost_ROOT_FOR_CONFIG 1)
+ endif()
+ find_package(Boost QUIET NO_MODULE ${_boost_FIND_PACKAGE_ARGS})
+ if(_Boost_ROOT_FOR_CONFIG)
+ unset(_Boost_ROOT_FOR_CONFIG)
+ unset(Boost_ROOT)
+ cmake_policy(POP)
+ endif()
if (DEFINED Boost_DIR)
mark_as_advanced(Boost_DIR)
endif ()
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index a93d4fd..f04f571 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -732,6 +732,8 @@ if(CMAKE_CROSSCOMPILING)
# Support for aarch64 cross compilation
if (ANDROID_ARCH_NAME STREQUAL "arm64")
set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi")
+ elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ set(CUDA_TOOLKIT_TARGET_NAME "aarch64-qnx")
else()
set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux")
endif (ANDROID_ARCH_NAME STREQUAL "arm64")
@@ -902,7 +904,7 @@ if(CUDA_USE_STATIC_CUDA_RUNTIME)
find_package(Threads REQUIRED)
set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags})
- if(NOT APPLE)
+ if(NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX"))
#On Linux, you must link against librt when using the static cuda runtime.
find_library(CUDA_rt_LIBRARY rt)
if (NOT CUDA_rt_LIBRARY)
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index b4599a3..b3c8569 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -678,6 +678,8 @@ if(CMAKE_CROSSCOMPILING)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
if(ANDROID_ARCH_NAME STREQUAL "arm64")
set(CUDAToolkit_TARGET_NAME "aarch64-linux-androideabi")
+ elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ set(CUDAToolkit_TARGET_NAME "aarch64-qnx")
else()
set(CUDAToolkit_TARGET_NAME "aarch64-linux")
endif(ANDROID_ARCH_NAME STREQUAL "arm64")
@@ -860,7 +862,7 @@ if(CUDAToolkit_FOUND)
target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS})
endif()
- if(UNIX AND NOT APPLE)
+ if(UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX"))
# On Linux, you must link against librt when using the static cuda runtime.
find_library(CUDAToolkit_rt_LIBRARY rt)
mark_as_advanced(CUDAToolkit_rt_LIBRARY)
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index 10e31b2..ff50869 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -12,6 +12,15 @@ Imported targets
This module defines the following :prop_tgt:`IMPORTED` targets:
+``GTest::gtest``
+ The Google Test ``gtest`` library, if found; adds Thread::Thread
+ automatically
+``GTest::gtest_main``
+ The Google Test ``gtest_main`` library, if found
+
+For backwards compatibility, this module defines additionally the
+following deprecated :prop_tgt:`IMPORTED` targets:
+
``GTest::GTest``
The Google Test ``gtest`` library, if found; adds Thread::Thread
automatically
@@ -24,7 +33,7 @@ Result variables
This module will set the following variables in your project:
-``GTEST_FOUND``
+``GTest_FOUND``
Found the Google Testing framework
``GTEST_INCLUDE_DIRS``
the directory containing the Google Test headers
@@ -62,7 +71,7 @@ Example usage
find_package(GTest REQUIRED)
add_executable(foo foo.cc)
- target_link_libraries(foo GTest::GTest GTest::Main)
+ target_link_libraries(foo GTest::gtest GTest::gtest_main)
add_test(AllTestsInFoo foo)
@@ -167,8 +176,41 @@ function(__gtest_import_library _target _var _config)
endif()
endfunction()
+function(__gtest_define_backwards_compatible_library_targets)
+ set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} PARENT_SCOPE)
+
+ # Add targets mapping the same library names as defined in
+ # older versions of CMake's FindGTest
+ if(NOT TARGET GTest::GTest)
+ add_library(GTest::GTest INTERFACE IMPORTED)
+ target_link_libraries(GTest::GTest INTERFACE GTest::gtest)
+ endif()
+ if(NOT TARGET GTest::Main)
+ add_library(GTest::Main INTERFACE IMPORTED)
+ target_link_libraries(GTest::Main INTERFACE GTest::gtest_main)
+ endif()
+endfunction()
+
#
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+# first specifically look for the CMake version of GTest
+find_package(GTest QUIET NO_MODULE)
+
+# if we found the GTest cmake package then we are done, and
+# can print what we found and return.
+if(GTest_FOUND)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTest HANDLE_COMPONENTS CONFIG_MODE)
+
+ set(GTEST_LIBRARIES GTest::gtest)
+ set(GTEST_MAIN_LIBRARIES GTest::gtest_main)
+
+ __gtest_define_backwards_compatible_library_targets()
+
+ return()
+endif()
+
if(NOT DEFINED GTEST_MSVC_SEARCH)
set(GTEST_MSVC_SEARCH MD)
endif()
@@ -208,8 +250,6 @@ find_path(GTEST_INCLUDE_DIR gtest/gtest.h
)
mark_as_advanced(GTEST_INCLUDE_DIR)
-# Allow GTEST_LIBRARY and GTEST_MAIN_LIBRARY to be set manually, as the
-# locations of the gtest and gtest_main libraries, respectively.
if(NOT GTEST_LIBRARY)
__gtest_find_and_select_library_configurations(GTEST gtest)
endif()
@@ -217,54 +257,43 @@ if(NOT GTEST_MAIN_LIBRARY)
__gtest_find_and_select_library_configurations(GTEST_MAIN gtest_main)
endif()
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTest DEFAULT_MSG GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-if(GTEST_FOUND)
+if(GTest_FOUND)
set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
__gtest_append_debugs(GTEST_LIBRARIES GTEST_LIBRARY)
__gtest_append_debugs(GTEST_MAIN_LIBRARIES GTEST_MAIN_LIBRARY)
- set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
find_package(Threads QUIET)
- if(NOT TARGET GTest::GTest)
+ if(NOT TARGET GTest::gtest)
__gtest_determine_library_type(GTEST_LIBRARY)
- add_library(GTest::GTest ${GTEST_LIBRARY_TYPE} IMPORTED)
+ add_library(GTest::gtest ${GTEST_LIBRARY_TYPE} IMPORTED)
if(TARGET Threads::Threads)
- set_target_properties(GTest::GTest PROPERTIES
+ set_target_properties(GTest::gtest PROPERTIES
INTERFACE_LINK_LIBRARIES Threads::Threads)
endif()
if(GTEST_LIBRARY_TYPE STREQUAL "SHARED")
- set_target_properties(GTest::GTest PROPERTIES
+ set_target_properties(GTest::gtest PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
endif()
if(GTEST_INCLUDE_DIRS)
- set_target_properties(GTest::GTest PROPERTIES
+ set_target_properties(GTest::gtest PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIRS}")
endif()
- __gtest_import_library(GTest::GTest GTEST_LIBRARY "")
- __gtest_import_library(GTest::GTest GTEST_LIBRARY "RELEASE")
- __gtest_import_library(GTest::GTest GTEST_LIBRARY "DEBUG")
+ __gtest_import_library(GTest::gtest GTEST_LIBRARY "")
+ __gtest_import_library(GTest::gtest GTEST_LIBRARY "RELEASE")
+ __gtest_import_library(GTest::gtest GTEST_LIBRARY "DEBUG")
endif()
- if(NOT TARGET GTest::Main)
+ if(NOT TARGET GTest::gtest_main)
__gtest_determine_library_type(GTEST_MAIN_LIBRARY)
- add_library(GTest::Main ${GTEST_MAIN_LIBRARY_TYPE} IMPORTED)
- set_target_properties(GTest::Main PROPERTIES
- INTERFACE_LINK_LIBRARIES "GTest::GTest")
- __gtest_import_library(GTest::Main GTEST_MAIN_LIBRARY "")
- __gtest_import_library(GTest::Main GTEST_MAIN_LIBRARY "RELEASE")
- __gtest_import_library(GTest::Main GTEST_MAIN_LIBRARY "DEBUG")
+ add_library(GTest::gtest_main ${GTEST_MAIN_LIBRARY_TYPE} IMPORTED)
+ set_target_properties(GTest::gtest_main PROPERTIES
+ INTERFACE_LINK_LIBRARIES "GTest::gtest")
+ __gtest_import_library(GTest::gtest_main GTEST_MAIN_LIBRARY "")
+ __gtest_import_library(GTest::gtest_main GTEST_MAIN_LIBRARY "RELEASE")
+ __gtest_import_library(GTest::gtest_main GTEST_MAIN_LIBRARY "DEBUG")
endif()
- # Add targets mapping the same library names as defined in
- # GTest's CMake package config.
- if(NOT TARGET GTest::gtest)
- add_library(GTest::gtest INTERFACE IMPORTED)
- target_link_libraries(GTest::gtest INTERFACE GTest::GTest)
- endif()
- if(NOT TARGET GTest::gtest_main)
- add_library(GTest::gtest_main INTERFACE IMPORTED)
- target_link_libraries(GTest::gtest_main INTERFACE GTest::Main)
- endif()
+ __gtest_define_backwards_compatible_library_targets()
endif()
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index c8b3e1f..d3e5380 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -31,7 +31,7 @@ Imported targets::
ICU::<C>
Where ``<C>`` is the name of an ICU component, for example
-``ICU::i18n``.
+``ICU::i18n``; ``<C>`` is lower-case.
ICU programs are reported in::
@@ -54,16 +54,14 @@ ICU programs are reported in::
ICU component libraries are reported in::
- ICU_<C>_FOUND - ON if component was found
- ICU_<C>_LIBRARIES - libraries for component
+ ICU_<C>_FOUND - ON if component was found; ``<C>`` is upper-case.
+ ICU_<C>_LIBRARIES - libraries for component; ``<C>`` is upper-case.
ICU datafiles are reported in::
ICU_MAKEFILE_INC - Makefile.inc
ICU_PKGDATA_INC - pkgdata.inc
-Note that ``<C>`` is the uppercased name of the component.
-
This module reads hints about search results from::
ICU_ROOT - the root of the ICU installation
@@ -73,9 +71,9 @@ ICU_ROOT variable takes precedence.
The following cache variables may also be set::
- ICU_<P>_EXECUTABLE - the path to executable <P>
+ ICU_<P>_EXECUTABLE - the path to executable <P>; ``<P>`` is upper-case.
ICU_INCLUDE_DIR - the directory containing the ICU headers
- ICU_<C>_LIBRARY - the library for component <C>
+ ICU_<C>_LIBRARY - the library for component <C>; ``<C>`` is upper-case.
.. note::
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 1927aa4..1970b26 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -87,7 +87,7 @@ set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to wher
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
- "12" "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
+ "13" "12" "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
# Define additional search paths for root directories.
set( PostgreSQL_ROOT_DIRECTORIES
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 5fc6a3b..e842e6b 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -318,6 +318,22 @@ Hints
``.Net`` interpreter (i.e. ``mono`` command) is expected to be available
through the ``PATH`` variable.
+``Python_FIND_UNVERSIONED_NAMES``
+
+ .. versionadded:: 3.20
+
+ This variable defines how the generic names will be searched. Currently, it
+ only applies to the generic names of the interpreter, namely, ``python3`` or
+ ``python2`` and ``python``.
+ The ``Python_FIND_UNVERSIONED_NAMES`` variable can be set to one of the
+ following values:
+
+ * ``FIRST``: The generic names are searched before the more specialized ones
+ (such as ``python2.5`` for example).
+ * ``LAST``: The generic names are searched after the more specialized ones.
+ This is the default.
+ * ``NEVER``: The generic name are not searched at all.
+
Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 2b911ae..0e76468 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -337,6 +337,9 @@ function (_PYTHON_GET_NAMES _PYTHON_PGN_NAMES)
foreach (implementation IN LISTS _PGN_IMPLEMENTATIONS)
if (implementation STREQUAL "CPython")
+ if (_PGN_INTERPRETER AND _${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES STREQUAL "FIRST")
+ list (APPEND names python${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR} python)
+ endif()
foreach (version IN LISTS _PGN_VERSION)
if (_PGN_WIN32)
string (REPLACE "." "" version_no_dots ${version})
@@ -386,7 +389,7 @@ function (_PYTHON_GET_NAMES _PYTHON_PGN_NAMES)
endif()
endif()
endforeach()
- if (_PGN_INTERPRETER)
+ if (_PGN_INTERPRETER AND _${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES STREQUAL "LAST")
list (APPEND names python${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR} python)
endif()
elseif (implementation STREQUAL "IronPython")
@@ -1364,9 +1367,22 @@ else()
endif()
+# Python naming handling
+if (DEFINED ${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES)
+ if (NOT ${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES MATCHES "^(FIRST|LAST|NEVER)$")
+ message (AUTHOR_WARNING "Find${_PYTHON_PREFIX}: ${_${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES}: invalid value for '${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES'. 'FIRST', 'LAST' or 'NEVER' expected. 'LAST' will be used instead.")
+ set (_${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES LAST)
+ else()
+ set (_${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES ${${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES})
+ endif()
+else()
+ set (_${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES LAST)
+endif()
+
+
# Compute search signature
# This signature will be used to check validity of cached variables on new search
-set (_${_PYTHON_PREFIX}_SIGNATURE "${${_PYTHON_PREFIX}_ROOT_DIR}:${_${_PYTHON_PREFIX}_FIND_IMPLEMENTATIONS}:${_${_PYTHON_PREFIX}_FIND_STRATEGY}:${${_PYTHON_PREFIX}_FIND_VIRTUALENV}")
+set (_${_PYTHON_PREFIX}_SIGNATURE "${${_PYTHON_PREFIX}_ROOT_DIR}:${_${_PYTHON_PREFIX}_FIND_IMPLEMENTATIONS}:${_${_PYTHON_PREFIX}_FIND_STRATEGY}:${${_PYTHON_PREFIX}_FIND_VIRTUALENV}${_${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES}")
if (NOT WIN32)
string (APPEND _${_PYTHON_PREFIX}_SIGNATURE ":${${_PYTHON_PREFIX}_USE_STATIC_LIBS}:")
endif()
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 9cd22e1..5277e33 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -265,6 +265,22 @@ Hints
``.Net`` interpreter (i.e. ``mono`` command) is expected to be available
through the ``PATH`` variable.
+``Python2_FIND_UNVERSIONED_NAMES``
+
+ .. versionadded:: 3.20
+
+ This variable defines how the generic names will be searched. Currently, it
+ only applies to the generic names of the interpreter, namely, ``python2`` and
+ ``python``.
+ The ``Python2_FIND_UNVERSIONED_NAMES`` variable can be set to one of the
+ following values:
+
+ * ``FIRST``: The generic names are searched before the more specialized ones
+ (such as ``python2.5`` for example).
+ * ``LAST``: The generic names are searched after the more specialized ones.
+ This is the default.
+ * ``NEVER``: The generic name are not searched at all.
+
Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index c79d482..2bd4d76 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -315,6 +315,22 @@ Hints
``.Net`` interpreter (i.e. ``mono`` command) is expected to be available
through the ``PATH`` variable.
+``Python3_FIND_UNVERSIONED_NAMES``
+
+ .. versionadded:: 3.20
+
+ This variable defines how the generic names will be searched. Currently, it
+ only applies to the generic names of the interpreter, namely, ``python3`` and
+ ``python``.
+ The ``Python3_FIND_UNVERSIONED_NAMES`` variable can be set to one of the
+ following values:
+
+ * ``FIRST``: The generic names are searched before the more specialized ones
+ (such as ``python3.5`` for example).
+ * ``LAST``: The generic names are searched after the more specialized ones.
+ This is the default.
+ * ``NEVER``: The generic name are not searched at all.
+
Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 0559a69..a0cdf3b 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -515,6 +515,7 @@ foreach(Camel
Ruby_SITELIB_DIR
Ruby_HAS_VENDOR_RUBY
Ruby_VENDORARCH_DIR
+ Ruby_VENDORLIB_DIR
)
string(TOUPPER ${Camel} UPPER)
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 13d067a..888f7b1 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -113,7 +113,7 @@ Macros
::
- GNUInstallDirs_get_absolute_install_dir(absvar var)
+ GNUInstallDirs_get_absolute_install_dir(absvar var dirname)
Set the given variable ``absvar`` to the absolute path contained
within the variable ``var``. This is to allow the computation of an
@@ -121,7 +121,8 @@ Macros
above. While this macro is used to compute the various
``CMAKE_INSTALL_FULL_<dir>`` variables, it is exposed publicly to
allow users who create additional path variables to also compute
- absolute paths where necessary, using the same logic.
+ absolute paths where necessary, using the same logic. ``dirname`` is
+ the directory name to get, e.g. ``BINDIR``.
#]=======================================================================]
cmake_policy(PUSH)
@@ -334,13 +335,25 @@ mark_as_advanced(
)
macro(GNUInstallDirs_get_absolute_install_dir absvar var)
+ set(GGAID_extra_args ${ARGN})
+ list(LENGTH GGAID_extra_args GGAID_extra_arg_count)
+ if(GGAID_extra_arg_count GREATER 0)
+ list(GET GGAID_extra_args 0 GGAID_dir)
+ else()
+ # Historical behaviour: use ${dir} from caller's scope
+ set(GGAID_dir "${dir}")
+ message(AUTHOR_WARNING
+ "GNUInstallDirs_get_absolute_install_dir called without third argument. "
+ "Using \${dir} from the caller's scope for compatibility with CMake 3.19 and below.")
+ endif()
+
if(NOT IS_ABSOLUTE "${${var}}")
# Handle special cases:
# - CMAKE_INSTALL_PREFIX == /
# - CMAKE_INSTALL_PREFIX == /usr
# - CMAKE_INSTALL_PREFIX == /opt/...
if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
- if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR")
+ if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
set(${absvar} "/${${var}}")
else()
if (NOT "${${var}}" MATCHES "^usr/")
@@ -349,13 +362,13 @@ macro(GNUInstallDirs_get_absolute_install_dir absvar var)
set(${absvar} "/${${var}}")
endif()
elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
- if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR")
+ if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
set(${absvar} "/${${var}}")
else()
set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/.*")
- if("${dir}" STREQUAL "SYSCONFDIR" OR "${dir}" STREQUAL "LOCALSTATEDIR" OR "${dir}" STREQUAL "RUNSTATEDIR")
+ if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
set(${absvar} "/${${var}}${CMAKE_INSTALL_PREFIX}")
else()
set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
@@ -366,6 +379,10 @@ macro(GNUInstallDirs_get_absolute_install_dir absvar var)
else()
set(${absvar} "${${var}}")
endif()
+
+ unset(GGAID_dir)
+ unset(GGAID_extra_arg_count)
+ unset(GGAID_extra_args)
endmacro()
# Result directories
@@ -388,7 +405,7 @@ foreach(dir
MANDIR
DOCDIR
)
- GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_${dir} CMAKE_INSTALL_${dir})
+ GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_${dir} CMAKE_INSTALL_${dir} ${dir})
endforeach()
cmake_policy(POP)
diff --git a/Modules/Internal/CheckCompilerFlag.cmake b/Modules/Internal/CheckCompilerFlag.cmake
new file mode 100644
index 0000000..f790d87
--- /dev/null
+++ b/Modules/Internal/CheckCompilerFlag.cmake
@@ -0,0 +1,79 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include_guard(GLOBAL)
+include(Internal/CheckSourceCompiles)
+include(CMakeCheckCompilerFlagCommonPatterns)
+
+cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
+cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
+
+function(CMAKE_CHECK_COMPILER_FLAG _lang _flag _var)
+
+ if(_lang STREQUAL C)
+ set(_lang_src "int main(void) { return 0; }")
+ set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C")
+ elseif(_lang STREQUAL CXX)
+ set(_lang_src "int main() { return 0; }")
+ set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+")
+ elseif(_lang STREQUAL CUDA)
+ set(_lang_src "__host__ int main() { return 0; }")
+ set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU
+ FAIL_REGEX "argument unused during compilation: .*") # Clang
+ elseif(_lang STREQUAL Fortran)
+ set(_lang_src " program test\n stop\n end program")
+ set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran")
+ elseif(_lang STREQUAL OBJC)
+ set(_lang_src [=[
+#ifndef __OBJC__
+# error "Not an Objective-C compiler"
+#endif
+int main(void) { return 0; }]=])
+ set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU
+ FAIL_REGEX "argument unused during compilation: .*") # Clang
+ elseif(_lang STREQUAL OBJCXX)
+ set(_lang_src [=[
+#ifndef __OBJC__
+# error "Not an Objective-C++ compiler"
+#endif
+int main(void) { return 0; }]=])
+ set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU
+ FAIL_REGEX "argument unused during compilation: .*") # Clang
+ elseif(_lang STREQUAL ISPC)
+ set(_lang_src "float func(uniform int32, float a) { return a / 2.25; }")
+ else()
+ message (SEND_ERROR "check_compiler_flag: ${_lang}: unknown language.")
+ return()
+ endif()
+
+ get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+ if (NOT _lang IN_LIST _supported_languages)
+ message (SEND_ERROR "check_compiler_flag: ${_lang}: needs to be enabled before use.")
+ return()
+ endif()
+
+ set(CMAKE_REQUIRED_DEFINITIONS ${_flag})
+
+ # Normalize locale during test compilation.
+ set(_locale_vars LC_ALL LC_MESSAGES LANG)
+ foreach(v IN LISTS _locale_vars)
+ set(_locale_vars_saved_${v} "$ENV{${v}}")
+ set(ENV{${v}} C)
+ endforeach()
+
+ check_compiler_flag_common_patterns(_common_patterns)
+ cmake_check_source_compiles(${_lang}
+ "${_lang_src}"
+ ${_var}
+ ${_lang_fail_regex}
+ ${_common_patterns}
+ )
+
+ foreach(v IN LISTS _locale_vars)
+ set(ENV{${v}} ${_locale_vars_saved_${v}})
+ endforeach()
+ set(${_var} "${${_var}}" PARENT_SCOPE)
+endfunction ()
+
+cmake_policy(POP)
diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake
new file mode 100644
index 0000000..91c8964
--- /dev/null
+++ b/Modules/Internal/CheckSourceCompiles.cmake
@@ -0,0 +1,127 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include_guard(GLOBAL)
+
+cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
+cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
+
+function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
+ if(NOT DEFINED "${_var}")
+
+ if(_lang STREQUAL C)
+ set(_lang_textual "C")
+ set(_lang_ext "c")
+ elseif(_lang STREQUAL CXX)
+ set(_lang_textual "C++")
+ set(_lang_ext "cxx")
+ elseif(_lang STREQUAL CUDA)
+ set(_lang_textual "CUDA")
+ set(_lang_ext "cu")
+ elseif(_lang STREQUAL Fortran)
+ set(_lang_textual "Fortran")
+ set(_lang_ext "F90")
+ elseif(_lang STREQUAL ISPC)
+ set(_lang_textual "ISPC")
+ set(_lang_ext "ispc")
+ elseif(_lang STREQUAL OBJC)
+ set(_lang_textual "Objective-C")
+ set(_lang_ext "m")
+ elseif(_lang STREQUAL OBJCXX)
+ set(_lang_textual "Objective-C++")
+ set(_lang_ext "mm")
+ else()
+ message (SEND_ERROR "check_source_compiles: ${_lang}: unknown language.")
+ return()
+ endif()
+
+ get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+ if (NOT _lang IN_LIST _supported_languages)
+ message (SEND_ERROR "check_source_compiles: ${_lang}: needs to be enabled before use.")
+ return()
+ endif()
+
+ set(_FAIL_REGEX)
+ set(_SRC_EXT)
+ set(_key)
+ foreach(arg ${ARGN})
+ if("${arg}" MATCHES "^(FAIL_REGEX|SRC_EXT)$")
+ set(_key "${arg}")
+ elseif(_key STREQUAL "FAIL_REGEX")
+ list(APPEND _FAIL_REGEX "${arg}")
+ elseif(_key STREQUAL "SRC_EXT")
+ set(_SRC_EXT "${arg}")
+ set(_key "")
+ else()
+ message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
+ endif()
+ endforeach()
+
+ if(NOT _SRC_EXT)
+ set(_SRC_EXT ${_lang_ext})
+ endif()
+
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
+ if(CMAKE_REQUIRED_LIBRARIES)
+ set(CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES
+ LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+ else()
+ set(CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_${LANG}_SOURCE_COMPILES_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_${LANG}_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
+ "${_source}\n")
+
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(CHECK_START "Performing Test ${_var}")
+ endif()
+ try_compile(${_var}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
+ COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS}
+ ${CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}
+ "${CHECK_${LANG}_SOURCE_COMPILES_ADD_INCLUDES}"
+ OUTPUT_VARIABLE OUTPUT)
+
+ foreach(_regex ${_FAIL_REGEX})
+ if("${OUTPUT}" MATCHES "${_regex}")
+ set(${_var} 0)
+ endif()
+ endforeach()
+
+ if(${_var})
+ set(${_var} 1 CACHE INTERNAL "Test ${_var}")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(CHECK_PASS "Success")
+ endif()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing ${_lang_textual} SOURCE FILE Test ${_var} succeeded with the following output:\n"
+ "${OUTPUT}\n"
+ "Source file was:\n${_source}\n")
+ else()
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(CHECK_FAIL "Failed")
+ endif()
+ set(${_var} "" CACHE INTERNAL "Test ${_var}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing ${_lang_textual} SOURCE FILE Test ${_var} failed with the following output:\n"
+ "${OUTPUT}\n"
+ "Source file was:\n${_source}\n")
+ endif()
+ endif()
+endfunction()
+
+cmake_policy(POP)
diff --git a/Modules/Internal/CheckSourceRuns.cmake b/Modules/Internal/CheckSourceRuns.cmake
new file mode 100644
index 0000000..3a4b758
--- /dev/null
+++ b/Modules/Internal/CheckSourceRuns.cmake
@@ -0,0 +1,142 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include_guard(GLOBAL)
+
+cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
+cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
+
+function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var)
+ if(NOT DEFINED "${_var}")
+
+ if(_lang STREQUAL C)
+ set(_lang_textual "C")
+ set(_lang_ext "c")
+ elseif(_lang STREQUAL CXX)
+ set(_lang_textual "C++")
+ set(_lang_ext "cxx")
+ elseif(_lang STREQUAL CUDA)
+ set(_lang_textual "CUDA")
+ set(_lang_ext "cu")
+ elseif(_lang STREQUAL Fortran)
+ set(_lang_textual "Fortran")
+ set(_lang_ext "F90")
+ elseif(_lang STREQUAL OBJC)
+ set(_lang_textual "Objective-C")
+ set(_lang_ext "m")
+ elseif(_lang STREQUAL OBJCXX)
+ set(_lang_textual "Objective-C++")
+ set(_lang_ext "mm")
+ else()
+ message (SEND_ERROR "check_source_runs: ${_lang}: unknown language.")
+ return()
+ endif()
+
+ get_property (_supported_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+ if (NOT _lang IN_LIST _supported_languages)
+ message (SEND_ERROR "check_source_runs: ${_lang}: needs to be enabled before use.")
+ return()
+ endif()
+
+ set(_FAIL_REGEX)
+ set(_SRC_EXT)
+ set(_key)
+ foreach(arg ${ARGN})
+ if("${arg}" MATCHES "^(FAIL_REGEX|SRC_EXT)$")
+ set(_key "${arg}")
+ elseif(_key STREQUAL "FAIL_REGEX")
+ list(APPEND _FAIL_REGEX "${arg}")
+ elseif(_key STREQUAL "SRC_EXT")
+ set(_SRC_EXT "${arg}")
+ set(_key "")
+ else()
+ set(message_type FATAL_ERROR)
+ if (_CheckSourceRuns_old_signature)
+ set(message_type AUTHOR_WARNING)
+ endif ()
+ message("${message_type}" "Unknown argument:\n ${arg}\n")
+ unset(message_type)
+ endif()
+ endforeach()
+
+ if(NOT _SRC_EXT)
+ set(_SRC_EXT ${_lang_ext})
+ endif()
+
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_${_lang}_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_${_lang}_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
+ if(CMAKE_REQUIRED_LIBRARIES)
+ set(CHECK_${_lang}_SOURCE_COMPILES_ADD_LIBRARIES
+ LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+ else()
+ set(CHECK_${_lang}_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
+ "${_source}\n")
+
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(CHECK_START "Performing Test ${_var}")
+ endif()
+ try_run(${_var}_EXITCODE ${_var}_COMPILED
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
+ COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_${_lang}_SOURCE_COMPILES_ADD_LINK_OPTIONS}
+ ${CHECK_${_lang}_SOURCE_COMPILES_ADD_LIBRARIES}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}
+ -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
+ "${CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES}"
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE RUN_OUTPUT)
+ # if it did not compile make the return value fail code of 1
+ if(NOT ${_var}_COMPILED)
+ set(${_var}_EXITCODE 1)
+ set(${_var}_EXITCODE 1 PARENT_SCOPE)
+ endif()
+ # if the return value was 0 then it worked
+ if("${${_var}_EXITCODE}" EQUAL 0)
+ set(${_var} 1 CACHE INTERNAL "Test ${_var}")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(CHECK_PASS "Success")
+ endif()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing ${_lang_textual} SOURCE FILE Test ${_var} succeeded with the following compile output:\n"
+ "${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
+ "Return value: ${${_var}}\n"
+ "Source file was:\n${_source}\n")
+ else()
+ if(CMAKE_CROSSCOMPILING AND "${${_var}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ set(${_var} "${${_var}_EXITCODE}" PARENT_SCOPE)
+ else()
+ set(${_var} "" CACHE INTERNAL "Test ${_var}")
+ endif()
+
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(CHECK_FAIL "Failed")
+ endif()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing ${_lang_textual} SOURCE FILE Test ${_var} failed with the following compile output:\n"
+ "${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
+ "Return value: ${${_var}_EXITCODE}\n"
+ "Source file was:\n${_source}\n")
+
+ endif()
+ endif()
+endfunction()
+
+cmake_policy(POP)
diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake
index 160eada..44d48cd 100644
--- a/Modules/Platform/Android-Clang.cmake
+++ b/Modules/Platform/Android-Clang.cmake
@@ -7,6 +7,12 @@ if(__ANDROID_COMPILER_CLANG)
endif()
set(__ANDROID_COMPILER_CLANG 1)
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android-Clang.cmake OPTIONAL)
+endif()
+
# Support for NVIDIA Nsight Tegra Visual Studio Edition was previously
# implemented in the CMake VS IDE generators. Avoid interfering with
# that functionality for now. Later we may try to integrate this.
@@ -57,3 +63,9 @@ macro(__android_compiler_clang lang)
set(_ANDROID_STL_NOSTDLIBXX 1)
endif()
endmacro()
+
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/post/Android-Clang.cmake OPTIONAL)
+endif()
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake
index 581fde4..39da933 100644
--- a/Modules/Platform/Android-Common.cmake
+++ b/Modules/Platform/Android-Common.cmake
@@ -53,6 +53,12 @@ if(CMAKE_ANDROID_STL_TYPE)
set(_ANDROID_STL_RTTI 0)
macro(__android_stl lang)
string(APPEND CMAKE_${lang}_FLAGS_INIT " -stdlib=libstdc++")
+ if(_ANDROID_STL_EXCEPTIONS OR _ANDROID_STL_RTTI)
+ string(APPEND CMAKE_${lang}_STANDARD_LIBRARIES " -lc++abi")
+ if(CMAKE_SYSTEM_VERSION LESS 21)
+ list(APPEND CMAKE_${lang}_STANDARD_LIBRARIES "-landroid_support")
+ endif()
+ endif()
endmacro()
elseif(CMAKE_ANDROID_STL_TYPE STREQUAL "c++_static")
set(_ANDROID_STL_EXCEPTIONS 1)
@@ -81,6 +87,12 @@ if(CMAKE_ANDROID_STL_TYPE)
"Android: STL '${CMAKE_ANDROID_STL_TYPE}' not supported by this NDK."
)
endif()
+ if(DEFINED CMAKE_ANDROID_RTTI)
+ set(_ANDROID_STL_RTTI ${CMAKE_ANDROID_RTTI})
+ endif()
+ if(DEFINED CMAKE_ANDROID_EXCEPTIONS)
+ set(_ANDROID_STL_EXCEPTIONS ${CMAKE_ANDROID_EXCEPTIONS})
+ endif()
elseif(CMAKE_ANDROID_NDK)
macro(__android_stl_inc lang dir req)
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index f7d8d13..3206c83 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -5,6 +5,12 @@
# This module detects platform-wide information about the Android target
# in order to store it in "CMakeSystem.cmake".
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android-Determine.cmake OPTIONAL)
+endif()
+
# Support for NVIDIA Nsight Tegra Visual Studio Edition was previously
# implemented in the CMake VS IDE generators. Avoid interfering with
# that functionality for now.
@@ -519,3 +525,9 @@ endif()
message(STATUS "Android: Targeting API '${CMAKE_SYSTEM_VERSION}' with architecture '${CMAKE_ANDROID_ARCH}', ABI '${CMAKE_ANDROID_ARCH_ABI}', and processor '${CMAKE_SYSTEM_PROCESSOR}'")
cmake_policy(POP)
+
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/post/Android-Determine.cmake OPTIONAL)
+endif()
diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake
index 5019c28..db75703 100644
--- a/Modules/Platform/Android-Initialize.cmake
+++ b/Modules/Platform/Android-Initialize.cmake
@@ -4,6 +4,12 @@
# When CMAKE_SYSTEM_NAME is "Android", CMakeSystemSpecificInitialize loads this
# module.
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android-Initialize.cmake OPTIONAL)
+endif()
+
# Support for NVIDIA Nsight Tegra Visual Studio Edition was previously
# implemented in the CMake VS IDE generators. Avoid interfering with
# that functionality for now.
@@ -53,3 +59,9 @@ else()
"Android: No CMAKE_SYSROOT was selected."
)
endif()
+
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/post/Android-Initialize.cmake OPTIONAL)
+endif()
diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake
index 8ffa1b2..2a1a7a3 100644
--- a/Modules/Platform/Android.cmake
+++ b/Modules/Platform/Android.cmake
@@ -1,3 +1,9 @@
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android.cmake OPTIONAL)
+endif()
+
include(Platform/Linux)
set(ANDROID 1)
@@ -22,3 +28,83 @@ set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
set(CMAKE_LINK_LIBRARY_FLAG "")
endif()
+
+# Commonly used Android toolchain files that pre-date CMake upstream support
+# set CMAKE_SYSTEM_VERSION to 1. Avoid interfering with them.
+if(CMAKE_SYSTEM_VERSION EQUAL 1)
+ return()
+endif()
+
+if(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED)
+ # Tell CMake not to search host sysroots for headers/libraries.
+ # CMAKE_FIND_ROOT_PATH must be non-empty for CMAKE_FIND_ROOT_PATH_MODE_* == ONLY
+ # to be meaningful. The actual path used here is fairly meaningless since CMake
+ # doesn't handle the NDK sysroot layout (per-arch and per-verion subdirectories for
+ # libraries), so find_library is handled separately by CMAKE_SYSTEM_LIBRARY_PATH.
+ # https://github.com/android-ndk/ndk/issues/890
+ if(NOT CMAKE_FIND_ROOT_PATH)
+ list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_ANDROID_NDK}")
+ endif()
+
+ # Allow users to override these values in case they want more strict behaviors.
+ # For example, they may want to prevent the NDK's libz from being picked up so
+ # they can use their own.
+ # https://github.com/android-ndk/ndk/issues/517
+ if(NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_PROGRAM)
+ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+ endif()
+
+ if(NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ endif()
+
+ if(NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+ endif()
+
+ if(NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_PACKAGE)
+ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+ endif()
+
+ # find_library's default search paths below a prefix do not match the Android
+ # sysroot layout, so we need to give the direct path to the libraries
+ # via CMAKE_SYSTEM_*_PATH.
+ #
+ # Ideally we'd set CMAKE_SYSTEM_PREFIX_PATH. But that causes the
+ # non-api-level-specific path to be searched first for find_library, which will
+ # cause libdl.a to be found before libdl.so.
+ # https://github.com/android/ndk/issues/929
+
+ # Clears the paths set by UnixPaths.cmake.
+ set(CMAKE_SYSTEM_PREFIX_PATH)
+ set(CMAKE_SYSTEM_INCLUDE_PATH)
+ set(CMAKE_SYSTEM_LIBRARY_PATH)
+
+ # Don't search paths in PATH environment variable.
+ if(NOT DEFINED CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH)
+ set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+ endif()
+
+ # Allows CMake to find headers in the architecture-specific include directories.
+ set(CMAKE_LIBRARY_ARCHITECTURE "${CMAKE_ANDROID_ARCH_TRIPLE}")
+
+ set(_ANDROID_SYSROOT_PREFIX "${CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED}/sysroot/usr")
+
+ list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
+ "${_ANDROID_SYSROOT_PREFIX}/include/${CMAKE_LIBRARY_ARCHITECTURE}")
+ list(APPEND CMAKE_SYSTEM_INCLUDE_PATH "${_ANDROID_SYSROOT_PREFIX}/include")
+
+ # Instructs CMake to search the correct API level for libraries.
+ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+ "${_ANDROID_SYSROOT_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}/${CMAKE_SYSTEM_VERSION}")
+ list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+ "${_ANDROID_SYSROOT_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+
+ list(APPEND CMAKE_SYSTEM_PROGRAM_PATH "${CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED}/bin")
+endif()
+
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/post/Android.cmake OPTIONAL)
+endif()
diff --git a/Modules/Platform/Android/Determine-Compiler.cmake b/Modules/Platform/Android/Determine-Compiler.cmake
index f9c2d89..f8eae62 100644
--- a/Modules/Platform/Android/Determine-Compiler.cmake
+++ b/Modules/Platform/Android/Determine-Compiler.cmake
@@ -7,6 +7,12 @@ if(__ANDROID_DETERMINE_COMPILER)
endif()
set(__ANDROID_DETERMINE_COMPILER 1)
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Determine-Compiler.cmake OPTIONAL)
+endif()
+
# Support for NVIDIA Nsight Tegra Visual Studio Edition was previously
# implemented in the CMake VS IDE generators. Avoid interfering with
# that functionality for now. Later we may try to integrate this.
@@ -83,3 +89,9 @@ set(CMAKE_${lang}_ANDROID_TOOLCHAIN_SUFFIX \"${_ANDROID_TOOL_${lang}_TOOLCHAIN_S
")
endif()
endmacro()
+
+# Include the NDK hook.
+# It can be used by NDK to inject necessary fixes for an earlier cmake.
+if(CMAKE_ANDROID_NDK)
+ include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/post/Determine-Compiler.cmake OPTIONAL)
+endif()
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 15e6123..213f71b 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -145,20 +145,26 @@ function(_apple_resolve_supported_archs_for_sdk_from_system_lib sdk_path ret ret
# Newer SDKs ship text based dylib stub files which contain the architectures supported by the
# library in text form.
if(EXISTS "${system_lib_tbd_path}")
- file(STRINGS "${system_lib_tbd_path}" tbd_lines REGEX "^archs: +\\[.+\\]")
+ file(STRINGS "${system_lib_tbd_path}" tbd_lines REGEX "^(archs|targets): +\\[.+\\]")
if(NOT tbd_lines)
set(${ret_failed} TRUE PARENT_SCOPE)
return()
endif()
# The tbd architectures line looks like the following:
- # archs: [ armv7, armv7s, arm64, arm64e ]
+ # archs: [ armv7, armv7s, arm64, arm64e ]
+ # or for version 4 TBD files:
+ # targets: [ armv7-ios, armv7s-ios, arm64-ios, arm64e-ios ]
list(GET tbd_lines 0 first_arch_line)
string(REGEX REPLACE
- "archs: +\\[ (.+) \\]" "\\1" arches_comma_separated "${first_arch_line}")
+ "(archs|targets): +\\[ (.+) \\]" "\\2" arches_comma_separated "${first_arch_line}")
string(STRIP "${arches_comma_separated}" arches_comma_separated)
string(REPLACE "," ";" arch_list "${arches_comma_separated}")
string(REPLACE " " "" arch_list "${arch_list}")
+
+ # Remove -platform suffix from target (version 4 only)
+ string(REGEX REPLACE "-[a-z-]+" "" arch_list "${arch_list}")
+
if(NOT arch_list)
set(${ret_failed} TRUE PARENT_SCOPE)
return()
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 2261c90..6275043 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -112,7 +112,9 @@ macro(__enable_llvm_rc_preprocessing clang_option_prefix)
endif()
if(DEFINED CMAKE_RC_PREPROCESSOR)
set(CMAKE_DEPFILE_FLAGS_RC "${clang_option_prefix}-MD ${clang_option_prefix}-MF ${clang_option_prefix}<DEPFILE>")
- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_COMMAND> -E cmake_llvm_rc <SOURCE> <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> -E -- <SOURCE> ++ <CMAKE_RC_COMPILER> <DEFINES> -I <SOURCE_DIR> <INCLUDES> /fo <OBJECT> <OBJECT>.pp")
+ # The <FLAGS> are passed to the preprocess and the resource compiler to pick
+ # up the eventual -D / -C options passed through the CMAKE_RC_FLAGS.
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_COMMAND> -E cmake_llvm_rc <SOURCE> <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> -E -- <SOURCE> ++ <CMAKE_RC_COMPILER> <DEFINES> -I <SOURCE_DIR> <INCLUDES> <FLAGS> /fo <OBJECT> <OBJECT>.pp")
if(CMAKE_GENERATOR MATCHES "Ninja")
set(CMAKE_NINJA_CMCLDEPS_RC 0)
set(CMAKE_NINJA_DEP_TYPE_RC gcc)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 67d986a..5137cc1 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 19)
-set(CMake_VERSION_PATCH 20201022)
+set(CMake_VERSION_PATCH 20201106)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index a9fe91c..8b544b4 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1329,7 +1329,7 @@ bool cmCPackGenerator::ConfigureFile(const std::string& inName,
bool copyOnly /* = false */)
{
return this->MakefileMap->ConfigureFile(inName, outName, copyOnly, true,
- false, true) == 1;
+ false) == 1;
}
int cmCPackGenerator::CleanTemporaryDirectory()
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index a5b2f34..c1555a2 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -33,11 +33,16 @@ static const char* cmDocumentationUsage[][2] = {
" cmake-gui [options] <path-to-source>\n"
" cmake-gui [options] <path-to-existing-build>\n"
" cmake-gui [options] -S <path-to-source> -B <path-to-build>\n"
- " cmake-gui [options] -S <path-to-source> --preset=<preset-name>\n" },
+ " cmake-gui [options] --browse-manual\n" },
{ nullptr, nullptr }
};
-static const char* cmDocumentationOptions[][2] = { { nullptr, nullptr } };
+static const char* cmDocumentationOptions[][2] = {
+ { "-S <path-to-source>", "Explicitly specify a source directory." },
+ { "-B <path-to-build>", "Explicitly specify a build directory." },
+ { "--preset=<preset>", "Specify a configure preset." },
+ { nullptr, nullptr }
+};
#if defined(Q_OS_MAC)
static int cmOSXInstall(std::string dir);
@@ -57,6 +62,7 @@ Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin);
int CMakeGUIExec(CMakeSetupDialog* window);
void SetupDefaultQSettings();
+void OpenReferenceManual();
int main(int argc, char** argv)
{
@@ -194,6 +200,9 @@ int main(int argc, char** argv)
return 1;
}
presetName = preset.toLocal8Bit().data();
+ } else if (arg == "--browse-manual") {
+ OpenReferenceManual();
+ return 0;
}
}
if (!sourceDirectory.empty() &&
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 7a04daa..05518a9 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -43,6 +43,21 @@
#include "RegexExplorer.h"
#include "WarningMessagesDialog.h"
+void OpenReferenceManual()
+{
+ QString urlFormat("https://cmake.org/cmake/help/v%1.%2/");
+ QUrl url(urlFormat.arg(QString::number(cmVersion::GetMajorVersion()),
+ QString::number(cmVersion::GetMinorVersion())));
+
+ if (!cmSystemTools::GetHTMLDoc().empty()) {
+ url = QUrl::fromLocalFile(
+ QDir(QString::fromLocal8Bit(cmSystemTools::GetHTMLDoc().data()))
+ .filePath("index.html"));
+ }
+
+ QDesktopServices::openUrl(url);
+}
+
namespace {
const QString PRESETS_DISABLED_TOOLTIP =
"This option is disabled because there are no available presets in "
@@ -194,19 +209,7 @@ CMakeSetupDialog::CMakeSetupDialog()
QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doHelp);
a->setShortcut(QKeySequence::HelpContents);
a = HelpMenu->addAction(tr("CMake Reference Manual"));
- QObject::connect(a, &QAction::triggered, this, []() {
- QString urlFormat("https://cmake.org/cmake/help/v%1.%2/");
- QUrl url(urlFormat.arg(QString::number(cmVersion::GetMajorVersion()),
- QString::number(cmVersion::GetMinorVersion())));
-
- if (!cmSystemTools::GetHTMLDoc().empty()) {
- url = QUrl::fromLocalFile(
- QDir(QString::fromLocal8Bit(cmSystemTools::GetHTMLDoc().data()))
- .filePath("index.html"));
- }
-
- QDesktopServices::openUrl(url);
- });
+ QObject::connect(a, &QAction::triggered, this, OpenReferenceManual);
a = HelpMenu->addAction(tr("About"));
QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doAbout);
@@ -859,8 +862,10 @@ bool CMakeSetupDialog::setupFirstConfigure()
if (presetData.isValid()) {
auto preset = presetData.value<QCMakePreset>();
dialog.setCurrentGenerator(preset.generator);
- if (preset.setGenConfig) {
+ if (preset.setArchitecture) {
dialog.setPlatform(preset.architecture);
+ }
+ if (preset.setToolset) {
dialog.setToolset(preset.toolset);
}
dialog.setCompilerOption(CompilerOption::DefaultNative);
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 3789e93..2f41f70 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -551,9 +551,11 @@ void QCMake::loadPresets()
preset.generator = std::move(QString::fromLocal8Bit(p.Generator.data()));
preset.architecture =
std::move(QString::fromLocal8Bit(p.Architecture.data()));
+ preset.setArchitecture = !p.ArchitectureStrategy ||
+ p.ArchitectureStrategy == cmCMakePresetsFile::ArchToolsetStrategy::Set;
preset.toolset = std::move(QString::fromLocal8Bit(p.Toolset.data()));
- preset.setGenConfig = !p.GeneratorConfig ||
- p.GeneratorConfig == cmCMakePresetsFile::CMakeGeneratorConfig::Default;
+ preset.setToolset = !p.ToolsetStrategy ||
+ p.ToolsetStrategy == cmCMakePresetsFile::ArchToolsetStrategy::Set;
preset.enabled = it.Expanded &&
std::find_if(this->AvailableGenerators.begin(),
this->AvailableGenerators.end(),
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 4f4b218..22f5be1 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -642,6 +642,19 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e,
return success;
}
+bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt)
+{
+ // FIXME: This filter avoids a crash when opening a file dialog
+ // with the '...' button on a cache entry line in the GUI.
+ // Previously this filter was commented as a workaround for Qt issue 205903,
+ // but that was fixed in Qt 4.5.0 and the crash still occurs as of Qt 5.14
+ // without this filter. This needs further investigation.
+ if (evt->type() == QEvent::FocusOut && this->FileDialogFlag) {
+ return false;
+ }
+ return QItemDelegate::eventFilter(object, evt);
+}
+
void QCMakeCacheModelDelegate::setModelData(QWidget* editor,
QAbstractItemModel* model,
const QModelIndex& index) const
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 11c6d3e..c5e6dd4 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -143,6 +143,7 @@ public:
bool editorEvent(QEvent* event, QAbstractItemModel* model,
const QStyleOptionViewItem& option,
const QModelIndex& index);
+ bool eventFilter(QObject* object, QEvent* event);
void setModelData(QWidget* editor, QAbstractItemModel* model,
const QModelIndex& index) const;
QSize sizeHint(const QStyleOptionViewItem& option,
diff --git a/Source/QtDialog/QCMakePreset.cxx b/Source/QtDialog/QCMakePreset.cxx
index b10cf07..176f532 100644
--- a/Source/QtDialog/QCMakePreset.cxx
+++ b/Source/QtDialog/QCMakePreset.cxx
@@ -6,8 +6,9 @@ bool operator==(const QCMakePreset& lhs, const QCMakePreset& rhs)
{
return lhs.name == rhs.name && lhs.displayName == rhs.displayName &&
lhs.description == rhs.description && lhs.generator == rhs.generator &&
- lhs.architecture == rhs.architecture && lhs.toolset == rhs.toolset &&
- lhs.setGenConfig == rhs.setGenConfig && lhs.enabled == rhs.enabled;
+ lhs.architecture == rhs.architecture &&
+ lhs.setArchitecture == rhs.setArchitecture && lhs.toolset == rhs.toolset &&
+ lhs.setToolset == rhs.setToolset && lhs.enabled == rhs.enabled;
}
bool operator!=(const QCMakePreset& lhs, const QCMakePreset& rhs)
@@ -27,11 +28,13 @@ bool operator<(const QCMakePreset& lhs, const QCMakePreset& rhs)
(lhs.generator == rhs.generator &&
(lhs.architecture < rhs.architecture ||
(lhs.architecture == rhs.architecture &&
- (lhs.toolset < rhs.toolset ||
- (lhs.toolset == rhs.toolset &&
- (lhs.setGenConfig < rhs.setGenConfig ||
- (lhs.setGenConfig == rhs.setGenConfig &&
- (lhs.enabled < rhs.enabled))))))))))))));
+ (lhs.setArchitecture < rhs.setArchitecture ||
+ (lhs.setArchitecture == rhs.setArchitecture &&
+ (lhs.toolset < rhs.toolset ||
+ (lhs.toolset == rhs.toolset &&
+ (lhs.setToolset < rhs.setToolset ||
+ (lhs.setToolset == rhs.setToolset &&
+ (lhs.enabled < rhs.enabled))))))))))))))));
}
bool operator<=(const QCMakePreset& lhs, const QCMakePreset& rhs)
diff --git a/Source/QtDialog/QCMakePreset.h b/Source/QtDialog/QCMakePreset.h
index 93d70d8..1609fcb 100644
--- a/Source/QtDialog/QCMakePreset.h
+++ b/Source/QtDialog/QCMakePreset.h
@@ -15,8 +15,9 @@ public:
QString description;
QString generator;
QString architecture;
+ bool setArchitecture;
QString toolset;
- bool setGenConfig;
+ bool setToolset;
bool enabled;
};
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index bea89c0..c1f98fa 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -190,15 +190,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
case doing_byproducts:
if (!cmSystemTools::FileIsFullPath(copy)) {
// This is an output to be generated, so it should be
- // under the build tree. CMake 2.4 placed this under the
- // source tree. However the only case that this change
- // will break is when someone writes
- //
- // add_custom_command(OUTPUT out.txt ...)
- //
- // and later references "${CMAKE_CURRENT_SOURCE_DIR}/out.txt".
- // This is fairly obscure so we can wait for someone to
- // complain.
+ // under the build tree.
filename = cmStrCat(mf.GetCurrentBinaryDirectory(), '/');
}
filename += copy;
@@ -215,8 +207,7 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
}
if (cmSystemTools::FileIsFullPath(filename)) {
- filename = cmSystemTools::CollapseFullPath(
- filename, status.GetMakefile().GetHomeOutputDirectory());
+ filename = cmSystemTools::CollapseFullPath(filename);
}
switch (doing) {
case doing_depfile:
diff --git a/Source/cmCMakePresetsFile.cxx b/Source/cmCMakePresetsFile.cxx
index b3bb6df..cf5db6e 100644
--- a/Source/cmCMakePresetsFile.cxx
+++ b/Source/cmCMakePresetsFile.cxx
@@ -30,7 +30,7 @@ using ReadFileResult = cmCMakePresetsFile::ReadFileResult;
using CacheVariable = cmCMakePresetsFile::CacheVariable;
using UnexpandedPreset = cmCMakePresetsFile::UnexpandedPreset;
using ExpandedPreset = cmCMakePresetsFile::ExpandedPreset;
-using CMakeGeneratorConfig = cmCMakePresetsFile::CMakeGeneratorConfig;
+using ArchToolsetStrategy = cmCMakePresetsFile::ArchToolsetStrategy;
constexpr int MIN_VERSION = 1;
constexpr int MAX_VERSION = 1;
@@ -212,8 +212,8 @@ auto const PresetDebugHelper =
.Bind("find"_s, &UnexpandedPreset::DebugFind, PresetOptionalBoolHelper,
false);
-ReadFileResult CMakeGeneratorConfigHelper(
- cm::optional<CMakeGeneratorConfig>& out, const Json::Value* value)
+ReadFileResult ArchToolsetStrategyHelper(
+ cm::optional<ArchToolsetStrategy>& out, const Json::Value* value)
{
if (!value) {
out = cm::nullopt;
@@ -224,19 +224,56 @@ ReadFileResult CMakeGeneratorConfigHelper(
return ReadFileResult::INVALID_PRESET;
}
- if (value->asString() == "default") {
- out = CMakeGeneratorConfig::Default;
+ if (value->asString() == "set") {
+ out = ArchToolsetStrategy::Set;
return ReadFileResult::READ_OK;
}
- if (value->asString() == "ignore") {
- out = CMakeGeneratorConfig::Ignore;
+ if (value->asString() == "external") {
+ out = ArchToolsetStrategy::External;
return ReadFileResult::READ_OK;
}
return ReadFileResult::INVALID_PRESET;
}
+std::function<ReadFileResult(UnexpandedPreset&, const Json::Value*)>
+ArchToolsetHelper(
+ std::string UnexpandedPreset::*valueField,
+ cm::optional<ArchToolsetStrategy> UnexpandedPreset::*strategyField)
+{
+ auto const objectHelper =
+ cmJSONObjectHelper<UnexpandedPreset, ReadFileResult>(
+ ReadFileResult::READ_OK, ReadFileResult::INVALID_PRESET, false)
+ .Bind("value", valueField, PresetStringHelper, false)
+ .Bind("strategy", strategyField, ArchToolsetStrategyHelper, false);
+ return [valueField, strategyField, objectHelper](
+ UnexpandedPreset& out, const Json::Value* value) -> ReadFileResult {
+ if (!value) {
+ (out.*valueField).clear();
+ out.*strategyField = cm::nullopt;
+ return ReadFileResult::READ_OK;
+ }
+
+ if (value->isString()) {
+ out.*valueField = value->asString();
+ out.*strategyField = cm::nullopt;
+ return ReadFileResult::READ_OK;
+ }
+
+ if (value->isObject()) {
+ return objectHelper(out, value);
+ }
+
+ return ReadFileResult::INVALID_PRESET;
+ };
+}
+
+auto const ArchitectureHelper = ArchToolsetHelper(
+ &UnexpandedPreset::Architecture, &UnexpandedPreset::ArchitectureStrategy);
+auto const ToolsetHelper = ArchToolsetHelper(
+ &UnexpandedPreset::Toolset, &UnexpandedPreset::ToolsetStrategy);
+
auto const PresetHelper =
cmJSONObjectHelper<UnexpandedPreset, ReadFileResult>(
ReadFileResult::READ_OK, ReadFileResult::INVALID_PRESET, false)
@@ -252,11 +289,8 @@ auto const PresetHelper =
false)
.Bind("generator"_s, &UnexpandedPreset::Generator, PresetStringHelper,
false)
- .Bind("architecture"_s, &UnexpandedPreset::Architecture,
- PresetStringHelper, false)
- .Bind("toolset"_s, &UnexpandedPreset::Toolset, PresetStringHelper, false)
- .Bind("cmakeGeneratorConfig"_s, &UnexpandedPreset::GeneratorConfig,
- CMakeGeneratorConfigHelper, false)
+ .Bind("architecture"_s, ArchitectureHelper, false)
+ .Bind("toolset"_s, ToolsetHelper, false)
.Bind("binaryDir"_s, &UnexpandedPreset::BinaryDir, PresetStringHelper,
false)
.Bind<std::string>("cmakeExecutable"_s, nullptr, PresetStringHelper, false)
@@ -353,8 +387,12 @@ ReadFileResult VisitPreset(
InheritString(preset.Generator, parent->second.Unexpanded.Generator);
InheritString(preset.Architecture, parent->second.Unexpanded.Architecture);
InheritString(preset.Toolset, parent->second.Unexpanded.Toolset);
- if (!preset.GeneratorConfig) {
- preset.GeneratorConfig = parent->second.Unexpanded.GeneratorConfig;
+ if (!preset.ArchitectureStrategy) {
+ preset.ArchitectureStrategy =
+ parent->second.Unexpanded.ArchitectureStrategy;
+ }
+ if (!preset.ToolsetStrategy) {
+ preset.ToolsetStrategy = parent->second.Unexpanded.ToolsetStrategy;
}
InheritString(preset.BinaryDir, parent->second.Unexpanded.BinaryDir);
InheritOptionalBool(preset.WarnDev, parent->second.Unexpanded.WarnDev);
@@ -638,6 +676,10 @@ ExpandMacroResult ExpandMacro(const cmCMakePresetsFile& file,
out += cmSystemTools::GetParentDirectory(file.SourceDir);
return ExpandMacroResult::Ok;
}
+ if (macroName == "sourceDirName") {
+ out += cmSystemTools::GetFilenameName(file.SourceDir);
+ return ExpandMacroResult::Ok;
+ }
if (macroName == "presetName") {
out += preset.Name;
return ExpandMacroResult::Ok;
diff --git a/Source/cmCMakePresetsFile.h b/Source/cmCMakePresetsFile.h
index 87797d7..f6b159a 100644
--- a/Source/cmCMakePresetsFile.h
+++ b/Source/cmCMakePresetsFile.h
@@ -12,10 +12,10 @@
class cmCMakePresetsFile
{
public:
- enum class CMakeGeneratorConfig
+ enum class ArchToolsetStrategy
{
- Default,
- Ignore,
+ Set,
+ External,
};
class CacheVariable
@@ -50,8 +50,9 @@ public:
std::string Description;
std::string Generator;
std::string Architecture;
+ cm::optional<ArchToolsetStrategy> ArchitectureStrategy;
std::string Toolset;
- cm::optional<CMakeGeneratorConfig> GeneratorConfig;
+ cm::optional<ArchToolsetStrategy> ToolsetStrategy;
std::string BinaryDir;
std::map<std::string, cm::optional<CacheVariable>> CacheVariables;
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 95686ea..8d1a5fd 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -162,6 +162,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
cmSystemTools::Error(message.str());
}
}
+ this->CacheLoaded = true;
return true;
}
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 20d49a8..9aebffc 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -66,6 +66,9 @@ public:
//! Print the cache to a stream
void PrintCache(std::ostream&) const;
+ //! Get whether or not cache is loaded
+ bool IsCacheLoaded() const { return this->CacheLoaded; }
+
//! Get a value from the cache given a key
cmProp GetInitializedCacheValue(const std::string& key) const;
@@ -204,6 +207,7 @@ private:
const CacheEntry& e, cmMessenger* messenger) const;
std::map<std::string, CacheEntry> Cache;
+ bool CacheLoaded = false;
// Cache version info
unsigned int CacheMajorVersion = 0;
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 37be542..9e5b783 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -119,12 +119,19 @@
void GetScriptingCommands(cmState* state)
{
- state->AddBuiltinCommand("break", cmBreakCommand);
+ state->AddFlowControlCommand("break", cmBreakCommand);
+ state->AddFlowControlCommand("continue", cmContinueCommand);
+ state->AddFlowControlCommand("foreach", cmForEachCommand);
+ state->AddFlowControlCommand("function", cmFunctionCommand);
+ state->AddFlowControlCommand("if", cmIfCommand);
+ state->AddFlowControlCommand("macro", cmMacroCommand);
+ state->AddFlowControlCommand("return", cmReturnCommand);
+ state->AddFlowControlCommand("while", cmWhileCommand);
+
state->AddBuiltinCommand("cmake_minimum_required", cmCMakeMinimumRequired);
state->AddBuiltinCommand("cmake_path", cmCMakePathCommand);
state->AddBuiltinCommand("cmake_policy", cmCMakePolicyCommand);
state->AddBuiltinCommand("configure_file", cmConfigureFileCommand);
- state->AddBuiltinCommand("continue", cmContinueCommand);
state->AddBuiltinCommand("exec_program", cmExecProgramCommand);
state->AddBuiltinCommand("execute_process", cmExecuteProcessCommand);
state->AddBuiltinCommand("file", cmFileCommand);
@@ -133,26 +140,21 @@ void GetScriptingCommands(cmState* state)
state->AddBuiltinCommand("find_package", cmFindPackage);
state->AddBuiltinCommand("find_path", cmFindPath);
state->AddBuiltinCommand("find_program", cmFindProgram);
- state->AddBuiltinCommand("foreach", cmForEachCommand);
- state->AddBuiltinCommand("function", cmFunctionCommand);
state->AddBuiltinCommand("get_cmake_property", cmGetCMakePropertyCommand);
state->AddBuiltinCommand("get_directory_property",
cmGetDirectoryPropertyCommand);
state->AddBuiltinCommand("get_filename_component",
cmGetFilenameComponentCommand);
state->AddBuiltinCommand("get_property", cmGetPropertyCommand);
- state->AddBuiltinCommand("if", cmIfCommand);
state->AddBuiltinCommand("include", cmIncludeCommand);
state->AddBuiltinCommand("include_guard", cmIncludeGuardCommand);
state->AddBuiltinCommand("list", cmListCommand);
- state->AddBuiltinCommand("macro", cmMacroCommand);
state->AddBuiltinCommand("make_directory", cmMakeDirectoryCommand);
state->AddBuiltinCommand("mark_as_advanced", cmMarkAsAdvancedCommand);
state->AddBuiltinCommand("math", cmMathCommand);
state->AddBuiltinCommand("message", cmMessageCommand);
state->AddBuiltinCommand("option", cmOptionCommand);
state->AddBuiltinCommand("cmake_parse_arguments", cmParseArgumentsCommand);
- state->AddBuiltinCommand("return", cmReturnCommand);
state->AddBuiltinCommand("separate_arguments", cmSeparateArgumentsCommand);
state->AddBuiltinCommand("set", cmSetCommand);
state->AddBuiltinCommand("set_directory_properties",
@@ -161,7 +163,6 @@ void GetScriptingCommands(cmState* state)
state->AddBuiltinCommand("site_name", cmSiteNameCommand);
state->AddBuiltinCommand("string", cmStringCommand);
state->AddBuiltinCommand("unset", cmUnsetCommand);
- state->AddBuiltinCommand("while", cmWhileCommand);
state->AddUnexpectedCommand(
"else",
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index 68322cc..edd261d 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -3,11 +3,15 @@
#include "cmConfigureFileCommand.h"
#include <set>
+#include <sstream>
#include <cm/string_view>
#include <cmext/string_view>
+#include <sys/types.h>
+
#include "cmExecutionStatus.h"
+#include "cmFSPermissions.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmNewLineStyle.h"
@@ -60,7 +64,19 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args,
}
bool copyOnly = false;
bool escapeQuotes = false;
- bool use_source_permissions = true;
+ bool useSourcePermissions = false;
+ bool noSourcePermissions = false;
+ bool filePermissions = false;
+ std::vector<std::string> filePermissionOptions;
+
+ enum class Doing
+ {
+ DoingNone,
+ DoingFilePermissions,
+ DoneFilePermissions
+ };
+
+ Doing doing = Doing::DoingNone;
static std::set<cm::string_view> noopOptions = {
/* Legacy. */
@@ -78,6 +94,9 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args,
bool atOnly = false;
for (unsigned int i = 2; i < args.size(); ++i) {
if (args[i] == "COPYONLY") {
+ if (doing == Doing::DoingFilePermissions) {
+ doing = Doing::DoneFilePermissions;
+ }
copyOnly = true;
if (newLineStyle.IsValid()) {
status.SetError("COPYONLY could not be used in combination "
@@ -85,13 +104,49 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args,
return false;
}
} else if (args[i] == "ESCAPE_QUOTES") {
+ if (doing == Doing::DoingFilePermissions) {
+ doing = Doing::DoneFilePermissions;
+ }
escapeQuotes = true;
} else if (args[i] == "@ONLY") {
+ if (doing == Doing::DoingFilePermissions) {
+ doing = Doing::DoneFilePermissions;
+ }
atOnly = true;
} else if (args[i] == "NO_SOURCE_PERMISSIONS") {
- use_source_permissions = false;
+ if (doing == Doing::DoingFilePermissions) {
+ status.SetError(" given both FILE_PERMISSIONS and "
+ "NO_SOURCE_PERMISSIONS. Only one option allowed.");
+ return false;
+ }
+ noSourcePermissions = true;
+ } else if (args[i] == "USE_SOURCE_PERMISSIONS") {
+ if (doing == Doing::DoingFilePermissions) {
+ status.SetError(" given both FILE_PERMISSIONS and "
+ "USE_SOURCE_PERMISSIONS. Only one option allowed.");
+ return false;
+ }
+ useSourcePermissions = true;
+ } else if (args[i] == "FILE_PERMISSIONS") {
+ if (useSourcePermissions) {
+ status.SetError(" given both FILE_PERMISSIONS and "
+ "USE_SOURCE_PERMISSIONS. Only one option allowed.");
+ return false;
+ }
+ if (noSourcePermissions) {
+ status.SetError(" given both FILE_PERMISSIONS and "
+ "NO_SOURCE_PERMISSIONS. Only one option allowed.");
+ return false;
+ }
+
+ if (doing == Doing::DoingNone) {
+ doing = Doing::DoingFilePermissions;
+ filePermissions = true;
+ }
} else if (noopOptions.find(args[i]) != noopOptions.end()) {
/* Ignore no-op options. */
+ } else if (doing == Doing::DoingFilePermissions) {
+ filePermissionOptions.push_back(args[i]);
} else {
unknown_args += " ";
unknown_args += args[i];
@@ -104,9 +159,53 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args,
status.GetMakefile().IssueMessage(MessageType::AUTHOR_WARNING, msg);
}
- if (!status.GetMakefile().ConfigureFile(
- inputFile, outputFile, copyOnly, atOnly, escapeQuotes,
- use_source_permissions, newLineStyle)) {
+ if (useSourcePermissions && noSourcePermissions) {
+ status.SetError(" given both USE_SOURCE_PERMISSIONS and "
+ "NO_SOURCE_PERMISSIONS. Only one option allowed.");
+ return false;
+ }
+
+ mode_t permisiions = 0;
+
+ if (filePermissions) {
+ if (filePermissionOptions.empty()) {
+ status.SetError(" given FILE_PERMISSIONS without any options.");
+ return false;
+ }
+
+ std::vector<std::string> invalidOptions;
+ for (auto const& e : filePermissionOptions) {
+ if (!cmFSPermissions::stringToModeT(e, permisiions)) {
+ invalidOptions.push_back(e);
+ }
+ }
+
+ if (!invalidOptions.empty()) {
+ std::ostringstream oss;
+ oss << " given invalid permission ";
+ for (auto i = 0u; i < invalidOptions.size(); i++) {
+ if (i == 0u) {
+ oss << "\"" << invalidOptions[i] << "\"";
+ } else {
+ oss << ",\"" << invalidOptions[i] << "\"";
+ }
+ }
+ oss << ".";
+ status.SetError(oss.str());
+ return false;
+ }
+ }
+
+ if (noSourcePermissions) {
+ permisiions |= cmFSPermissions::mode_owner_read;
+ permisiions |= cmFSPermissions::mode_owner_write;
+ permisiions |= cmFSPermissions::mode_group_read;
+ permisiions |= cmFSPermissions::mode_world_read;
+ }
+
+ if (!status.GetMakefile().ConfigureFile(inputFile, outputFile, copyOnly,
+ atOnly, escapeQuotes, permisiions,
+ newLineStyle)) {
status.SetError("Problem configuring file");
return false;
}
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index 9c4deea..9d492ba 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -127,7 +127,7 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
mf.AddDefinition("CMAKE_FORWARD_DECLARE_TESTS", forwardDeclareCode);
mf.AddDefinition("CMAKE_FUNCTION_TABLE_ENTIRES", functionMapCode);
bool res = true;
- if (!mf.ConfigureFile(configFile, driver, false, true, false, true)) {
+ if (!mf.ConfigureFile(configFile, driver, false, true, false)) {
res = false;
}
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index d8307f6..08a0574 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -35,8 +35,7 @@ void AppendPaths(const std::vector<std::string>& inputs,
for (std::string& it : result) {
cmSystemTools::ConvertToUnixSlashes(it);
if (cmSystemTools::FileIsFullPath(it)) {
- it = cmSystemTools::CollapseFullPath(
- it, lg->GetMakefile()->GetHomeOutputDirectory());
+ it = cmSystemTools::CollapseFullPath(it);
}
}
cm::append(output, result);
@@ -48,7 +47,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
std::string config,
cmLocalGenerator* lg,
bool transformDepfile)
- : CC(cc)
+ : CC(&cc)
, Config(std::move(config))
, LG(lg)
, OldStyle(cc.GetEscapeOldStyle())
@@ -57,23 +56,35 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
{
cmGeneratorExpression ge(cc.GetBacktrace());
- const cmCustomCommandLines& cmdlines = this->CC.GetCommandLines();
+ const cmCustomCommandLines& cmdlines = this->CC->GetCommandLines();
for (cmCustomCommandLine const& cmdline : cmdlines) {
cmCustomCommandLine argv;
for (std::string const& clarg : cmdline) {
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(clarg);
std::string parsed_arg = cge->Evaluate(this->LG, this->Config);
- if (this->CC.GetCommandExpandLists()) {
+ for (cmGeneratorTarget* gt : cge->GetTargets()) {
+ this->Utilities.emplace(BT<std::pair<std::string, bool>>(
+ { gt->GetName(), true }, cge->GetBacktrace()));
+ }
+ if (this->CC->GetCommandExpandLists()) {
cm::append(argv, cmExpandedList(parsed_arg));
} else {
argv.push_back(std::move(parsed_arg));
}
}
- // Later code assumes at least one entry exists, but expanding
- // lists on an empty command may have left this empty.
- // FIXME: Should we define behavior for removing empty commands?
- if (argv.empty()) {
+ if (!argv.empty()) {
+ // If the command references an executable target by name,
+ // collect the target to add a target-level dependency on it.
+ cmGeneratorTarget* gt = this->LG->FindGeneratorTargetToUse(argv.front());
+ if (gt && gt->GetType() == cmStateEnums::EXECUTABLE) {
+ this->Utilities.emplace(BT<std::pair<std::string, bool>>(
+ { gt->GetName(), true }, cc.GetBacktrace()));
+ }
+ } else {
+ // Later code assumes at least one entry exists, but expanding
+ // lists on an empty command may have left this empty.
+ // FIXME: Should we define behavior for removing empty commands?
argv.emplace_back();
}
@@ -114,7 +125,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
this->Byproducts);
AppendPaths(cc.GetDepends(), ge, this->LG, this->Config, this->Depends);
- const std::string& workingdirectory = this->CC.GetWorkingDirectory();
+ const std::string& workingdirectory = this->CC->GetWorkingDirectory();
if (!workingdirectory.empty()) {
std::unique_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(workingdirectory);
@@ -271,7 +282,7 @@ void cmCustomCommandGenerator::AppendArguments(unsigned int c,
std::string cmCustomCommandGenerator::GetFullDepfile() const
{
- std::string depfile = this->CC.GetDepfile();
+ std::string depfile = this->CC->GetDepfile();
if (depfile.empty()) {
return "";
}
@@ -305,7 +316,7 @@ std::string cmCustomCommandGenerator::GetInternalDepfile() const
const char* cmCustomCommandGenerator::GetComment() const
{
- return this->CC.GetComment();
+ return this->CC->GetComment();
}
std::string cmCustomCommandGenerator::GetWorkingDirectory() const
@@ -315,7 +326,7 @@ std::string cmCustomCommandGenerator::GetWorkingDirectory() const
std::vector<std::string> const& cmCustomCommandGenerator::GetOutputs() const
{
- return this->CC.GetOutputs();
+ return this->CC->GetOutputs();
}
std::vector<std::string> const& cmCustomCommandGenerator::GetByproducts() const
@@ -327,3 +338,9 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
{
return this->Depends;
}
+
+std::set<BT<std::pair<std::string, bool>>> const&
+cmCustomCommandGenerator::GetUtilities() const
+{
+ return this->Utilities;
+}
diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h
index 8b5259d..cb0d7df 100644
--- a/Source/cmCustomCommandGenerator.h
+++ b/Source/cmCustomCommandGenerator.h
@@ -4,17 +4,20 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <set>
#include <string>
+#include <utility>
#include <vector>
#include "cmCustomCommandLines.h"
+#include "cmListFileCache.h"
class cmCustomCommand;
class cmLocalGenerator;
class cmCustomCommandGenerator
{
- cmCustomCommand const& CC;
+ cmCustomCommand const* CC;
std::string Config;
cmLocalGenerator* LG;
bool OldStyle;
@@ -24,6 +27,7 @@ class cmCustomCommandGenerator
std::vector<std::string> Byproducts;
std::vector<std::string> Depends;
std::string WorkingDirectory;
+ std::set<BT<std::pair<std::string, bool>>> Utilities;
void FillEmulatorsWithArguments();
std::vector<std::string> GetCrossCompilingEmulator(unsigned int c) const;
@@ -33,9 +37,11 @@ public:
cmCustomCommandGenerator(cmCustomCommand const& cc, std::string config,
cmLocalGenerator* lg, bool transformDepfile = true);
cmCustomCommandGenerator(const cmCustomCommandGenerator&) = delete;
+ cmCustomCommandGenerator(cmCustomCommandGenerator&&) = default;
cmCustomCommandGenerator& operator=(const cmCustomCommandGenerator&) =
delete;
- cmCustomCommand const& GetCC() const { return this->CC; }
+ cmCustomCommandGenerator& operator=(cmCustomCommandGenerator&&) = default;
+ cmCustomCommand const& GetCC() const { return *(this->CC); }
unsigned int GetNumberOfCommands() const;
std::string GetCommand(unsigned int c) const;
void AppendArguments(unsigned int c, std::string& cmd) const;
@@ -44,6 +50,7 @@ public:
std::vector<std::string> const& GetOutputs() const;
std::vector<std::string> const& GetByproducts() const;
std::vector<std::string> const& GetDepends() const;
+ std::set<BT<std::pair<std::string, bool>>> const& GetUtilities() const;
bool HasOnlyEmptyCommandLines() const;
std::string GetFullDepfile() const;
std::string GetInternalDepfile() const;
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 71c82d6..1359009 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -163,8 +163,11 @@ bool cmFunctionFunctionBlocker::Replay(
f.FilePath = this->GetStartingContext().FilePath;
f.Line = this->GetStartingContext().Line;
mf.RecordPolicies(f.Policies);
- mf.GetState()->AddScriptedCommand(this->Args.front(), std::move(f));
- return true;
+ return mf.GetState()->AddScriptedCommand(
+ this->Args.front(),
+ BT<cmState::Command>(std::move(f),
+ mf.GetBacktrace().Push(this->GetStartingContext())),
+ mf);
}
} // anonymous namespace
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1ed82fd..eb5803e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -24,9 +24,7 @@
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
-#include "cmCustomCommand.h"
#include "cmCustomCommandGenerator.h"
-#include "cmCustomCommandLines.h"
#include "cmFileTimes.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
@@ -2892,9 +2890,6 @@ private:
bool IsUtility(std::string const& dep);
void CheckCustomCommand(cmCustomCommand const& cc);
void CheckCustomCommands(const std::vector<cmCustomCommand>& commands);
- void FollowCommandDepends(cmCustomCommand const& cc,
- const std::string& config,
- std::set<std::string>& emitted);
};
cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target)
@@ -3081,66 +3076,27 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc)
{
- // Transform command names that reference targets built in this
- // project to corresponding target-level dependencies.
- cmGeneratorExpression ge(cc.GetBacktrace());
-
- // Add target-level dependencies referenced by generator expressions.
- std::set<cmGeneratorTarget*> targets;
-
- for (cmCustomCommandLine const& cCmdLine : cc.GetCommandLines()) {
- std::string const& command = cCmdLine.front();
- // Check for a target with this name.
- if (cmGeneratorTarget* t =
- this->LocalGenerator->FindGeneratorTargetToUse(command)) {
- if (t->GetType() == cmStateEnums::EXECUTABLE) {
- // The command refers to an executable target built in
- // this project. Add the target-level dependency to make
- // sure the executable is up to date before this custom
- // command possibly runs.
- this->GeneratorTarget->Target->AddUtility(command, true);
- }
- }
+ // Collect dependencies referenced by all configurations.
+ std::set<std::string> depends;
+ for (std::string const& config :
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig)) {
+ cmCustomCommandGenerator ccg(cc, config, this->LocalGenerator);
- // Check for target references in generator expressions.
- for (std::string const& cl : cCmdLine) {
- const std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(cl);
- cge->SetQuiet(true);
- cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), "");
- std::set<cmGeneratorTarget*> geTargets = cge->GetTargets();
- targets.insert(geTargets.begin(), geTargets.end());
+ // Collect target-level dependencies referenced in command lines.
+ for (auto const& util : ccg.GetUtilities()) {
+ this->GeneratorTarget->Target->AddUtility(util);
}
- }
- for (cmGeneratorTarget* target : targets) {
- this->GeneratorTarget->Target->AddUtility(target->GetName(), true);
+ // Collect file-level dependencies referenced in DEPENDS.
+ depends.insert(ccg.GetDepends().begin(), ccg.GetDepends().end());
}
- // Queue the custom command dependencies.
- std::set<std::string> emitted;
- std::vector<std::string> const& configs =
- this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
- for (std::string const& conf : configs) {
- this->FollowCommandDepends(cc, conf, emitted);
- }
-}
-
-void cmTargetTraceDependencies::FollowCommandDepends(
- cmCustomCommand const& cc, const std::string& config,
- std::set<std::string>& emitted)
-{
- cmCustomCommandGenerator ccg(cc, config,
- this->GeneratorTarget->LocalGenerator);
-
- const std::vector<std::string>& depends = ccg.GetDepends();
-
+ // Queue file-level dependencies.
for (std::string const& dep : depends) {
- if (emitted.insert(dep).second) {
- if (!this->IsUtility(dep)) {
- // The dependency does not name a target and may be a file we
- // know how to generate. Queue it.
- this->FollowName(dep);
- }
+ if (!this->IsUtility(dep)) {
+ // The dependency does not name a target and may be a file we
+ // know how to generate. Queue it.
+ this->FollowName(dep);
}
}
}
@@ -7240,6 +7196,14 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
}
}
+bool cmGeneratorTarget::IsLanguageUsed(std::string const& language,
+ std::string const& config) const
+{
+ std::set<std::string> languages;
+ this->GetLanguages(languages, config);
+ return languages.count(language);
+}
+
bool cmGeneratorTarget::IsCSharpOnly() const
{
// Only certain target types may compile CSharp.
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index e5fa892..2517b72 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -417,6 +417,8 @@ public:
// until we have per-target object file properties.
void GetLanguages(std::set<std::string>& languages,
std::string const& config) const;
+ bool IsLanguageUsed(std::string const& language,
+ std::string const& config) const;
bool IsCSharpOnly() const;
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 3a5b39d..b1dc72d 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -391,7 +391,7 @@ bool HandleSourceMode(cmExecutionStatus& status, const std::string& name,
if (cmSourceFile* sf =
directory_makefile.GetOrCreateSource(source_file_absolute_path)) {
return StoreResult(infoType, status.GetMakefile(), variable,
- sf->GetPropertyForUser(propertyName));
+ cmToCStr(sf->GetPropertyForUser(propertyName)));
}
status.SetError(
cmStrCat("given SOURCE name that could not be found or created: ",
diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx
index 5395bc8..212a968 100644
--- a/Source/cmGetSourceFilePropertyCommand.cxx
+++ b/Source/cmGetSourceFilePropertyCommand.cxx
@@ -4,6 +4,7 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
+#include "cmProperty.h"
#include "cmSetPropertyCommand.h"
#include "cmSourceFile.h"
@@ -57,14 +58,14 @@ bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
}
if (sf) {
- const char* prop = nullptr;
+ cmProp prop = nullptr;
if (!args[property_arg_index].empty()) {
prop = sf->GetPropertyForUser(args[property_arg_index]);
}
if (prop) {
// Set the value on the original Makefile scope, not the scope of the
// requested directory.
- status.GetMakefile().AddDefinition(var, prop);
+ status.GetMakefile().AddDefinition(var, *prop);
return true;
}
}
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 9b27bc5..12b5033 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1253,7 +1253,9 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias,
std::string outputPath = this->NinjaOutputPath(alias);
std::string buildAlias = this->BuildAlias(outputPath, config);
cmNinjaDeps outputs;
- this->AppendTargetOutputs(target, outputs, config, DependOnTargetArtifact);
+ if (config != "all") {
+ this->AppendTargetOutputs(target, outputs, config, DependOnTargetArtifact);
+ }
// Mark the target's outputs as ambiguous to ensure that no other target
// uses the output as an alias.
for (std::string const& output : outputs) {
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 2c934e1..c6c540b 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -590,9 +590,10 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
makeCommand.Add(this->SelectMakeProgram(makeProgram));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.Add("-j");
- if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.Add(std::to_string(jobs));
+ if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
+ makeCommand.Add("-j");
+ } else {
+ makeCommand.Add("-j" + std::to_string(jobs));
}
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 952a179..91f8c2b 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -503,16 +503,15 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
}
}
- if (this->XcodeBuildSystem >= BuildSystem::Twelve) {
+ if ((this->XcodeBuildSystem >= BuildSystem::Twelve) ||
+ (jobs != cmake::NO_BUILD_PARALLEL_LEVEL)) {
makeCommand.Add("-parallelizeTargets");
}
makeCommand.Add("-configuration", (config.empty() ? "Debug" : config));
- if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.Add("-jobs");
- if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.Add(std::to_string(jobs));
- }
+ if ((jobs != cmake::NO_BUILD_PARALLEL_LEVEL) &&
+ (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL)) {
+ makeCommand.Add("-jobs", std::to_string(jobs));
}
if (this->XcodeVersion >= 70) {
@@ -1423,7 +1422,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
cmGeneratorTarget::SourceFileFlags tsFlags =
gtgt->GetTargetSourceFileFlags(sourceFile);
- if (filetype && IsLibraryType(filetype->GetString())) {
+ if (filetype && filetype->GetString() == "compiled.mach-o.objfile") {
if (sourceFile->GetObjectLibrary().empty()) {
externalObjFiles.push_back(xsf);
}
@@ -1591,7 +1590,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
}
}
- // always create framework build phase
+ // Always create Link Binary With Libraries build phase
cmXCodeObject* frameworkBuildPhase = nullptr;
frameworkBuildPhase =
this->CreateObject(cmXCodeObject::PBXFrameworksBuildPhase);
@@ -1600,6 +1599,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
this->CreateString("2147483647"));
buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
frameworkBuildPhase->AddAttribute("files", buildFiles);
+ // Add all collected .o files to this build phase
for (auto& externalObjFile : externalObjFiles) {
buildFiles->AddObject(externalObjFile);
}
@@ -3556,6 +3556,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
for (auto& libDir : linkSearchPaths) {
libSearchPaths.Add(this->XCodeEscapePath(libDir));
}
+ // Add paths defined in project-wide build settings
+ libSearchPaths.Add("$(inherited)");
this->AppendBuildSettingAttribute(target, "LIBRARY_SEARCH_PATHS",
libSearchPaths.CreateList(),
configName);
@@ -3569,6 +3571,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
for (auto& fwDir : frameworkSearchPaths) {
fwSearchPaths.Add(this->XCodeEscapePath(fwDir));
}
+ // Add paths defined in project-wide build settings
+ fwSearchPaths.Add("$(inherited)");
this->AppendBuildSettingAttribute(target, "FRAMEWORK_SEARCH_PATHS",
fwSearchPaths.CreateList(),
configName);
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 70ef5af..3658d11 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -30,6 +30,7 @@ struct cmListFileParser
bool ParseFunction(const char* name, long line);
bool AddArgument(cmListFileLexer_Token* token,
cmListFileArgument::Delimiter delim);
+ cm::optional<cmListFileContext> CheckNesting();
cmListFile* ListFile;
cmListFileBacktrace Backtrace;
cmMessenger* Messenger;
@@ -158,6 +159,17 @@ bool cmListFileParser::Parse()
return false;
}
}
+
+ // Check if all functions are nested properly.
+ if (auto badNesting = this->CheckNesting()) {
+ this->Messenger->IssueMessage(
+ MessageType::FATAL_ERROR,
+ "Flow control statements are not properly nested.",
+ this->Backtrace.Push(*badNesting));
+ cmSystemTools::SetFatalErrorOccured();
+ return false;
+ }
+
return true;
}
@@ -317,6 +329,112 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
return true;
}
+namespace {
+enum class NestingStateEnum
+{
+ If,
+ Else,
+ While,
+ Foreach,
+ Function,
+ Macro,
+};
+
+struct NestingState
+{
+ NestingStateEnum State;
+ cmListFileContext Context;
+};
+
+bool TopIs(std::vector<NestingState>& stack, NestingStateEnum state)
+{
+ return !stack.empty() && stack.back().State == state;
+}
+}
+
+cm::optional<cmListFileContext> cmListFileParser::CheckNesting()
+{
+ std::vector<NestingState> stack;
+
+ for (auto const& func : this->ListFile->Functions) {
+ auto const& name = func.LowerCaseName();
+ if (name == "if") {
+ stack.push_back({
+ NestingStateEnum::If,
+ cmListFileContext::FromCommandContext(func, this->FileName),
+ });
+ } else if (name == "elseif") {
+ if (!TopIs(stack, NestingStateEnum::If)) {
+ return cmListFileContext::FromCommandContext(func, this->FileName);
+ }
+ stack.back() = {
+ NestingStateEnum::If,
+ cmListFileContext::FromCommandContext(func, this->FileName),
+ };
+ } else if (name == "else") {
+ if (!TopIs(stack, NestingStateEnum::If)) {
+ return cmListFileContext::FromCommandContext(func, this->FileName);
+ }
+ stack.back() = {
+ NestingStateEnum::Else,
+ cmListFileContext::FromCommandContext(func, this->FileName),
+ };
+ } else if (name == "endif") {
+ if (!TopIs(stack, NestingStateEnum::If) &&
+ !TopIs(stack, NestingStateEnum::Else)) {
+ return cmListFileContext::FromCommandContext(func, this->FileName);
+ }
+ stack.pop_back();
+ } else if (name == "while") {
+ stack.push_back({
+ NestingStateEnum::While,
+ cmListFileContext::FromCommandContext(func, this->FileName),
+ });
+ } else if (name == "endwhile") {
+ if (!TopIs(stack, NestingStateEnum::While)) {
+ return cmListFileContext::FromCommandContext(func, this->FileName);
+ }
+ stack.pop_back();
+ } else if (name == "foreach") {
+ stack.push_back({
+ NestingStateEnum::Foreach,
+ cmListFileContext::FromCommandContext(func, this->FileName),
+ });
+ } else if (name == "endforeach") {
+ if (!TopIs(stack, NestingStateEnum::Foreach)) {
+ return cmListFileContext::FromCommandContext(func, this->FileName);
+ }
+ stack.pop_back();
+ } else if (name == "function") {
+ stack.push_back({
+ NestingStateEnum::Function,
+ cmListFileContext::FromCommandContext(func, this->FileName),
+ });
+ } else if (name == "endfunction") {
+ if (!TopIs(stack, NestingStateEnum::Function)) {
+ return cmListFileContext::FromCommandContext(func, this->FileName);
+ }
+ stack.pop_back();
+ } else if (name == "macro") {
+ stack.push_back({
+ NestingStateEnum::Macro,
+ cmListFileContext::FromCommandContext(func, this->FileName),
+ });
+ } else if (name == "endmacro") {
+ if (!TopIs(stack, NestingStateEnum::Macro)) {
+ return cmListFileContext::FromCommandContext(func, this->FileName);
+ }
+ stack.pop_back();
+ }
+ }
+
+ if (!stack.empty()) {
+ return stack.back().Context;
+ }
+
+ return cm::nullopt;
+}
+
// We hold either the bottom scope of a directory or a call/file context.
// Discriminate these cases via the parent pointer.
struct cmListFileBacktrace::Entry
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 727fc60..ed45c07 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -89,6 +89,14 @@ public:
{
}
+#if __cplusplus < 201703L && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)
+ cmListFileContext(const cmListFileContext& /*other*/) = default;
+ cmListFileContext(cmListFileContext&& /*other*/) = default;
+
+ cmListFileContext& operator=(const cmListFileContext& /*other*/) = default;
+ cmListFileContext& operator=(cmListFileContext&& /*other*/) = delete;
+#endif
+
static cmListFileContext FromCommandContext(
cmCommandContext const& lfcc, std::string const& fileName,
cm::optional<std::string> deferId = {})
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 5790e16..adebe02 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -24,6 +24,7 @@
#include "cmCommand.h"
#include "cmDynamicLoader.h"
#include "cmExecutionStatus.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmState.h"
@@ -36,8 +37,6 @@
# include <malloc.h> /* for malloc/free on QNX */
#endif
-class cmListFileBacktrace;
-
namespace {
const char* LastName = nullptr;
@@ -256,10 +255,12 @@ bool cmLoadCommandCommand(std::vector<std::string> const& args,
// if the symbol is found call it to set the name on the
// function blocker
if (initFunction) {
- status.GetMakefile().GetState()->AddScriptedCommand(
+ return status.GetMakefile().GetState()->AddScriptedCommand(
args[0],
- cmLegacyCommandWrapper(cm::make_unique<cmLoadedCommand>(initFunction)));
- return true;
+ BT<cmState::Command>(
+ cmLegacyCommandWrapper(cm::make_unique<cmLoadedCommand>(initFunction)),
+ status.GetMakefile().GetBacktrace()),
+ status.GetMakefile());
}
status.SetError("Attempt to load command failed. "
"No init function found.");
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 47e10e0..8bd3017 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -823,16 +823,13 @@ cmStateSnapshot cmLocalGenerator::GetStateSnapshot() const
return this->Makefile->GetStateSnapshot();
}
-const char* cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
- const std::string& prop)
+cmProp cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
+ const std::string& prop)
{
- cmProp p;
if (target) {
- p = target->GetProperty(prop);
- } else {
- p = this->Makefile->GetProperty(prop);
+ return target->GetProperty(prop);
}
- return p ? p->c_str() : nullptr;
+ return this->Makefile->GetProperty(prop);
}
std::string cmLocalGenerator::ConvertToIncludeReference(
@@ -3768,7 +3765,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target,
cmLGInfoProp(mf, target, "MACOSX_BUNDLE_SHORT_VERSION_STRING");
cmLGInfoProp(mf, target, "MACOSX_BUNDLE_BUNDLE_VERSION");
cmLGInfoProp(mf, target, "MACOSX_BUNDLE_COPYRIGHT");
- mf->ConfigureFile(inFile, fname, false, false, false, true);
+ mf->ConfigureFile(inFile, fname, false, false, false);
}
void cmLocalGenerator::GenerateFrameworkInfoPList(
@@ -3803,7 +3800,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(
cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_IDENTIFIER");
cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_SHORT_VERSION_STRING");
cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_BUNDLE_VERSION");
- mf->ConfigureFile(inFile, fname, false, false, false, true);
+ mf->ConfigureFile(inFile, fname, false, false, false);
}
namespace {
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index b8bd3bc..30371c5 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -519,8 +519,7 @@ public:
void CreateEvaluationFileOutputs(const std::string& config);
void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles);
- const char* GetRuleLauncher(cmGeneratorTarget* target,
- const std::string& prop);
+ cmProp GetRuleLauncher(cmGeneratorTarget* target, const std::string& prop);
protected:
//! put all the libraries for a target on into the given stream
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index ce85320..d90a37b 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -603,11 +603,6 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
}
}
-#if 0
-# error TODO: Once CC in an ExternalProject target must provide the \
- file of each imported target that has an add_dependencies pointing \
- at us. How to know which ExternalProject step actually provides it?
-#endif
cmNinjaDeps ninjaOutputs(outputs.size() + byproducts.size());
std::transform(outputs.begin(), outputs.end(), ninjaOutputs.begin(),
gg->MapToNinjaPath());
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index c877cf8..dd27084 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -960,7 +960,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
std::string launcher;
// Short-circuit if there is no launcher.
- const char* val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM");
+ cmProp val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM");
if (cmNonempty(val)) {
// Expand rule variables referenced in the given launcher command.
cmRulePlaceholderExpander::RuleVariables vars;
@@ -980,7 +980,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
}
vars.Output = output.c_str();
- launcher = val;
+ launcher = *val;
rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars);
if (!launcher.empty()) {
launcher += " ";
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index fdf8307..d2cdb99 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -275,10 +275,9 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] = {
{ "SuppressStartupBanner", "nologo", "SuppressStartupBanner", "true", 0 },
{ "SourceFileFormat", "fixed", "Use Fixed Format", "fileFormatFixed", 0 },
{ "SourceFileFormat", "free", "Use Free Format", "fileFormatFree", 0 },
- { "DebugInformationFormat", "Zi", "full debug", "debugEnabled", 0 },
{ "DebugInformationFormat", "debug:full", "full debug", "debugEnabled", 0 },
- { "DebugInformationFormat", "Z7", "c7 compat", "debugOldStyleInfo", 0 },
- { "DebugInformationFormat", "Zd", "line numbers", "debugLineInfoOnly", 0 },
+ { "DebugInformationFormat", "debug:minimal", "line numbers",
+ "debugLineInfoOnly", 0 },
{ "Optimization", "Od", "disable optimization", "optimizeDisabled", 0 },
{ "Optimization", "O1", "min space", "optimizeMinSpace", 0 },
{ "Optimization", "O3", "full optimize", "optimizeFull", 0 },
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 98f88c1..8c4b2a7 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -171,8 +171,11 @@ bool cmMacroFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
f.Functions = std::move(functions);
f.FilePath = this->GetStartingContext().FilePath;
mf.RecordPolicies(f.Policies);
- mf.GetState()->AddScriptedCommand(this->Args[0], std::move(f));
- return true;
+ return mf.GetState()->AddScriptedCommand(
+ this->Args[0],
+ BT<cmState::Command>(std::move(f),
+ mf.GetBacktrace().Push(this->GetStartingContext())),
+ mf);
}
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6d1868c..56b7ae1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -29,15 +29,12 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
-#include "cm_sys_stat.h"
-
#include "cmCommandArgumentParserHelper.h"
#include "cmCustomCommand.h"
#include "cmCustomCommandLines.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h" // IWYU pragma: keep
#include "cmExportBuildFileGenerator.h"
-#include "cmFSPermissions.h"
#include "cmFileLockPool.h"
#include "cmFunctionBlocker.h"
#include "cmGeneratedFileStream.h"
@@ -72,8 +69,6 @@
class cmMessenger;
-using namespace cmFSPermissions;
-
cmDirectoryId::cmDirectoryId(std::string s)
: String(std::move(s))
{
@@ -3850,8 +3845,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
int cmMakefile::ConfigureFile(const std::string& infile,
const std::string& outfile, bool copyonly,
bool atOnly, bool escapeQuotes,
- bool use_source_permissions,
- cmNewLineStyle newLine)
+ mode_t permissions, cmNewLineStyle newLine)
{
int res = 1;
if (!this->CanIWriteThisFile(outfile)) {
@@ -3873,12 +3867,8 @@ int cmMakefile::ConfigureFile(const std::string& infile,
// output files that now don't exist.
this->AddCMakeOutputFile(soutfile);
- mode_t perm = 0;
- if (!use_source_permissions) {
- perm = perm | mode_owner_read | mode_owner_write | mode_group_read |
- mode_world_read;
- } else {
- cmSystemTools::GetPermissions(sinfile, perm);
+ if (permissions == 0) {
+ cmSystemTools::GetPermissions(sinfile, permissions);
}
std::string::size_type pos = soutfile.rfind('/');
@@ -3893,7 +3883,7 @@ int cmMakefile::ConfigureFile(const std::string& infile,
cmSystemTools::GetLastSystemError());
return 0;
}
- if (!cmSystemTools::SetPermissions(soutfile, perm)) {
+ if (!cmSystemTools::SetPermissions(soutfile, permissions)) {
this->IssueMessage(MessageType::FATAL_ERROR,
cmSystemTools::GetLastSystemError());
return 0;
@@ -3950,7 +3940,7 @@ int cmMakefile::ConfigureFile(const std::string& infile,
cmSystemTools::GetLastSystemError());
res = 0;
} else {
- if (!cmSystemTools::SetPermissions(soutfile, perm)) {
+ if (!cmSystemTools::SetPermissions(soutfile, permissions)) {
this->IssueMessage(MessageType::FATAL_ERROR,
cmSystemTools::GetLastSystemError());
res = 0;
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 26ed737..edee02b 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -20,6 +20,8 @@
#include "cmsys/RegularExpression.hxx"
+#include "cm_sys_stat.h"
+
#include "cmAlgorithms.h"
#include "cmCustomCommandTypes.h"
#include "cmListFileCache.h"
@@ -659,8 +661,7 @@ public:
*/
int ConfigureFile(const std::string& infile, const std::string& outfile,
bool copyonly, bool atOnly, bool escapeQuotes,
- bool use_source_permissions,
- cmNewLineStyle = cmNewLineStyle());
+ mode_t permissions = 0, cmNewLineStyle = cmNewLineStyle());
/**
* Print a command's invocation
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 871878c..1750e37 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -21,6 +21,7 @@
#include "cmMakefile.h"
#include "cmOSXBundleGenerator.h"
#include "cmOutputConverter.h"
+#include "cmProperty.h"
#include "cmRulePlaceholderExpander.h"
#include "cmState.h"
#include "cmStateDirectory.h"
@@ -232,10 +233,10 @@ void cmMakefileExecutableTargetGenerator::WriteNvidiaDeviceExecutableRule(
std::string launcher;
- const char* val = this->LocalGenerator->GetRuleLauncher(
- this->GeneratorTarget, "RULE_LAUNCH_LINK");
+ cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget,
+ "RULE_LAUNCH_LINK");
if (cmNonempty(val)) {
- launcher = cmStrCat(val, ' ');
+ launcher = cmStrCat(*val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
@@ -591,10 +592,10 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string launcher;
- const char* val = this->LocalGenerator->GetRuleLauncher(
- this->GeneratorTarget, "RULE_LAUNCH_LINK");
+ cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget,
+ "RULE_LAUNCH_LINK");
if (cmNonempty(val)) {
- launcher = cmStrCat(val, ' ');
+ launcher = cmStrCat(*val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index b32ea6a..ce64e2c 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -21,6 +21,7 @@
#include "cmMakefile.h"
#include "cmOSXBundleGenerator.h"
#include "cmOutputConverter.h"
+#include "cmProperty.h"
#include "cmRulePlaceholderExpander.h"
#include "cmState.h"
#include "cmStateDirectory.h"
@@ -366,10 +367,10 @@ void cmMakefileLibraryTargetGenerator::WriteNvidiaDeviceLibraryRules(
vars.TargetCompilePDB = targetOutPathCompilePDB.c_str();
std::string launcher;
- const char* val = this->LocalGenerator->GetRuleLauncher(
- this->GeneratorTarget, "RULE_LAUNCH_LINK");
+ cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget,
+ "RULE_LAUNCH_LINK");
if (cmNonempty(val)) {
- launcher = cmStrCat(val, ' ');
+ launcher = cmStrCat(*val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
@@ -816,10 +817,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
vars.LanguageCompileFlags = langFlags.c_str();
std::string launcher;
- const char* val = this->LocalGenerator->GetRuleLauncher(
- this->GeneratorTarget, "RULE_LAUNCH_LINK");
+ cmProp val = this->LocalGenerator->GetRuleLauncher(this->GeneratorTarget,
+ "RULE_LAUNCH_LINK");
if (cmNonempty(val)) {
- launcher = cmStrCat(val, ' ');
+ launcher = cmStrCat(*val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 5f97d86..1e9c1f8 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -795,7 +795,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
bool lang_has_preprocessor =
((lang == "C") || (lang == "CXX") || (lang == "OBJC") ||
(lang == "OBJCXX") || (lang == "Fortran") || (lang == "CUDA") ||
- lang == "ISPC");
+ lang == "ISPC" || lang == "ASM");
bool const lang_has_assembly = lang_has_preprocessor;
bool const lang_can_export_cmds = lang_has_preprocessor;
@@ -943,10 +943,10 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
std::string launcher;
{
- const char* val = this->LocalGenerator->GetRuleLauncher(
+ cmProp val = this->LocalGenerator->GetRuleLauncher(
this->GeneratorTarget, "RULE_LAUNCH_COMPILE");
if (cmNonempty(val)) {
- launcher = cmStrCat(val, ' ');
+ launcher = cmStrCat(*val, ' ');
}
}
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index ccb959b..a5b9466 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -266,10 +266,10 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkRule(
vars.LanguageCompileFlags = "$LANGUAGE_COMPILE_FLAGS";
std::string launcher;
- const char* val = this->GetLocalGenerator()->GetRuleLauncher(
+ cmProp val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
if (cmNonempty(val)) {
- launcher = cmStrCat(val, ' ');
+ launcher = cmStrCat(*val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
@@ -452,10 +452,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
}
std::string launcher;
- const char* val = this->GetLocalGenerator()->GetRuleLauncher(
+ cmProp val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
if (cmNonempty(val)) {
- launcher = cmStrCat(val, ' ');
+ launcher = cmStrCat(*val, ' ');
}
std::unique_ptr<cmRulePlaceholderExpander> rulePlaceholderExpander(
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 04d84a0..0566949 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -664,10 +664,10 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
cmLocalGenerator::SHELL);
std::string launcher;
- const char* val = this->GetLocalGenerator()->GetRuleLauncher(
+ cmProp val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_COMPILE");
if (cmNonempty(val)) {
- launcher = cmStrCat(val, ' ');
+ launcher = cmStrCat(*val, ' ');
}
std::string const cmakeCmd =
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 3b62e9c..f2696a6 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -807,7 +807,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
qrc.Generated = sf->GetIsGenerated();
// RCC options
{
- std::string const opts = sf->GetSafeProperty(kw.AUTORCC_OPTIONS);
+ std::string const& opts = sf->GetSafeProperty(kw.AUTORCC_OPTIONS);
if (!opts.empty()) {
cmExpandList(opts, qrc.Options);
}
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 61f48e9..39074a5 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -310,7 +310,7 @@ void cmSourceFile::AppendProperty(const std::string& prop,
}
}
-const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
+cmProp cmSourceFile::GetPropertyForUser(const std::string& prop)
{
// This method is a consequence of design history and backwards
// compatibility. GetProperty is (and should be) a const method.
@@ -334,13 +334,12 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
// Similarly, LANGUAGE can be determined by the file extension
// if it is requested by the user.
if (prop == propLANGUAGE) {
- // The c_str pointer is valid until `this->Language` is modified.
- return this->GetOrDetermineLanguage().c_str();
+ // The pointer is valid until `this->Language` is modified.
+ return &this->GetOrDetermineLanguage();
}
// Perform the normal property lookup.
- cmProp p = this->GetProperty(prop);
- return p ? p->c_str() : nullptr;
+ return this->GetProperty(prop);
}
cmProp cmSourceFile::GetProperty(const std::string& prop) const
@@ -398,13 +397,15 @@ cmProp cmSourceFile::GetProperty(const std::string& prop) const
return retVal;
}
-const char* cmSourceFile::GetSafeProperty(const std::string& prop) const
+const std::string& cmSourceFile::GetSafeProperty(const std::string& prop) const
{
cmProp ret = this->GetProperty(prop);
- if (!ret) {
- return "";
+ if (ret) {
+ return *ret;
}
- return ret->c_str();
+
+ static std::string const s_empty;
+ return s_empty;
}
bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 3196b3f..3ad2664 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -47,12 +47,12 @@ public:
//! Might return a nullptr if the property is not set or invalid
cmProp GetProperty(const std::string& prop) const;
//! Always returns a valid pointer
- const char* GetSafeProperty(const std::string& prop) const;
+ const std::string& GetSafeProperty(const std::string& prop) const;
bool GetPropertyAsBool(const std::string& prop) const;
/** Implement getting a property when called from a CMake language
command like get_property or get_source_file_property. */
- const char* GetPropertyForUser(const std::string& prop);
+ cmProp GetPropertyForUser(const std::string& prop);
//! Checks is the GENERATED property is set and true
/// @return Equivalent to GetPropertyAsBool("GENERATED")
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 222bafa..921eb0e 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -33,8 +33,7 @@ cmSourceFileLocation::cmSourceFileLocation(cmMakefile const* mf,
this->AmbiguousExtension = true;
this->Directory = cmSystemTools::GetFilenamePath(name);
if (cmSystemTools::FileIsFullPath(this->Directory)) {
- this->Directory = cmSystemTools::CollapseFullPath(
- this->Directory, mf->GetHomeOutputDirectory());
+ this->Directory = cmSystemTools::CollapseFullPath(this->Directory);
}
this->Name = cmSystemTools::GetFilenameName(name);
if (kind == cmSourceFileLocationKind::Known) {
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d5ac9ae..3692a01 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -135,6 +135,11 @@ bool cmState::DeleteCache(const std::string& path)
return this->CacheManager->DeleteCache(path);
}
+bool cmState::IsCacheLoaded() const
+{
+ return this->CacheManager->IsCacheLoaded();
+}
+
std::vector<std::string> cmState::GetCacheEntryKeys() const
{
return this->CacheManager->GetCacheEntryKeys();
@@ -436,6 +441,19 @@ void cmState::AddBuiltinCommand(std::string const& name,
});
}
+void cmState::AddFlowControlCommand(std::string const& name, Command command)
+{
+ this->FlowControlCommands.insert(name);
+ this->AddBuiltinCommand(name, std::move(command));
+}
+
+void cmState::AddFlowControlCommand(std::string const& name,
+ BuiltinCommand command)
+{
+ this->FlowControlCommands.insert(name);
+ this->AddBuiltinCommand(name, command);
+}
+
void cmState::AddDisallowedCommand(std::string const& name,
BuiltinCommand command,
cmPolicies::PolicyID policy,
@@ -465,7 +483,7 @@ void cmState::AddDisallowedCommand(std::string const& name,
void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
{
- this->AddBuiltinCommand(
+ this->AddFlowControlCommand(
name,
[name, error](std::vector<cmListFileArgument> const&,
cmExecutionStatus& status) -> bool {
@@ -480,16 +498,28 @@ void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
});
}
-void cmState::AddScriptedCommand(std::string const& name, Command command)
+bool cmState::AddScriptedCommand(std::string const& name, BT<Command> command,
+ cmMakefile& mf)
{
std::string sName = cmSystemTools::LowerCase(name);
+ if (this->FlowControlCommands.count(sName)) {
+ mf.GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("Built-in flow control command \"", sName,
+ "\" cannot be overridden."),
+ command.Backtrace);
+ cmSystemTools::SetFatalErrorOccured();
+ return false;
+ }
+
// if the command already exists, give a new name to the old command.
if (Command oldCmd = this->GetCommandByExactName(sName)) {
this->ScriptedCommands["_" + sName] = oldCmd;
}
- this->ScriptedCommands[sName] = std::move(command);
+ this->ScriptedCommands[sName] = std::move(command.Value);
+ return true;
}
cmState::Command cmState::GetCommand(std::string const& name) const
diff --git a/Source/cmState.h b/Source/cmState.h
index 2aa57e0..4e41156 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -9,6 +9,7 @@
#include <set>
#include <string>
#include <unordered_map>
+#include <unordered_set>
#include <vector>
#include "cmDefinitions.h"
@@ -24,6 +25,7 @@
class cmCacheManager;
class cmCommand;
class cmGlobVerificationManager;
+class cmMakefile;
class cmStateSnapshot;
class cmMessenger;
class cmExecutionStatus;
@@ -87,6 +89,8 @@ public:
bool DeleteCache(const std::string& path);
+ bool IsCacheLoaded() const;
+
std::vector<std::string> GetCacheEntryKeys() const;
cmProp GetCacheEntryValue(std::string const& key) const;
std::string GetSafeCacheEntryValue(std::string const& key) const;
@@ -157,10 +161,13 @@ public:
std::unique_ptr<cmCommand> command);
void AddBuiltinCommand(std::string const& name, Command command);
void AddBuiltinCommand(std::string const& name, BuiltinCommand command);
+ void AddFlowControlCommand(std::string const& name, Command command);
+ void AddFlowControlCommand(std::string const& name, BuiltinCommand command);
void AddDisallowedCommand(std::string const& name, BuiltinCommand command,
cmPolicies::PolicyID policy, const char* message);
void AddUnexpectedCommand(std::string const& name, const char* error);
- void AddScriptedCommand(std::string const& name, Command command);
+ bool AddScriptedCommand(std::string const& name, BT<Command> command,
+ cmMakefile& mf);
void RemoveBuiltinCommand(std::string const& name);
void RemoveUserDefinedCommands();
std::vector<std::string> GetCommandNames() const;
@@ -223,6 +230,7 @@ private:
std::vector<std::string> EnabledLanguages;
std::unordered_map<std::string, Command> BuiltinCommands;
std::unordered_map<std::string, Command> ScriptedCommands;
+ std::unordered_set<std::string> FlowControlCommands;
cmPropertyMap GlobalProperties;
std::unique_ptr<cmCacheManager> CacheManager;
std::unique_ptr<cmGlobVerificationManager> GlobVerificationManager;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4eebec6..0860b71 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -623,6 +623,11 @@ void cmTarget::AddUtility(std::string const& name, bool cross, cmMakefile* mf)
{ name, cross }, mf ? mf->GetBacktrace() : cmListFileBacktrace()));
}
+void cmTarget::AddUtility(BT<std::pair<std::string, bool>> util)
+{
+ impl->Utilities.emplace(std::move(util));
+}
+
std::set<BT<std::pair<std::string, bool>>> const& cmTarget::GetUtilities()
const
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index c2a4d86..27f0c59 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -164,6 +164,7 @@ public:
*/
void AddUtility(std::string const& name, bool cross,
cmMakefile* mf = nullptr);
+ void AddUtility(BT<std::pair<std::string, bool>> util);
//! Get the utilities used by this target
std::set<BT<std::pair<std::string, bool>>> const& GetUtilities() const;
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 9e30136..b050a58 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -45,15 +45,26 @@ bool cmTargetPropCommandBase::HandleArguments(
this->HandleMissingTarget(args[0]);
return false;
}
- if ((this->Target->GetType() != cmStateEnums::EXECUTABLE) &&
- (this->Target->GetType() != cmStateEnums::STATIC_LIBRARY) &&
- (this->Target->GetType() != cmStateEnums::SHARED_LIBRARY) &&
- (this->Target->GetType() != cmStateEnums::MODULE_LIBRARY) &&
- (this->Target->GetType() != cmStateEnums::OBJECT_LIBRARY) &&
- (this->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) &&
- (this->Target->GetType() != cmStateEnums::UNKNOWN_LIBRARY)) {
- this->SetError("called with non-compilable target type");
- return false;
+ const bool isRegularTarget =
+ (this->Target->GetType() == cmStateEnums::EXECUTABLE) ||
+ (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY) ||
+ (this->Target->GetType() == cmStateEnums::SHARED_LIBRARY) ||
+ (this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) ||
+ (this->Target->GetType() == cmStateEnums::OBJECT_LIBRARY) ||
+ (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) ||
+ (this->Target->GetType() == cmStateEnums::UNKNOWN_LIBRARY);
+ const bool isCustomTarget = this->Target->GetType() == cmStateEnums::UTILITY;
+
+ if (prop == "SOURCES") {
+ if (!isRegularTarget && !isCustomTarget) {
+ this->SetError("called with non-compilable target type");
+ return false;
+ }
+ } else {
+ if (!isRegularTarget) {
+ this->SetError("called with non-compilable target type");
+ return false;
+ }
}
bool system = false;
@@ -131,6 +142,11 @@ bool cmTargetPropCommandBase::ProcessContentArgs(
this->SetError("may only set INTERFACE properties on IMPORTED targets");
return false;
}
+ if (this->Target->GetType() == cmStateEnums::UTILITY &&
+ scope != "PRIVATE") {
+ this->SetError("may only set PRIVATE properties on custom targets");
+ return false;
+ }
}
return this->PopulateTargetProperies(scope, content, prepend, system);
}
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 1ca7de8..9f6973e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -676,7 +676,7 @@ void cmVisualStudio10TargetGenerator::Generate()
cmStrCat(this->DefaultArtifactDir, "\\nasm.props");
ConvertToWindowsSlash(propsLocal);
this->Makefile->ConfigureFile(propsTemplate, propsLocal, false, true,
- true, true);
+ true);
Elem(e1, "Import").Attribute("Project", propsLocal);
}
}
@@ -3106,7 +3106,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions()
return true;
}
for (std::string const& c : this->Configurations) {
- if (!this->ComputeCudaOptions(c)) {
+ if (this->GeneratorTarget->IsLanguageUsed("CUDA", c) &&
+ !this->ComputeCudaOptions(c)) {
return false;
}
}
@@ -3246,7 +3247,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
void cmVisualStudio10TargetGenerator::WriteCudaOptions(
Elem& e1, std::string const& configName)
{
- if (!this->MSTools || !this->GlobalGenerator->IsCudaEnabled()) {
+ if (!this->MSTools || !this->GlobalGenerator->IsCudaEnabled() ||
+ !this->GeneratorTarget->IsLanguageUsed("CUDA", configName)) {
return;
}
Elem e2(e1, "CudaCompile");
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 7d044ec..0274a16 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -727,6 +727,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
{
bool haveToolset = false;
bool havePlatform = false;
+ bool haveBArg = false;
#if !defined(CMAKE_BOOTSTRAP)
std::string profilingFormat;
std::string profilingOutput;
@@ -775,6 +776,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
path = cmSystemTools::CollapseFullPath(path);
cmSystemTools::ConvertToUnixSlashes(path);
this->SetHomeOutputDirectory(path);
+ haveBArg = true;
} else if ((i < args.size() - 2) &&
cmHasLiteralPrefix(arg, "--check-build-system")) {
this->CheckBuildSystemArgument = args[++i];
@@ -941,19 +943,19 @@ void cmake::SetArgs(const std::vector<std::string>& args)
return;
}
#if !defined(CMAKE_BOOTSTRAP)
- } else if (cmHasLiteralPrefix(arg, "--profiling-format")) {
+ } else if (cmHasLiteralPrefix(arg, "--profiling-format=")) {
profilingFormat = arg.substr(strlen("--profiling-format="));
if (profilingFormat.empty()) {
cmSystemTools::Error("No format specified for --profiling-format");
}
- } else if (cmHasLiteralPrefix(arg, "--profiling-output")) {
+ } else if (cmHasLiteralPrefix(arg, "--profiling-output=")) {
profilingOutput = arg.substr(strlen("--profiling-output="));
profilingOutput = cmSystemTools::CollapseFullPath(profilingOutput);
cmSystemTools::ConvertToUnixSlashes(profilingOutput);
if (profilingOutput.empty()) {
cmSystemTools::Error("No path specified for --profiling-output");
}
- } else if (cmHasLiteralPrefix(arg, "--preset")) {
+ } else if (cmHasLiteralPrefix(arg, "--preset=")) {
presetName = arg.substr(strlen("--preset="));
if (presetName.empty()) {
cmSystemTools::Error("No preset specified for --preset");
@@ -1003,9 +1005,15 @@ void cmake::SetArgs(const std::vector<std::string>& args)
const bool haveSourceDir = !this->GetHomeDirectory().empty();
const bool haveBinaryDir = !this->GetHomeOutputDirectory().empty();
+ const bool havePreset =
+#ifdef CMAKE_BOOTSTRAP
+ false;
+#else
+ !presetName.empty();
+#endif
if (this->CurrentWorkingMode == cmake::NORMAL_MODE && !haveSourceDir &&
- !haveBinaryDir) {
+ !haveBinaryDir && !havePreset) {
this->IssueMessage(
MessageType::WARNING,
"No source or binary directory provided. Both will be assumed to be "
@@ -1057,7 +1065,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
return;
}
- if (!haveBinaryDir) {
+ if (!this->State->IsCacheLoaded() && !haveBArg) {
this->SetHomeOutputDirectory(expandedPreset->BinaryDir);
}
if (!this->GlobalGenerator) {
@@ -1069,12 +1077,16 @@ void cmake::SetArgs(const std::vector<std::string>& args)
this->UnprocessedPresetVariables = expandedPreset->CacheVariables;
this->UnprocessedPresetEnvironment = expandedPreset->Environment;
- if (!expandedPreset->GeneratorConfig ||
- expandedPreset->GeneratorConfig ==
- cmCMakePresetsFile::CMakeGeneratorConfig::Default) {
+ if (!expandedPreset->ArchitectureStrategy ||
+ expandedPreset->ArchitectureStrategy ==
+ cmCMakePresetsFile::ArchToolsetStrategy::Set) {
if (!this->GeneratorPlatformSet) {
this->SetGeneratorPlatform(expandedPreset->Architecture);
}
+ }
+ if (!expandedPreset->ToolsetStrategy ||
+ expandedPreset->ToolsetStrategy ==
+ cmCMakePresetsFile::ArchToolsetStrategy::Set) {
if (!this->GeneratorToolsetSet) {
this->SetGeneratorToolset(expandedPreset->Toolset);
}
diff --git a/Source/cmake.h b/Source/cmake.h
index f70fd14..914b827 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -704,8 +704,6 @@ private:
#define CMAKE_STANDARD_OPTIONS_TABLE \
{ "-S <path-to-source>", "Explicitly specify a source directory." }, \
{ "-B <path-to-build>", "Explicitly specify a build directory." }, \
- { "--preset=<preset-name>", "Explicitly specify a preset." }, \
- { "--list-presets", "List available presets." }, \
{ "-C <initial-cache>", "Pre-load a script to populate the cache." }, \
{ "-D <var>[:<type>]=<value>", "Create or update a cmake cache entry." }, \
{ "-U <globbing_expr>", "Remove matching entries from CMake cache." }, \
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index f570337..f7734a6 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -49,8 +49,7 @@ const char* cmDocumentationUsage[][2] = {
{ nullptr,
" cmake [options] <path-to-source>\n"
" cmake [options] <path-to-existing-build>\n"
- " cmake [options] -S <path-to-source> -B <path-to-build>\n"
- " cmake [options] -S <path-to-source> --preset=<preset-name>" },
+ " cmake [options] -S <path-to-source> -B <path-to-build>" },
{ nullptr,
"Specify a source directory to (re-)generate a build system for "
"it in the current working directory. Specify an existing build "
@@ -65,6 +64,8 @@ const char* cmDocumentationUsageNote[][2] = {
const char* cmDocumentationOptions[][2] = {
CMAKE_STANDARD_OPTIONS_TABLE,
+ { "--preset=<preset>", "Specify a configure preset." },
+ { "--list-presets", "List available presets." },
{ "-E", "CMake command mode." },
{ "-L[A][H]", "List non-advanced cached variables." },
{ "--build <dir>", "Build a CMake-generated project binary tree." },
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index ea1f968..f094085 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -58,6 +58,7 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
+#include "cmsys/RegularExpression.hxx"
#include "cmsys/Terminal.h"
int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
@@ -1711,7 +1712,6 @@ int cmcmd::WindowsCEEnvironment(const char* version, const std::string& name)
int cmcmd::RunPreprocessor(const std::vector<std::string>& command,
const std::string& intermediate_file)
{
-
cmUVProcessChainBuilder builder;
uv_fs_t fs_req;
@@ -1743,7 +1743,6 @@ int cmcmd::RunPreprocessor(const std::vector<std::string>& command,
return 1;
}
-
return 0;
}
@@ -1761,19 +1760,56 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args)
std::cerr << "Invalid cmake_llvm_rc arguments";
return 1;
}
+
const std::string& intermediate_file = args[3];
const std::string& source_file = args[2];
std::vector<std::string> preprocess;
std::vector<std::string> resource_compile;
std::vector<std::string>* pArgTgt = &preprocess;
+
+ static const cmsys::RegularExpression llvm_rc_only_single_arg("^[-/](N|Y)");
+ static const cmsys::RegularExpression llvm_rc_only_double_arg(
+ "^[-/](C|LN|L)(.)?");
+ static const cmsys::RegularExpression common_double_arg(
+ "^[-/](D|U|I|FO|fo|Fo)(.)?");
+ bool acceptNextArg = false;
+ bool skipNextArg = false;
for (std::string const& arg : cmMakeRange(args).advance(4)) {
+ if (skipNextArg) {
+ skipNextArg = false;
+ continue;
+ }
// We use ++ as seperator between the preprocessing step definition and the
// rc compilation step becase we need to prepend a -- to seperate the
// source file properly from other options when using clang-cl for
// preprocessing.
if (arg == "++") {
pArgTgt = &resource_compile;
+ skipNextArg = false;
+ acceptNextArg = true;
} else {
+ cmsys::RegularExpressionMatch match;
+ if (!acceptNextArg) {
+ if (common_double_arg.find(arg.c_str(), match)) {
+ acceptNextArg = match.match(2).empty();
+ } else {
+ if (llvm_rc_only_single_arg.find(arg.c_str(), match)) {
+ if (pArgTgt == &preprocess) {
+ continue;
+ }
+ } else if (llvm_rc_only_double_arg.find(arg.c_str(), match)) {
+ if (pArgTgt == &preprocess) {
+ skipNextArg = match.match(2).empty();
+ continue;
+ }
+ acceptNextArg = match.match(2).empty();
+ } else if (pArgTgt == &resource_compile) {
+ continue;
+ }
+ }
+ } else {
+ acceptNextArg = false;
+ }
if (arg.find("SOURCE_DIR") != std::string::npos) {
std::string sourceDirArg = arg;
cmSystemTools::ReplaceString(
@@ -1793,10 +1829,14 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args)
std::cerr << "Empty resource compilation command";
return 1;
}
+ // Since we might have skipped the last argument to llvm-rc
+ // we need to make sure the llvm-rc source file is present in the commandline
+ if (resource_compile.back() != intermediate_file) {
+ resource_compile.push_back(intermediate_file);
+ }
auto result = RunPreprocessor(preprocess, intermediate_file);
if (result != 0) {
-
cmSystemTools::RemoveFile(intermediate_file);
return result;
}
diff --git a/Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx b/Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx
index 6ee55c3..a95d008 100644
--- a/Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx
+++ b/Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx
@@ -24,8 +24,9 @@ void QCMakePresetComboBoxTest::changePresets()
/*description=*/"",
/*generator=*/"Ninja",
/*architecture=*/"",
+ /*setArchitecture=*/true,
/*toolset=*/"",
- /*setGenConfig=*/true,
+ /*setToolset=*/true,
/*enabled=*/true,
},
});
@@ -48,8 +49,9 @@ void QCMakePresetComboBoxTest::changePresets()
/*description=*/"",
/*generator=*/"Ninja Multi-Config",
/*architecture=*/"",
+ /*setArchitecture=*/true,
/*toolset=*/"",
- /*setGenConfig=*/true,
+ /*setToolset=*/true,
/*enabled=*/true,
},
});
diff --git a/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx b/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx
index ee45d39..97dbb30 100644
--- a/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx
+++ b/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx
@@ -32,8 +32,9 @@ void QCMakePresetItemModelTest::initTestCase_data()
/*description=*/"",
/*generator=*/"",
/*architecture=*/"",
+ /*setArchitecture=*/true,
/*toolset=*/"",
- /*setGenConfig=*/true,
+ /*setToolset=*/true,
/*enabled=*/true,
},
QCMakePreset{
@@ -42,8 +43,9 @@ void QCMakePresetItemModelTest::initTestCase_data()
/*description=*/"",
/*generator=*/"",
/*architecture=*/"",
+ /*setArchitecture=*/true,
/*toolset=*/"",
- /*setGenConfig=*/true,
+ /*setToolset=*/true,
/*enabled=*/true,
},
QCMakePreset{
@@ -52,8 +54,9 @@ void QCMakePresetItemModelTest::initTestCase_data()
/*description=*/"Long Description",
/*generator=*/"",
/*architecture=*/"",
+ /*setArchitecture=*/true,
/*toolset=*/"",
- /*setGenConfig=*/true,
+ /*setToolset=*/true,
/*enabled=*/true,
},
QCMakePreset{
@@ -62,8 +65,9 @@ void QCMakePresetItemModelTest::initTestCase_data()
/*description=*/"",
/*generator=*/"",
/*architecture=*/"",
+ /*setArchitecture=*/true,
/*toolset=*/"",
- /*setGenConfig=*/true,
+ /*setToolset=*/true,
/*enabled=*/false,
},
};
diff --git a/Tests/CMakeGUI/QCMakePresetTest.cxx b/Tests/CMakeGUI/QCMakePresetTest.cxx
index 8fd07e7..2081055 100644
--- a/Tests/CMakeGUI/QCMakePresetTest.cxx
+++ b/Tests/CMakeGUI/QCMakePresetTest.cxx
@@ -16,8 +16,9 @@ QCMakePreset makePreset()
/*description=*/"description",
/*generator=*/"generator",
/*architecture=*/"architecture",
+ /*setArchitecture=*/true,
/*toolset=*/"toolset",
- /*setGenConfig=*/true,
+ /*setToolset=*/true,
/*enabled=*/true,
};
}
@@ -69,12 +70,14 @@ void QCMakePresetTest::equality_data()
QTest::newRow("architecture")
<< makePreset(&QCMakePreset::architecture, "other-architecture") << false
<< true << false;
+ QTest::newRow("setArchitecture")
+ << makePreset(&QCMakePreset::setArchitecture, false) << false << false
+ << true;
QTest::newRow("toolset") << makePreset(&QCMakePreset::toolset,
"other-toolset")
<< false << false << true;
- QTest::newRow("setGenConfig")
- << makePreset(&QCMakePreset::setGenConfig, false) << false << false
- << true;
+ QTest::newRow("setToolset")
+ << makePreset(&QCMakePreset::setToolset, false) << false << false << true;
QTest::newRow("enabled") << makePreset(&QCMakePreset::enabled, false)
<< false << false << true;
}
diff --git a/Tests/CMakeLib/testOptional.cxx b/Tests/CMakeLib/testOptional.cxx
index de09c0f..2d7dd7c 100644
--- a/Tests/CMakeLib/testOptional.cxx
+++ b/Tests/CMakeLib/testOptional.cxx
@@ -82,6 +82,18 @@ public:
int Value = 0;
};
+class NoMoveAssignEventLogger : public EventLogger
+{
+public:
+ using EventLogger::EventLogger;
+
+ NoMoveAssignEventLogger(const NoMoveAssignEventLogger&) = default;
+ NoMoveAssignEventLogger(NoMoveAssignEventLogger&&) = default;
+
+ NoMoveAssignEventLogger& operator=(const NoMoveAssignEventLogger&) = default;
+ NoMoveAssignEventLogger& operator=(NoMoveAssignEventLogger&&) = delete;
+};
+
#define ASSERT_TRUE(x) \
do { \
if (!(x)) { \
@@ -328,12 +340,28 @@ static bool testCopyAssign(std::vector<Event>& expected)
o1 = o4; // Intentionally duplicated to test assigning an empty optional to
// an empty optional
+ cm::optional<NoMoveAssignEventLogger> o5{ 1 };
+ auto const* v5 = &*o5;
+ const cm::optional<NoMoveAssignEventLogger> o6{ 2 };
+ auto const* v6 = &*o6;
+ o5 = std::move(o6);
+ const NoMoveAssignEventLogger e7{ 3 };
+ o5 = std::move(e7);
+
expected = {
{ Event::VALUE_CONSTRUCT, v2, nullptr, 4 },
{ Event::COPY_CONSTRUCT, v1, v2, 4 },
{ Event::VALUE_CONSTRUCT, v3, nullptr, 5 },
{ Event::COPY_ASSIGN, v1, v3, 5 },
{ Event::DESTRUCT, v1, nullptr, 5 },
+ { Event::VALUE_CONSTRUCT, v5, nullptr, 1 },
+ { Event::VALUE_CONSTRUCT, v6, nullptr, 2 },
+ { Event::COPY_ASSIGN, v5, v6, 2 },
+ { Event::VALUE_CONSTRUCT, &e7, nullptr, 3 },
+ { Event::COPY_ASSIGN, v5, &e7, 3 },
+ { Event::DESTRUCT, &e7, nullptr, 3 },
+ { Event::DESTRUCT, v6, nullptr, 2 },
+ { Event::DESTRUCT, v5, nullptr, 3 },
{ Event::DESTRUCT, v3, nullptr, 5 },
{ Event::DESTRUCT, v2, nullptr, 4 },
};
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index 61a77cf..a003205 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -181,6 +181,10 @@ bool checkOutput(std::istream& outputStream, std::istream& errorStream)
}
std::string error = getInput(errorStream);
+ auto qemu_error_pos = error.find("qemu:");
+ if (qemu_error_pos != std::string::npos) {
+ error.resize(qemu_error_pos);
+ }
if (error.length() != 3 || error.find('1') == std::string::npos ||
error.find('2') == std::string::npos ||
error.find('3') == std::string::npos) {
diff --git a/Tests/CMakeTests/EndStuffTestScript.cmake b/Tests/CMakeTests/EndStuffTestScript.cmake
index 9f40818..6a6b162 100644
--- a/Tests/CMakeTests/EndStuffTestScript.cmake
+++ b/Tests/CMakeTests/EndStuffTestScript.cmake
@@ -1,68 +1,40 @@
message(STATUS "testname='${testname}'")
-if(testname STREQUAL bad_else) # fail
- file(WRITE "${dir}/${testname}.cmake"
-"else()
-")
+function(do_end content)
+ file(WRITE "${dir}/${testname}.cmake" "${content}")
execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
RESULT_VARIABLE rv)
if(NOT rv EQUAL 0)
message(FATAL_ERROR "${testname} failed")
endif()
+endfunction()
+
+if(testname STREQUAL bad_else) # fail
+ do_end("else()\n")
elseif(testname STREQUAL bad_elseif) # fail
- file(WRITE "${dir}/${testname}.cmake"
-"elseif()
-")
- execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
- RESULT_VARIABLE rv)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "${testname} failed")
- endif()
+ do_end("elseif()\n")
elseif(testname STREQUAL bad_endforeach) # fail
- endforeach()
+ do_end("endforeach()\n")
elseif(testname STREQUAL bad_endfunction) # fail
- endfunction()
+ do_end("endfunction()\n")
elseif(testname STREQUAL bad_endif) # fail
- file(WRITE "${dir}/${testname}.cmake"
-"cmake_minimum_required(VERSION 2.8)
-endif()
-")
- execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
- RESULT_VARIABLE rv)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "${testname} failed")
- endif()
+ do_end("cmake_minimum_required(VERSION 2.8)\nendif()\n")
-elseif(testname STREQUAL endif_low_min_version) # pass
- file(WRITE "${dir}/${testname}.cmake"
-"cmake_minimum_required(VERSION 1.2)
-endif()
-")
- execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
- RESULT_VARIABLE rv)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "${testname} failed")
- endif()
+elseif(testname STREQUAL endif_low_min_version) # fail
+ do_end("cmake_minimum_required(VERSION 1.2)\nendif()\n")
-elseif(testname STREQUAL endif_no_min_version) # pass
- file(WRITE "${dir}/${testname}.cmake"
-"endif()
-")
- execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
- RESULT_VARIABLE rv)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "${testname} failed")
- endif()
+elseif(testname STREQUAL endif_no_min_version) # fail
+ do_end("endif()\n")
elseif(testname STREQUAL bad_endmacro) # fail
- endmacro()
+ do_end("endmacro()\n")
elseif(testname STREQUAL bad_endwhile) # fail
- endwhile()
+ do_end("endwhile()\n")
else() # fail
message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'")
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index 7b1a312..1db00cc 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -91,3 +91,16 @@ target_compile_definitions(ObjLibFromGeneratedSources PRIVATE OBJ_SHARED)
target_sources(ObjLibFromGeneratedSources PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp)
add_library(SharedLibFromObjLibFromGeneratedSources SHARED shared.cpp)
target_link_libraries(SharedLibFromObjLibFromGeneratedSources PRIVATE ObjLibFromGeneratedSources)
+
+
+# ---------------------------------------------------------------------------
+# Make sure that additional build-events do not confuse CMake when using generated files.
+add_library(SharedLibFromGeneratedSources SHARED)
+set_property(TARGET SharedLibFromGeneratedSources PROPERTY POSITION_INDEPENDENT_CODE 1)
+target_sources(SharedLibFromGeneratedSources PRIVATE
+ shared.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp
+ )
+add_custom_command(TARGET SharedLibFromGeneratedSources POST_BUILD
+ COMMAND "${CMAKE_COMMAND}" "-E" "echo" "$<TARGET_FILE:SharedLibFromGeneratedSources>"
+ )
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 44484c3..520ba9e 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -451,6 +451,18 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
endif()
+
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ add_test(NAME FindPython.UnversionedNames COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames"
+ "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames"
+ ${build_generator_args}
+ --build-project UnversionedNames
+ --build-options ${build_options}
+ )
+ endif()
endif()
if(CMake_TEST_FindPython_NumPy)
diff --git a/Tests/FindPython/UnversionedNames/CMakeLists.txt b/Tests/FindPython/UnversionedNames/CMakeLists.txt
new file mode 100644
index 0000000..597bd4e
--- /dev/null
+++ b/Tests/FindPython/UnversionedNames/CMakeLists.txt
@@ -0,0 +1,66 @@
+cmake_minimum_required(VERSION 3.19...3.20)
+
+project(UnversionedNames LANGUAGES NONE)
+
+# check if it is possible to find python with a generic name
+find_program(UNVERSIONED_Python3 NAMES python3)
+
+if (NOT UNVERSIONED_Python3)
+ # no generic name available
+ # test cannot be done
+ return()
+endif()
+
+# search with default configuration
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (Python3_EXECUTABLE STREQUAL UNVERSIONED_Python3)
+ # default configuration pick-up the generic name
+ # test cannot be completed
+ return()
+endif()
+
+unset(Python3_EXECUTABLE)
+# Force now to search first for generic name
+set(Python3_FIND_UNVERSIONED_NAMES FIRST)
+
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (NOT Python3_EXECUTABLE STREQUAL UNVERSIONED_Python3)
+ message(SEND_ERROR "Found unexpected interpreter ${Python3_EXECUTABLE} instead of ${UNVERSIONED_Python3}")
+endif()
+
+# To check value 'NEVER", creates directory holding a symlink to the generic name
+file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/bin")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
+file(CREATE_LINK "${UNVERSIONED_Python3}" "${CMAKE_CURRENT_BINARY_DIR}/bin/python3" SYMBOLIC)
+
+unset(Python3_EXECUTABLE)
+set(Python3_FIND_UNVERSIONED_NAMES FIRST)
+set(Python3_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+# First search: generic name must be found
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (NOT Python3_EXECUTABLE STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+ message(FATAL_ERROR "Found unexpected interpreter ${Python3_EXECUTABLE} instead of ${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+endif()
+
+unset(Python3_EXECUTABLE)
+set(Python3_FIND_UNVERSIONED_NAMES LAST)
+
+# Second search: generic name must be found
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (NOT Python3_EXECUTABLE STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+ message(FATAL_ERROR "Found unexpected interpreter ${Python3_EXECUTABLE} instead of ${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+endif()
+
+unset(Python3_EXECUTABLE)
+set(Python3_FIND_UNVERSIONED_NAMES NEVER)
+
+# Third search: generic name must NOT be found
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (Python3_EXECUTABLE STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+ message(FATAL_ERROR "Found unexpected interpreter ${Python3_EXECUTABLE}")
+endif()
diff --git a/Tests/RunCMake/ABI/C.cmake b/Tests/RunCMake/ABI/C.cmake
new file mode 100644
index 0000000..51f5a34
--- /dev/null
+++ b/Tests/RunCMake/ABI/C.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+if(NOT CMAKE_C_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ message(FATAL_ERROR "CMAKE_C_BYTE_ORDER has unexpected value '${CMAKE_C_BYTE_ORDER}'")
+endif()
diff --git a/Tests/RunCMake/ABI/CMakeLists.txt b/Tests/RunCMake/ABI/CMakeLists.txt
new file mode 100644
index 0000000..ab1a20c
--- /dev/null
+++ b/Tests/RunCMake/ABI/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.19)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ABI/CUDA.cmake b/Tests/RunCMake/ABI/CUDA.cmake
new file mode 100644
index 0000000..1a40843
--- /dev/null
+++ b/Tests/RunCMake/ABI/CUDA.cmake
@@ -0,0 +1,4 @@
+enable_language(CUDA)
+if(NOT CMAKE_CUDA_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ message(FATAL_ERROR "CMAKE_CUDA_BYTE_ORDER has unexpected value '${CMAKE_CUDA_BYTE_ORDER}'")
+endif()
diff --git a/Tests/RunCMake/ABI/CXX.cmake b/Tests/RunCMake/ABI/CXX.cmake
new file mode 100644
index 0000000..7dc6f4a
--- /dev/null
+++ b/Tests/RunCMake/ABI/CXX.cmake
@@ -0,0 +1,4 @@
+enable_language(CXX)
+if(NOT CMAKE_CXX_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ message(FATAL_ERROR "CMAKE_CXX_BYTE_ORDER has unexpected value '${CMAKE_CXX_BYTE_ORDER}'")
+endif()
diff --git a/Tests/RunCMake/ABI/OBJC.cmake b/Tests/RunCMake/ABI/OBJC.cmake
new file mode 100644
index 0000000..9caccee
--- /dev/null
+++ b/Tests/RunCMake/ABI/OBJC.cmake
@@ -0,0 +1,4 @@
+enable_language(OBJC)
+if(NOT CMAKE_OBJC_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ message(FATAL_ERROR "CMAKE_OBJC_BYTE_ORDER has unexpected value '${CMAKE_OBJC_BYTE_ORDER}'")
+endif()
diff --git a/Tests/RunCMake/ABI/OBJCXX.cmake b/Tests/RunCMake/ABI/OBJCXX.cmake
new file mode 100644
index 0000000..8ddefc0
--- /dev/null
+++ b/Tests/RunCMake/ABI/OBJCXX.cmake
@@ -0,0 +1,4 @@
+enable_language(OBJCXX)
+if(NOT CMAKE_OBJCXX_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ message(FATAL_ERROR "CMAKE_OBJCXX_BYTE_ORDER has unexpected value '${CMAKE_OBJCXX_BYTE_ORDER}'")
+endif()
diff --git a/Tests/RunCMake/ABI/RunCMakeTest.cmake b/Tests/RunCMake/ABI/RunCMakeTest.cmake
new file mode 100644
index 0000000..883b849
--- /dev/null
+++ b/Tests/RunCMake/ABI/RunCMakeTest.cmake
@@ -0,0 +1,13 @@
+include(RunCMake)
+
+run_cmake(C)
+run_cmake(CXX)
+
+if(APPLE)
+ run_cmake(OBJC)
+ run_cmake(OBJCXX)
+endif()
+
+if(CMake_TEST_CUDA)
+ run_cmake(CUDA)
+endif()
diff --git a/Tests/RunCMake/CMP0104/CMP0104-Common.cmake b/Tests/RunCMake/CMP0104/CMP0104-Common.cmake
index b3568f1..ca4c1aa2 100644
--- a/Tests/RunCMake/CMP0104/CMP0104-Common.cmake
+++ b/Tests/RunCMake/CMP0104/CMP0104-Common.cmake
@@ -1,2 +1,6 @@
+# Make sure CMP0104 isn't issued for CXX targets created prior to enabling CUDA. See #21341.
+enable_language(CXX)
+add_library(cxx main.cxx)
+
enable_language(CUDA)
add_library(cuda main.cu)
diff --git a/Tests/RunCMake/CMP0104/main.cxx b/Tests/RunCMake/CMP0104/main.cxx
new file mode 100644
index 0000000..5047a34
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/main.cxx
@@ -0,0 +1,3 @@
+int main()
+{
+}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 38ab553..740815b 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -179,6 +179,10 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
)
endif()
+add_RunCMake_test(ABI -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
+set_property(TEST RunCMake.ABI APPEND
+ PROPERTY LABELS "CUDA")
+
add_RunCMake_test(AndroidTestUtilities)
set(autogen_with_qt5 FALSE)
if(CMake_TEST_Qt5)
@@ -565,7 +569,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin)"
endif()
-add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
+add_executable(pseudo_llvm-rc pseudo_llvm-rc.c)
+add_RunCMake_test(CommandLine -DLLVM_RC=$<TARGET_FILE:pseudo_llvm-rc> -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
add_RunCMake_test(CommandLineTar)
if(CMAKE_PLATFORM_NO_VERSIONED_SONAME OR (NOT CMAKE_SHARED_LIBRARY_SONAME_FLAG AND NOT CMAKE_SHARED_LIBRARY_SONAME_C_FLAG))
diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-result.txt b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-result.txt
+++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-result.txt
diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-stderr.txt b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-stderr.txt
index a3b79b6..a3b79b6 100644
--- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-stderr.txt
diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigIgnore.cmake b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyIgnore.cmake
index e69de29..e69de29 100644
--- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigIgnore.cmake
+++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyIgnore.cmake
diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-result.txt b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-result.txt
+++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-result.txt
diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-stderr.txt b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-stderr.txt
index a3b79b6..a3b79b6 100644
--- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-stderr.txt
diff --git a/Tests/RunCMake/CMakePresets/CMakePresets.json.in b/Tests/RunCMake/CMakePresets/CMakePresets.json.in
index ea7df45..54e4140 100644
--- a/Tests/RunCMake/CMakePresets/CMakePresets.json.in
+++ b/Tests/RunCMake/CMakePresets/CMakePresets.json.in
@@ -72,6 +72,7 @@
"TEST_DOLLAR": {
"value": "${dollar}"
},
+ "TEST_SOURCE_DIR_NAME": "${sourceDirName}",
"TEST_ENV_REF": "$env{TEST_ENV_REF}",
"TEST_ENV": "$env{TEST_ENV}",
"TEST_D_ENV_REF": "$env{TEST_D_ENV_REF}",
@@ -159,6 +160,21 @@
"binaryDir": "${sourceDir}/build"
},
{
+ "name": "GoodNoSCachePrep",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceParentDir}/GoodNoSCachePrep-build"
+ },
+ {
+ "name": "GoodNoSCache",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build"
+ },
+ {
+ "name": "GoodNoSourceArg",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build"
+ },
+ {
"name": "GoodInheritanceParentBase",
"hidden": true,
"generator": "@RunCMake_GENERATOR@",
@@ -451,28 +467,38 @@
"binaryDir": "${sourceDir}/build"
},
{
- "name": "CMakeGeneratorConfigNone",
+ "name": "ArchToolsetStrategyNone",
"generator": "@RunCMake_GENERATOR@",
"architecture": "a",
"toolset": "a",
"binaryDir": "${sourceDir}/build"
},
{
- "name": "CMakeGeneratorConfigBase",
+ "name": "ArchToolsetStrategyBase",
"generator": "@RunCMake_GENERATOR@",
- "architecture": "a",
- "toolset": "a",
- "cmakeGeneratorConfig": "ignore",
+ "architecture": {
+ "value": "a",
+ "strategy": "external"
+ },
+ "toolset": {
+ "value": "a",
+ "strategy": "external"
+ },
"binaryDir": "${sourceDir}/build"
},
{
- "name": "CMakeGeneratorConfigDefault",
- "inherits": "CMakeGeneratorConfigBase",
- "cmakeGeneratorConfig": "default"
+ "name": "ArchToolsetStrategyDefault",
+ "inherits": "ArchToolsetStrategyBase",
+ "architecture": {
+ "strategy": "set"
+ },
+ "toolset": {
+ "strategy": "set"
+ }
},
{
- "name": "CMakeGeneratorConfigIgnore",
- "inherits": "CMakeGeneratorConfigBase"
+ "name": "ArchToolsetStrategyIgnore",
+ "inherits": "ArchToolsetStrategyBase"
}
]
}
diff --git a/Tests/RunCMake/CMakePresets/Good-stdout.txt b/Tests/RunCMake/CMakePresets/Good-stdout.txt
index 7adf1ca..75003c7 100644
--- a/Tests/RunCMake/CMakePresets/Good-stdout.txt
+++ b/Tests/RunCMake/CMakePresets/Good-stdout.txt
@@ -26,6 +26,7 @@ Preset CMake variables:
TEST_PRESET_NAME:STRING="xGoodx"
TEST_SOURCE_DIR:PATH="[^
]*/Tests/RunCMake/CMakePresets/Good"
+ TEST_SOURCE_DIR_NAME="Good"
TEST_SOURCE_LIST:FILEPATH="[^
]*/Tests/RunCMake/CMakePresets/Good/CMakeLists\.txt"
TEST_SOURCE_PARENT_DIR:PATH="[^
diff --git a/Tests/RunCMake/CMakePresets/Good.cmake b/Tests/RunCMake/CMakePresets/Good.cmake
index 55b85da..73a618d 100644
--- a/Tests/RunCMake/CMakePresets/Good.cmake
+++ b/Tests/RunCMake/CMakePresets/Good.cmake
@@ -17,6 +17,7 @@ test_variable(TEST_UNTYPED_BOOL_FALSE "UNINITIALIZED" "FALSE")
test_variable(TEST_PRESET_NAME "STRING" "xGoodx")
test_variable(TEST_GENERATOR "UNINITIALIZED" "x${CMAKE_GENERATOR}x")
test_variable(TEST_DOLLAR "UNINITIALIZED" "$")
+test_variable(TEST_SOURCE_DIR_NAME "UNINITIALIZED" "Good")
test_variable(TEST_ENV_REF "UNINITIALIZED" "Environment variable")
test_variable(TEST_ENV "UNINITIALIZED" "Environment variable")
test_variable(TEST_D_ENV_REF "UNINITIALIZED" "xEnvironment variablex")
diff --git a/Tests/RunCMake/CMakePresets/GoodNoS.cmake b/Tests/RunCMake/CMakePresets/GoodNoS.cmake
index 1d3b2ff..49e7a25 100644
--- a/Tests/RunCMake/CMakePresets/GoodNoS.cmake
+++ b/Tests/RunCMake/CMakePresets/GoodNoS.cmake
@@ -1,4 +1,3 @@
include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake)
-get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY)
-test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodNoS-build")
+test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build")
diff --git a/Tests/RunCMake/CMakePresets/GoodNoSCache.cmake b/Tests/RunCMake/CMakePresets/GoodNoSCache.cmake
new file mode 100644
index 0000000..df58e72
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/GoodNoSCache.cmake
@@ -0,0 +1,4 @@
+include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake)
+
+get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY)
+test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodNoSCachePrep-build")
diff --git a/Tests/RunCMake/CMakePresets/GoodNoSCachePrep.cmake b/Tests/RunCMake/CMakePresets/GoodNoSCachePrep.cmake
new file mode 100644
index 0000000..df58e72
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/GoodNoSCachePrep.cmake
@@ -0,0 +1,4 @@
+include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake)
+
+get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY)
+test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodNoSCachePrep-build")
diff --git a/Tests/RunCMake/CMakePresets/GoodNoSourceArg.cmake b/Tests/RunCMake/CMakePresets/GoodNoSourceArg.cmake
new file mode 100644
index 0000000..49e7a25
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/GoodNoSourceArg.cmake
@@ -0,0 +1,3 @@
+include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake)
+
+test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build")
diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-result.txt b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-result.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-result.txt
diff --git a/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt
new file mode 100644
index 0000000..4a4d4ce
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy: Invalid preset$
diff --git a/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy.json.in b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy.json.in
new file mode 100644
index 0000000..9ec2cee
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy.json.in
@@ -0,0 +1,13 @@
+{
+ "version": 1,
+ "configurePresets": [
+ {
+ "name": "InvalidArchitectureStrategy",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build",
+ "architecture": {
+ "strategy": {}
+ }
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt
deleted file mode 100644
index 72a20d5..0000000
--- a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-^CMake Error: Could not read presets from [^
-]*/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig: Invalid preset$
diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-result.txt b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-result.txt
+++ b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-result.txt
diff --git a/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt
new file mode 100644
index 0000000..fab3766
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy: Invalid preset$
diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig.json.in b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy.json.in
index 1479c66..7d2ab1f 100644
--- a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig.json.in
+++ b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy.json.in
@@ -2,10 +2,12 @@
"version": 1,
"configurePresets": [
{
- "name": "InvalidCMakeGeneratorConfig",
+ "name": "InvalidToolsetStrategy",
"generator": "@RunCMake_GENERATOR@",
"binaryDir": "${sourceDir}/build",
- "cmakeGeneratorConfig": {}
+ "toolset": {
+ "strategy": {}
+ }
}
]
}
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
index dddf05f..1ffda3d 100644
--- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
@@ -28,8 +28,8 @@ endfunction()
function(run_cmake_presets name)
set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}")
set(_source_arg "${RunCMake_TEST_SOURCE_DIR}")
- if(CMakePresets_RELATIVE_SOURCE)
- set(_source_arg "../${name}")
+ if(CMakePresets_SOURCE_ARG)
+ set(_source_arg "${CMakePresets_SOURCE_ARG}")
endif()
file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}")
@@ -117,8 +117,10 @@ run_cmake_presets(InvalidInheritance)
run_cmake_presets(ErrorNoWarningDev)
run_cmake_presets(ErrorNoWarningDeprecated)
set(CMakePresets_SCHEMA_EXPECTED_RESULT 1)
-run_cmake_presets(InvalidCMakeGeneratorConfig)
-run_cmake_presets(UnknownCMakeGeneratorConfig)
+run_cmake_presets(InvalidArchitectureStrategy)
+run_cmake_presets(UnknownArchitectureStrategy)
+run_cmake_presets(InvalidToolsetStrategy)
+run_cmake_presets(UnknownToolsetStrategy)
run_cmake_presets(EmptyCacheKey)
run_cmake_presets(EmptyEnvKey)
set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
@@ -152,9 +154,9 @@ unset(ENV{TEST_ENV_REF_PENV})
run_cmake_presets(GoodNoArgs)
file(REMOVE_RECURSE ${RunCMake_BINARY_DIR}/GoodBinaryUp-build)
run_cmake_presets(GoodBinaryUp)
-set(CMakePresets_RELATIVE_SOURCE TRUE)
+set(CMakePresets_SOURCE_ARG "../GoodBinaryRelative")
run_cmake_presets(GoodBinaryRelative)
-unset(CMakePresets_RELATIVE_SOURCE)
+unset(CMakePresets_SOURCE_ARG)
run_cmake_presets(GoodSpaces "--preset=Good Spaces")
if(WIN32)
run_cmake_presets(GoodWindowsBackslash)
@@ -168,7 +170,22 @@ run_cmake_presets(GoodGeneratorCmdLine -G ${RunCMake_GENERATOR})
run_cmake_presets(InvalidGeneratorCmdLine -G "Invalid Generator")
set(CMakePresets_NO_S_ARG TRUE)
run_cmake_presets(GoodNoS)
+set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/GoodNoSCachePrep-build")
+run_cmake_presets(GoodNoSCachePrep)
+set(CMakePresets_SOURCE_ARG ".")
+set(RunCMake_TEST_NO_CLEAN 1)
+run_cmake_presets(GoodNoSCache)
+unset(RunCMake_TEST_NO_CLEAN)
+unset(CMakePresets_SOURCE_ARG)
+unset(RunCMake_TEST_BINARY_DIR)
unset(CMakePresets_NO_S_ARG)
+set(CMakePresets_NO_SOURCE_ARGS 1)
+set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/GoodNoSourceArg")
+set(RunCMake_TEST_NO_CLEAN 1)
+run_cmake_presets(GoodNoSourceArg)
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+unset(CMakePresets_NO_SOURCE_ARGS)
run_cmake_presets(GoodInheritanceParent)
run_cmake_presets(GoodInheritanceChild)
run_cmake_presets(GoodInheritanceOverride)
@@ -196,9 +213,9 @@ if(RunCMake_GENERATOR MATCHES "^Visual Studio ")
run_cmake_presets(VisualStudioInheritanceMultiSecond)
endif()
else()
- run_cmake_presets(CMakeGeneratorConfigNone)
- run_cmake_presets(CMakeGeneratorConfigDefault)
- run_cmake_presets(CMakeGeneratorConfigIgnore)
+ run_cmake_presets(ArchToolsetStrategyNone)
+ run_cmake_presets(ArchToolsetStrategyDefault)
+ run_cmake_presets(ArchToolsetStrategyIgnore)
endif()
# Test bad command line arguments
diff --git a/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-result.txt b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt
new file mode 100644
index 0000000..cf17881
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy: Invalid preset$
diff --git a/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy.json.in b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy.json.in
new file mode 100644
index 0000000..a3bf7c8
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy.json.in
@@ -0,0 +1,13 @@
+{
+ "version": 1,
+ "configurePresets": [
+ {
+ "name": "UnknownArchitectureStrategy",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build",
+ "architecture": {
+ "strategy": "unknown"
+ }
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt
deleted file mode 100644
index b1759b0..0000000
--- a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-^CMake Error: Could not read presets from [^
-]*/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig: Invalid preset$
diff --git a/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-result.txt b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt
new file mode 100644
index 0000000..8f9be29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy: Invalid preset$
diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig.json.in b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy.json.in
index 900c6df..1668700 100644
--- a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig.json.in
+++ b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy.json.in
@@ -2,10 +2,12 @@
"version": 1,
"configurePresets": [
{
- "name": "UnknownCMakeGeneratorConfig",
+ "name": "UnknownToolsetStrategy",
"generator": "@RunCMake_GENERATOR@",
"binaryDir": "${sourceDir}/build",
- "cmakeGeneratorConfig": "unknown"
+ "toolset": {
+ "strategy": "unknown"
+ }
}
]
}
diff --git a/Tests/RunCMake/CTest/RunCMakeTest.cmake b/Tests/RunCMake/CTest/RunCMakeTest.cmake
index ffc8f78..b81f319 100644
--- a/Tests/RunCMake/CTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTest/RunCMakeTest.cmake
@@ -5,6 +5,7 @@ run_cmake(BeforeProject)
unset(RunCMake_TEST_OPTIONS)
run_cmake(NotOn)
+run_cmake(Site)
function(run_CMakeCTestArguments)
run_cmake_with_options(CMakeCTestArguments "-DCMAKE_CTEST_ARGUMENTS=--quiet\\;--output-log\\;output-log.txt")
diff --git a/Tests/RunCMake/CTest/Site.cmake b/Tests/RunCMake/CTest/Site.cmake
new file mode 100644
index 0000000..2c96f23
--- /dev/null
+++ b/Tests/RunCMake/CTest/Site.cmake
@@ -0,0 +1,5 @@
+include(CTest)
+get_property(site CACHE SITE PROPERTY VALUE)
+if(NOT "${site}" STREQUAL "${SITE}")
+ message(FATAL_ERROR "SITE is not a cache entry")
+endif()
diff --git a/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt b/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt
index eed581a..a7e0af5 100644
--- a/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt
+++ b/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt
@@ -1,9 +1,11 @@
^CMake Error at [^
-]*/Modules/CheckSourceCompiles.cmake:[0-9]+ \(message\):
+]*/Modules/Internal/CheckSourceCompiles.cmake:[0-9]+ \(message\):
Unknown argument:
BAD
Call Stack \(most recent call first\):
+ [^
+]*/Modules/CheckSourceCompiles.cmake:[0-9]+ \(cmake_check_source_compiles\)
UnknownArgument.cmake:[0-9]+ \(check_source_compiles\)
CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt b/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt
index 8ae1ea1..6824e72 100644
--- a/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt
+++ b/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt
@@ -1,9 +1,24 @@
-^CMake Error at [^
-]*/Modules/CheckSourceRuns.cmake:[0-9]+ \(message\):
+^CMake Warning \(dev\) at [^
+]*/Modules/Internal/CheckSourceRuns.cmake:[0-9]+ \(message\):
Unknown argument:
BAD
Call Stack \(most recent call first\):
+ [^
+]*/Modules/CheckCSourceRuns.cmake:[0-9]+ \(cmake_check_source_runs\)
+ UnknownArgument.cmake:[0-9]+ \(check_c_source_runs\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Error at [^
+]*/Modules/Internal/CheckSourceRuns.cmake:[0-9]+ \(message\):
+ Unknown argument:
+
+ BAD
+
+Call Stack \(most recent call first\):
+ [^
+]*/Modules/CheckSourceRuns.cmake:[0-9]+ \(cmake_check_source_runs\)
UnknownArgument.cmake:[0-9]+ \(check_source_runs\)
CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake b/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake
index 6e50fa7..927a6b0 100644
--- a/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake
@@ -1,5 +1,7 @@
enable_language (C)
+include(CheckCSourceRuns)
include(CheckSourceRuns)
-check_source_runs(C "int main() {return 0;}" SHOULD_BUILD SRC_EXT C BAD)
+check_c_source_runs("int main() {return 0;}" C_SHOULD_BUILD BAD)
+check_source_runs(C "int main() {return 0;}" SHOULD_BUILD SRC_EXT c BAD)
diff --git a/Tests/RunCMake/CommandLine/NoArgs-stdout.txt b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt
index 50f7d9d..f1dafc8 100644
--- a/Tests/RunCMake/CommandLine/NoArgs-stdout.txt
+++ b/Tests/RunCMake/CommandLine/NoArgs-stdout.txt
@@ -3,7 +3,6 @@
cmake \[options\] <path-to-source>
cmake \[options\] <path-to-existing-build>
cmake \[options\] -S <path-to-source> -B <path-to-build>
- cmake \[options\] -S <path-to-source> --preset=<preset-name>
Specify a source directory to \(re-\)generate a build system for it in the
current working directory. Specify an existing build directory to
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 76ca898..c438860 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -201,8 +201,8 @@ function(run_BuildDir)
run_cmake_command(BuildDir--build--parallel-large ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build --parallel 4294967293)
- # No default jobs for Xcode and FreeBSD build command
- if(NOT RunCMake_GENERATOR MATCHES "Xcode" AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ # No default jobs for FreeBSD build command
+ if(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
run_cmake_command(BuildDir--build-jobs-no-number ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build -j)
run_cmake_command(BuildDir--build-jobs-no-number-trailing--target ${CMAKE_COMMAND} -E chdir ..
@@ -789,7 +789,7 @@ function(run_llvm_rc)
"test.tmp was not deleted")
endif()
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir")
- run_cmake_command(llvm_rc_full_run ${CMAKE_COMMAND} -E cmake_llvm_rc ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/source_file test.tmp ${CMAKE_COMMAND} -E echo "This is a test" ++ ${CMAKE_COMMAND} -E copy test.tmp SOURCE_DIR/llvmrc.result )
+ run_cmake_command(llvm_rc_full_run ${CMAKE_COMMAND} -E cmake_llvm_rc ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/source_file test.tmp ${CMAKE_COMMAND} -E echo "This is a test" ++ ${LLVM_RC} -bad /FO SOURCE_DIR/llvmrc.result test.tmp )
if(EXISTS ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/test.tmp)
message(SEND_ERROR "${test} - FAILED:\n"
"test.tmp was not deleted")
diff --git a/Tests/RunCMake/ExternalData/BadArguments-stderr.txt b/Tests/RunCMake/ExternalData/BadArguments-stderr.txt
new file mode 100644
index 0000000..44efe7e
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadArguments-stderr.txt
@@ -0,0 +1,7 @@
+CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
+ Ignoring unrecognized arguments passed to ExternalData_add_target:
+ `UNKNOWN_ARGUMENT`
+Call Stack \(most recent call first\):
+ BadArguments.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/ExternalData/BadArguments.cmake b/Tests/RunCMake/ExternalData/BadArguments.cmake
new file mode 100644
index 0000000..dad0007
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadArguments.cmake
@@ -0,0 +1,5 @@
+include(ExternalData)
+set(ExternalData_URL_TEMPLATES
+ "file:///path/to/%(algo)/%(hash)"
+ )
+ExternalData_Add_Target(Data UNKNOWN_ARGUMENT)
diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
index b5ab22d..b4cc95e 100644
--- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
@@ -2,6 +2,7 @@ include(RunCMake)
run_cmake(BadAlgoMap1)
run_cmake(BadAlgoMap2)
+run_cmake(BadArguments)
run_cmake(BadCustom1)
run_cmake(BadCustom2)
run_cmake(BadCustom3)
diff --git a/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt b/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt
new file mode 100644
index 0000000..ec9a2dd
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt
@@ -0,0 +1,12 @@
+^PROJ1_FULL_BINDIR='/usr/bin'
+CMake Warning \(dev\) at [^
+]*/Modules/GNUInstallDirs.cmake:[0-9]+ \(message\):
+ GNUInstallDirs_get_absolute_install_dir called without third argument.
+ Using \${dir} from the caller's scope for compatibility with CMake 3.19 and
+ below.
+Call Stack \(most recent call first\):
+ GetAbs.cmake:10 \(GNUInstallDirs_get_absolute_install_dir\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
++
+PROJ2_FULL_BINDIR='/usr/bin'$
diff --git a/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake b/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake
new file mode 100644
index 0000000..7d5bfc8
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake
@@ -0,0 +1,11 @@
+set(CMAKE_SIZEOF_VOID_P 8)
+set(CMAKE_LIBRARY_ARCHITECTURE "arch")
+set(CMAKE_INSTALL_PREFIX /usr)
+include(GNUInstallDirs)
+
+GNUInstallDirs_get_absolute_install_dir(PROJ1_FULL_BINDIR CMAKE_INSTALL_BINDIR BINDIR)
+message("PROJ1_FULL_BINDIR='${PROJ1_FULL_BINDIR}'")
+
+set(dir BINDIR)
+GNUInstallDirs_get_absolute_install_dir(PROJ2_FULL_BINDIR CMAKE_INSTALL_BINDIR)
+message("PROJ2_FULL_BINDIR='${PROJ2_FULL_BINDIR}'")
diff --git a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
index 529e10a..395ff30 100644
--- a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
@@ -21,4 +21,5 @@ foreach(case
unset(RunCMake-stderr-file)
endforeach()
+run_cmake(GetAbs)
run_cmake(NoSystem)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 6349112..edeb6bd 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -35,6 +35,9 @@ run_cmake(TARGET_NAME_IF_EXISTS-no-arg)
run_cmake(TARGET_NAME_IF_EXISTS-empty-arg)
run_cmake(TARGET_NAME_IF_EXISTS)
run_cmake(TARGET_NAME_IF_EXISTS-not-a-target)
+run_cmake(TARGET_NAME_IF_EXISTS-alias-target)
+run_cmake(TARGET_NAME_IF_EXISTS-imported-target)
+run_cmake(TARGET_NAME_IF_EXISTS-imported-global-target)
run_cmake(REMOVE_DUPLICATES-empty)
run_cmake(REMOVE_DUPLICATES-1)
run_cmake(REMOVE_DUPLICATES-2)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target-check.cmake
new file mode 100644
index 0000000..8ae2ecc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target-check.cmake
@@ -0,0 +1,5 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/TARGET_NAME_IF_EXISTS-generated-alias.txt" content)
+
+if(NOT content STREQUAL aliasTarget)
+ set(RunCMake_TEST_FAILED "actual content:\n ${content}\nbut expected [[aliasTarget]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target.cmake
new file mode 100644
index 0000000..d3ef0f8
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target.cmake
@@ -0,0 +1,8 @@
+enable_language(CXX)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy_executable.cpp" "int main(int,char**) { return 0; }\n")
+add_executable(executableTarget "${CMAKE_CURRENT_BINARY_DIR}/dummy_executable.cpp")
+add_executable(aliasTarget ALIAS executableTarget)
+
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT TARGET_NAME_IF_EXISTS-generated-alias.txt CONTENT "$<TARGET_NAME_IF_EXISTS:aliasTarget>")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target-check.cmake
new file mode 100644
index 0000000..b14c9e1
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target-check.cmake
@@ -0,0 +1,5 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/TARGET_NAME_IF_EXISTS-generated-imported-global.txt" content)
+
+if(NOT content STREQUAL importedGlobalTarget)
+ set(RunCMake_TEST_FAILED "actual content:\n ${content}\nbut expected [[importedGlobalTarget]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target.cmake
new file mode 100644
index 0000000..b685558
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target.cmake
@@ -0,0 +1,4 @@
+add_executable(importedGlobalTarget IMPORTED GLOBAL)
+
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT TARGET_NAME_IF_EXISTS-generated-imported-global.txt CONTENT "$<TARGET_NAME_IF_EXISTS:importedGlobalTarget>")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target-check.cmake
new file mode 100644
index 0000000..9615893
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target-check.cmake
@@ -0,0 +1,5 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/TARGET_NAME_IF_EXISTS-generated-imported.txt" content)
+
+if(NOT content STREQUAL importedTarget)
+ set(RunCMake_TEST_FAILED "actual content:\n ${content}\nbut expected [[importedTarget]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target.cmake
new file mode 100644
index 0000000..2008907
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target.cmake
@@ -0,0 +1,4 @@
+add_executable(importedTarget IMPORTED)
+
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT TARGET_NAME_IF_EXISTS-generated-imported.txt CONTENT "$<TARGET_NAME_IF_EXISTS:importedTarget>")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-again-ninja-check.cmake
index 1e4cbe1..1e4cbe1 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-again-ninja-check.cmake
diff --git a/Tests/RunCMake/NinjaMultiConfig/PerConfigSources.cmake b/Tests/RunCMake/NinjaMultiConfig/PerConfigSources.cmake
new file mode 100644
index 0000000..7483130
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/PerConfigSources.cmake
@@ -0,0 +1,8 @@
+enable_language(C)
+file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/main_$<CONFIG>.c" CONTENT
+[[int main(void)
+{
+ return 0;
+}
+]])
+add_executable(exe "${CMAKE_BINARY_DIR}/main_$<CONFIG>.c")
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index ec8804b..2411114 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -215,7 +215,7 @@ run_ninja(CustomCommandGenerator debug-clean build-Debug.ninja clean)
run_cmake_build(CustomCommandGenerator release-clean Release clean)
run_cmake_build(CustomCommandGenerator debug-in-release-graph Release generated:Debug)
run_cmake_command(CustomCommandGenerator-debug-in-release-graph-generated "${TARGET_FILE_generated_Debug}")
-run_ninja(CustomCommandGenerator debug-in-release-graph-clean build-Debug.ninja clean:Debug)
+run_ninja(CustomCommandGenerator debug-clean-again build-Debug.ninja clean:Debug)
run_ninja(CustomCommandGenerator release-in-debug-graph build-Debug.ninja generated:Release)
run_cmake_command(CustomCommandGenerator-release-in-debug-graph-generated "${TARGET_FILE_generated_Release}")
unset(RunCMake_TEST_NO_CLEAN)
@@ -246,6 +246,10 @@ unset(RunCMake_TEST_BINARY_DIR)
run_cmake(CustomCommandDepfile)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all")
+run_cmake(PerConfigSources)
+unset(RunCMake_TEST_OPTIONS)
+
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/PostfixAndLocation-build)
set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_CROSS_CONFIGS=all")
run_cmake_configure(PostfixAndLocation)
diff --git a/Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt b/Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt
index 306c255..87fa746 100644
--- a/Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt
+++ b/Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error in FunctionUnmatched.cmake:
- A logical block opening on the line
-
- .*/Tests/RunCMake/Syntax/FunctionUnmatched.cmake:[0-9]+ \(function\)
-
- is not closed.
+^CMake Error at FunctionUnmatched\.cmake:[0-9]+ \(function\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt
index f4ff709..7904b87 100644
--- a/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt
+++ b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error at FunctionUnmatchedForeach.cmake:[0-9]+ \(f\):
- A logical block opening on the line
-
- .*/Tests/RunCMake/Syntax/FunctionUnmatchedForeach.cmake:[0-9]+ \(foreach\)
-
- is not closed.
+^CMake Error at FunctionUnmatchedForeach\.cmake:[0-9]+ \(endfunction\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/ImproperNesting-result.txt b/Tests/RunCMake/Syntax/ImproperNesting-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ImproperNesting-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/ImproperNesting-stderr.txt b/Tests/RunCMake/Syntax/ImproperNesting-stderr.txt
new file mode 100644
index 0000000..a209ef6
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ImproperNesting-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at ImproperNesting\.cmake:[0-9]+ \(endforeach\):
+ Flow control statements are not properly nested\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/ImproperNesting.cmake b/Tests/RunCMake/Syntax/ImproperNesting.cmake
new file mode 100644
index 0000000..47ff9f9
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ImproperNesting.cmake
@@ -0,0 +1,7 @@
+message(FATAL_ERROR "This should not happen")
+
+foreach(i 1 2)
+ if(1)
+endforeach()
+endif()
+endif()
diff --git a/Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt b/Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt
index 440d863..a7af590 100644
--- a/Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt
+++ b/Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error in MacroUnmatched.cmake:
- A logical block opening on the line
-
- .*/Tests/RunCMake/Syntax/MacroUnmatched.cmake:[0-9]+ \(macro\)
-
- is not closed.
+^CMake Error at MacroUnmatched\.cmake:[0-9]+ \(macro\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt b/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt
index 820cd2e..30c4a4c 100644
--- a/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt
+++ b/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error at MacroUnmatchedForeach.cmake:[0-9]+ \(m\):
- A logical block opening on the line
-
- .*/Tests/RunCMake/Syntax/MacroUnmatchedForeach.cmake:[0-9]+ \(foreach\)
-
- is not closed.
+^CMake Error at MacroUnmatchedForeach\.cmake:[0-9]+ \(endmacro\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/Override.cmake b/Tests/RunCMake/Syntax/Override.cmake
new file mode 100644
index 0000000..af62db1
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Override.cmake
@@ -0,0 +1,6 @@
+function(override)
+ function(${FUNCTION_NAME})
+ endfunction()
+endfunction()
+override()
+message(FATAL_ERROR "This shouldn't happen")
diff --git a/Tests/RunCMake/Syntax/OverrideBreak-result.txt b/Tests/RunCMake/Syntax/OverrideBreak-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideBreak-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideContinue-result.txt b/Tests/RunCMake/Syntax/OverrideContinue-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideContinue-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideElse-result.txt b/Tests/RunCMake/Syntax/OverrideElse-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideElse-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideElseIf-result.txt b/Tests/RunCMake/Syntax/OverrideElseIf-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideElseIf-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndForeach-result.txt b/Tests/RunCMake/Syntax/OverrideEndForeach-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndForeach-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndFunction-result.txt b/Tests/RunCMake/Syntax/OverrideEndFunction-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndFunction-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndIf-result.txt b/Tests/RunCMake/Syntax/OverrideEndIf-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndIf-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndMacro-result.txt b/Tests/RunCMake/Syntax/OverrideEndMacro-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndMacro-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndWhile-result.txt b/Tests/RunCMake/Syntax/OverrideEndWhile-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndWhile-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideForeach-result.txt b/Tests/RunCMake/Syntax/OverrideForeach-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideForeach-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideFunction-result.txt b/Tests/RunCMake/Syntax/OverrideFunction-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideFunction-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideIf-result.txt b/Tests/RunCMake/Syntax/OverrideIf-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideIf-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideMacro-result.txt b/Tests/RunCMake/Syntax/OverrideMacro-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideMacro-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideReturn-result.txt b/Tests/RunCMake/Syntax/OverrideReturn-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideReturn-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideWhile-result.txt b/Tests/RunCMake/Syntax/OverrideWhile-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideWhile-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index 8d74dc1..4d24657 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -72,6 +72,7 @@ run_cmake(UnterminatedBrace2)
run_cmake(UnterminatedBracket0)
run_cmake(UnterminatedBracket1)
run_cmake(UnterminatedBracketComment)
+run_cmake(ImproperNesting)
# Variable expansion tests
run_cmake(ExpandInAt)
@@ -122,3 +123,30 @@ run_cmake(FunctionUnmatched)
run_cmake(FunctionUnmatchedForeach)
run_cmake(MacroUnmatched)
run_cmake(MacroUnmatchedForeach)
+
+function(run_override name)
+ string(TOLOWER "${name}" lname)
+ set(RunCMake_DEFAULT_stderr "^CMake Error at [^
+]*/Tests/RunCMake/Syntax/Override\\.cmake:[0-9]+ \\(function\\):
+ Built-in flow control command \"${lname}\" cannot be overridden\\.
+Call Stack \\(most recent call first\\):
+ [^
+]*/Tests/RunCMake/Syntax/Override\\.cmake:[0-9]+ \\(override\\)$")
+ run_cmake_command(Override${name} "${CMAKE_COMMAND}" -DFUNCTION_NAME=${name} -P "${RunCMake_SOURCE_DIR}/Override.cmake")
+endfunction()
+
+run_override(Break)
+run_override(Continue)
+run_override(Else)
+run_override(ElseIf)
+run_override(EndForeach)
+run_override(EndFunction)
+run_override(EndIf)
+run_override(EndMacro)
+run_override(EndWhile)
+run_override(Foreach)
+run_override(Function)
+run_override(If)
+run_override(Macro)
+run_override(Return)
+run_override(While)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake
new file mode 100644
index 0000000..1787e87
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake
@@ -0,0 +1,16 @@
+add_custom_target(target1 ALL)
+target_sources(target1 PRIVATE main.cpp)
+get_property(actualProp1 TARGET target1 PROPERTY SOURCES)
+set(desiredProp1 main.cpp)
+if(NOT desiredProp1 STREQUAL actualProp1)
+ message("source property not set. desired: \"${desiredProp1}\" actual: \"${actualProp1}\"")
+endif()
+
+add_custom_target(target2 ALL SOURCES main.cpp)
+target_sources(target2 PRIVATE empty_1.cpp empty_2.cpp)
+target_sources(target2 PRIVATE empty_3.cpp)
+get_property(actualProp2 TARGET target2 PROPERTY SOURCES)
+set(desiredProp2 main.cpp empty_1.cpp empty_2.cpp empty_3.cpp)
+if (NOT desiredProp2 STREQUAL actualProp2)
+ message("source property not set. desired: \"${desiredProp2}\" actual: \"${actualProp2}\"")
+endif()
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake
new file mode 100644
index 0000000..0078eab
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target PRIVATE $<IF:1,${CMAKE_CURRENT_LIST_DIR}/main.cpp,${CMAKE_CURRENT_LIST_DIR}/empty_1.cpp>)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt
new file mode 100644
index 0000000..9334bf6
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at AddCustomTargetInterfaceSources.cmake:2 \(target_sources\):
+ target_sources may only set PRIVATE properties on custom targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake
new file mode 100644
index 0000000..42a8ca2
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target INTERFACE main.cpp)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake
new file mode 100644
index 0000000..11f0258
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target PRIVATE main.cpp)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt
new file mode 100644
index 0000000..afba4be
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at AddCustomTargetPublicSources.cmake:2 \(target_sources\):
+ target_sources may only set PRIVATE properties on custom targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake
new file mode 100644
index 0000000..d9e82c0
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target PUBLIC main.cpp)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt
new file mode 100644
index 0000000..4a153e9
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at AddCustomTargetSources.cmake:2 \(target_sources\):
+ target_sources called with invalid arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake
new file mode 100644
index 0000000..dd688d3
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target main.cpp)
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index 0d462ba..b56ee44 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -14,3 +14,9 @@ run_cmake(RelativePathInSubdirInterface)
run_cmake(RelativePathInSubdirPrivate)
run_cmake(RelativePathInSubdirInclude)
run_cmake(ExportBuild)
+run_cmake(AddCustomTargetPublicSources)
+run_cmake(AddCustomTargetPrivateSources)
+run_cmake(AddCustomTargetInterfaceSources)
+run_cmake(AddCustomTargetSources)
+run_cmake(AddCustomTargetCheckProperty)
+run_cmake(AddCustomTargetGenx)
diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
index 71694fb..0a2e3f9 100644
--- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
@@ -16,6 +16,13 @@ run_cmake(NewLineStyle-WrongArg)
run_cmake(NewLineStyle-ValidArg)
run_cmake(NewLineStyle-COPYONLY)
run_cmake(NoSourcePermissions)
+run_cmake(SourcePermissionsInvalidArg-1)
+run_cmake(SourcePermissionsInvalidArg-2)
+run_cmake(SourcePermissionsInvalidArg-3)
+run_cmake(SourcePermissionsInvalidArg-4)
+run_cmake(SourcePermissionsInvalidArg-5)
+run_cmake(UseSourcePermissions)
+run_cmake(SourcePermissions)
if(RunCMake_GENERATOR MATCHES "Make")
# Use a single build tree for a few tests without cleaning.
diff --git a/Tests/RunCMake/configure_file/SourcePermissions-result.txt b/Tests/RunCMake/configure_file/SourcePermissions-result.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissions-result.txt
diff --git a/Tests/RunCMake/configure_file/SourcePermissions-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissions-stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissions-stderr.txt
diff --git a/Tests/RunCMake/configure_file/SourcePermissions.cmake b/Tests/RunCMake/configure_file/SourcePermissions.cmake
new file mode 100644
index 0000000..50330fc
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissions.cmake
@@ -0,0 +1,34 @@
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ
+)
+
+if (UNIX)
+ find_program(STAT_EXECUTABLE NAMES stat)
+ if(NOT STAT_EXECUTABLE)
+ return()
+ endif()
+
+ if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt"
+ OUTPUT_VARIABLE output
+ )
+ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt"
+ OUTPUT_VARIABLE output
+ )
+ else()
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt"
+ OUTPUT_VARIABLE output
+ )
+ endif()
+
+ if (NOT output EQUAL "554")
+ message(FATAL_ERROR "configure file has different permissions than "
+ "desired, generated permissions: ${output}")
+ endif()
+
+endif()
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-stderr.txt
new file mode 100644
index 0000000..d483d34
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissionsInvalidArg-1.cmake:1 \(configure_file\):
+ configure_file given both USE_SOURCE_PERMISSIONS and NO_SOURCE_PERMISSIONS.
+ Only one option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1.cmake
new file mode 100644
index 0000000..4969880
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1.cmake
@@ -0,0 +1,5 @@
+configure_file(sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile.txt
+ NO_SOURCE_PERMISSIONS
+ USE_SOURCE_PERMISSIONS
+)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-stderr.txt
new file mode 100644
index 0000000..2fcfe58
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissionsInvalidArg-2.cmake:1 \(configure_file\):
+ configure_file given both FILE_PERMISSIONS and NO_SOURCE_PERMISSIONS. Only
+ one option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2.cmake
new file mode 100644
index 0000000..8a3fb87
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2.cmake
@@ -0,0 +1,5 @@
+configure_file(sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile.txt
+ NO_SOURCE_PERMISSIONS
+ FILE_PERMISSIONS OWNER_READ
+)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-stderr.txt
new file mode 100644
index 0000000..29fae1b
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissionsInvalidArg-3.cmake:1 \(configure_file\):
+ configure_file given both FILE_PERMISSIONS and USE_SOURCE_PERMISSIONS.
+ Only one option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3.cmake
new file mode 100644
index 0000000..78ecb0f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3.cmake
@@ -0,0 +1,5 @@
+configure_file(sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile.txt
+ USE_SOURCE_PERMISSIONS
+ FILE_PERMISSIONS OWNER_READ
+)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-stderr.txt
new file mode 100644
index 0000000..7d477cb
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourcePermissionsInvalidArg-4.cmake:1 \(configure_file\):
+ configure_file given FILE_PERMISSIONS without any options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4.cmake
new file mode 100644
index 0000000..308b455
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4.cmake
@@ -0,0 +1,4 @@
+configure_file(sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile.txt
+ FILE_PERMISSIONS
+)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-stderr.txt
new file mode 100644
index 0000000..7cab120
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourcePermissionsInvalidArg-5.cmake:1 \(configure_file\):
+ configure_file given invalid permission "OWNER_RX","GROUP_RWX".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5.cmake
new file mode 100644
index 0000000..15c6f9a
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5.cmake
@@ -0,0 +1,6 @@
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_RX
+ GROUP_RWX
+)
diff --git a/Tests/RunCMake/configure_file/UseSourcePermissions.cmake b/Tests/RunCMake/configure_file/UseSourcePermissions.cmake
new file mode 100644
index 0000000..f7aedd1
--- /dev/null
+++ b/Tests/RunCMake/configure_file/UseSourcePermissions.cmake
@@ -0,0 +1,40 @@
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt
+ USE_SOURCE_PERMISSIONS
+)
+
+if (UNIX)
+ find_program(STAT_EXECUTABLE NAMES stat)
+ if(NOT STAT_EXECUTABLE)
+ return()
+ endif()
+
+ if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt"
+ OUTPUT_VARIABLE output1
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt"
+ OUTPUT_VARIABLE output2
+ )
+ elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt"
+ OUTPUT_VARIABLE output1
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt"
+ OUTPUT_VARIABLE output2
+ )
+ else()
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt"
+ OUTPUT_VARIABLE output1
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt"
+ OUTPUT_VARIABLE output2
+ )
+ endif()
+
+ if (NOT output1 EQUAL output2)
+ message(FATAL_ERROR "configure file has different permissions source "
+ "permissions: ${output1} generated permissions: ${output2}")
+ endif()
+
+endif()
diff --git a/Tests/RunCMake/configure_file/sourcefile.txt b/Tests/RunCMake/configure_file/sourcefile.txt
new file mode 100644
index 0000000..2296808
--- /dev/null
+++ b/Tests/RunCMake/configure_file/sourcefile.txt
@@ -0,0 +1 @@
+an empty file
diff --git a/Tests/RunCMake/if/duplicate-deep-else-stderr.txt b/Tests/RunCMake/if/duplicate-deep-else-stderr.txt
index ac2335c..ee886e0 100644
--- a/Tests/RunCMake/if/duplicate-deep-else-stderr.txt
+++ b/Tests/RunCMake/if/duplicate-deep-else-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at duplicate-deep-else.cmake:[0-9]+ \(else\):
- A duplicate ELSE command was found inside an IF block.
+CMake Error at duplicate-deep-else\.cmake:[0-9]+ \(else\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt b/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt
index ba6765c..60c8484 100644
--- a/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt
+++ b/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at duplicate-else-after-elseif.cmake:[0-9]+ \(else\):
- A duplicate ELSE command was found inside an IF block.
+CMake Error at duplicate-else-after-elseif\.cmake:[0-9]+ \(else\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/if/duplicate-else-stderr.txt b/Tests/RunCMake/if/duplicate-else-stderr.txt
index e0dd01f..518c43f 100644
--- a/Tests/RunCMake/if/duplicate-else-stderr.txt
+++ b/Tests/RunCMake/if/duplicate-else-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at duplicate-else.cmake:[0-9]+ \(else\):
- A duplicate ELSE command was found inside an IF block.
+CMake Error at duplicate-else\.cmake:[0-9]+ \(else\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/if/misplaced-elseif-stderr.txt b/Tests/RunCMake/if/misplaced-elseif-stderr.txt
index c4b0266..5138f11 100644
--- a/Tests/RunCMake/if/misplaced-elseif-stderr.txt
+++ b/Tests/RunCMake/if/misplaced-elseif-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at misplaced-elseif.cmake:[0-9]+ \(elseif\):
- An ELSEIF command was found after an ELSE command.
+CMake Error at misplaced-elseif\.cmake:[0-9]+ \(elseif\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/pseudo_llvm-rc.c b/Tests/RunCMake/pseudo_llvm-rc.c
new file mode 100644
index 0000000..7acb2a3
--- /dev/null
+++ b/Tests/RunCMake/pseudo_llvm-rc.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char* argv[])
+{
+ FILE* source;
+ FILE* target;
+ int i;
+ for (i = 1; i < argc; ++i) {
+ if (strcmp(argv[i], "-bad") == 0) {
+ fprintf(stdout, "stdout from bad command line arg '-bad'\n");
+ fprintf(stderr, "stderr from bad command line arg '-bad'\n");
+ return 1;
+ }
+ }
+ source = fopen(argv[argc - 1], "rb");
+ if (source == NULL) {
+ return 1;
+ }
+ target = fopen(argv[argc - 2], "wb");
+ if (target != NULL) {
+ char buffer[500];
+ size_t n = fread(buffer, 1, sizeof(buffer), source);
+ fwrite(buffer, 1, n, target);
+ fclose(source);
+ fclose(target);
+ return 0;
+ }
+ return 1;
+}
diff --git a/Tests/RunCMake/while/EndAlone-stderr.txt b/Tests/RunCMake/while/EndAlone-stderr.txt
index 5fe6655..3195fa0 100644
--- a/Tests/RunCMake/while/EndAlone-stderr.txt
+++ b/Tests/RunCMake/while/EndAlone-stderr.txt
@@ -1,5 +1,4 @@
-^CMake Error at EndAlone.cmake:1 \(endwhile\):
- endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE
- structure. Or its arguments did not match the opening WHILE command.
+^CMake Error at EndAlone\.cmake:[0-9]+ \(endwhile\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/while/EndAloneArgs-stderr.txt b/Tests/RunCMake/while/EndAloneArgs-stderr.txt
index a8c043d..1634e3b 100644
--- a/Tests/RunCMake/while/EndAloneArgs-stderr.txt
+++ b/Tests/RunCMake/while/EndAloneArgs-stderr.txt
@@ -1,5 +1,4 @@
-^CMake Error at EndAloneArgs.cmake:1 \(endwhile\):
- endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE
- structure. Or its arguments did not match the opening WHILE command.
+^CMake Error at EndAloneArgs\.cmake:[0-9]+ \(endwhile\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/while/EndMissing-stderr.txt b/Tests/RunCMake/while/EndMissing-stderr.txt
index 964792f..1e3be4d 100644
--- a/Tests/RunCMake/while/EndMissing-stderr.txt
+++ b/Tests/RunCMake/while/EndMissing-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error in EndMissing.cmake:
- A logical block opening on the line
-
- .*/Tests/RunCMake/while/EndMissing.cmake:1 \(while\)
-
- is not closed.
+^CMake Error at EndMissing\.cmake:[0-9]+ \(while\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/while/MissingArgument-stderr.txt b/Tests/RunCMake/while/MissingArgument-stderr.txt
index 7ff0971..59e8ee3 100644
--- a/Tests/RunCMake/while/MissingArgument-stderr.txt
+++ b/Tests/RunCMake/while/MissingArgument-stderr.txt
@@ -1,4 +1,11 @@
-^CMake Error at MissingArgument.cmake:1 \(while\):
+^CMake Error at MissingArgument\.cmake:[0-9]+ \(while\):
while called with incorrect number of arguments
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Error at MissingArgument\.cmake:[0-9]+ \(endwhile\):
+ endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE
+ structure\. Or its arguments did not match the opening WHILE command\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/while/MissingArgument.cmake b/Tests/RunCMake/while/MissingArgument.cmake
index 32eaa26..3fe2d97 100644
--- a/Tests/RunCMake/while/MissingArgument.cmake
+++ b/Tests/RunCMake/while/MissingArgument.cmake
@@ -1 +1,2 @@
while()
+endwhile()
diff --git a/Utilities/std/cm/optional b/Utilities/std/cm/optional
index 9a5d840..0defae1 100644
--- a/Utilities/std/cm/optional
+++ b/Utilities/std/cm/optional
@@ -68,16 +68,22 @@ public:
optional& operator=(nullopt_t) noexcept;
optional& operator=(const optional& other);
- optional& operator=(optional&& other) noexcept;
- template <
- typename U = T,
- typename = typename std::enable_if<
- !std::is_same<typename std::decay<U>::type, cm::optional<T>>::value &&
- std::is_constructible<T, U>::value && std::is_assignable<T&, U>::value &&
+ template <typename U = T>
+ typename std::enable_if<std::is_constructible<T, U&&>::value &&
+ std::is_assignable<T&, U&&>::value,
+ optional&>::type
+ operator=(optional<U>&& other) noexcept;
+
+ template <typename U = T>
+ typename std::enable_if<
+ !std::is_same<typename std::decay<U>::type, cm::optional<T>>::value &&
+ std::is_constructible<T, U&&>::value &&
+ std::is_assignable<T&, U&&>::value &&
(!std::is_scalar<T>::value ||
- !std::is_same<typename std::decay<U>::type, T>::value)>::type>
- optional& operator=(U&& v);
+ !std::is_same<typename std::decay<U>::type, T>::value),
+ optional&>::type
+ operator=(U&& v);
const T* operator->() const;
T* operator->();
@@ -134,19 +140,24 @@ optional<T> make_optional(Args&&... args)
template <typename T>
optional<T>::optional(nullopt_t) noexcept
+ : optional()
{
}
template <typename T>
optional<T>::optional(const optional& other)
{
- *this = other;
+ if (other.has_value()) {
+ this->emplace(*other);
+ }
}
template <typename T>
optional<T>::optional(optional&& other) noexcept
{
- *this = std::move(other);
+ if (other.has_value()) {
+ this->emplace(std::move(*other));
+ }
}
template <typename T>
@@ -192,7 +203,11 @@ optional<T>& optional<T>::operator=(const optional& other)
}
template <typename T>
-optional<T>& optional<T>::operator=(optional&& other) noexcept
+template <typename U>
+typename std::enable_if<std::is_constructible<T, U&&>::value &&
+ std::is_assignable<T&, U&&>::value,
+ optional<T>&>::type
+optional<T>::operator=(optional<U>&& other) noexcept
{
if (other.has_value()) {
if (this->has_value()) {
@@ -207,8 +222,15 @@ optional<T>& optional<T>::operator=(optional&& other) noexcept
}
template <typename T>
-template <typename U, typename>
-optional<T>& optional<T>::operator=(U&& v)
+template <typename U>
+typename std::enable_if<
+ !std::is_same<typename std::decay<U>::type, cm::optional<T>>::value &&
+ std::is_constructible<T, U&&>::value &&
+ std::is_assignable<T&, U&&>::value &&
+ (!std::is_scalar<T>::value ||
+ !std::is_same<typename std::decay<U>::type, T>::value),
+ optional<T>&>::type
+optional<T>::operator=(U&& v)
{
if (this->has_value()) {
this->value() = v;