summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-format2
-rw-r--r--.gitlab/artifacts.yml2
-rw-r--r--CMakeLists.txt5
-rw-r--r--CTestConfig.cmake4
-rw-r--r--Help/command/add_compile_definitions.rst2
-rw-r--r--Help/command/add_library.rst142
-rw-r--r--Help/command/add_link_options.rst2
-rw-r--r--Help/command/cmake_language.rst2
-rw-r--r--Help/command/cmake_parse_arguments.rst2
-rw-r--r--Help/command/configure_file.rst6
-rw-r--r--Help/command/continue.rst2
-rw-r--r--Help/command/file.rst15
-rw-r--r--Help/command/include_guard.rst2
-rw-r--r--Help/command/install.rst3
-rw-r--r--Help/command/target_compile_features.rst2
-rw-r--r--Help/command/target_link_directories.rst2
-rw-r--r--Help/command/target_link_options.rst2
-rw-r--r--Help/command/target_precompile_headers.rst2
-rw-r--r--Help/command/target_sources.rst16
-rw-r--r--Help/command/variable_watch.rst39
-rw-r--r--Help/cpack_gen/external.rst7
-rw-r--r--Help/cpack_gen/packagemaker.rst2
-rw-r--r--Help/cpack_gen/productbuild.rst2
-rw-r--r--Help/dev/maint.rst42
-rw-r--r--Help/dev/review.rst2
-rw-r--r--Help/dev/source.rst6
-rw-r--r--Help/envvar/ASM_DIALECT.rst2
-rw-r--r--Help/envvar/ASM_DIALECTFLAGS.rst2
-rw-r--r--Help/envvar/CC.rst2
-rw-r--r--Help/envvar/CCMAKE_COLORS.rst2
-rw-r--r--Help/envvar/CFLAGS.rst2
-rw-r--r--Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst2
-rw-r--r--Help/envvar/CMAKE_CONFIG_TYPE.rst2
-rw-r--r--Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst2
-rw-r--r--Help/envvar/CMAKE_GENERATOR.rst2
-rw-r--r--Help/envvar/CMAKE_GENERATOR_INSTANCE.rst2
-rw-r--r--Help/envvar/CMAKE_GENERATOR_PLATFORM.rst2
-rw-r--r--Help/envvar/CMAKE_GENERATOR_TOOLSET.rst2
-rw-r--r--Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst2
-rw-r--r--Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst2
-rw-r--r--Help/envvar/CMAKE_NO_VERBOSE.rst2
-rw-r--r--Help/envvar/CMAKE_OSX_ARCHITECTURES.rst2
-rw-r--r--Help/envvar/CMAKE_PREFIX_PATH.rst2
-rw-r--r--Help/envvar/CSFLAGS.rst2
-rw-r--r--Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst2
-rw-r--r--Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst2
-rw-r--r--Help/envvar/CTEST_PARALLEL_LEVEL.rst2
-rw-r--r--Help/envvar/CTEST_PROGRESS_OUTPUT.rst2
-rw-r--r--Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst2
-rw-r--r--Help/envvar/CUDACXX.rst2
-rw-r--r--Help/envvar/CUDAFLAGS.rst2
-rw-r--r--Help/envvar/CUDAHOSTCXX.rst2
-rw-r--r--Help/envvar/CXX.rst2
-rw-r--r--Help/envvar/CXXFLAGS.rst2
-rw-r--r--Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst2
-rw-r--r--Help/envvar/DESTDIR.rst2
-rw-r--r--Help/envvar/FC.rst2
-rw-r--r--Help/envvar/FFLAGS.rst2
-rw-r--r--Help/envvar/LDFLAGS.rst2
-rw-r--r--Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst2
-rw-r--r--Help/envvar/OBJC.rst2
-rw-r--r--Help/envvar/OBJCXX.rst2
-rw-r--r--Help/envvar/PackageName_ROOT.rst2
-rw-r--r--Help/envvar/RC.rst2
-rw-r--r--Help/envvar/RCFLAGS.rst2
-rw-r--r--Help/envvar/SWIFTC.rst2
-rw-r--r--Help/envvar/VERBOSE.rst2
-rw-r--r--Help/generator/Green Hills MULTI.rst2
-rw-r--r--Help/generator/Ninja Multi-Config.rst2
-rw-r--r--Help/generator/Visual Studio 14 2015.rst2
-rw-r--r--Help/generator/Visual Studio 15 2017.rst2
-rw-r--r--Help/generator/Visual Studio 16 2019.rst2
-rw-r--r--Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt6
-rw-r--r--Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt6
-rw-r--r--Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt6
-rw-r--r--Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt6
-rw-r--r--Help/guide/tutorial/index.rst87
-rw-r--r--Help/manual/cmake-file-api.7.rst22
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst9
-rw-r--r--Help/manual/cmake-policies.7.rst8
-rw-r--r--Help/manual/cmake.1.rst21
-rw-r--r--Help/manual/ctest.1.rst2
-rw-r--r--Help/module/CPackArchive.rst2
-rw-r--r--Help/module/CPackFreeBSD.rst2
-rw-r--r--Help/module/CPackNuGet.rst2
-rw-r--r--Help/module/CPackProductBuild.rst2
-rw-r--r--Help/policy/CMP0051.rst2
-rw-r--r--Help/policy/CMP0052.rst2
-rw-r--r--Help/policy/CMP0053.rst2
-rw-r--r--Help/policy/CMP0054.rst2
-rw-r--r--Help/policy/CMP0055.rst2
-rw-r--r--Help/policy/CMP0056.rst2
-rw-r--r--Help/policy/CMP0057.rst2
-rw-r--r--Help/policy/CMP0058.rst2
-rw-r--r--Help/policy/CMP0059.rst2
-rw-r--r--Help/policy/CMP0060.rst2
-rw-r--r--Help/policy/CMP0061.rst2
-rw-r--r--Help/policy/CMP0062.rst2
-rw-r--r--Help/policy/CMP0063.rst2
-rw-r--r--Help/policy/CMP0064.rst2
-rw-r--r--Help/policy/CMP0065.rst2
-rw-r--r--Help/policy/CMP0066.rst2
-rw-r--r--Help/policy/CMP0067.rst2
-rw-r--r--Help/policy/CMP0068.rst2
-rw-r--r--Help/policy/CMP0069.rst2
-rw-r--r--Help/policy/CMP0070.rst2
-rw-r--r--Help/policy/CMP0071.rst2
-rw-r--r--Help/policy/CMP0072.rst2
-rw-r--r--Help/policy/CMP0073.rst2
-rw-r--r--Help/policy/CMP0074.rst2
-rw-r--r--Help/policy/CMP0075.rst2
-rw-r--r--Help/policy/CMP0076.rst2
-rw-r--r--Help/policy/CMP0077.rst2
-rw-r--r--Help/policy/CMP0078.rst2
-rw-r--r--Help/policy/CMP0079.rst2
-rw-r--r--Help/policy/CMP0080.rst2
-rw-r--r--Help/policy/CMP0081.rst2
-rw-r--r--Help/policy/CMP0082.rst2
-rw-r--r--Help/policy/CMP0083.rst2
-rw-r--r--Help/policy/CMP0084.rst2
-rw-r--r--Help/policy/CMP0085.rst2
-rw-r--r--Help/policy/CMP0086.rst2
-rw-r--r--Help/policy/CMP0087.rst2
-rw-r--r--Help/policy/CMP0088.rst2
-rw-r--r--Help/policy/CMP0089.rst2
-rw-r--r--Help/policy/CMP0090.rst2
-rw-r--r--Help/policy/CMP0091.rst2
-rw-r--r--Help/policy/CMP0092.rst4
-rw-r--r--Help/policy/CMP0093.rst2
-rw-r--r--Help/policy/CMP0094.rst2
-rw-r--r--Help/policy/CMP0095.rst2
-rw-r--r--Help/policy/CMP0096.rst2
-rw-r--r--Help/policy/CMP0097.rst2
-rw-r--r--Help/policy/CMP0098.rst2
-rw-r--r--Help/policy/CMP0099.rst2
-rw-r--r--Help/policy/CMP0100.rst2
-rw-r--r--Help/policy/CMP0101.rst2
-rw-r--r--Help/policy/CMP0102.rst2
-rw-r--r--Help/policy/CMP0103.rst2
-rw-r--r--Help/policy/CMP0104.rst2
-rw-r--r--Help/policy/CMP0105.rst2
-rw-r--r--Help/policy/CMP0106.rst2
-rw-r--r--Help/policy/CMP0107.rst2
-rw-r--r--Help/policy/CMP0108.rst2
-rw-r--r--Help/policy/CMP0109.rst24
-rw-r--r--Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst2
-rw-r--r--Help/prop_dir/BINARY_DIR.rst2
-rw-r--r--Help/prop_dir/BUILDSYSTEM_TARGETS.rst2
-rw-r--r--Help/prop_dir/LABELS.rst2
-rw-r--r--Help/prop_dir/LINK_OPTIONS.rst2
-rw-r--r--Help/prop_dir/SOURCE_DIR.rst2
-rw-r--r--Help/prop_dir/SUBDIRECTORIES.rst2
-rw-r--r--Help/prop_dir/TESTS.rst2
-rw-r--r--Help/prop_dir/TEST_INCLUDE_FILES.rst2
-rw-r--r--Help/prop_dir/VS_STARTUP_PROJECT.rst2
-rw-r--r--Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst2
-rw-r--r--Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst2
-rw-r--r--Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst2
-rw-r--r--Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_gbl/CMAKE_ROLE.rst2
-rw-r--r--Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst2
-rw-r--r--Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst2
-rw-r--r--Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst2
-rw-r--r--Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst2
-rw-r--r--Help/prop_gbl/TARGET_MESSAGES.rst2
-rw-r--r--Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst2
-rw-r--r--Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst2
-rw-r--r--Help/prop_inst/CPACK_NEVER_OVERWRITE.rst2
-rw-r--r--Help/prop_inst/CPACK_PERMANENT.rst2
-rw-r--r--Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst2
-rw-r--r--Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst2
-rw-r--r--Help/prop_inst/CPACK_WIX_ACL.rst2
-rw-r--r--Help/prop_sf/COMPILE_OPTIONS.rst2
-rw-r--r--Help/prop_sf/Fortran_PREPROCESS.rst2
-rw-r--r--Help/prop_sf/INCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/prop_sf/SKIP_AUTOGEN.rst2
-rw-r--r--Help/prop_sf/SKIP_AUTOMOC.rst2
-rw-r--r--Help/prop_sf/SKIP_AUTORCC.rst2
-rw-r--r--Help/prop_sf/SKIP_AUTOUIC.rst2
-rw-r--r--Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst2
-rw-r--r--Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst2
-rw-r--r--Help/prop_sf/Swift_DEPENDENCIES_FILE.rst2
-rw-r--r--Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst2
-rw-r--r--Help/prop_sf/UNITY_GROUP.rst2
-rw-r--r--Help/prop_sf/VS_COPY_TO_OUT_DIR.rst2
-rw-r--r--Help/prop_sf/VS_CSHARP_tagname.rst2
-rw-r--r--Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst2
-rw-r--r--Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst2
-rw-r--r--Help/prop_sf/VS_INCLUDE_IN_VSIX.rst2
-rw-r--r--Help/prop_sf/VS_RESOURCE_GENERATOR.rst2
-rw-r--r--Help/prop_sf/VS_SETTINGS.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_ENTRYPOINT.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_FLAGS.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_MODEL.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_TYPE.rst2
-rw-r--r--Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst2
-rw-r--r--Help/prop_sf/VS_TOOL_OVERRIDE.rst2
-rw-r--r--Help/prop_sf/VS_XAML_TYPE.rst2
-rw-r--r--Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst2
-rw-r--r--Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst2
-rw-r--r--Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst2
-rw-r--r--Help/prop_test/DISABLED.rst2
-rw-r--r--Help/prop_test/FIXTURES_CLEANUP.rst2
-rw-r--r--Help/prop_test/FIXTURES_REQUIRED.rst2
-rw-r--r--Help/prop_test/FIXTURES_SETUP.rst2
-rw-r--r--Help/prop_test/PROCESSOR_AFFINITY.rst2
-rw-r--r--Help/prop_test/RESOURCE_GROUPS.rst2
-rw-r--r--Help/prop_test/SKIP_REGULAR_EXPRESSION.rst2
-rw-r--r--Help/prop_test/TIMEOUT_AFTER_MATCH.rst2
-rw-r--r--Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst2
-rw-r--r--Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst2
-rw-r--r--Help/prop_tgt/ALIAS_GLOBAL.rst2
-rw-r--r--Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/ANDROID_API.rst2
-rw-r--r--Help/prop_tgt/ANDROID_API_MIN.rst2
-rw-r--r--Help/prop_tgt/ANDROID_ARCH.rst2
-rw-r--r--Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst2
-rw-r--r--Help/prop_tgt/ANDROID_GUI.rst2
-rw-r--r--Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst2
-rw-r--r--Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst2
-rw-r--r--Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst2
-rw-r--r--Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst2
-rw-r--r--Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst2
-rw-r--r--Help/prop_tgt/ANDROID_PROCESS_MAX.rst2
-rw-r--r--Help/prop_tgt/ANDROID_PROGUARD.rst2
-rw-r--r--Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst2
-rw-r--r--Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst2
-rw-r--r--Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst2
-rw-r--r--Help/prop_tgt/ANDROID_STL_TYPE.rst2
-rw-r--r--Help/prop_tgt/AUTOGEN_BUILD_DIR.rst2
-rw-r--r--Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst2
-rw-r--r--Help/prop_tgt/AUTOGEN_PARALLEL.rst2
-rw-r--r--Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst2
-rw-r--r--Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst2
-rw-r--r--Help/prop_tgt/AUTOMOC_EXECUTABLE.rst2
-rw-r--r--Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst2
-rw-r--r--Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst2
-rw-r--r--Help/prop_tgt/AUTORCC_EXECUTABLE.rst2
-rw-r--r--Help/prop_tgt/AUTOUIC_EXECUTABLE.rst2
-rw-r--r--Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst2
-rw-r--r--Help/prop_tgt/BINARY_DIR.rst2
-rw-r--r--Help/prop_tgt/BUILD_RPATH.rst2
-rw-r--r--Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst2
-rw-r--r--Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst2
-rw-r--r--Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst2
-rw-r--r--Help/prop_tgt/COMPILE_FEATURES.rst2
-rw-r--r--Help/prop_tgt/COMPILE_PDB_NAME.rst2
-rw-r--r--Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst2
-rw-r--r--Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst2
-rw-r--r--Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst2
-rw-r--r--Help/prop_tgt/CUDA_ARCHITECTURES.rst2
-rw-r--r--Help/prop_tgt/CUDA_EXTENSIONS.rst2
-rw-r--r--Help/prop_tgt/CUDA_PTX_COMPILATION.rst2
-rw-r--r--Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst2
-rw-r--r--Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst2
-rw-r--r--Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst2
-rw-r--r--Help/prop_tgt/CUDA_STANDARD.rst2
-rw-r--r--Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst2
-rw-r--r--Help/prop_tgt/CXX_EXTENSIONS.rst2
-rw-r--r--Help/prop_tgt/CXX_STANDARD.rst2
-rw-r--r--Help/prop_tgt/CXX_STANDARD_REQUIRED.rst2
-rw-r--r--Help/prop_tgt/C_EXTENSIONS.rst2
-rw-r--r--Help/prop_tgt/C_STANDARD.rst2
-rw-r--r--Help/prop_tgt/C_STANDARD_REQUIRED.rst2
-rw-r--r--Help/prop_tgt/DEBUG_POSTFIX.rst4
-rw-r--r--Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst2
-rw-r--r--Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/DEPRECATION.rst2
-rw-r--r--Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst2
-rw-r--r--Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst2
-rw-r--r--Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst2
-rw-r--r--Help/prop_tgt/EXCLUDE_FROM_ALL.rst7
-rw-r--r--Help/prop_tgt/EXPORT_PROPERTIES.rst2
-rw-r--r--Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst2
-rw-r--r--Help/prop_tgt/FRAMEWORK_VERSION.rst2
-rw-r--r--Help/prop_tgt/Fortran_PREPROCESS.rst2
-rw-r--r--Help/prop_tgt/GHS_INTEGRITY_APP.rst2
-rw-r--r--Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst2
-rw-r--r--Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst2
-rw-r--r--Help/prop_tgt/IMPORTED_GLOBAL.rst2
-rw-r--r--Help/prop_tgt/IMPORTED_LIBNAME.rst2
-rw-r--r--Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst2
-rw-r--r--Help/prop_tgt/IMPORTED_OBJECTS.rst2
-rw-r--r--Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst2
-rw-r--r--Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_SOURCES.rst2
-rw-r--r--Help/prop_tgt/IOS_INSTALL_COMBINED.rst2
-rw-r--r--Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst2
-rw-r--r--Help/prop_tgt/LANG_CLANG_TIDY.rst2
-rw-r--r--Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst2
-rw-r--r--Help/prop_tgt/LANG_CPPCHECK.rst2
-rw-r--r--Help/prop_tgt/LANG_CPPLINT.rst2
-rw-r--r--Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst2
-rw-r--r--Help/prop_tgt/LINK_DIRECTORIES.rst2
-rw-r--r--Help/prop_tgt/LINK_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/LINK_WHAT_YOU_USE.rst2
-rw-r--r--Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst2
-rw-r--r--Help/prop_tgt/MACHO_CURRENT_VERSION.rst2
-rw-r--r--Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst2
-rw-r--r--Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst2
-rw-r--r--Help/prop_tgt/OBJCXX_EXTENSIONS.rst2
-rw-r--r--Help/prop_tgt/OBJCXX_STANDARD.rst2
-rw-r--r--Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst2
-rw-r--r--Help/prop_tgt/OBJC_EXTENSIONS.rst2
-rw-r--r--Help/prop_tgt/OBJC_STANDARD.rst2
-rw-r--r--Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst2
-rw-r--r--Help/prop_tgt/PCH_WARN_INVALID.rst2
-rw-r--r--Help/prop_tgt/PRECOMPILE_HEADERS.rst2
-rw-r--r--Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst2
-rw-r--r--Help/prop_tgt/SOURCE_DIR.rst2
-rw-r--r--Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst2
-rw-r--r--Help/prop_tgt/Swift_LANGUAGE_VERSION.rst2
-rw-r--r--Help/prop_tgt/Swift_MODULE_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/Swift_MODULE_NAME.rst2
-rw-r--r--Help/prop_tgt/UNITY_BUILD.rst2
-rw-r--r--Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst2
-rw-r--r--Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst2
-rw-r--r--Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst2
-rw-r--r--Help/prop_tgt/UNITY_BUILD_MODE.rst2
-rw-r--r--Help/prop_tgt/VS_CONFIGURATION_TYPE.rst2
-rw-r--r--Help/prop_tgt/VS_DEBUGGER_COMMAND.rst2
-rw-r--r--Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst2
-rw-r--r--Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst2
-rw-r--r--Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst2
-rw-r--r--Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst2
-rw-r--r--Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst2
-rw-r--r--Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst2
-rw-r--r--Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst2
-rw-r--r--Help/prop_tgt/VS_DPI_AWARE.rst2
-rw-r--r--Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst2
-rw-r--r--Help/prop_tgt/VS_IOT_STARTUP_TASK.rst2
-rw-r--r--Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst2
-rw-r--r--Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst2
-rw-r--r--Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst2
-rw-r--r--Help/prop_tgt/VS_PACKAGE_REFERENCES.rst2
-rw-r--r--Help/prop_tgt/VS_PLATFORM_TOOLSET.rst2
-rw-r--r--Help/prop_tgt/VS_PROJECT_IMPORT.rst2
-rw-r--r--Help/prop_tgt/VS_SDK_REFERENCES.rst2
-rw-r--r--Help/prop_tgt/VS_SOLUTION_DEPLOY.rst2
-rw-r--r--Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst2
-rw-r--r--Help/prop_tgt/VS_USER_PROPS.rst2
-rw-r--r--Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst2
-rw-r--r--Help/prop_tgt/VS_WINRT_COMPONENT.rst2
-rw-r--r--Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst2
-rw-r--r--Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst2
-rw-r--r--Help/prop_tgt/XCODE_GENERATE_SCHEME.rst2
-rw-r--r--Help/prop_tgt/XCODE_PRODUCT_TYPE.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst2
-rw-r--r--Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst2
-rw-r--r--Help/prop_tgt/XCTEST.rst2
-rw-r--r--Help/release/3.1.rst2
-rw-r--r--Help/release/3.3.rst2
-rw-r--r--Help/release/dev/0-sample-topic.rst7
-rw-r--r--Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst4
-rw-r--r--Help/release/dev/EXCLUDE_FROM_ALL-genex.rst5
-rw-r--r--Help/release/dev/FindSDL-update.rst11
-rw-r--r--Help/release/dev/FindTIFF-tiffxx.rst5
-rw-r--r--Help/release/dev/FindVulkan-glslc.rst10
-rw-r--r--Help/release/dev/cmake-E-create_hardlink.rst5
-rw-r--r--Help/release/dev/configure_file-permission-control.rst5
-rw-r--r--Help/release/dev/cpack-pre-and-post-build-scripts.rst5
-rw-r--r--Help/release/dev/ctest-cuda-memcheck.rst8
-rw-r--r--Help/release/dev/deprecate-policy-old.rst13
-rw-r--r--Help/release/dev/file-download-optional-file.rst5
-rw-r--r--Help/release/dev/fileapi-codemodel-2.2.rst7
-rw-r--r--Help/release/dev/find_program-exe-no-read.rst5
-rw-r--r--Help/release/dev/install-default-directory-permissions.rst5
-rw-r--r--Help/release/dev/macOS-sdk-latest.rst10
-rw-r--r--Help/release/dev/remove-cmake-gui-qt4.rst5
-rw-r--r--Help/release/dev/remove-warn-unused-vars.rst6
-rw-r--r--Help/release/dev/visual-studio-android.rst7
-rw-r--r--Help/release/index.rst2
-rw-r--r--Help/variable/ANDROID.rst2
-rw-r--r--Help/variable/CACHE.rst2
-rw-r--r--Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_API.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_API_MIN.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_ARCH.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_ARCH_ABI.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_ARM_MODE.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_ARM_NEON.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_GUI.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_NDK.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_PROGUARD.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst2
-rw-r--r--Help/variable/CMAKE_ANDROID_STL_TYPE.rst2
-rw-r--r--Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst2
-rw-r--r--Help/variable/CMAKE_AUTOGEN_PARALLEL.rst2
-rw-r--r--Help/variable/CMAKE_AUTOGEN_VERBOSE.rst2
-rw-r--r--Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst2
-rw-r--r--Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst2
-rw-r--r--Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst2
-rw-r--r--Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst2
-rw-r--r--Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst2
-rw-r--r--Help/variable/CMAKE_BUILD_RPATH.rst2
-rw-r--r--Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst2
-rw-r--r--Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst2
-rw-r--r--Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst2
-rw-r--r--Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst2
-rw-r--r--Help/variable/CMAKE_CODELITE_USE_TARGETS.rst2
-rw-r--r--Help/variable/CMAKE_COMPILER_IS_GNUCC.rst2
-rw-r--r--Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst2
-rw-r--r--Help/variable/CMAKE_COMPILER_IS_GNUG77.rst2
-rw-r--r--Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst2
-rw-r--r--Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_CPACK_COMMAND.rst2
-rw-r--r--Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst2
-rw-r--r--Help/variable/CMAKE_CROSS_CONFIGS.rst2
-rw-r--r--Help/variable/CMAKE_CTEST_ARGUMENTS.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_ARCHITECTURES.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_EXTENSIONS.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_HOST_COMPILER.rst27
-rw-r--r--Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_STANDARD.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst2
-rw-r--r--Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_CURRENT_FUNCTION.rst2
-rw-r--r--Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst2
-rw-r--r--Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst2
-rw-r--r--Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst2
-rw-r--r--Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst2
-rw-r--r--Help/variable/CMAKE_CXX_EXTENSIONS.rst2
-rw-r--r--Help/variable/CMAKE_CXX_STANDARD.rst2
-rw-r--r--Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst2
-rw-r--r--Help/variable/CMAKE_C_COMPILE_FEATURES.rst2
-rw-r--r--Help/variable/CMAKE_C_EXTENSIONS.rst2
-rw-r--r--Help/variable/CMAKE_C_STANDARD.rst2
-rw-r--r--Help/variable/CMAKE_C_STANDARD_REQUIRED.rst2
-rw-r--r--Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst2
-rw-r--r--Help/variable/CMAKE_DEFAULT_CONFIGS.rst2
-rw-r--r--Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst2
-rw-r--r--Help/variable/CMAKE_DIRECTORY_LABELS.rst2
-rw-r--r--Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst2
-rw-r--r--Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst2
-rw-r--r--Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst2
-rw-r--r--Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst2
-rw-r--r--Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst2
-rw-r--r--Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst2
-rw-r--r--Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst2
-rw-r--r--Help/variable/CMAKE_ECLIPSE_VERSION.rst2
-rw-r--r--Help/variable/CMAKE_ENABLE_EXPORTS.rst2
-rw-r--r--Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst2
-rw-r--r--Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst2
-rw-r--r--Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst2
-rw-r--r--Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst2
-rw-r--r--Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst2
-rw-r--r--Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst2
-rw-r--r--Help/variable/CMAKE_FIND_APPBUNDLE.rst2
-rw-r--r--Help/variable/CMAKE_FIND_DEBUG_MODE.rst2
-rw-r--r--Help/variable/CMAKE_FIND_FRAMEWORK.rst2
-rw-r--r--Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_NAME.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst2
-rw-r--r--Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst2
-rw-r--r--Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst2
-rw-r--r--Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst2
-rw-r--r--Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst2
-rw-r--r--Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst2
-rw-r--r--Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst2
-rw-r--r--Help/variable/CMAKE_FOLDER.rst2
-rw-r--r--Help/variable/CMAKE_FRAMEWORK.rst2
-rw-r--r--Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_Fortran_PREPROCESS.rst2
-rw-r--r--Help/variable/CMAKE_GENERATOR_INSTANCE.rst2
-rw-r--r--Help/variable/CMAKE_GENERATOR_PLATFORM.rst2
-rw-r--r--Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst2
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst2
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst2
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst2
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst2
-rw-r--r--Help/variable/CMAKE_HOST_SOLARIS.rst2
-rw-r--r--Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst2
-rw-r--r--Help/variable/CMAKE_INSTALL_MESSAGE.rst2
-rw-r--r--Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst2
-rw-r--r--Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst2
-rw-r--r--Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst2
-rw-r--r--Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst2
-rw-r--r--Help/variable/CMAKE_JOB_POOLS.rst2
-rw-r--r--Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst2
-rw-r--r--Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst2
-rw-r--r--Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst2
-rw-r--r--Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst2
-rw-r--r--Help/variable/CMAKE_LANG_CLANG_TIDY.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_AR.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst2
-rw-r--r--Help/variable/CMAKE_LANG_CPPCHECK.rst2
-rw-r--r--Help/variable/CMAKE_LANG_CPPLINT.rst2
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst2
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst2
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS_INIT.rst2
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst2
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst2
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst2
-rw-r--r--Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst2
-rw-r--r--Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst2
-rw-r--r--Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst2
-rw-r--r--Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst2
-rw-r--r--Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst2
-rw-r--r--Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst2
-rw-r--r--Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst2
-rw-r--r--Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst2
-rw-r--r--Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst2
-rw-r--r--Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst2
-rw-r--r--Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst2
-rw-r--r--Help/variable/CMAKE_MATCH_COUNT.rst2
-rw-r--r--Help/variable/CMAKE_MATCH_n.rst2
-rw-r--r--Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst2
-rw-r--r--Help/variable/CMAKE_MESSAGE_CONTEXT.rst2
-rw-r--r--Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst2
-rw-r--r--Help/variable/CMAKE_MESSAGE_INDENT.rst2
-rw-r--r--Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst2
-rw-r--r--Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst2
-rw-r--r--Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst2
-rw-r--r--Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst2
-rw-r--r--Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst2
-rw-r--r--Help/variable/CMAKE_NETRC.rst2
-rw-r--r--Help/variable/CMAKE_NETRC_FILE.rst2
-rw-r--r--Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst2
-rw-r--r--Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst2
-rw-r--r--Help/variable/CMAKE_OBJCXX_STANDARD.rst2
-rw-r--r--Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst2
-rw-r--r--Help/variable/CMAKE_OBJC_EXTENSIONS.rst2
-rw-r--r--Help/variable/CMAKE_OBJC_STANDARD.rst2
-rw-r--r--Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst2
-rw-r--r--Help/variable/CMAKE_PCH_WARN_INVALID.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_DESCRIPTION.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_INCLUDE.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_VERSION.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst2
-rw-r--r--Help/variable/CMAKE_RULE_MESSAGES.rst2
-rw-r--r--Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst2
-rw-r--r--Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst2
-rw-r--r--Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst2
-rw-r--r--Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst2
-rw-r--r--Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst2
-rw-r--r--Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst2
-rw-r--r--Help/variable/CMAKE_SUPPRESS_REGENERATION.rst2
-rw-r--r--Help/variable/CMAKE_SYSROOT_COMPILE.rst2
-rw-r--r--Help/variable/CMAKE_SYSROOT_LINK.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst2
-rw-r--r--Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst2
-rw-r--r--Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst2
-rw-r--r--Help/variable/CMAKE_Swift_NUM_THREADS.rst2
-rw-r--r--Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst2
-rw-r--r--Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst2
-rw-r--r--Help/variable/CMAKE_UNITY_BUILD.rst2
-rw-r--r--Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst2
-rw-r--r--Help/variable/CMAKE_VS_GLOBALS.rst2
-rw-r--r--Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst2
-rw-r--r--Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst2
-rw-r--r--Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst2
-rw-r--r--Help/variable/CMAKE_VS_NsightTegra_VERSION.rst2
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_NAME.rst2
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst2
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst2
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst2
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst2
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst2
-rw-r--r--Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst2
-rw-r--r--Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst2
-rw-r--r--Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst2
-rw-r--r--Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst2
-rw-r--r--Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst2
-rw-r--r--Help/variable/CTEST_BINARY_DIRECTORY.rst2
-rw-r--r--Help/variable/CTEST_BUILD_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_BUILD_NAME.rst2
-rw-r--r--Help/variable/CTEST_BZR_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_CHANGE_ID.rst2
-rw-r--r--Help/variable/CTEST_CHECKOUT_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_CONFIGURATION_TYPE.rst2
-rw-r--r--Help/variable/CTEST_CONFIGURE_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_COVERAGE_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst2
-rw-r--r--Help/variable/CTEST_CURL_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_POST_TEST.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_PRE_TEST.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst2
-rw-r--r--Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst2
-rw-r--r--Help/variable/CTEST_CVS_CHECKOUT.rst2
-rw-r--r--Help/variable/CTEST_CVS_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_DROP_LOCATION.rst2
-rw-r--r--Help/variable/CTEST_DROP_METHOD.rst2
-rw-r--r--Help/variable/CTEST_DROP_SITE.rst2
-rw-r--r--Help/variable/CTEST_DROP_SITE_CDASH.rst2
-rw-r--r--Help/variable/CTEST_DROP_SITE_PASSWORD.rst2
-rw-r--r--Help/variable/CTEST_DROP_SITE_USER.rst2
-rw-r--r--Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst2
-rw-r--r--Help/variable/CTEST_GIT_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_GIT_INIT_SUBMODULES.rst2
-rw-r--r--Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst2
-rw-r--r--Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_HG_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_HG_UPDATE_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst2
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst2
-rw-r--r--Help/variable/CTEST_MEMORYCHECK_TYPE.rst2
-rw-r--r--Help/variable/CTEST_NIGHTLY_START_TIME.rst2
-rw-r--r--Help/variable/CTEST_P4_CLIENT.rst2
-rw-r--r--Help/variable/CTEST_P4_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_P4_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_P4_UPDATE_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_RESOURCE_SPEC_FILE.rst2
-rw-r--r--Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst2
-rw-r--r--Help/variable/CTEST_SCP_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_SITE.rst2
-rw-r--r--Help/variable/CTEST_SOURCE_DIRECTORY.rst2
-rw-r--r--Help/variable/CTEST_SUBMIT_URL.rst2
-rw-r--r--Help/variable/CTEST_SVN_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_SVN_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_TEST_LOAD.rst2
-rw-r--r--Help/variable/CTEST_TEST_TIMEOUT.rst2
-rw-r--r--Help/variable/CTEST_TRIGGER_SITE.rst2
-rw-r--r--Help/variable/CTEST_UPDATE_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_UPDATE_OPTIONS.rst2
-rw-r--r--Help/variable/CTEST_UPDATE_VERSION_ONLY.rst2
-rw-r--r--Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst2
-rw-r--r--Help/variable/CTEST_USE_LAUNCHERS.rst2
-rw-r--r--Help/variable/GHS-MULTI.rst2
-rw-r--r--Help/variable/IOS.rst2
-rw-r--r--Help/variable/MINGW.rst2
-rw-r--r--Help/variable/MSVC14.rst2
-rw-r--r--Help/variable/MSVC_TOOLSET_VERSION.rst2
-rw-r--r--Help/variable/MSYS.rst2
-rw-r--r--Help/variable/PROJECT-NAME_DESCRIPTION.rst2
-rw-r--r--Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst2
-rw-r--r--Help/variable/PROJECT_DESCRIPTION.rst2
-rw-r--r--Help/variable/PROJECT_HOMEPAGE_URL.rst2
-rw-r--r--Help/variable/PackageName_ROOT.rst2
-rw-r--r--Help/variable/WINCE.rst2
-rw-r--r--Help/variable/WINDOWS_PHONE.rst2
-rw-r--r--Help/variable/WINDOWS_STORE.rst2
-rw-r--r--Help/variable/XCODE.rst2
-rw-r--r--Modules/AndroidTestUtilities.cmake2
-rw-r--r--Modules/BundleUtilities.cmake15
-rw-r--r--Modules/CMakeASMInformation.cmake10
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake31
-rw-r--r--Modules/CMakeParseImplicitIncludeInfo.cmake4
-rw-r--r--Modules/CMakePlatformId.h.in19
-rw-r--r--Modules/CMakeTestCCompiler.cmake2
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake2
-rw-r--r--Modules/CMakeTestOBJCCompiler.cmake2
-rw-r--r--Modules/CMakeTestOBJCXXCompiler.cmake2
-rw-r--r--Modules/CPack.cmake27
-rw-r--r--Modules/CPackIFW.cmake2
-rw-r--r--Modules/CPackIFWConfigureFile.cmake2
-rw-r--r--Modules/CSharpUtilities.cmake2
-rw-r--r--Modules/CTestCoverageCollectGCOV.cmake2
-rw-r--r--Modules/CheckFortranCompilerFlag.cmake2
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake2
-rw-r--r--Modules/CheckFortranSourceRuns.cmake2
-rw-r--r--Modules/CheckIPOSupported.cmake2
-rw-r--r--Modules/CheckLanguage.cmake2
-rw-r--r--Modules/CheckLinkerFlag.cmake2
-rw-r--r--Modules/CheckOBJCCompilerFlag.cmake2
-rw-r--r--Modules/CheckOBJCSourceCompiles.cmake2
-rw-r--r--Modules/CheckOBJCSourceRuns.cmake2
-rw-r--r--Modules/CheckOBJCXXCompilerFlag.cmake2
-rw-r--r--Modules/CheckOBJCXXSourceCompiles.cmake2
-rw-r--r--Modules/CheckOBJCXXSourceRuns.cmake2
-rw-r--r--Modules/CheckPIESupported.cmake2
-rw-r--r--Modules/CheckTypeSize.cmake54
-rw-r--r--Modules/Compiler/ARMClang.cmake2
-rw-r--r--Modules/Compiler/AppleClang-C.cmake2
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake2
-rw-r--r--Modules/Compiler/Clang-C.cmake2
-rw-r--r--Modules/Compiler/Clang-CXX.cmake2
-rw-r--r--Modules/Compiler/GNU-C.cmake2
-rw-r--r--Modules/Compiler/GNU-CXX.cmake2
-rw-r--r--Modules/Compiler/Intel-C.cmake2
-rw-r--r--Modules/Compiler/Intel-CXX.cmake2
-rw-r--r--Modules/Compiler/OpenWatcom.cmake2
-rw-r--r--Modules/Compiler/PGI-CXX.cmake8
-rw-r--r--Modules/Compiler/TI-ASM.cmake8
-rw-r--r--Modules/Compiler/TI-C.cmake18
-rw-r--r--Modules/Compiler/TI-CXX.cmake17
-rw-r--r--Modules/Compiler/TI.cmake40
-rw-r--r--Modules/Compiler/XL-C.cmake2
-rw-r--r--Modules/Compiler/XL-CXX.cmake5
-rw-r--r--Modules/Compiler/XLClang-C.cmake2
-rw-r--r--Modules/Compiler/XLClang-CXX.cmake2
-rw-r--r--Modules/CompilerId/VS-10.vcxproj.in4
-rw-r--r--Modules/FetchContent.cmake2
-rw-r--r--Modules/FindArmadillo.cmake1
-rw-r--r--Modules/FindBLAS.cmake11
-rw-r--r--Modules/FindBZip2.cmake4
-rw-r--r--Modules/FindBoost.cmake8
-rw-r--r--Modules/FindCUDA/run_nvcc.cmake2
-rw-r--r--Modules/FindCUDAToolkit.cmake4
-rw-r--r--Modules/FindCURL.cmake2
-rw-r--r--Modules/FindCurses.cmake4
-rw-r--r--Modules/FindEXPAT.cmake2
-rw-r--r--Modules/FindEnvModules.cmake2
-rw-r--r--Modules/FindFontconfig.cmake2
-rw-r--r--Modules/FindGIF.cmake1
-rw-r--r--Modules/FindGLEW.cmake4
-rw-r--r--Modules/FindGSL.cmake2
-rw-r--r--Modules/FindGTest.cmake40
-rw-r--r--Modules/FindHDF5.cmake4
-rw-r--r--Modules/FindICU.cmake2
-rw-r--r--Modules/FindIce.cmake2
-rw-r--r--Modules/FindIconv.cmake3
-rw-r--r--Modules/FindIntl.cmake4
-rw-r--r--Modules/FindJPEG.cmake4
-rw-r--r--Modules/FindLAPACK.cmake5
-rw-r--r--Modules/FindLTTngUST.cmake2
-rw-r--r--Modules/FindLibLZMA.cmake4
-rw-r--r--Modules/FindLibinput.cmake2
-rw-r--r--Modules/FindMPI.cmake2
-rw-r--r--Modules/FindMatlab.cmake5
-rw-r--r--Modules/FindODBC.cmake2
-rw-r--r--Modules/FindOpenACC.cmake2
-rw-r--r--Modules/FindOpenCL.cmake2
-rw-r--r--Modules/FindOpenSSL.cmake4
-rw-r--r--Modules/FindPNG.cmake4
-rw-r--r--Modules/FindPatch.cmake2
-rw-r--r--Modules/FindProtobuf.cmake2
-rw-r--r--Modules/FindPython.cmake12
-rw-r--r--Modules/FindPython2.cmake10
-rw-r--r--Modules/FindPython3.cmake12
-rw-r--r--Modules/FindQt4.cmake2
-rw-r--r--Modules/FindSDL.cmake85
-rw-r--r--Modules/FindSQLite3.cmake2
-rw-r--r--Modules/FindTIFF.cmake99
-rw-r--r--Modules/FindVulkan.cmake32
-rw-r--r--Modules/FindX11.cmake19
-rw-r--r--Modules/FindXCTest.cmake2
-rw-r--r--Modules/FindXalanC.cmake2
-rw-r--r--Modules/FindXercesC.cmake2
-rw-r--r--Modules/FindwxWindows.cmake2
-rw-r--r--Modules/GetPrerequisites.cmake2
-rw-r--r--Modules/GoogleTest.cmake4
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake4
-rw-r--r--Modules/Platform/Android-Clang.cmake3
-rw-r--r--Modules/Platform/Android-Determine.cmake61
-rw-r--r--Modules/Platform/Android-Initialize.cmake2
-rw-r--r--Modules/Platform/Android/Determine-Compiler-NDK.cmake2
-rw-r--r--Modules/Platform/Android/VCXProjInspect.vcxproj.in38
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake43
-rw-r--r--Modules/Platform/HP-UX.cmake2
-rw-r--r--Modules/Platform/Windows-MSVC.cmake5
-rw-r--r--Modules/UseSWIG.cmake2
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake2
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx28
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx448
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.h33
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx10
-rw-r--r--Source/CPack/cmCPackGenerator.cxx94
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx2
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx10
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx25
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx25
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx21
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx2
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx21
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx144
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.h3
-rw-r--r--Source/CTest/cmCTestReadCustomFilesCommand.cxx2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx8
-rw-r--r--Source/CTest/cmCTestStartCommand.cxx5
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx12
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx2
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx11
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx12
-rw-r--r--Source/CTest/cmCTestTestHandler.h5
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx5
-rw-r--r--Source/CTest/cmProcess.cxx6
-rw-r--r--Source/Checks/cm_cxx_features.cmake5
-rw-r--r--Source/Checks/cm_cxx_filesystem.cxx10
-rw-r--r--Source/CursesDialog/ccmake.cxx16
-rw-r--r--Source/CursesDialog/form/frm_driver.c4
-rw-r--r--Source/QtDialog/CMakeLists.txt179
-rw-r--r--Source/QtDialog/CMakeSetup.cxx8
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx6
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h1
-rw-r--r--Source/QtDialog/QCMake.cxx13
-rw-r--r--Source/QtDialog/QCMake.h4
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx33
-rw-r--r--Source/QtDialog/QCMakeCacheView.h1
-rw-r--r--Source/QtDialog/QCMakeWidgets.cxx18
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx2
-rw-r--r--Source/cmCMakeLanguageCommand.h2
-rw-r--r--Source/cmCTest.cxx72
-rw-r--r--Source/cmCTest.h26
-rw-r--r--Source/cmCacheManager.cxx5
-rw-r--r--Source/cmCommonTargetGenerator.cxx2
-rw-r--r--Source/cmComputeComponentGraph.cxx8
-rw-r--r--Source/cmComputeComponentGraph.h3
-rw-r--r--Source/cmComputeLinkDepends.cxx5
-rw-r--r--Source/cmComputeLinkInformation.cxx72
-rw-r--r--Source/cmComputeLinkInformation.h6
-rw-r--r--Source/cmComputeTargetDepends.cxx28
-rw-r--r--Source/cmConfigure.cmake.h.in1
-rw-r--r--Source/cmConfigureFileCommand.cxx6
-rw-r--r--Source/cmCoreTryCompile.cxx619
-rw-r--r--Source/cmCoreTryCompile.h4
-rw-r--r--Source/cmCreateTestSourceList.cxx2
-rw-r--r--Source/cmDefinitions.cxx14
-rw-r--r--Source/cmDefinitions.h4
-rw-r--r--Source/cmDependsFortran.cxx2
-rw-r--r--Source/cmExportCommand.cxx8
-rw-r--r--Source/cmExportFileGenerator.cxx5
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx46
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx3
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx26
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx7
-rw-r--r--Source/cmFileAPI.cxx2
-rw-r--r--Source/cmFileAPICodemodel.cxx79
-rw-r--r--Source/cmFileCommand.cxx63
-rw-r--r--Source/cmFileCopier.cxx2
-rw-r--r--Source/cmFindCommon.cxx8
-rw-r--r--Source/cmFindPackageCommand.cxx10
-rw-r--r--Source/cmFindProgramCommand.cxx61
-rw-r--r--Source/cmGeneratedFileStream.cxx16
-rw-r--r--Source/cmGeneratedFileStream.h9
-rw-r--r--Source/cmGeneratorExpression.cxx6
-rw-r--r--Source/cmGeneratorExpression.h2
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx8
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h1
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx8
-rw-r--r--Source/cmGeneratorExpressionNode.cxx62
-rw-r--r--Source/cmGeneratorTarget.cxx318
-rw-r--r--Source/cmGeneratorTarget.h26
-rw-r--r--Source/cmGetFilenameComponentCommand.cxx2
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx7
-rw-r--r--Source/cmGhsMultiTargetGenerator.h2
-rw-r--r--Source/cmGlobalCommonGenerator.cxx39
-rw-r--r--Source/cmGlobalCommonGenerator.h4
-rw-r--r--Source/cmGlobalGenerator.cxx139
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmGlobalGeneratorFactory.h2
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx14
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx78
-rw-r--r--Source/cmGlobalNinjaGenerator.h15
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx11
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx103
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h22
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio14Generator.h6
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx15
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx6
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx38
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx428
-rw-r--r--Source/cmGlobalXCodeGenerator.h14
-rw-r--r--Source/cmGraphVizWriter.cxx2
-rw-r--r--Source/cmInstallCommand.cxx6
-rw-r--r--Source/cmJsonObjects.cxx6
-rw-r--r--Source/cmLinkItemGraphVisitor.cxx7
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx25
-rw-r--r--Source/cmListFileCache.h26
-rw-r--r--Source/cmLocalCommonGenerator.cxx6
-rw-r--r--Source/cmLocalGenerator.cxx280
-rw-r--r--Source/cmLocalGenerator.h7
-rw-r--r--Source/cmLocalGhsMultiGenerator.cxx3
-rw-r--r--Source/cmLocalNinjaGenerator.cxx23
-rw-r--r--Source/cmLocalNinjaGenerator.h8
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx10
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx13
-rw-r--r--Source/cmMakefile.cxx788
-rw-r--r--Source/cmMakefile.h72
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx4
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx4
-rw-r--r--Source/cmMakefileTargetGenerator.cxx34
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx13
-rw-r--r--Source/cmNinjaTargetGenerator.cxx35
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx3
-rw-r--r--Source/cmPolicies.cxx30
-rw-r--r--Source/cmPolicies.h17
-rw-r--r--Source/cmProjectCommand.cxx2
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx4
-rw-r--r--Source/cmQtAutoGenInitializer.cxx21
-rw-r--r--Source/cmSearchPath.cxx2
-rw-r--r--Source/cmServerProtocol.cxx5
-rw-r--r--Source/cmServerProtocol.h1
-rw-r--r--Source/cmSourceFile.cxx34
-rw-r--r--Source/cmSourceFileLocation.cxx4
-rw-r--r--Source/cmStandardLevelResolver.cxx538
-rw-r--r--Source/cmStandardLevelResolver.h59
-rw-r--r--Source/cmState.cxx3
-rw-r--r--Source/cmStateDirectory.cxx3
-rw-r--r--Source/cmStateSnapshot.cxx9
-rw-r--r--Source/cmStateSnapshot.h1
-rw-r--r--Source/cmString.cxx2
-rw-r--r--Source/cmString.hxx2
-rw-r--r--Source/cmStringAlgorithms.h32
-rw-r--r--Source/cmSystemTools.cxx2
-rw-r--r--Source/cmTarget.cxx183
-rw-r--r--Source/cmTarget.h11
-rw-r--r--Source/cmTargetCompileFeaturesCommand.cxx4
-rw-r--r--Source/cmTestGenerator.cxx2
-rw-r--r--Source/cmTimestamp.cxx2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx84
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h2
-rw-r--r--Source/cmXCodeScheme.cxx5
-rw-r--r--Source/cmake.cxx53
-rw-r--r--Source/cmake.h42
-rw-r--r--Source/cmakemain.cxx140
-rw-r--r--Source/cmcmd.cxx52
-rw-r--r--Source/kwsys/Glob.hxx.in4
-rw-r--r--Source/kwsys/ProcessUNIX.c6
-rw-r--r--Source/kwsys/SystemTools.cxx2
-rw-r--r--Source/kwsys/testProcess.c11
-rw-r--r--Source/kwsys/testSystemTools.cxx22
-rw-r--r--Tests/CMakeLib/CMakeLists.txt3
-rw-r--r--Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt3
-rw-r--r--Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in34
-rw-r--r--Tests/CMakeLib/testCMExtMemory.cxx2
-rw-r--r--Tests/CMakeLib/testCMFilesystemPath.cxx1006
-rw-r--r--Tests/CMakeLib/testRST.expect2
-rw-r--r--Tests/CMakeLib/testRST.rst2
-rw-r--r--Tests/CMakeLists.txt148
-rw-r--r--Tests/CMakeTests/CMakeLists.txt2
-rw-r--r--Tests/CMakeTests/FileDownloadTest.cmake.in13
-rw-r--r--Tests/CMakeTests/FileTestScript.cmake4
-rw-r--r--Tests/COnly/CMakeLists.txt2
-rw-r--r--Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake32
-rw-r--r--Tests/CSharpOnly/CMakeLists.txt1
-rw-r--r--Tests/Cuda/MixedStandardLevels4/lib.cpp2
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu2
-rw-r--r--Tests/CxxOnly/CMakeLists.txt1
-rw-r--r--Tests/FindPackageModeMakefileTest/Makefile.in2
-rw-r--r--Tests/FindSDL/CMakeLists.txt10
-rw-r--r--Tests/FindSDL/Test/CMakeLists.txt19
-rw-r--r--Tests/FindSDL/Test/main.c18
-rw-r--r--Tests/FindTIFF/Test/CMakeLists.txt13
-rw-r--r--Tests/FindTIFF/Test/main.cxx16
-rw-r--r--Tests/FindVulkan/Test/CMakeLists.txt9
-rw-r--r--Tests/FindVulkan/Test/Run-glslc.cmake20
-rw-r--r--Tests/FindVulkan/Test/main.c4
-rw-r--r--Tests/FindX11/Test/CMakeLists.txt2
-rw-r--r--Tests/FindX11/Test/main.c21
-rw-r--r--Tests/FortranOnly/CMakeLists.txt2
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt10
-rw-r--r--Tests/GeneratorExpression/check-part3.cmake4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/standard.h2
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test3.h2
-rw-r--r--Tests/LoadCommand/CMakeCommands/cmTestCommand.c2
-rw-r--r--Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c2
-rw-r--r--Tests/Module/CheckTypeSize/CMakeLists.txt2
-rw-r--r--Tests/Module/CheckTypeSize/CheckTypeSize.cxx26
-rw-r--r--Tests/Module/CheckTypeSize/config.hxx.in10
-rw-r--r--Tests/RunCMake/Android/RunCMakeTest.cmake84
-rw-r--r--Tests/RunCMake/Android/common.cmake2
-rw-r--r--Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt7
-rw-r--r--Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt7
-rw-r--r--Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt7
-rw-r--r--Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt7
-rw-r--r--Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt7
-rw-r--r--Tests/RunCMake/Android/ndk-x86-stderr.txt7
-rw-r--r--Tests/RunCMake/Android/ndk-x86_64-stderr.txt7
-rw-r--r--Tests/RunCMake/BundleUtilities/ExecutableScripts.cmake18
-rw-r--r--Tests/RunCMake/BundleUtilities/RunCMakeTest.cmake1
-rwxr-xr-xTests/RunCMake/BundleUtilities/test.app/script3
-rwxr-xr-xTests/RunCMake/BundleUtilities/test.app/script.bat3
-rwxr-xr-xTests/RunCMake/BundleUtilities/test.app/script.sh3
-rw-r--r--Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt6
-rw-r--r--Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt9
-rw-r--r--Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt7
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt6
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt6
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt6
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt6
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt6
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt7
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt9
-rw-r--r--Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt6
-rw-r--r--Tests/RunCMake/CMP0026/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0027/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0028/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0037/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0041/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0042/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0043/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0045/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/CPack/DragNDrop/Accept.txt1
-rw-r--r--Tests/RunCMake/CPack/DragNDrop/Helpers.cmake1
-rw-r--r--Tests/RunCMake/CPack/DragNDrop/packaging_MONOLITHIC_default.cmake2
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf7
-rw-r--r--Tests/RunCMake/CPack/tests/DMG_SLA/English.menu.txt9
-rw-r--r--Tests/RunCMake/CPack/tests/DMG_SLA/ExpectedFiles.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt3
-rw-r--r--Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt9
-rw-r--r--Tests/RunCMake/CPack/tests/DMG_SLA/VerifyResult.cmake33
-rw-r--r--Tests/RunCMake/CPack/tests/DMG_SLA/test.cmake3
-rw-r--r--Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake8
-rw-r--r--Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt10
-rw-r--r--Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake1
-rw-r--r--Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake19
-rw-r--r--Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt4
-rw-r--r--Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt4
-rw-r--r--Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake1
-rw-r--r--Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake9
-rw-r--r--Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake2
-rw-r--r--Tests/RunCMake/CTest/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CheckModules/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-no-arg-result.txt (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-no-arg-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-result.txt (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-non-existent-source-result.txt (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-non-existent-source-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-result.txt (renamed from Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake65
-rw-r--r--Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt (renamed from Tests/RunCMake/interface_library/genex_link-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt (renamed from Tests/RunCMake/interface_library/global-interface-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt (renamed from Tests/RunCMake/interface_library/invalid_name-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt (renamed from Tests/RunCMake/interface_library/invalid_signature-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt (renamed from Tests/RunCMake/interface_library/target_commands-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt (renamed from Tests/RunCMake/interface_library/whitelist-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt1
-rw-r--r--Tests/RunCMake/CompatibleInterface/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CompatibleInterface/DebugProperties.cmake2
-rw-r--r--Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake2
-rw-r--r--Tests/RunCMake/CompilerChange/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CompilerNotFound/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/Configure/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/DisallowedCommands/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/ExcludeFromAll/CMakeLists.txt (renamed from Tests/RunCMake/interface_library/CMakeLists.txt)2
-rw-r--r--Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake26
-rw-r--r--Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-result.txt1
-rw-r--r--Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt3
-rw-r--r--Tests/RunCMake/ExcludeFromAll/error-on-mixed-config.cmake6
-rw-r--r--Tests/RunCMake/ExcludeFromAll/main.c4
-rw-r--r--Tests/RunCMake/ExcludeFromAll/single-config-build-check.cmake17
-rw-r--r--Tests/RunCMake/ExcludeFromAll/single-config.cmake7
-rw-r--r--Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/ExternalData/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/FPHSA/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/FeatureSummary/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py33
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json8
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json8
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json110
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json36
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json110
-rw-r--r--Tests/RunCMake/FileAPI/cxx/CMakeLists.txt11
-rw-r--r--Tests/RunCMake/File_Generate/AdjacentInOut.cmake6
-rw-r--r--Tests/RunCMake/File_Generate/AdjacentInOut.in1
-rw-r--r--Tests/RunCMake/File_Generate/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/File_Generate/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/FindPkgConfig/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake2
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-TARGET_PROPERTY.cmake17
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-TARGET_PROPERTY.cmake17
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake9
-rw-r--r--Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES-check.cmake17
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake7
-rw-r--r--Tests/RunCMake/GeneratorPlatform/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestXML-special-result-check.cmake28
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestXML.cmake11
-rw-r--r--Tests/RunCMake/GoogleTest/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/GoogleTest/xml_output.cpp11
-rw-r--r--Tests/RunCMake/Graphviz/GraphvizTestProject.cmake8
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot43
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot39
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot39
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot31
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot31
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot9
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot33
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot27
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot35
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot39
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot27
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot35
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot39
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot39
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot39
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication24
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers36
-rw-r--r--Tests/RunCMake/Graphviz/test_project/system_library.c3
-rw-r--r--Tests/RunCMake/IncompatibleQt/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/InterfaceLibrary/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value-stderr.txt (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-stderr.txt)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value.cmake (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface-stderr.txt (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-stderr.txt)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface.cmake (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported-stderr.txt (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-stderr.txt)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported.cmake (renamed from Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/RunCMakeTest.cmake (renamed from Tests/RunCMake/interface_library/RunCMakeTest.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET-stderr.txt (renamed from Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET.cmake (renamed from Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/genex_link-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/genex_link.cmake (renamed from Tests/RunCMake/interface_library/genex_link.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/global-interface-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/global-interface-stderr.txt (renamed from Tests/RunCMake/interface_library/global-interface-stderr.txt)4
-rw-r--r--Tests/RunCMake/InterfaceLibrary/global-interface.cmake (renamed from Tests/RunCMake/interface_library/global-interface.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/invalid_name-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/invalid_name-stderr.txt (renamed from Tests/RunCMake/interface_library/invalid_name-stderr.txt)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/invalid_name.cmake (renamed from Tests/RunCMake/interface_library/invalid_name.cmake)2
-rw-r--r--Tests/RunCMake/InterfaceLibrary/invalid_signature-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/invalid_signature-stderr.txt (renamed from Tests/RunCMake/interface_library/invalid_signature-stderr.txt)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/invalid_signature.cmake (renamed from Tests/RunCMake/interface_library/invalid_signature.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/no_shared_libs.cmake (renamed from Tests/RunCMake/interface_library/no_shared_libs.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/target_commands-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/target_commands-stderr.txt (renamed from Tests/RunCMake/interface_library/target_commands-stderr.txt)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/target_commands.cmake (renamed from Tests/RunCMake/interface_library/target_commands.cmake)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/whitelist-result.txt1
-rw-r--r--Tests/RunCMake/InterfaceLibrary/whitelist-stderr.txt (renamed from Tests/RunCMake/interface_library/whitelist-stderr.txt)0
-rw-r--r--Tests/RunCMake/InterfaceLibrary/whitelist.cmake (renamed from Tests/RunCMake/interface_library/whitelist.cmake)0
-rw-r--r--Tests/RunCMake/Languages/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll-all-build-check.cmake9
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll.cmake12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt4
-rw-r--r--Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/PositionIndependentCode/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/RunCMake.cmake1
-rw-r--r--Tests/RunCMake/SourceProperties/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/TargetObjects/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/TargetPolicies/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/TargetProperties/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/TargetSources/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake2
-rw-r--r--Tests/RunCMake/VSSolution/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/XcodeProject/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake2
-rw-r--r--Tests/RunCMake/add_dependencies/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/alias_targets/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/alias_targets/invalid-name.cmake2
-rw-r--r--Tests/RunCMake/build_command/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/cmake_language/call_invalid_command.cmake2
-rw-r--r--Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt26
-rw-r--r--Tests/RunCMake/cmake_minimum_required/Before2812.cmake6
-rw-r--r--Tests/RunCMake/cmake_minimum_required/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt9
-rw-r--r--Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/configure_file/NoSourcePermissions.cmake10
-rwxr-xr-xTests/RunCMake/configure_file/NoSourcePermissions.sh3
-rw-r--r--Tests/RunCMake/configure_file/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in2
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-result.txt1
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stdout.txt10
-rw-r--r--Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/ctest_memcheck/test.cmake.in2
-rw-r--r--Tests/RunCMake/ctest_memcheck/testCudaMemcheck.cmake264
-rw-r--r--Tests/RunCMake/ctest_update/test.cmake.in2
-rw-r--r--Tests/RunCMake/export/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-no-save-hash-result.txt1
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-no-save-hash-stderr.txt4
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-no-save-hash.cmake8
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-no-save-hash.txt0
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/find_dependency/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/find_package/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt11
-rw-r--r--Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/BundleSpaceInName.cmake8
-rw-r--r--Tests/RunCMake/find_program/CMP0109-Common.cmake (renamed from Tests/RunCMake/find_program/ExeNoRead.cmake)3
-rw-r--r--Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt2
-rw-r--r--Tests/RunCMake/find_program/CMP0109-NEW.cmake2
-rw-r--r--Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt2
-rw-r--r--Tests/RunCMake/find_program/CMP0109-OLD.cmake2
-rw-r--r--Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt29
-rw-r--r--Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt2
-rw-r--r--Tests/RunCMake/find_program/CMP0109-WARN.cmake1
-rw-r--r--Tests/RunCMake/find_program/ExeNoRead-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake6
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt2
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake2
-rw-r--r--Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt1
-rw-r--r--Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt4
-rw-r--r--Tests/RunCMake/get_filename_component/IncorrectArguments.cmake2
-rw-r--r--Tests/RunCMake/get_filename_component/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt4
-rw-r--r--Tests/RunCMake/get_filename_component/UnknownComponent.cmake1
-rw-r--r--Tests/RunCMake/get_property/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/if/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/include/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/include_external_msproject/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/include_external_msproject/check_utils.cmake2
-rw-r--r--Tests/RunCMake/list/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt11
-rw-r--r--Tests/RunCMake/math/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/message/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/no_install_prefix/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/project/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/string/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake1
-rw-r--r--Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake1
-rw-r--r--Tests/RunCMake/try_compile/CMP0056.cmake1
-rw-r--r--Tests/RunCMake/try_compile/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/try_compile/CudaStandard-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/CudaStandard.cmake2
-rw-r--r--Tests/RunCMake/try_compile/proj/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/try_run/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/variable_watch/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/while/CMakeLists.txt2
-rw-r--r--Tests/SetLang/CMakeLists.txt7
-rw-r--r--Tests/SetLang/bar.c14
-rw-r--r--Tests/SetLang/zoom.zzz7
-rw-r--r--Tests/VSAndroid/AndroidManifest.xml (renamed from Tests/VSNsightTegra/AndroidManifest.xml)0
-rw-r--r--Tests/VSAndroid/CMakeLists.txt (renamed from Tests/VSNsightTegra/CMakeLists.txt)2
-rw-r--r--Tests/VSAndroid/build.xml (renamed from Tests/VSNsightTegra/build.xml)0
-rw-r--r--Tests/VSAndroid/jni/first.c (renamed from Tests/VSNsightTegra/jni/first.c)0
-rw-r--r--Tests/VSAndroid/jni/first.h (renamed from Tests/VSNsightTegra/jni/first.h)0
-rw-r--r--Tests/VSAndroid/jni/second.c (renamed from Tests/VSNsightTegra/jni/second.c)0
-rw-r--r--Tests/VSAndroid/proguard-android.txt (renamed from Tests/VSNsightTegra/proguard-android.txt)0
-rw-r--r--Tests/VSAndroid/res/values/strings.xml (renamed from Tests/VSNsightTegra/res/values/strings.xml)0
-rw-r--r--Tests/VSAndroid/src/com/example/twolibs/TwoLibs.java (renamed from Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java)0
-rw-r--r--Tests/VSWinStorePhone/CMakeLists.txt2
-rw-r--r--Tests/VariableUnusedViaSet/CMakeLists.txt4
-rw-r--r--Tests/VariableUnusedViaUnset/CMakeLists.txt8
-rw-r--r--Tests/XCTest/StaticLibExample/StaticLibExample.c2
-rw-r--r--Tests/XCTest/StaticLibExample/StaticLibExample.h2
-rw-r--r--Utilities/Sphinx/CTestConfig.cmake4
-rwxr-xr-xUtilities/Sphinx/update_versions.py115
-rw-r--r--Utilities/cmlibuv/include/uv/unix.h3
-rw-r--r--Utilities/std/CMakeLists.txt4
-rw-r--r--Utilities/std/cm/bits/fs_path.cxx1029
-rw-r--r--Utilities/std/cm/filesystem1175
-rw-r--r--Utilities/std/cm/iomanip183
-rw-r--r--Utilities/std/cm/memory3
-rw-r--r--Utilities/std/cmSTL.hxx.in10
-rwxr-xr-xbootstrap50
1394 files changed, 12263 insertions, 3759 deletions
diff --git a/.clang-format b/.clang-format
index 8c015ef350..cba23d6047 100644
--- a/.clang-format
+++ b/.clang-format
@@ -20,6 +20,8 @@ SortUsingDeclarations: false
SpaceAfterTemplateKeyword: true
IncludeBlocks: Regroup
IncludeCategories:
+ - Regex: '^[<"]cmSTL\.hxx'
+ Priority: -2
- Regex: '^[<"]cmConfigure\.h'
Priority: -1
- Regex: '^<queue>'
diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml
index c2d28da463..be10e2447c 100644
--- a/.gitlab/artifacts.yml
+++ b/.gitlab/artifacts.yml
@@ -34,10 +34,12 @@
- build/Tests/CMake*/PseudoMemcheck/purify
- build/Tests/CMake*/PseudoMemcheck/memcheck_fail
- build/Tests/CMake*/PseudoMemcheck/BC
+ - build/Tests/CMake*/PseudoMemcheck/cuda-memcheck
- build/Tests/CMake*/PseudoMemcheck/valgrind.exe
- build/Tests/CMake*/PseudoMemcheck/purify.exe
- build/Tests/CMake*/PseudoMemcheck/memcheck_fail.exe
- build/Tests/CMake*/PseudoMemcheck/BC.exe
+ - build/Tests/CMake*/PseudoMemcheck/cuda-memcheck.exe
- build/Tests/CMake*/PseudoMemcheck/NoLog
- build/Tests/CMake*Lib/*LibTests
- build/Tests/CMake*Lib/*LibTests.exe
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f62c666bd1..2d860d4a8b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,6 +108,11 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()
endif()
+# Inform STL library header wrappers whether to use system versions.
+configure_file(${CMake_SOURCE_DIR}/Utilities/std/cmSTL.hxx.in
+ ${CMake_BINARY_DIR}/Utilities/cmSTL.hxx
+ @ONLY)
+
# set the internal encoding of CMake to UTF-8
set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 9ec9e8f725..476a1c6b83 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -6,7 +6,9 @@
set(CTEST_PROJECT_NAME "CMake")
set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")
-set(CTEST_DROP_METHOD "http")
+if(NOT CTEST_DROP_METHOD STREQUAL "https")
+ set(CTEST_DROP_METHOD "http")
+endif()
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Help/command/add_compile_definitions.rst b/Help/command/add_compile_definitions.rst
index e10aba022e..48e33be63f 100644
--- a/Help/command/add_compile_definitions.rst
+++ b/Help/command/add_compile_definitions.rst
@@ -1,6 +1,8 @@
add_compile_definitions
-----------------------
+.. versionadded:: 3.12
+
Add preprocessor definitions to the compilation of source files.
.. code-block:: cmake
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index 01c415a929..ed8447e87c 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -64,42 +64,6 @@ See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are
pre-processed, and you want to have the original sources reachable from
within IDE.
-Imported Libraries
-^^^^^^^^^^^^^^^^^^
-
-.. code-block:: cmake
-
- add_library(<name> <SHARED|STATIC|MODULE|OBJECT|UNKNOWN> IMPORTED
- [GLOBAL])
-
-An :ref:`IMPORTED library target <Imported Targets>` references a library
-file located outside the project. No rules are generated to build it, and
-the :prop_tgt:`IMPORTED` target property is ``True``. The target name has
-scope in the directory in which it is created and below, but the ``GLOBAL``
-option extends visibility. It may be referenced like any target built
-within the project. ``IMPORTED`` libraries are useful for convenient
-reference from commands like :command:`target_link_libraries`. Details
-about the imported library are specified by setting properties whose names
-begin in ``IMPORTED_`` and ``INTERFACE_``.
-
-The most important properties are:
-
-* :prop_tgt:`IMPORTED_LOCATION` (and its per-configuration
- variant :prop_tgt:`IMPORTED_LOCATION_<CONFIG>`) which specifies the
- location of the main library file on disk.
-* :prop_tgt:`IMPORTED_OBJECTS` (and :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>`)
- for object libraries, specifies the locations of object files on disk.
-* :prop_tgt:`PUBLIC_HEADER` files to be installed during :command:`install` invocation
-
-See documentation of the ``IMPORTED_*`` and ``INTERFACE_*`` properties
-for more information.
-
-An ``UNKNOWN`` library type is typically only used in the implementation of
-:ref:`Find Modules`. It allows the path to an imported library (often found
-using the :command:`find_library` command) to be used without having to know
-what type of library it is. This is especially useful on Windows where a
-static library and a DLL's import library both have the same file extension.
-
Object Libraries
^^^^^^^^^^^^^^^^
@@ -129,6 +93,80 @@ systems (such as Xcode) may not like targets that have only object files, so
consider adding at least one real source file to any target that references
``$<TARGET_OBJECTS:objlib>``.
+Interface Libraries
+^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: cmake
+
+ add_library(<name> INTERFACE)
+
+Creates an :ref:`Interface Library <Interface Libraries>`.
+An ``INTERFACE`` library target does not compile sources and does
+not produce a library artifact on disk. However, it may have
+properties set on it and it may be installed and exported.
+Typically, ``INTERFACE_*`` properties are populated on an interface
+target using the commands:
+
+* :command:`set_property`,
+* :command:`target_link_libraries(INTERFACE)`,
+* :command:`target_link_options(INTERFACE)`,
+* :command:`target_include_directories(INTERFACE)`,
+* :command:`target_compile_options(INTERFACE)`,
+* :command:`target_compile_definitions(INTERFACE)`, and
+* :command:`target_sources(INTERFACE)`,
+
+and then it is used as an argument to :command:`target_link_libraries`
+like any other target.
+
+An interface library has no source files itself and is not included
+as a target in the generated buildsystem.
+
+Imported Libraries
+^^^^^^^^^^^^^^^^^^
+
+.. code-block:: cmake
+
+ add_library(<name> <type> IMPORTED [GLOBAL])
+
+Creates an :ref:`IMPORTED library target <Imported Targets>` called ``<name>``.
+No rules are generated to build it, and the :prop_tgt:`IMPORTED` target
+property is ``True``. The target name has scope in the directory in which
+it is created and below, but the ``GLOBAL`` option extends visibility.
+It may be referenced like any target built within the project.
+``IMPORTED`` libraries are useful for convenient reference from commands
+like :command:`target_link_libraries`. Details about the imported library
+are specified by setting properties whose names begin in ``IMPORTED_`` and
+``INTERFACE_``.
+
+The ``<type>`` must be one of:
+
+``STATIC``, ``SHARED``, ``MODULE``, ``UNKNOWN``
+ References a library file located outside the project. The
+ :prop_tgt:`IMPORTED_LOCATION` target property (or its per-configuration
+ variant :prop_tgt:`IMPORTED_LOCATION_<CONFIG>`) specifies the
+ location of the main library file on disk.
+ Additional usage requirements may be specified in ``INTERFACE_*`` properties.
+
+ An ``UNKNOWN`` library type is typically only used in the implementation of
+ :ref:`Find Modules`. It allows the path to an imported library (often found
+ using the :command:`find_library` command) to be used without having to know
+ what type of library it is. This is especially useful on Windows where a
+ static library and a DLL's import library both have the same file extension.
+
+``OBJECT``
+ References a set of object files located outside the project.
+ The :prop_tgt:`IMPORTED_OBJECTS` target property (or its per-configuration
+ variant :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>`) specifies the locations of
+ object files on disk.
+ Additional usage requirements may be specified in ``INTERFACE_*`` properties.
+
+``INTERFACE``
+ Does not reference any library or object files on disk, but may
+ specify usage requirements in ``INTERFACE_*`` properties.
+
+See documentation of the ``IMPORTED_*`` and ``INTERFACE_*`` properties
+for more information.
+
Alias Libraries
^^^^^^^^^^^^^^^
@@ -153,35 +191,3 @@ to modify properties of ``<target>``, that is, it may not be used as the
operand of :command:`set_property`, :command:`set_target_properties`,
:command:`target_link_libraries` etc. An ``ALIAS`` target may not be
installed or exported.
-
-Interface Libraries
-^^^^^^^^^^^^^^^^^^^
-
-.. code-block:: cmake
-
- add_library(<name> INTERFACE [IMPORTED [GLOBAL]])
-
-Creates an :ref:`Interface Library <Interface Libraries>`. An ``INTERFACE``
-library target does not directly create build output, though it may
-have properties set on it and it may be installed, exported and
-imported. Typically the ``INTERFACE_*`` properties are populated on
-the interface target using the commands:
-
-* :command:`set_property`,
-* :command:`target_link_libraries(INTERFACE)`,
-* :command:`target_link_options(INTERFACE)`,
-* :command:`target_include_directories(INTERFACE)`,
-* :command:`target_compile_options(INTERFACE)`,
-* :command:`target_compile_definitions(INTERFACE)`, and
-* :command:`target_sources(INTERFACE)`,
-
-and then it is used as an argument to :command:`target_link_libraries`
-like any other target.
-
-An ``INTERFACE`` :ref:`Imported Target <Imported Targets>` may also be
-created with this signature. An ``IMPORTED`` library target references a
-library defined outside the project. The target name has scope in the
-directory in which it is created and below, but the ``GLOBAL`` option
-extends visibility. It may be referenced like any target built within
-the project. ``IMPORTED`` libraries are useful for convenient reference
-from commands like :command:`target_link_libraries`.
diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst
index faa4afb244..f03e7c0e4c 100644
--- a/Help/command/add_link_options.rst
+++ b/Help/command/add_link_options.rst
@@ -1,6 +1,8 @@
add_link_options
----------------
+.. versionadded:: 3.13
+
Add options to the link step for executable, shared library or module
library targets in the current directory and below that are added after
this command is invoked.
diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst
index 09880975f4..9e98d79703 100644
--- a/Help/command/cmake_language.rst
+++ b/Help/command/cmake_language.rst
@@ -1,6 +1,8 @@
cmake_language
--------------
+.. versionadded:: 3.18
+
Call meta-operations on CMake commands.
Synopsis
diff --git a/Help/command/cmake_parse_arguments.rst b/Help/command/cmake_parse_arguments.rst
index fcd36d0a39..8803ec8bd0 100644
--- a/Help/command/cmake_parse_arguments.rst
+++ b/Help/command/cmake_parse_arguments.rst
@@ -1,6 +1,8 @@
cmake_parse_arguments
---------------------
+.. versionadded:: 3.5
+
Parse function or macro arguments.
.. code-block:: cmake
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index 29e85bd16c..46d1a05954 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -7,6 +7,7 @@ Copy a file to another location and modify its contents.
configure_file(<input> <output>
[COPYONLY] [ESCAPE_QUOTES] [@ONLY]
+ [NO_SOURCE_PERMISSIONS]
[NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
Copies an ``<input>`` file to an ``<output>`` file and substitutes
@@ -82,6 +83,11 @@ 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``
+ 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--).
+
``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/continue.rst b/Help/command/continue.rst
index 31c7089a12..f62802e2d1 100644
--- a/Help/command/continue.rst
+++ b/Help/command/continue.rst
@@ -1,6 +1,8 @@
continue
--------
+.. versionadded:: 3.2
+
Continue to the top of enclosing foreach or while loop.
.. code-block:: cmake
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 693c059c52..2cf938b9d2 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -776,11 +776,14 @@ Transfer
.. code-block:: cmake
- file(DOWNLOAD <url> <file> [<options>...])
+ file(DOWNLOAD <url> [<file>] [<options>...])
file(UPLOAD <file> <url> [<options>...])
-The ``DOWNLOAD`` mode downloads the given ``<url>`` to a local ``<file>``.
-The ``UPLOAD`` mode uploads a local ``<file>`` to a given ``<url>``.
+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>``.
Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
@@ -853,10 +856,12 @@ Additional options to ``DOWNLOAD`` are:
Verify that the downloaded content hash matches the expected value, where
``ALGO`` is one of the algorithms supported by ``file(<HASH>)``.
- If it does not match, the operation fails with an error.
+ If it does not match, the operation fails with an error. It is an error to
+ specify this if ``DOWNLOAD`` is not given a ``<file>``.
``EXPECTED_MD5 <value>``
- Historical short-hand for ``EXPECTED_HASH MD5=<value>``.
+ Historical short-hand for ``EXPECTED_HASH MD5=<value>``. It is an error to
+ specify this if ``DOWNLOAD`` is not given a ``<file>``.
Locking
^^^^^^^
diff --git a/Help/command/include_guard.rst b/Help/command/include_guard.rst
index 877aa86d9f..dca3b6f0e4 100644
--- a/Help/command/include_guard.rst
+++ b/Help/command/include_guard.rst
@@ -1,6 +1,8 @@
include_guard
-------------
+.. versionadded:: 3.10
+
Provides an include guard for the file currently being processed by CMake.
.. code-block:: cmake
diff --git a/Help/command/install.rst b/Help/command/install.rst
index c8df7d92fc..c11eaf4293 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -45,6 +45,9 @@ signatures that specify them. The common options are:
As absolute paths are not supported by :manual:`cpack <cpack(1)>` installer
generators, it is preferable to use relative paths throughout.
+ In particular, there is no need to make paths absolute by prepending
+ :variable:`CMAKE_INSTALL_PREFIX`; this prefix is used by default if
+ the DESTINATION is a relative path.
``PERMISSIONS``
Specify permissions for installed files. Valid permissions are
diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst
index c5401e6ec8..b50be34a6b 100644
--- a/Help/command/target_compile_features.rst
+++ b/Help/command/target_compile_features.rst
@@ -1,6 +1,8 @@
target_compile_features
-----------------------
+.. versionadded:: 3.1
+
Add expected compiler features to a target.
.. code-block:: cmake
diff --git a/Help/command/target_link_directories.rst b/Help/command/target_link_directories.rst
index 76da94dc12..bb75a3de48 100644
--- a/Help/command/target_link_directories.rst
+++ b/Help/command/target_link_directories.rst
@@ -1,6 +1,8 @@
target_link_directories
-----------------------
+.. versionadded:: 3.13
+
Add link directories to a target.
.. code-block:: cmake
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index 89038e3288..e59e0e1c68 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -1,6 +1,8 @@
target_link_options
-------------------
+.. versionadded:: 3.13
+
Add options to the link step for an executable, shared library or module
library target.
diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst
index d4280b13b6..7005180630 100644
--- a/Help/command/target_precompile_headers.rst
+++ b/Help/command/target_precompile_headers.rst
@@ -1,6 +1,8 @@
target_precompile_headers
-------------------------
+.. versionadded:: 3.16
+
Add a list of header files to precompile.
Precompiling header files can speed up compilation by creating a partially
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
index 27e737bf08..653b8d7c53 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -1,6 +1,8 @@
target_sources
--------------
+.. versionadded:: 3.1
+
Add sources to a target.
.. code-block:: cmake
@@ -9,19 +11,21 @@ Add sources to a target.
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specifies sources to use when compiling a given target. Relative
-source file paths are interpreted as being relative to the current
+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
:ref:`ALIAS target <Alias Targets>`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
+specify the scope of the items following them. ``PRIVATE`` and ``PUBLIC``
items will populate the :prop_tgt:`SOURCES` property of
-``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
-:prop_tgt:`INTERFACE_SOURCES` property of ``<target>``.
-(:ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.)
+``<target>``, which are used when building the target itself.
+``PUBLIC`` and ``INTERFACE`` items will populate the
+:prop_tgt:`INTERFACE_SOURCES` property of ``<target>``, which are used
+when building dependents. (: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.
diff --git a/Help/command/variable_watch.rst b/Help/command/variable_watch.rst
index ce69bcfcde..8293f5aabc 100644
--- a/Help/command/variable_watch.rst
+++ b/Help/command/variable_watch.rst
@@ -7,9 +7,42 @@ Watch the CMake variable for change.
variable_watch(<variable> [<command>])
-If the specified ``<variable>`` changes, a message will be printed
-to inform about the change.
+If the specified ``<variable>`` changes and no ``<command>`` is given,
+a message will be printed to inform about the change.
-Additionally, if ``<command>`` is given, this command will be executed.
+If ``<command>`` is given, this command will be executed instead.
The command will receive the following arguments:
``COMMAND(<variable> <access> <value> <current_list_file> <stack>)``
+
+``<variable>``
+ Name of the variable being accessed.
+
+``<access>``
+ One of ``READ_ACCESS``, ``UNKNOWN_READ_ACCESS``, ``MODIFIED_ACCESS``,
+ ``UNKNOWN_MODIFIED_ACCESS``, or ``REMOVED_ACCESS``. The ``UNKNOWN_``
+ values are only used when the variable has never been set. Once set,
+ they are never used again during the same CMake run, even if the
+ variable is later unset.
+
+``<value>``
+ The value of the variable. On a modification, this is the new
+ (modified) value of the variable. On removal, the value is empty.
+
+``<current_list_file>``
+ Full path to the file doing the access.
+
+``<stack>``
+ List of absolute paths of all files currently on the stack of file
+ inclusion, with the bottom-most file first and the currently
+ processed file (that is, ``current_list_file``) last.
+
+Note that for some accesses such as :command:`list(APPEND)`, the watcher
+is executed twice, first with a read access and then with a write one.
+Also note that an :command:`if(DEFINED)` query on the variable does not
+register as an access and the watcher is not executed.
+
+Only non-cache variables can be watched using this command. Access to
+cache variables is never watched. However, the existence of a cache
+variable ``var`` causes accesses to the non-cache variable ``var`` to
+not use the ``UNKNOWN_`` prefix, even if a non-cache variable ``var``
+has never existed.
diff --git a/Help/cpack_gen/external.rst b/Help/cpack_gen/external.rst
index 406f6be1a5..7ef1071e79 100644
--- a/Help/cpack_gen/external.rst
+++ b/Help/cpack_gen/external.rst
@@ -281,3 +281,10 @@ Variables specific to CPack External generator
It is invoked after (optional) staging took place and may
run an external packaging tool. The script has access to
the variables defined by the CPack config file.
+
+.. 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.
diff --git a/Help/cpack_gen/packagemaker.rst b/Help/cpack_gen/packagemaker.rst
index c2a450e6cb..357eb7316f 100644
--- a/Help/cpack_gen/packagemaker.rst
+++ b/Help/cpack_gen/packagemaker.rst
@@ -29,7 +29,7 @@ macOS using PackageMaker:
.. variable:: CPACK_PACKAGEMAKER_BACKGROUND
- Adds a background to Distribtion XML if specified. The value contains the
+ Adds a background to Distribution XML if specified. The value contains the
path to image in ``Resources`` directory.
.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT
diff --git a/Help/cpack_gen/productbuild.rst b/Help/cpack_gen/productbuild.rst
index 82b79aeacf..fd99e5a271 100644
--- a/Help/cpack_gen/productbuild.rst
+++ b/Help/cpack_gen/productbuild.rst
@@ -68,7 +68,7 @@ macOS using ProductBuild:
.. variable:: CPACK_PRODUCTBUILD_BACKGROUND
- Adds a background to Distribtion XML if specified. The value contains the
+ Adds a background to Distribution XML if specified. The value contains the
path to image in ``Resources`` directory.
.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index a1c1a6fada..4c2c89fdaa 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -200,6 +200,23 @@ the notes, and revise wording. Then commit with a message such as::
Add section headers similar to the $prev release notes and move each
individual bullet into an appropriate section. Revise a few bullets.
+Update Sphinx ``versionadded`` directives in documents added since
+the previous release by running the `update_versions.py`_ script:
+
+.. code-block:: shell
+
+ Utilities/Sphinx/update_versions.py --since v$prev.0 --overwrite
+
+.. _`update_versions.py`: ../../Utilities/Sphinx/update_versions.py
+
+Commit the changes with a message such as::
+
+ Help: Update Sphinx versionadded directives for $ver release
+
+ Run the script:
+
+ Utilities/Sphinx/update_versions.py --since v$prev.0 --overwrite
+
Open a merge request with the ``doc-$ver-relnotes`` branch for review
and integration. Further steps may proceed after this has been merged
to ``master``.
@@ -299,3 +316,28 @@ announcing that post-release development is open::
before staging or merging.
.. _`CMake Discourse Forum Development Category`: https://discourse.cmake.org/c/development
+
+Initial Post-Release Development
+--------------------------------
+
+Deprecate policies more than 8 release series old by updating the
+policy range check in ``cmMakefile::SetPolicy``.
+Commit with a message such as::
+
+ Add deprecation warnings for policies CMP#### and below
+
+ The OLD behaviors of all policies are deprecated, but only by
+ documentation. Add an explicit deprecation diagnostic for policies
+ introduced in CMake $OLDVER and below to encourage projects to port
+ away from setting policies to OLD.
+
+Update the ``cmake_policy`` version range generated by ``install(EXPORT)``
+in ``cmExportFileGenerator::GeneratePolicyHeaderCode`` to end at the
+previous release. We use one release back since we now know all the
+policies added for that version. Commit with a message such as::
+
+ export: Increase maximum policy version in exported files to $prev
+
+ The files generatd by `install(EXPORT)` and `export()` commands
+ are known to work with policies as of CMake $prev, so enable them
+ in sufficiently new CMake versions.
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index 6c7e92cf8b..f2a91c0dd3 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -260,7 +260,7 @@ This may be generated with
If the commit is a fix for the mentioned commit, consider using a ``Fixes:``
trailer in the commit message with the specified format. This trailer should
not be word-wrapped. Note that if there is also an issue for what is being
-fixed, it is preferrable to link to the issue instead.
+fixed, it is preferable to link to the issue instead.
If relevant, add the first release tag of CMake containing the commit after
the ``<date>``, i.e., ``commit <shorthash> (<subject>, <date>, <tag>)``.
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 0ccb8f42d9..d93e55cfb0 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -35,6 +35,9 @@ Available features are:
* From ``C++14``:
+ * ``<cm/iomanip>``:
+ ``cm::quoted``
+
* ``<cm/iterator>``:
``cm::make_reverse_iterator``, ``cm::cbegin``, ``cm::cend``,
``cm::rbegin``, ``cm::rend``, ``cm::crbegin``, ``cm::crend``
@@ -53,6 +56,9 @@ Available features are:
* ``<cm/algorithm>``:
``cm::clamp``
+ * ``cm/filesystem>``:
+ ``cm::filesystem::path``
+
* ``<cm/iterator>``:
``cm::size``, ``cm::empty``, ``cm::data``
diff --git a/Help/envvar/ASM_DIALECT.rst b/Help/envvar/ASM_DIALECT.rst
index a06e3cba24..768d8fee32 100644
--- a/Help/envvar/ASM_DIALECT.rst
+++ b/Help/envvar/ASM_DIALECT.rst
@@ -1,6 +1,8 @@
ASM<DIALECT>
------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Preferred executable for compiling a specific dialect of assembly language
diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst
index 2e1c6d2948..66a75e285d 100644
--- a/Help/envvar/ASM_DIALECTFLAGS.rst
+++ b/Help/envvar/ASM_DIALECTFLAGS.rst
@@ -1,6 +1,8 @@
ASM<DIALECT>FLAGS
-----------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Default compilation flags to be used when compiling a specific dialect of an
diff --git a/Help/envvar/CC.rst b/Help/envvar/CC.rst
index ef120593ed..7d2b870782 100644
--- a/Help/envvar/CC.rst
+++ b/Help/envvar/CC.rst
@@ -1,6 +1,8 @@
CC
--
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``C`` language files. Will only be used by
diff --git a/Help/envvar/CCMAKE_COLORS.rst b/Help/envvar/CCMAKE_COLORS.rst
index d4750c3682..4e76bf8b57 100644
--- a/Help/envvar/CCMAKE_COLORS.rst
+++ b/Help/envvar/CCMAKE_COLORS.rst
@@ -1,6 +1,8 @@
CCMAKE_COLORS
-------------
+.. versionadded:: 3.18
+
Determines what colors are used by the CMake curses interface,
when run on a terminal that supports colors.
The syntax follows the same conventions as ``LS_COLORS``;
diff --git a/Help/envvar/CFLAGS.rst b/Help/envvar/CFLAGS.rst
index 190b4f47c8..31db6a6b00 100644
--- a/Help/envvar/CFLAGS.rst
+++ b/Help/envvar/CFLAGS.rst
@@ -1,6 +1,8 @@
CFLAGS
------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Default compilation flags to be used when compiling ``C`` files. Will only be
diff --git a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
index 199ca3e4b7..dbc589ac20 100644
--- a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
@@ -1,6 +1,8 @@
CMAKE_BUILD_PARALLEL_LEVEL
--------------------------
+.. versionadded:: 3.12
+
.. include:: ENV_VAR.txt
Specifies the maximum number of concurrent processes to use when building
diff --git a/Help/envvar/CMAKE_CONFIG_TYPE.rst b/Help/envvar/CMAKE_CONFIG_TYPE.rst
index 168593d507..c207a48221 100644
--- a/Help/envvar/CMAKE_CONFIG_TYPE.rst
+++ b/Help/envvar/CMAKE_CONFIG_TYPE.rst
@@ -1,6 +1,8 @@
CMAKE_CONFIG_TYPE
-----------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
The default build configuration for :ref:`Build Tool Mode` and
diff --git a/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst
index e9e0810650..9e678bef3c 100644
--- a/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst
+++ b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst
@@ -1,6 +1,8 @@
CMAKE_EXPORT_COMPILE_COMMANDS
-----------------------------
+.. versionadded:: 3.17
+
.. include:: ENV_VAR.txt
The default value for :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` when there
diff --git a/Help/envvar/CMAKE_GENERATOR.rst b/Help/envvar/CMAKE_GENERATOR.rst
index f2d055f10f..3488b040aa 100644
--- a/Help/envvar/CMAKE_GENERATOR.rst
+++ b/Help/envvar/CMAKE_GENERATOR.rst
@@ -1,6 +1,8 @@
CMAKE_GENERATOR
---------------
+.. versionadded:: 3.15
+
.. include:: ENV_VAR.txt
Specifies the CMake default generator to use when no generator is supplied
diff --git a/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst b/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst
index 1654fa1db1..8ca7d80e2b 100644
--- a/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst
+++ b/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst
@@ -1,6 +1,8 @@
CMAKE_GENERATOR_INSTANCE
------------------------
+.. versionadded:: 3.15
+
.. include:: ENV_VAR.txt
Default value for :variable:`CMAKE_GENERATOR_INSTANCE` if no Cache entry is
diff --git a/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst b/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
index 917b30b144..b039845b1c 100644
--- a/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
+++ b/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
@@ -1,6 +1,8 @@
CMAKE_GENERATOR_PLATFORM
------------------------
+.. versionadded:: 3.15
+
.. include:: ENV_VAR.txt
Default value for :variable:`CMAKE_GENERATOR_PLATFORM` if no Cache entry
diff --git a/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst b/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
index 7ac3856a11..394dd88d1b 100644
--- a/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
@@ -1,6 +1,8 @@
CMAKE_GENERATOR_TOOLSET
-----------------------
+.. versionadded:: 3.15
+
.. include:: ENV_VAR.txt
Default value for :variable:`CMAKE_GENERATOR_TOOLSET` if no Cache entry
diff --git a/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst
index 4f91e9a42d..c384fa1b90 100644
--- a/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst
+++ b/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_COMPILER_LAUNCHER
------------------------------
+.. versionadded:: 3.17
+
.. include:: ENV_VAR.txt
Default compiler launcher to use for the specified language. Will only be used
diff --git a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
index 77ead4d55c..5babbe50fd 100644
--- a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
+++ b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_MSVCIDE_RUN_PATH
----------------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Extra PATH locations for custom commands when using
diff --git a/Help/envvar/CMAKE_NO_VERBOSE.rst b/Help/envvar/CMAKE_NO_VERBOSE.rst
index 149efbd6f4..fe733f8af0 100644
--- a/Help/envvar/CMAKE_NO_VERBOSE.rst
+++ b/Help/envvar/CMAKE_NO_VERBOSE.rst
@@ -1,6 +1,8 @@
CMAKE_NO_VERBOSE
----------------
+.. versionadded:: 3.14
+
Disables verbose output from CMake when :envvar:`VERBOSE` environment variable
is set.
diff --git a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
index ef7d5470b5..4bfa36af4e 100644
--- a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
+++ b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
@@ -1,6 +1,8 @@
CMAKE_OSX_ARCHITECTURES
-----------------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Target specific architectures for macOS.
diff --git a/Help/envvar/CMAKE_PREFIX_PATH.rst b/Help/envvar/CMAKE_PREFIX_PATH.rst
index 276fdd6b97..e5d6aa1ef2 100644
--- a/Help/envvar/CMAKE_PREFIX_PATH.rst
+++ b/Help/envvar/CMAKE_PREFIX_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_PREFIX_PATH
-----------------
+.. versionadded:: 3.18
+
.. include:: ENV_VAR.txt
The ``CMAKE_PREFIX_PATH`` environment variable may be set to a list of
diff --git a/Help/envvar/CSFLAGS.rst b/Help/envvar/CSFLAGS.rst
index 87629827d4..e8c0a119ff 100644
--- a/Help/envvar/CSFLAGS.rst
+++ b/Help/envvar/CSFLAGS.rst
@@ -1,6 +1,8 @@
CSFLAGS
-------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``CSharp`` language files. Will only be
diff --git a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
index e1991b2df0..b27bc091cc 100644
--- a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
+++ b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
@@ -1,6 +1,8 @@
CTEST_INTERACTIVE_DEBUG_MODE
----------------------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Environment variable that will exist and be set to ``1`` when a test executed
diff --git a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
index d8b42624fa..9c6bd035ad 100644
--- a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
+++ b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
@@ -1,6 +1,8 @@
CTEST_OUTPUT_ON_FAILURE
-----------------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Boolean environment variable that controls if the output should be logged for
diff --git a/Help/envvar/CTEST_PARALLEL_LEVEL.rst b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
index fd4936e374..a21c783509 100644
--- a/Help/envvar/CTEST_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
@@ -1,6 +1,8 @@
CTEST_PARALLEL_LEVEL
--------------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Specify the number of tests for CTest to run in parallel. See :manual:`ctest(1)`
diff --git a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
index b36a6b8c2b..8c29d7d16d 100644
--- a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
+++ b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
@@ -1,6 +1,8 @@
CTEST_PROGRESS_OUTPUT
---------------------
+.. versionadded:: 3.13
+
.. include:: ENV_VAR.txt
Boolean environment variable that affects how :manual:`ctest <ctest(1)>`
diff --git a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
index 79dbb79f37..dffd63df45 100644
--- a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
+++ b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
@@ -1,6 +1,8 @@
CTEST_USE_LAUNCHERS_DEFAULT
---------------------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Initializes the :variable:`CTEST_USE_LAUNCHERS` variable if not already defined.
diff --git a/Help/envvar/CUDACXX.rst b/Help/envvar/CUDACXX.rst
index 10c0f9dd7f..1affab6140 100644
--- a/Help/envvar/CUDACXX.rst
+++ b/Help/envvar/CUDACXX.rst
@@ -1,6 +1,8 @@
CUDACXX
-------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``CUDA`` language files. Will only be used by
diff --git a/Help/envvar/CUDAFLAGS.rst b/Help/envvar/CUDAFLAGS.rst
index 14c5d84bd0..1f1bde5f0c 100644
--- a/Help/envvar/CUDAFLAGS.rst
+++ b/Help/envvar/CUDAFLAGS.rst
@@ -1,6 +1,8 @@
CUDAFLAGS
---------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Default compilation flags to be used when compiling ``CUDA`` files. Will only be
diff --git a/Help/envvar/CUDAHOSTCXX.rst b/Help/envvar/CUDAHOSTCXX.rst
index b9f65bd1e1..81c1228bba 100644
--- a/Help/envvar/CUDAHOSTCXX.rst
+++ b/Help/envvar/CUDAHOSTCXX.rst
@@ -1,6 +1,8 @@
CUDAHOSTCXX
-----------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Preferred executable for compiling host code when compiling ``CUDA``
diff --git a/Help/envvar/CXX.rst b/Help/envvar/CXX.rst
index d6553501a5..df927d53f4 100644
--- a/Help/envvar/CXX.rst
+++ b/Help/envvar/CXX.rst
@@ -1,6 +1,8 @@
CXX
---
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``CXX`` language files. Will only be used by
diff --git a/Help/envvar/CXXFLAGS.rst b/Help/envvar/CXXFLAGS.rst
index 460a347c54..a3cef77bd1 100644
--- a/Help/envvar/CXXFLAGS.rst
+++ b/Help/envvar/CXXFLAGS.rst
@@ -1,6 +1,8 @@
CXXFLAGS
--------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Default compilation flags to be used when compiling ``CXX`` (C++) files. Will
diff --git a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
index 6a52d6494e..76353428bb 100644
--- a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
+++ b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
@@ -1,6 +1,8 @@
DASHBOARD_TEST_FROM_CTEST
-------------------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Environment variable that will exist when a test executed by :manual:`ctest(1)`
diff --git a/Help/envvar/DESTDIR.rst b/Help/envvar/DESTDIR.rst
index d2144ae7c1..ee290f231c 100644
--- a/Help/envvar/DESTDIR.rst
+++ b/Help/envvar/DESTDIR.rst
@@ -1,6 +1,8 @@
DESTDIR
-------
+.. versionadded:: 3.12
+
.. include:: ENV_VAR.txt
On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the
diff --git a/Help/envvar/FC.rst b/Help/envvar/FC.rst
index d6cabbc90f..f1c26b00b3 100644
--- a/Help/envvar/FC.rst
+++ b/Help/envvar/FC.rst
@@ -1,6 +1,8 @@
FC
--
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``Fortran`` language files. Will only be used
diff --git a/Help/envvar/FFLAGS.rst b/Help/envvar/FFLAGS.rst
index 53bffb67f6..4c1f3d2d64 100644
--- a/Help/envvar/FFLAGS.rst
+++ b/Help/envvar/FFLAGS.rst
@@ -1,6 +1,8 @@
FFLAGS
------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Default compilation flags to be used when compiling ``Fortran`` files. Will only
diff --git a/Help/envvar/LDFLAGS.rst b/Help/envvar/LDFLAGS.rst
index 816d6ef77a..78b34f401f 100644
--- a/Help/envvar/LDFLAGS.rst
+++ b/Help/envvar/LDFLAGS.rst
@@ -1,6 +1,8 @@
LDFLAGS
-------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Will only be used by CMake on the first configuration to determine the default
diff --git a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
index 662bd03ec5..15587048ac 100644
--- a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
+++ b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
@@ -1,6 +1,8 @@
MACOSX_DEPLOYMENT_TARGET
------------------------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Specify the minimum version of macOS on which the target binaries are
diff --git a/Help/envvar/OBJC.rst b/Help/envvar/OBJC.rst
index 30c0d133b9..2d95806cbf 100644
--- a/Help/envvar/OBJC.rst
+++ b/Help/envvar/OBJC.rst
@@ -1,6 +1,8 @@
OBJC
----
+.. versionadded:: 3.16.7
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``OBJC`` language files. Will only be used
diff --git a/Help/envvar/OBJCXX.rst b/Help/envvar/OBJCXX.rst
index a72f7e7104..71286d9dd2 100644
--- a/Help/envvar/OBJCXX.rst
+++ b/Help/envvar/OBJCXX.rst
@@ -1,6 +1,8 @@
OBJCXX
------
+.. versionadded:: 3.16.7
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``OBJCXX`` language files. Will only be used
diff --git a/Help/envvar/PackageName_ROOT.rst b/Help/envvar/PackageName_ROOT.rst
index 82b0a069e3..fc2a1d5f1f 100644
--- a/Help/envvar/PackageName_ROOT.rst
+++ b/Help/envvar/PackageName_ROOT.rst
@@ -1,6 +1,8 @@
<PackageName>_ROOT
------------------
+.. versionadded:: 3.12.1
+
.. include:: ENV_VAR.txt
Calls to :command:`find_package(<PackageName>)` will search in prefixes
diff --git a/Help/envvar/RC.rst b/Help/envvar/RC.rst
index 557520e8f4..3ec17881ab 100644
--- a/Help/envvar/RC.rst
+++ b/Help/envvar/RC.rst
@@ -1,6 +1,8 @@
RC
--
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``resource`` files. Will only be used by CMake
diff --git a/Help/envvar/RCFLAGS.rst b/Help/envvar/RCFLAGS.rst
index bc43cb212c..f33a9a88c0 100644
--- a/Help/envvar/RCFLAGS.rst
+++ b/Help/envvar/RCFLAGS.rst
@@ -1,6 +1,8 @@
RCFLAGS
-------
+.. versionadded:: 3.10
+
.. include:: ENV_VAR.txt
Default compilation flags to be used when compiling ``resource`` files. Will
diff --git a/Help/envvar/SWIFTC.rst b/Help/envvar/SWIFTC.rst
index b12e51df97..ce01ca212b 100644
--- a/Help/envvar/SWIFTC.rst
+++ b/Help/envvar/SWIFTC.rst
@@ -1,6 +1,8 @@
SWIFTC
------
+.. versionadded:: 3.15
+
.. include:: ENV_VAR.txt
Preferred executable for compiling ``Swift`` language files. Will only be used by
diff --git a/Help/envvar/VERBOSE.rst b/Help/envvar/VERBOSE.rst
index 2d775a5bec..5911951bf3 100644
--- a/Help/envvar/VERBOSE.rst
+++ b/Help/envvar/VERBOSE.rst
@@ -1,6 +1,8 @@
VERBOSE
-------
+.. versionadded:: 3.14
+
Activates verbose output from CMake and your build tools of choice when
you start to actually build your project.
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index dffc6795df..2246699d93 100644
--- a/Help/generator/Green Hills MULTI.rst
+++ b/Help/generator/Green Hills MULTI.rst
@@ -1,6 +1,8 @@
Green Hills MULTI
-----------------
+.. versionadded:: 3.3
+
Generates Green Hills MULTI project files (experimental, work-in-progress).
The buildsystem has predetermined build-configuration settings that can be controlled
diff --git a/Help/generator/Ninja Multi-Config.rst b/Help/generator/Ninja Multi-Config.rst
index f480eb82e6..e6c7a1cdff 100644
--- a/Help/generator/Ninja Multi-Config.rst
+++ b/Help/generator/Ninja Multi-Config.rst
@@ -1,6 +1,8 @@
Ninja Multi-Config
------------------
+.. versionadded:: 3.17
+
Generates multiple ``build-<Config>.ninja`` files.
This generator is very much like the :generator:`Ninja` generator, but with
diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst
index 7383f7a6f9..401845de9d 100644
--- a/Help/generator/Visual Studio 14 2015.rst
+++ b/Help/generator/Visual Studio 14 2015.rst
@@ -1,6 +1,8 @@
Visual Studio 14 2015
---------------------
+.. versionadded:: 3.1
+
Generates Visual Studio 14 (VS 2015) project files.
Project Types
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index 7e6f0fb20f..e7baaadb67 100644
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@ -1,6 +1,8 @@
Visual Studio 15 2017
---------------------
+.. versionadded:: 3.7.1
+
Generates Visual Studio 15 (VS 2017) project files.
Project Types
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
index 4aec7f73cc..3da80915ad 100644
--- a/Help/generator/Visual Studio 16 2019.rst
+++ b/Help/generator/Visual Studio 16 2019.rst
@@ -1,6 +1,8 @@
Visual Studio 16 2019
---------------------
+.. versionadded:: 3.14
+
Generates Visual Studio 16 (VS 2019) project files.
Project Types
diff --git a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
index c911625b80..a47d5e027a 100644
--- a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt
@@ -57,7 +57,11 @@ set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
# install rules
-install(TARGETS MathFunctions tutorial_compiler_flags
+set(installable_libs MathFunctions tutorial_compiler_flags)
+if(TARGET SqrtLibrary)
+ list(APPEND installable_libs SqrtLibrary)
+endif()
+install(TARGETS ${installable_libs}
DESTINATION lib
EXPORT MathFunctionsTargets)
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt
index e0c06214cc..0bfe20c100 100644
--- a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt
@@ -47,5 +47,9 @@ endif()
target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
# install rules
-install(TARGETS MathFunctions DESTINATION lib)
+set(installable_libs MathFunctions)
+if(TARGET SqrtLibrary)
+ list(APPEND installable_libs SqrtLibrary)
+endif()
+install(TARGETS ${installable_libs} DESTINATION lib)
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
index 32f5e084ad..0d287ca899 100644
--- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
@@ -51,5 +51,9 @@ target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
# install rules
-install(TARGETS MathFunctions DESTINATION lib)
+set(installable_libs MathFunctions tutorial_compiler_flags)
+if(TARGET SqrtLibrary)
+ list(APPEND installable_libs SqrtLibrary)
+endif()
+install(TARGETS ${installable_libs} DESTINATION lib)
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt
index 720ee64376..ea3861c1f5 100644
--- a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt
@@ -53,7 +53,11 @@ target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
# install rules
-install(TARGETS MathFunctions tutorial_compiler_flags
+set(installable_libs MathFunctions tutorial_compiler_flags)
+if(TARGET SqrtLibrary)
+ list(APPEND installable_libs SqrtLibrary)
+endif()
+install(TARGETS ${installable_libs}
DESTINATION lib
EXPORT MathFunctionsTargets)
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst
index 6e26de977e..665d123f68 100644
--- a/Help/guide/tutorial/index.rst
+++ b/Help/guide/tutorial/index.rst
@@ -81,8 +81,8 @@ replaced.
Next modify ``tutorial.cxx`` to include the configured header file,
``TutorialConfig.h``.
-Finally, let's print out the version number by updating ``tutorial.cxx`` as
-follows:
+Finally, let's print out the executable name and version number by updating
+``tutorial.cxx`` as follows:
.. literalinclude:: Step2/tutorial.cxx
:language: c++
@@ -106,7 +106,8 @@ correct flags. The easiest way to enable support for a specific C++ standard
in CMake is by using the :variable:`CMAKE_CXX_STANDARD` variable. For this
tutorial, set the :variable:`CMAKE_CXX_STANDARD` variable in the
``CMakeLists.txt`` file to 11 and :variable:`CMAKE_CXX_STANDARD_REQUIRED` to
-True:
+True. Make sure to add the ``CMAKE_CXX_STANDARD`` declarations above the call
+to ``add_executable``.
.. literalinclude:: Step2/CMakeLists.txt
:language: cmake
@@ -120,18 +121,28 @@ Run the :manual:`cmake <cmake(1)>` executable or the
with your chosen build tool.
For example, from the command line we could navigate to the
-``Help/guide/tutorial`` directory of the CMake source code tree and run the
-following commands:
+``Help/guide/tutorial`` directory of the CMake source code tree and create a
+build directory:
.. code-block:: console
mkdir Step1_build
+
+Next, navigate to the build directory and run CMake to configure the project
+and generate a native build system:
+
+.. code-block:: console
+
cd Step1_build
cmake ../Step1
+
+Then call that build system to actually compile/link the project:
+
+.. code-block:: console
+
cmake --build .
-Navigate to the directory where Tutorial was built (likely the make directory
-or a Debug or Release build configuration subdirectory) and run these commands:
+Finally, try to use the newly built ``Tutorial`` with these commands:
.. code-block:: console
@@ -212,8 +223,9 @@ libraries to later be linked into the executable. The variable
classic approach when dealing with many optional components, we will cover
the modern approach in the next step.
-The corresponding changes to the source code are fairly straightforward. First,
-in ``tutorial.cxx``, include the ``MathFunctions.h`` header if we need it:
+The corresponding changes to the source code are fairly straightforward.
+First, in ``tutorial.cxx``, include the ``MathFunctions.h`` header if we
+need it:
.. literalinclude:: Step3/tutorial.cxx
:language: c++
@@ -242,8 +254,17 @@ Run the :manual:`cmake <cmake(1)>` executable or the
:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
with your chosen build tool. Then run the built Tutorial executable.
-Use the :manual:`ccmake <ccmake(1)>` executable or the :manual:`cmake-gui <cmake-gui(1)>`
-to update the value of ``USE_MYMATH``. Rebuild and run the tutorial again.
+Now let's update the value of ``USE_MYMATH``. The easiest way is to use the
+:manual:`cmake-gui <cmake-gui(1)>` or :manual:`ccmake <ccmake(1)>` if you're
+in the terminal. Or, alternatively, if you want to change the option from the
+command-line, try:
+
+.. code-block:: console
+
+ cmake ../Step2 -DUSE_MYMATH=OFF
+
+Rebuild and run the tutorial again.
+
Which function gives better results, sqrt or mysqrt?
Adding Usage Requirements for Library (Step 3)
@@ -320,21 +341,32 @@ And to the end of the top-level ``CMakeLists.txt`` we add:
That is all that is needed to create a basic local install of the tutorial.
-Run the :manual:`cmake <cmake(1)>` executable or the
+Now run the :manual:`cmake <cmake(1)>` executable or the
:manual:`cmake-gui <cmake-gui(1)>` to configure the project and then build it
-with your chosen build tool. Run the install step by using the ``install``
-option of the :manual:`cmake <cmake(1)>` command (introduced in 3.15, older
-versions of CMake must use ``make install``) from the command line, or build
-the ``INSTALL`` target from an IDE. This will install the appropriate header
-files, libraries, and executables.
+with your chosen build tool.
+
+Then run the install step by using the ``install`` option of the
+:manual:`cmake <cmake(1)>` command (introduced in 3.15, older versions of
+CMake must use ``make install``) from the command line. For
+multi-configuration tools, don't forget to use the ``--config`` argument to
+specify the configuration. If using an IDE, simply build the ``INSTALL``
+target. This step will install the appropriate header files, libraries, and
+executables. For example:
+
+.. code-block:: console
+
+ cmake --install .
The CMake variable :variable:`CMAKE_INSTALL_PREFIX` is used to determine the
-root of where the files will be installed. If using ``cmake --install`` a
-custom installation directory can be given via the ``--prefix`` argument. For
-multi-configuration tools, use the ``--config`` argument to specify the
-configuration.
+root of where the files will be installed. If using the ``cmake --install``
+command, the installation prefix can be overridden via the ``--prefix``
+argument. For example:
+
+.. code-block:: console
+
+ cmake --install . --prefix "/home/myuser/installdir"
-Verify that the installed Tutorial runs.
+Navigate to the install directory and verify that the installed Tutorial runs.
Testing Support
---------------
@@ -520,6 +552,7 @@ We also have to add the current binary directory to the list of include
directories so that ``Table.h`` can be found and included by ``mysqrt.cxx``.
.. literalinclude:: Step7/MathFunctions/CMakeLists.txt
+ :language: cmake
:start-after: # state that we depend on our bin
:end-before: # install rules
@@ -675,9 +708,9 @@ The first step is to update the starting section of the top-level
Now that we have made MathFunctions always be used, we will need to update
the logic of that library. So, in ``MathFunctions/CMakeLists.txt`` we need to
-create a SqrtLibrary that will conditionally be built when ``USE_MYMATH`` is
-enabled. Now, since this is a tutorial, we are going to explicitly require
-that SqrtLibrary is built statically.
+create a SqrtLibrary that will conditionally be built and installed when
+``USE_MYMATH`` is enabled. Now, since this is a tutorial, we are going to
+explicitly require that SqrtLibrary is built statically.
The end result is that ``MathFunctions/CMakeLists.txt`` should look like:
@@ -703,7 +736,7 @@ Finally, update ``MathFunctions/MathFunctions.h`` to use dll export defines:
.. literalinclude:: Step10/MathFunctions/MathFunctions.h
:language: c++
-At this point, if you build everything, you will notice that linking fails
+At this point, if you build everything, you may notice that linking fails
as we are combining a static library without position independent code with a
library that has position independent code. The solution to this is to
explicitly set the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property of
@@ -750,7 +783,7 @@ A common usage of
:manual:`generator expressions <cmake-generator-expressions(7)>` is to
conditionally add compiler flags, such as those for language levels or
warnings. A nice pattern is to associate this information to an ``INTERFACE``
-target allowing this information to propagate. Lets start by constructing an
+target allowing this information to propagate. Let's start by constructing an
``INTERFACE`` target and specifying the required C++ standard level of ``11``
instead of using :variable:`CMAKE_CXX_STANDARD`.
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
index cc50952d69..34edc56806 100644
--- a/Help/manual/cmake-file-api.7.rst
+++ b/Help/manual/cmake-file-api.7.rst
@@ -425,7 +425,7 @@ Version 1 does not exist to avoid confusion with that from
{
"kind": "codemodel",
- "version": { "major": 2, "minor": 1 },
+ "version": { "major": 2, "minor": 2 },
"paths": {
"source": "/path/to/top-level-source-dir",
"build": "/path/to/top-level-build-dir"
@@ -869,6 +869,26 @@ with members:
A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``)
of the toolchain is used to compile the source file.
+ ``languageStandard``
+ Optional member that is present when the language standard is set
+ explicitly (e.g. via :prop_tgt:`CXX_STANDARD`) or implicitly by
+ compile features. Each entry is a JSON object with two members:
+
+ ``backtraces``
+ Optional member that is present when a CMake language backtrace to
+ the ``<LANG>_STANDARD`` setting is available. If the language
+ standard was set implicitly by compile features those are used as
+ the backtrace(s). It's possible for multiple compile features to
+ require the same language standard so there could be multiple
+ backtraces. The value is a JSON array with each entry being an
+ unsigned integer 0-based index into the ``backtraceGraph``
+ member's ``nodes`` array.
+
+ ``standard``
+ String representing the language standard.
+
+ This field was added in codemodel version 2.2.
+
``compileCommandFragments``
Optional member that is present when fragments of the compiler command
line invocation are available. The value is a JSON array of entries
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 124da4414d..c7f6b2703e 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -105,10 +105,11 @@ Variable Queries
``$<TARGET_EXISTS:target>``
``1`` if ``target`` exists, else ``0``.
-``$<CONFIG:cfg>``
- ``1`` if config is ``cfg``, else ``0``. This is a case-insensitive comparison.
- The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by
- this expression when it is evaluated on a property on an :prop_tgt:`IMPORTED`
+``$<CONFIG:cfgs>``
+ ``1`` if config is any one of the entries in ``cfgs``, else ``0``. This is a
+ case-insensitive comparison. The mapping in
+ :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by this
+ expression when it is evaluated on a property on an :prop_tgt:`IMPORTED`
target.
``$<PLATFORM_ID:platform_ids>``
where ``platform_ids`` is a comma-separated list.
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index e98038ac6b..3ceb1dfc71 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,14 @@ Policies Introduced by CMake 3.18
.. toctree::
:maxdepth: 1
+ CMP0109: find_program() requires permission to execute but not to read. </policy/CMP0109>
+
+Policies Introduced by CMake 3.18
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
CMP0108: A target cannot link to itself through an alias. </policy/CMP0108>
CMP0107: An ALIAS target cannot overwrite another target. </policy/CMP0107>
CMP0106: The Documentation module is removed. </policy/CMP0106>
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 9becfc60d8..c5e0aaea3c 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -341,9 +341,9 @@ Options
Print a warning when an uninitialized variable is used.
``--warn-unused-vars``
- Warn about unused variables.
-
- Find variables that are declared or set, but not used.
+ Does nothing. In CMake versions 3.2 and below this enabled warnings about
+ unused variables. In CMake versions 3.3 through 3.18 the option was broken.
+ In CMake 3.19 and above the option has been removed.
``--no-warn-unused-cli``
Don't warn about command line options.
@@ -359,7 +359,7 @@ Options
This flag tells CMake to warn about other files as well.
``--profiling-output=<path>``
- Used in conjuction with ``--profiling-format`` to output to a given path.
+ Used in conjunction with ``--profiling-format`` to output to a given path.
``--profiling-format=<file>``
Enable the output of profiling data of CMake script in the given format.
@@ -450,6 +450,9 @@ The options are:
``--component <comp>``
Component-based install. Only install component ``<comp>``.
+``--default-directory-permissions <permissions>``
+ Default directory install permissions. Permissions in format ``<u=rwx,g=rx,o=rx>``.
+
``--prefix <prefix>``
Override the installation prefix, :variable:`CMAKE_INSTALL_PREFIX`.
@@ -566,7 +569,8 @@ Available commands are:
``compare_files [--ignore-eol] <file1> <file2>``
Check if ``<file1>`` is same as ``<file2>``. If files are the same,
- then returns ``0``, if not it returns ``1``. The ``--ignore-eol`` option
+ then returns ``0``, if not it returns ``1``. In case of invalid
+ arguments, it returns 2. The ``--ignore-eol`` option
implies line-wise comparison and ignores LF/CRLF differences.
``copy <file>... <destination>``
@@ -594,6 +598,13 @@ Available commands are:
.. note::
Path to where ``<new>`` symbolic link will be created has to exist beforehand.
+``create_hardlink <old> <new>``
+ Create a hard link ``<new>`` naming ``<old>``.
+
+ .. note::
+ Path to where ``<new>`` hard link will be created has to exist beforehand.
+ ``<old>`` has to exist beforehand.
+
``echo [<string>...]``
Displays arguments as text.
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index d3ab75a927..b5bb1c12df 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -1333,7 +1333,7 @@ Resource Allocation
===================
CTest provides a mechanism for tests to specify the resources that they need
-in a fine-grained way, and for users to specify the resources availiable on
+in a fine-grained way, and for users to specify the resources available on
the running machine. This allows CTest to internally keep track of which
resources are in use and which are free, scheduling tests in a way that
prevents them from trying to claim resources that are not available.
diff --git a/Help/module/CPackArchive.rst b/Help/module/CPackArchive.rst
index 8616098cb7..f5d6da4b5f 100644
--- a/Help/module/CPackArchive.rst
+++ b/Help/module/CPackArchive.rst
@@ -1,4 +1,6 @@
CPackArchive
------------
+.. versionadded:: 3.9
+
The documentation for the CPack Archive generator has moved here: :cpack_gen:`CPack Archive Generator`
diff --git a/Help/module/CPackFreeBSD.rst b/Help/module/CPackFreeBSD.rst
index 69701b8e95..7ae6164c72 100644
--- a/Help/module/CPackFreeBSD.rst
+++ b/Help/module/CPackFreeBSD.rst
@@ -1,4 +1,6 @@
CPackFreeBSD
------------
+.. versionadded:: 3.10
+
The documentation for the CPack FreeBSD generator has moved here: :cpack_gen:`CPack FreeBSD Generator`
diff --git a/Help/module/CPackNuGet.rst b/Help/module/CPackNuGet.rst
index 4f39b3a7ec..bbed7f9f3f 100644
--- a/Help/module/CPackNuGet.rst
+++ b/Help/module/CPackNuGet.rst
@@ -1,4 +1,6 @@
CPackNuGet
----------
+.. versionadded:: 3.12
+
The documentation for the CPack NuGet generator has moved here: :cpack_gen:`CPack NuGet Generator`
diff --git a/Help/module/CPackProductBuild.rst b/Help/module/CPackProductBuild.rst
index 8cd9198b48..e12cd32da5 100644
--- a/Help/module/CPackProductBuild.rst
+++ b/Help/module/CPackProductBuild.rst
@@ -1,4 +1,6 @@
CPackProductBuild
-----------------
+.. versionadded:: 3.7
+
The documentation for the CPack productbuild generator has moved here: :cpack_gen:`CPack productbuild Generator`
diff --git a/Help/policy/CMP0051.rst b/Help/policy/CMP0051.rst
index 6b679e5b41..053bc97576 100644
--- a/Help/policy/CMP0051.rst
+++ b/Help/policy/CMP0051.rst
@@ -1,6 +1,8 @@
CMP0051
-------
+.. versionadded:: 3.1
+
List TARGET_OBJECTS in SOURCES target property.
CMake 3.0 and lower did not include the ``TARGET_OBJECTS``
diff --git a/Help/policy/CMP0052.rst b/Help/policy/CMP0052.rst
index ee2e6e8dea..c75f9ab4cf 100644
--- a/Help/policy/CMP0052.rst
+++ b/Help/policy/CMP0052.rst
@@ -1,6 +1,8 @@
CMP0052
-------
+.. versionadded:: 3.1
+
Reject source and build dirs in installed
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`.
diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst
index 032b3e5c63..9b18b2dfd0 100644
--- a/Help/policy/CMP0053.rst
+++ b/Help/policy/CMP0053.rst
@@ -1,6 +1,8 @@
CMP0053
-------
+.. versionadded:: 3.1
+
Simplify variable reference and escape sequence evaluation.
CMake 3.1 introduced a much faster implementation of evaluation of the
diff --git a/Help/policy/CMP0054.rst b/Help/policy/CMP0054.rst
index 1e000a6624..c7ae0190a0 100644
--- a/Help/policy/CMP0054.rst
+++ b/Help/policy/CMP0054.rst
@@ -1,6 +1,8 @@
CMP0054
-------
+.. versionadded:: 3.1
+
Only interpret :command:`if` arguments as variables or keywords when unquoted.
CMake 3.1 and above no longer implicitly dereference variables or
diff --git a/Help/policy/CMP0055.rst b/Help/policy/CMP0055.rst
index bc5ad086b3..47cac8ea37 100644
--- a/Help/policy/CMP0055.rst
+++ b/Help/policy/CMP0055.rst
@@ -1,6 +1,8 @@
CMP0055
-------
+.. versionadded:: 3.2
+
Strict checking for the :command:`break` command.
CMake 3.1 and lower allowed calls to the :command:`break` command
diff --git a/Help/policy/CMP0056.rst b/Help/policy/CMP0056.rst
index 834da844f7..628a6a19af 100644
--- a/Help/policy/CMP0056.rst
+++ b/Help/policy/CMP0056.rst
@@ -1,6 +1,8 @@
CMP0056
-------
+.. versionadded:: 3.2
+
Honor link flags in :command:`try_compile` source-file signature.
The :command:`try_compile` command source-file signature generates a
diff --git a/Help/policy/CMP0057.rst b/Help/policy/CMP0057.rst
index 83db1863db..76aebfb870 100644
--- a/Help/policy/CMP0057.rst
+++ b/Help/policy/CMP0057.rst
@@ -1,6 +1,8 @@
CMP0057
-------
+.. versionadded:: 3.3
+
Support new :command:`if` IN_LIST operator.
CMake 3.3 adds support for the new IN_LIST operator.
diff --git a/Help/policy/CMP0058.rst b/Help/policy/CMP0058.rst
index 05efd48fbe..06cc74b5f9 100644
--- a/Help/policy/CMP0058.rst
+++ b/Help/policy/CMP0058.rst
@@ -1,6 +1,8 @@
CMP0058
-------
+.. versionadded:: 3.3
+
Ninja requires custom command byproducts to be explicit.
When an intermediate file generated during the build is consumed
diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst
index bce982e10d..6317d05672 100644
--- a/Help/policy/CMP0059.rst
+++ b/Help/policy/CMP0059.rst
@@ -1,6 +1,8 @@
CMP0059
-------
+.. versionadded:: 3.3
+
Do not treat ``DEFINITIONS`` as a built-in directory property.
CMake 3.3 and above no longer make a list of definitions available through
diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst
index 98ac2cf699..09257d14a0 100644
--- a/Help/policy/CMP0060.rst
+++ b/Help/policy/CMP0060.rst
@@ -1,6 +1,8 @@
CMP0060
-------
+.. versionadded:: 3.3
+
Link libraries by full path even in implicit directories.
Policy :policy:`CMP0003` was introduced with the intention of always
diff --git a/Help/policy/CMP0061.rst b/Help/policy/CMP0061.rst
index 57e4161d08..aca551d630 100644
--- a/Help/policy/CMP0061.rst
+++ b/Help/policy/CMP0061.rst
@@ -1,6 +1,8 @@
CMP0061
-------
+.. versionadded:: 3.3
+
CTest does not by default tell ``make`` to ignore errors (``-i``).
The :command:`ctest_build` and :command:`build_command` commands no
diff --git a/Help/policy/CMP0062.rst b/Help/policy/CMP0062.rst
index 0db7aafd0e..01e93f0915 100644
--- a/Help/policy/CMP0062.rst
+++ b/Help/policy/CMP0062.rst
@@ -1,6 +1,8 @@
CMP0062
-------
+.. versionadded:: 3.3
+
Disallow :command:`install` of :command:`export` result.
The :command:`export()` command generates a file containing
diff --git a/Help/policy/CMP0063.rst b/Help/policy/CMP0063.rst
index d736d06347..fec3ad860f 100644
--- a/Help/policy/CMP0063.rst
+++ b/Help/policy/CMP0063.rst
@@ -1,6 +1,8 @@
CMP0063
-------
+.. versionadded:: 3.3
+
Honor visibility properties for all target types.
The :prop_tgt:`<LANG>_VISIBILITY_PRESET` and
diff --git a/Help/policy/CMP0064.rst b/Help/policy/CMP0064.rst
index e9a061ba1a..0c20c13359 100644
--- a/Help/policy/CMP0064.rst
+++ b/Help/policy/CMP0064.rst
@@ -1,6 +1,8 @@
CMP0064
-------
+.. versionadded:: 3.4
+
Recognize ``TEST`` as a operator for the :command:`if` command.
The ``TEST`` operator was added to the :command:`if` command to determine if a
diff --git a/Help/policy/CMP0065.rst b/Help/policy/CMP0065.rst
index b820aad510..8968b916e3 100644
--- a/Help/policy/CMP0065.rst
+++ b/Help/policy/CMP0065.rst
@@ -1,6 +1,8 @@
CMP0065
-------
+.. versionadded:: 3.4
+
Do not add flags to export symbols from executables without
the :prop_tgt:`ENABLE_EXPORTS` target property.
diff --git a/Help/policy/CMP0066.rst b/Help/policy/CMP0066.rst
index e110ae1275..b08430ff0a 100644
--- a/Help/policy/CMP0066.rst
+++ b/Help/policy/CMP0066.rst
@@ -1,6 +1,8 @@
CMP0066
-------
+.. versionadded:: 3.7
+
Honor per-config flags in :command:`try_compile` source-file signature.
The source file signature of the :command:`try_compile` command uses the value
diff --git a/Help/policy/CMP0067.rst b/Help/policy/CMP0067.rst
index f802787ff9..8358bb2569 100644
--- a/Help/policy/CMP0067.rst
+++ b/Help/policy/CMP0067.rst
@@ -1,6 +1,8 @@
CMP0067
-------
+.. versionadded:: 3.8
+
Honor language standard in :command:`try_compile` source-file signature.
The :command:`try_compile` source file signature is intended to allow
diff --git a/Help/policy/CMP0068.rst b/Help/policy/CMP0068.rst
index 978a6e34fd..5d2a4b1d8b 100644
--- a/Help/policy/CMP0068.rst
+++ b/Help/policy/CMP0068.rst
@@ -1,6 +1,8 @@
CMP0068
-------
+.. versionadded:: 3.9
+
``RPATH`` settings on macOS do not affect ``install_name``.
CMake 3.9 and newer remove any effect the following settings may have on the
diff --git a/Help/policy/CMP0069.rst b/Help/policy/CMP0069.rst
index 0d5ddfde94..eafac453f7 100644
--- a/Help/policy/CMP0069.rst
+++ b/Help/policy/CMP0069.rst
@@ -1,6 +1,8 @@
CMP0069
-------
+.. versionadded:: 3.9
+
:prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` is enforced when enabled.
CMake 3.9 and newer prefer to add IPO flags whenever the
diff --git a/Help/policy/CMP0070.rst b/Help/policy/CMP0070.rst
index 0fb3617797..c880d1f8a4 100644
--- a/Help/policy/CMP0070.rst
+++ b/Help/policy/CMP0070.rst
@@ -1,6 +1,8 @@
CMP0070
-------
+.. versionadded:: 3.10
+
Define :command:`file(GENERATE)` behavior for relative paths.
CMake 3.10 and newer define that relative paths given to ``INPUT`` and
diff --git a/Help/policy/CMP0071.rst b/Help/policy/CMP0071.rst
index 855ecf0e9c..700d3b0eb4 100644
--- a/Help/policy/CMP0071.rst
+++ b/Help/policy/CMP0071.rst
@@ -1,6 +1,8 @@
CMP0071
-------
+.. versionadded:: 3.10
+
Let :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` process
:prop_sf:`GENERATED` files.
diff --git a/Help/policy/CMP0072.rst b/Help/policy/CMP0072.rst
index 3abbad7903..1dcdfef84d 100644
--- a/Help/policy/CMP0072.rst
+++ b/Help/policy/CMP0072.rst
@@ -1,6 +1,8 @@
CMP0072
-------
+.. versionadded:: 3.11
+
:module:`FindOpenGL` prefers GLVND by default when available.
The :module:`FindOpenGL` module provides an ``OpenGL::GL`` target and an
diff --git a/Help/policy/CMP0073.rst b/Help/policy/CMP0073.rst
index 9bfa0e9057..8f0345c011 100644
--- a/Help/policy/CMP0073.rst
+++ b/Help/policy/CMP0073.rst
@@ -1,6 +1,8 @@
CMP0073
-------
+.. versionadded:: 3.12
+
Do not produce legacy ``_LIB_DEPENDS`` cache entries.
Ancient CMake versions once used ``<tgt>_LIB_DEPENDS`` cache entries to
diff --git a/Help/policy/CMP0074.rst b/Help/policy/CMP0074.rst
index 63ebf7b434..863bbb2048 100644
--- a/Help/policy/CMP0074.rst
+++ b/Help/policy/CMP0074.rst
@@ -1,6 +1,8 @@
CMP0074
-------
+.. versionadded:: 3.12
+
:command:`find_package` uses ``<PackageName>_ROOT`` variables.
In CMake 3.12 and above the :command:`find_package(<PackageName>)` command now
diff --git a/Help/policy/CMP0075.rst b/Help/policy/CMP0075.rst
index aa5c3f76f7..4213782498 100644
--- a/Help/policy/CMP0075.rst
+++ b/Help/policy/CMP0075.rst
@@ -1,6 +1,8 @@
CMP0075
-------
+.. versionadded:: 3.12
+
Include file check macros honor ``CMAKE_REQUIRED_LIBRARIES``.
In CMake 3.12 and above, the
diff --git a/Help/policy/CMP0076.rst b/Help/policy/CMP0076.rst
index dd25f80c66..edca742b0b 100644
--- a/Help/policy/CMP0076.rst
+++ b/Help/policy/CMP0076.rst
@@ -1,6 +1,8 @@
CMP0076
-------
+.. versionadded:: 3.13
+
The :command:`target_sources` command converts relative paths to absolute.
In CMake 3.13 and above, the :command:`target_sources` command now converts
diff --git a/Help/policy/CMP0077.rst b/Help/policy/CMP0077.rst
index 44797b648b..174cde91bc 100644
--- a/Help/policy/CMP0077.rst
+++ b/Help/policy/CMP0077.rst
@@ -1,6 +1,8 @@
CMP0077
-------
+.. versionadded:: 3.13
+
:command:`option` honors normal variables.
The :command:`option` command is typically used to create a cache entry
diff --git a/Help/policy/CMP0078.rst b/Help/policy/CMP0078.rst
index 2e97934f46..89fdb0b5d8 100644
--- a/Help/policy/CMP0078.rst
+++ b/Help/policy/CMP0078.rst
@@ -1,6 +1,8 @@
CMP0078
-------
+.. versionadded:: 3.13
+
:module:`UseSWIG` generates standard target names.
Starting with CMake 3.13, :module:`UseSWIG` generates now standard target
diff --git a/Help/policy/CMP0079.rst b/Help/policy/CMP0079.rst
index 0244d6ca63..01aa08dfe5 100644
--- a/Help/policy/CMP0079.rst
+++ b/Help/policy/CMP0079.rst
@@ -1,6 +1,8 @@
CMP0079
-------
+.. versionadded:: 3.13
+
:command:`target_link_libraries` allows use with targets in other directories.
Prior to CMake 3.13 the :command:`target_link_libraries` command did not
diff --git a/Help/policy/CMP0080.rst b/Help/policy/CMP0080.rst
index 5ce9591dae..789efea679 100644
--- a/Help/policy/CMP0080.rst
+++ b/Help/policy/CMP0080.rst
@@ -1,6 +1,8 @@
CMP0080
-------
+.. versionadded:: 3.13
+
:module:`BundleUtilities` cannot be included at configure time.
The macros provided by :module:`BundleUtilities` are intended to be invoked
diff --git a/Help/policy/CMP0081.rst b/Help/policy/CMP0081.rst
index d3b2872c44..d1573dd527 100644
--- a/Help/policy/CMP0081.rst
+++ b/Help/policy/CMP0081.rst
@@ -1,6 +1,8 @@
CMP0081
-------
+.. versionadded:: 3.13
+
Relative paths not allowed in :prop_tgt:`LINK_DIRECTORIES` target property.
CMake 3.12 and lower allowed the :prop_dir:`LINK_DIRECTORIES` directory
diff --git a/Help/policy/CMP0082.rst b/Help/policy/CMP0082.rst
index d887616be2..25c958043a 100644
--- a/Help/policy/CMP0082.rst
+++ b/Help/policy/CMP0082.rst
@@ -1,6 +1,8 @@
CMP0082
-------
+.. versionadded:: 3.14
+
Install rules from :command:`add_subdirectory` calls are interleaved with
those in caller.
diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst
index e0b09cff55..7518ee334c 100644
--- a/Help/policy/CMP0083.rst
+++ b/Help/policy/CMP0083.rst
@@ -1,6 +1,8 @@
CMP0083
-------
+.. versionadded:: 3.14
+
To control generation of Position Independent Executable (``PIE``) or not, some
flags are required at link time.
diff --git a/Help/policy/CMP0084.rst b/Help/policy/CMP0084.rst
index 713d295f86..954770169f 100644
--- a/Help/policy/CMP0084.rst
+++ b/Help/policy/CMP0084.rst
@@ -1,6 +1,8 @@
CMP0084
-------
+.. versionadded:: 3.14
+
The :module:`FindQt` module does not exist for :command:`find_package`.
The existence of :module:`FindQt` means that for Qt upstream to provide
diff --git a/Help/policy/CMP0085.rst b/Help/policy/CMP0085.rst
index d9ec9a2079..d90c72ff69 100644
--- a/Help/policy/CMP0085.rst
+++ b/Help/policy/CMP0085.rst
@@ -1,6 +1,8 @@
CMP0085
-------
+.. versionadded:: 3.14
+
``$<IN_LIST:...>`` handles empty list items.
In CMake 3.13 and lower, the ``$<IN_LIST:...>`` generator expression always
diff --git a/Help/policy/CMP0086.rst b/Help/policy/CMP0086.rst
index 4a9e8b80a4..725b5020d2 100644
--- a/Help/policy/CMP0086.rst
+++ b/Help/policy/CMP0086.rst
@@ -1,6 +1,8 @@
CMP0086
-------
+.. versionadded:: 3.14
+
:module:`UseSWIG` honors ``SWIG_MODULE_NAME`` via ``-module`` flag.
Starting with CMake 3.14, :module:`UseSWIG` passes option
diff --git a/Help/policy/CMP0087.rst b/Help/policy/CMP0087.rst
index 4c45b99e4c..4a6550675c 100644
--- a/Help/policy/CMP0087.rst
+++ b/Help/policy/CMP0087.rst
@@ -1,6 +1,8 @@
CMP0087
-------
+.. versionadded:: 3.14
+
:command:`install(CODE)` and :command:`install(SCRIPT)` support generator
expressions.
diff --git a/Help/policy/CMP0088.rst b/Help/policy/CMP0088.rst
index 82c04ef7b4..1840a588b7 100644
--- a/Help/policy/CMP0088.rst
+++ b/Help/policy/CMP0088.rst
@@ -1,6 +1,8 @@
CMP0088
-------
+.. versionadded:: 3.14
+
:module:`FindBISON` runs bison in :variable:`CMAKE_CURRENT_BINARY_DIR`
when executing.
diff --git a/Help/policy/CMP0089.rst b/Help/policy/CMP0089.rst
index 029de55342..e3fc77a5b1 100644
--- a/Help/policy/CMP0089.rst
+++ b/Help/policy/CMP0089.rst
@@ -1,6 +1,8 @@
CMP0089
-------
+.. versionadded:: 3.15
+
Compiler id for IBM Clang-based XL compilers is now ``XLClang``.
CMake 3.15 and above recognize that IBM's Clang-based XL compilers
diff --git a/Help/policy/CMP0090.rst b/Help/policy/CMP0090.rst
index 720c17c2ab..58dd999724 100644
--- a/Help/policy/CMP0090.rst
+++ b/Help/policy/CMP0090.rst
@@ -1,6 +1,8 @@
CMP0090
-------
+.. versionadded:: 3.15
+
:command:`export(PACKAGE)` does not populate package registry by default.
In CMake 3.14 and below the :command:`export(PACKAGE)` command populated the
diff --git a/Help/policy/CMP0091.rst b/Help/policy/CMP0091.rst
index 1a5878a1fc..ffc0ade31a 100644
--- a/Help/policy/CMP0091.rst
+++ b/Help/policy/CMP0091.rst
@@ -1,6 +1,8 @@
CMP0091
-------
+.. versionadded:: 3.15
+
MSVC runtime library flags are selected by an abstraction.
Compilers targeting the MSVC ABI have flags to select the MSVC runtime library.
diff --git a/Help/policy/CMP0092.rst b/Help/policy/CMP0092.rst
index 8d3a288ae8..2f39830631 100644
--- a/Help/policy/CMP0092.rst
+++ b/Help/policy/CMP0092.rst
@@ -1,6 +1,8 @@
CMP0092
-------
+.. versionadded:: 3.15
+
MSVC warning flags are not in :variable:`CMAKE_<LANG>_FLAGS` by default.
When using MSVC-like compilers in CMake 3.14 and below, warning flags
@@ -16,7 +18,7 @@ CMake 3.15 and above prefer to leave out warning flags from the value of
This policy provides compatibility with projects that have not been updated
to expect the lack of warning flags. The policy setting takes effect as of
the first :command:`project` or :command:`enable_language` command that
-initializes :variable:`CMAKE_<LANG>_FLAGS` for a given lanuage ``<LANG>``.
+initializes :variable:`CMAKE_<LANG>_FLAGS` for a given language ``<LANG>``.
.. note::
diff --git a/Help/policy/CMP0093.rst b/Help/policy/CMP0093.rst
index 0ffc493de5..4a9955fdcf 100644
--- a/Help/policy/CMP0093.rst
+++ b/Help/policy/CMP0093.rst
@@ -1,6 +1,8 @@
CMP0093
-------
+.. versionadded:: 3.15
+
:module:`FindBoost` reports ``Boost_VERSION`` in ``x.y.z`` format.
In CMake 3.14 and below the module would report the Boost version
diff --git a/Help/policy/CMP0094.rst b/Help/policy/CMP0094.rst
index 836f30f09f..1b576586b5 100644
--- a/Help/policy/CMP0094.rst
+++ b/Help/policy/CMP0094.rst
@@ -1,6 +1,8 @@
CMP0094
-------
+.. versionadded:: 3.15
+
Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
use ``LOCATION`` for lookup strategy.
diff --git a/Help/policy/CMP0095.rst b/Help/policy/CMP0095.rst
index 4c56a0524d..ebdbab6f9f 100644
--- a/Help/policy/CMP0095.rst
+++ b/Help/policy/CMP0095.rst
@@ -1,6 +1,8 @@
CMP0095
-------
+.. versionadded:: 3.16
+
``RPATH`` entries are properly escaped in the intermediary CMake install script.
In CMake 3.15 and earlier, ``RPATH`` entries set via
diff --git a/Help/policy/CMP0096.rst b/Help/policy/CMP0096.rst
index 8eaf0f95d6..8fd6f7255d 100644
--- a/Help/policy/CMP0096.rst
+++ b/Help/policy/CMP0096.rst
@@ -1,6 +1,8 @@
CMP0096
-------
+.. versionadded:: 3.16
+
The :command:`project` command preserves leading zeros in version components.
When a ``VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]`` argument is given
diff --git a/Help/policy/CMP0097.rst b/Help/policy/CMP0097.rst
index 4840aa69d9..2240874e0f 100644
--- a/Help/policy/CMP0097.rst
+++ b/Help/policy/CMP0097.rst
@@ -1,6 +1,8 @@
CMP0097
-------
+.. versionadded:: 3.16
+
:command:`ExternalProject_Add` with ``GIT_SUBMODULES ""`` initializes no
submodules.
diff --git a/Help/policy/CMP0098.rst b/Help/policy/CMP0098.rst
index 6d1443b764..e7933803a7 100644
--- a/Help/policy/CMP0098.rst
+++ b/Help/policy/CMP0098.rst
@@ -1,6 +1,8 @@
CMP0098
-------
+.. versionadded:: 3.17
+
:module:`FindFLEX` runs ``flex`` in directory
:variable:`CMAKE_CURRENT_BINARY_DIR` when executing.
diff --git a/Help/policy/CMP0099.rst b/Help/policy/CMP0099.rst
index c897e7ba2b..0c64949422 100644
--- a/Help/policy/CMP0099.rst
+++ b/Help/policy/CMP0099.rst
@@ -1,6 +1,8 @@
CMP0099
-------
+.. versionadded:: 3.17
+
Target link properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
:prop_tgt:`INTERFACE_LINK_DIRECTORIES` and :prop_tgt:`INTERFACE_LINK_DEPENDS`
are now transitive over private dependencies of static libraries.
diff --git a/Help/policy/CMP0100.rst b/Help/policy/CMP0100.rst
index b24d013a96..730fa82c00 100644
--- a/Help/policy/CMP0100.rst
+++ b/Help/policy/CMP0100.rst
@@ -1,6 +1,8 @@
CMP0100
-------
+.. versionadded:: 3.17
+
Let :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` process
header files that end with a ``.hh`` extension.
diff --git a/Help/policy/CMP0101.rst b/Help/policy/CMP0101.rst
index 9941acfc64..f02bccc881 100644
--- a/Help/policy/CMP0101.rst
+++ b/Help/policy/CMP0101.rst
@@ -1,6 +1,8 @@
CMP0101
-------
+.. versionadded:: 3.17
+
:command:`target_compile_options` now honors ``BEFORE`` keyword in all scopes.
In CMake 3.16 and below the :command:`target_compile_options` ignores the
diff --git a/Help/policy/CMP0102.rst b/Help/policy/CMP0102.rst
index 9859006ea0..78b5584808 100644
--- a/Help/policy/CMP0102.rst
+++ b/Help/policy/CMP0102.rst
@@ -1,6 +1,8 @@
CMP0102
-------
+.. versionadded:: 3.17
+
The :command:`mark_as_advanced` command no longer creates a cache entry if one
does not already exist.
diff --git a/Help/policy/CMP0103.rst b/Help/policy/CMP0103.rst
index 223e0cb008..b5f44d1d3d 100644
--- a/Help/policy/CMP0103.rst
+++ b/Help/policy/CMP0103.rst
@@ -1,6 +1,8 @@
CMP0103
-------
+.. versionadded:: 3.18
+
Multiple calls to :command:`export` command with same ``FILE`` without
``APPEND`` is no longer allowed.
diff --git a/Help/policy/CMP0104.rst b/Help/policy/CMP0104.rst
index 85167169f0..7c7a16e378 100644
--- a/Help/policy/CMP0104.rst
+++ b/Help/policy/CMP0104.rst
@@ -1,6 +1,8 @@
CMP0104
-------
+.. versionadded:: 3.18
+
Initialize :variable:`CMAKE_CUDA_ARCHITECTURES` when
:variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA``.
Raise an error if :prop_tgt:`CUDA_ARCHITECTURES` is empty.
diff --git a/Help/policy/CMP0105.rst b/Help/policy/CMP0105.rst
index 19a1edbe7f..097a59abb8 100644
--- a/Help/policy/CMP0105.rst
+++ b/Help/policy/CMP0105.rst
@@ -1,6 +1,8 @@
CMP0105
-------
+.. versionadded:: 3.18
+
:prop_tgt:`LINK_OPTIONS` and :prop_tgt:`INTERFACE_LINK_OPTIONS` target
properties are now used for the device link step.
diff --git a/Help/policy/CMP0106.rst b/Help/policy/CMP0106.rst
index e34d15ac86..18a6635392 100644
--- a/Help/policy/CMP0106.rst
+++ b/Help/policy/CMP0106.rst
@@ -1,6 +1,8 @@
CMP0106
-------
+.. versionadded:: 3.18
+
The :module:`Documentation` module is removed.
The :module:`Documentation` was added as a support mechanism for the VTK
diff --git a/Help/policy/CMP0107.rst b/Help/policy/CMP0107.rst
index 111bef7a40..da5ae06882 100644
--- a/Help/policy/CMP0107.rst
+++ b/Help/policy/CMP0107.rst
@@ -1,6 +1,8 @@
CMP0107
-------
+.. versionadded:: 3.18
+
It is not allowed to create an ``ALIAS`` target with the same name as an
another target.
diff --git a/Help/policy/CMP0108.rst b/Help/policy/CMP0108.rst
index 0d54cfa3e1..4d1091d751 100644
--- a/Help/policy/CMP0108.rst
+++ b/Help/policy/CMP0108.rst
@@ -1,6 +1,8 @@
CMP0108
-------
+.. versionadded:: 3.18
+
A target is not allowed to link to itself even through an ``ALIAS`` target.
In CMake 3.17 and below, a target can link to a target aliased to itself.
diff --git a/Help/policy/CMP0109.rst b/Help/policy/CMP0109.rst
new file mode 100644
index 0000000000..f86287f684
--- /dev/null
+++ b/Help/policy/CMP0109.rst
@@ -0,0 +1,24 @@
+CMP0109
+-------
+
+.. versionadded:: 3.19
+
+:command:`find_program` requires permission to execute but not to read.
+
+In CMake 3.18 and below, the :command:`find_program` command on UNIX
+would find files that are readable without requiring execute permission,
+and would not find files that are executable without read permission.
+In CMake 3.19 and above, ``find_program`` now prefers to require execute
+permission but not read permission. This policy provides compatibility
+with projects that have not been updated to expect the new behavior.
+
+The ``OLD`` behavior for this policy is for ``find_program`` to require
+read permission but not execute permission.
+The ``NEW`` behavior for this policy is for ``find_program`` to require
+execute permission but not read permission.
+
+This policy was introduced in CMake version 3.19. CMake version |release|
+warns when the policy is not set and uses ``OLD`` behavior. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst b/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst
index 051d22a814..6097d14d32 100644
--- a/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst
+++ b/Help/prop_dir/ADDITIONAL_CLEAN_FILES.rst
@@ -1,6 +1,8 @@
ADDITIONAL_CLEAN_FILES
----------------------
+.. versionadded:: 3.15
+
A :ref:`;-list <CMake Language Lists>` of files or directories that will be
removed as a part of the global ``clean`` target. It is useful for
specifying generated files or directories that are used by multiple targets
diff --git a/Help/prop_dir/BINARY_DIR.rst b/Help/prop_dir/BINARY_DIR.rst
index 597c79aa88..fcf9d17d7b 100644
--- a/Help/prop_dir/BINARY_DIR.rst
+++ b/Help/prop_dir/BINARY_DIR.rst
@@ -1,5 +1,7 @@
BINARY_DIR
----------
+.. versionadded:: 3.7
+
This read-only directory property reports absolute path to the binary
directory corresponding to the source on which it is read.
diff --git a/Help/prop_dir/BUILDSYSTEM_TARGETS.rst b/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
index 04bb56ec17..5c5893dfc7 100644
--- a/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
+++ b/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
@@ -1,6 +1,8 @@
BUILDSYSTEM_TARGETS
-------------------
+.. versionadded:: 3.7
+
This read-only directory property contains a
:ref:`semicolon-separated list <CMake Language Lists>` of buildsystem targets added in the
directory by calls to the :command:`add_library`, :command:`add_executable`,
diff --git a/Help/prop_dir/LABELS.rst b/Help/prop_dir/LABELS.rst
index de27d906ee..bf14368e23 100644
--- a/Help/prop_dir/LABELS.rst
+++ b/Help/prop_dir/LABELS.rst
@@ -1,6 +1,8 @@
LABELS
------
+.. versionadded:: 3.10
+
Specify a list of text labels associated with a directory and all of its
subdirectories. This is equivalent to setting the :prop_tgt:`LABELS` target
property and the :prop_test:`LABELS` test property on all targets and tests in
diff --git a/Help/prop_dir/LINK_OPTIONS.rst b/Help/prop_dir/LINK_OPTIONS.rst
index f229ba6d61..3a5c72ff09 100644
--- a/Help/prop_dir/LINK_OPTIONS.rst
+++ b/Help/prop_dir/LINK_OPTIONS.rst
@@ -1,6 +1,8 @@
LINK_OPTIONS
------------
+.. versionadded:: 3.13
+
List of options to use for the link step of shared library, module
and executable targets as well as the device link step.
diff --git a/Help/prop_dir/SOURCE_DIR.rst b/Help/prop_dir/SOURCE_DIR.rst
index ac98c3b283..d73707dacb 100644
--- a/Help/prop_dir/SOURCE_DIR.rst
+++ b/Help/prop_dir/SOURCE_DIR.rst
@@ -1,5 +1,7 @@
SOURCE_DIR
----------
+.. versionadded:: 3.7
+
This read-only directory property reports absolute path to the source
directory on which it is read.
diff --git a/Help/prop_dir/SUBDIRECTORIES.rst b/Help/prop_dir/SUBDIRECTORIES.rst
index 6a0ac80d8e..71ea496fe4 100644
--- a/Help/prop_dir/SUBDIRECTORIES.rst
+++ b/Help/prop_dir/SUBDIRECTORIES.rst
@@ -1,6 +1,8 @@
SUBDIRECTORIES
--------------
+.. versionadded:: 3.7
+
This read-only directory property contains a
:ref:`semicolon-separated list <CMake Language Lists>` of subdirectories processed so far by
the :command:`add_subdirectory` or :command:`subdirs` commands. Each entry is
diff --git a/Help/prop_dir/TESTS.rst b/Help/prop_dir/TESTS.rst
index 1c9f6e5c62..294be178d4 100644
--- a/Help/prop_dir/TESTS.rst
+++ b/Help/prop_dir/TESTS.rst
@@ -1,6 +1,8 @@
TESTS
-----
+.. versionadded:: 3.12
+
List of tests.
This read-only property holds a
diff --git a/Help/prop_dir/TEST_INCLUDE_FILES.rst b/Help/prop_dir/TEST_INCLUDE_FILES.rst
index c3e4602b0c..f9a66f42c0 100644
--- a/Help/prop_dir/TEST_INCLUDE_FILES.rst
+++ b/Help/prop_dir/TEST_INCLUDE_FILES.rst
@@ -1,6 +1,8 @@
TEST_INCLUDE_FILES
------------------
+.. versionadded:: 3.10
+
A list of cmake files that will be included when ctest is run.
If you specify ``TEST_INCLUDE_FILES``, those files will be included and
diff --git a/Help/prop_dir/VS_STARTUP_PROJECT.rst b/Help/prop_dir/VS_STARTUP_PROJECT.rst
index 2680dfa6c2..8a0c3c8437 100644
--- a/Help/prop_dir/VS_STARTUP_PROJECT.rst
+++ b/Help/prop_dir/VS_STARTUP_PROJECT.rst
@@ -1,6 +1,8 @@
VS_STARTUP_PROJECT
------------------
+.. versionadded:: 3.6
+
Specify the default startup project in a Visual Studio solution.
The :ref:`Visual Studio Generators` create a ``.sln`` file for each directory
diff --git a/Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst b/Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst
index d294eb170e..2e3232062a 100644
--- a/Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst
+++ b/Help/prop_gbl/AUTOGEN_SOURCE_GROUP.rst
@@ -1,6 +1,8 @@
AUTOGEN_SOURCE_GROUP
--------------------
+.. versionadded:: 3.9
+
Name of the :command:`source_group` for :prop_tgt:`AUTOMOC` and
:prop_tgt:`AUTORCC` generated files.
diff --git a/Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst b/Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst
index 2455dc7631..a266fdebf4 100644
--- a/Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst
+++ b/Help/prop_gbl/AUTOMOC_SOURCE_GROUP.rst
@@ -1,6 +1,8 @@
AUTOMOC_SOURCE_GROUP
--------------------
+.. versionadded:: 3.9
+
Name of the :command:`source_group` for :prop_tgt:`AUTOMOC` generated files.
When set this is used instead of :prop_gbl:`AUTOGEN_SOURCE_GROUP` for
diff --git a/Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst b/Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst
index 65ea95b17f..54ebabb0d8 100644
--- a/Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst
+++ b/Help/prop_gbl/AUTORCC_SOURCE_GROUP.rst
@@ -1,6 +1,8 @@
AUTORCC_SOURCE_GROUP
--------------------
+.. versionadded:: 3.9
+
Name of the :command:`source_group` for :prop_tgt:`AUTORCC` generated files.
When set this is used instead of :prop_gbl:`AUTOGEN_SOURCE_GROUP` for
diff --git a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
index 44e37fe1c5..e8e314881a 100644
--- a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_KNOWN_FEATURES
-------------------------
+.. versionadded:: 3.17
+
List of CUDA features known to this version of CMake.
The features listed in this global property may be known to be available to the
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index b921c6b038..9b532828da 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -1,6 +1,8 @@
CMAKE_CXX_KNOWN_FEATURES
------------------------
+.. versionadded:: 3.1
+
List of C++ features known to this version of CMake.
The features listed in this global property may be known to be available to the
diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
index e5f896ee00..7166381aa4 100644
--- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
@@ -1,6 +1,8 @@
CMAKE_C_KNOWN_FEATURES
----------------------
+.. versionadded:: 3.1
+
List of C features known to this version of CMake.
The features listed in this global property may be known to be available to the
diff --git a/Help/prop_gbl/CMAKE_ROLE.rst b/Help/prop_gbl/CMAKE_ROLE.rst
index 27512fadae..3f4492f0c8 100644
--- a/Help/prop_gbl/CMAKE_ROLE.rst
+++ b/Help/prop_gbl/CMAKE_ROLE.rst
@@ -1,6 +1,8 @@
CMAKE_ROLE
----------
+.. versionadded:: 3.14
+
Tells what mode the current running script is in. Could be one of several
values:
diff --git a/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst b/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst
index 50c41a9239..2f110a74e2 100644
--- a/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst
+++ b/Help/prop_gbl/ECLIPSE_EXTRA_CPROJECT_CONTENTS.rst
@@ -1,6 +1,8 @@
ECLIPSE_EXTRA_CPROJECT_CONTENTS
-------------------------------
+.. versionadded:: 3.12
+
Additional contents to be inserted into the generated Eclipse cproject file.
The cproject file defines the CDT specific information. Some third party IDE's
diff --git a/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst b/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst
index 839602674d..f6cad66b81 100644
--- a/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst
+++ b/Help/prop_gbl/FIND_LIBRARY_USE_LIB32_PATHS.rst
@@ -1,6 +1,8 @@
FIND_LIBRARY_USE_LIB32_PATHS
----------------------------
+.. versionadded:: 3.7
+
Whether the :command:`find_library` command should automatically search
``lib32`` directories.
diff --git a/Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst b/Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst
index b87b09be11..851f859025 100644
--- a/Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst
+++ b/Help/prop_gbl/FIND_LIBRARY_USE_LIBX32_PATHS.rst
@@ -1,6 +1,8 @@
FIND_LIBRARY_USE_LIBX32_PATHS
-----------------------------
+.. versionadded:: 3.9
+
Whether the :command:`find_library` command should automatically search
``libx32`` directories.
diff --git a/Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst b/Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst
index b8ec8a62c0..6f1a9e185c 100644
--- a/Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst
+++ b/Help/prop_gbl/GENERATOR_IS_MULTI_CONFIG.rst
@@ -1,6 +1,8 @@
GENERATOR_IS_MULTI_CONFIG
-------------------------
+.. versionadded:: 3.9
+
Read-only property that is true on multi-configuration generators.
True when using a multi-configuration generator
diff --git a/Help/prop_gbl/TARGET_MESSAGES.rst b/Help/prop_gbl/TARGET_MESSAGES.rst
index 275b0741df..bb917723e3 100644
--- a/Help/prop_gbl/TARGET_MESSAGES.rst
+++ b/Help/prop_gbl/TARGET_MESSAGES.rst
@@ -1,6 +1,8 @@
TARGET_MESSAGES
---------------
+.. versionadded:: 3.4
+
Specify whether to report the completion of each target.
This property specifies whether :ref:`Makefile Generators` should
diff --git a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst
index 950044301c..392b704f89 100644
--- a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst
+++ b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst
@@ -1,6 +1,8 @@
XCODE_EMIT_EFFECTIVE_PLATFORM_NAME
----------------------------------
+.. versionadded:: 3.8
+
Control emission of ``EFFECTIVE_PLATFORM_NAME`` by the :generator:`Xcode`
generator.
diff --git a/Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst b/Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst
index 729ab603c9..55e9a20ff4 100644
--- a/Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst
+++ b/Help/prop_inst/CPACK_DESKTOP_SHORTCUTS.rst
@@ -1,6 +1,8 @@
CPACK_DESKTOP_SHORTCUTS
-----------------------
+.. versionadded:: 3.3
+
Species a list of shortcut names that should be created on the `Desktop`
for this file.
diff --git a/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst b/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst
index 4789e253d4..12eef9ec26 100644
--- a/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst
+++ b/Help/prop_inst/CPACK_NEVER_OVERWRITE.rst
@@ -1,6 +1,8 @@
CPACK_NEVER_OVERWRITE
---------------------
+.. versionadded:: 3.1
+
Request that this file not be overwritten on install or reinstall.
The property is currently only supported by the :cpack_gen:`CPack WIX Generator`.
diff --git a/Help/prop_inst/CPACK_PERMANENT.rst b/Help/prop_inst/CPACK_PERMANENT.rst
index 985de0da9c..e89c55200d 100644
--- a/Help/prop_inst/CPACK_PERMANENT.rst
+++ b/Help/prop_inst/CPACK_PERMANENT.rst
@@ -1,6 +1,8 @@
CPACK_PERMANENT
---------------
+.. versionadded:: 3.1
+
Request that this file not be removed on uninstall.
The property is currently only supported by the :cpack_gen:`CPack WIX Generator`.
diff --git a/Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst b/Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst
index d9208b9f91..e896acdd4d 100644
--- a/Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst
+++ b/Help/prop_inst/CPACK_STARTUP_SHORTCUTS.rst
@@ -1,6 +1,8 @@
CPACK_STARTUP_SHORTCUTS
-----------------------
+.. versionadded:: 3.3
+
Species a list of shortcut names that should be created in the `Startup` folder
for this file.
diff --git a/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst b/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst
index 092334a5aa..fb8807f315 100644
--- a/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst
+++ b/Help/prop_inst/CPACK_START_MENU_SHORTCUTS.rst
@@ -1,6 +1,8 @@
CPACK_START_MENU_SHORTCUTS
--------------------------
+.. versionadded:: 3.3
+
Species a list of shortcut names that should be created in the `Start Menu`
for this file.
diff --git a/Help/prop_inst/CPACK_WIX_ACL.rst b/Help/prop_inst/CPACK_WIX_ACL.rst
index c88f42675c..8b4fb5c27c 100644
--- a/Help/prop_inst/CPACK_WIX_ACL.rst
+++ b/Help/prop_inst/CPACK_WIX_ACL.rst
@@ -1,6 +1,8 @@
CPACK_WIX_ACL
-------------
+.. versionadded:: 3.1
+
Specifies access permissions for files or directories
installed by a WiX installer.
diff --git a/Help/prop_sf/COMPILE_OPTIONS.rst b/Help/prop_sf/COMPILE_OPTIONS.rst
index 537dcecf64..a694c3e61e 100644
--- a/Help/prop_sf/COMPILE_OPTIONS.rst
+++ b/Help/prop_sf/COMPILE_OPTIONS.rst
@@ -1,6 +1,8 @@
COMPILE_OPTIONS
---------------
+.. versionadded:: 3.11
+
List of additional options to pass to the compiler.
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
diff --git a/Help/prop_sf/Fortran_PREPROCESS.rst b/Help/prop_sf/Fortran_PREPROCESS.rst
index 25ea827c88..548a97b147 100644
--- a/Help/prop_sf/Fortran_PREPROCESS.rst
+++ b/Help/prop_sf/Fortran_PREPROCESS.rst
@@ -1,6 +1,8 @@
Fortran_PREPROCESS
------------------
+.. versionadded:: 3.18
+
Control whether the Fortran source file should be unconditionally preprocessed.
If unset or empty, rely on the compiler to determine whether the file
diff --git a/Help/prop_sf/INCLUDE_DIRECTORIES.rst b/Help/prop_sf/INCLUDE_DIRECTORIES.rst
index 23de70e167..89ffd15605 100644
--- a/Help/prop_sf/INCLUDE_DIRECTORIES.rst
+++ b/Help/prop_sf/INCLUDE_DIRECTORIES.rst
@@ -1,6 +1,8 @@
INCLUDE_DIRECTORIES
-------------------
+.. versionadded:: 3.11
+
List of preprocessor include file search directories.
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of paths
diff --git a/Help/prop_sf/SKIP_AUTOGEN.rst b/Help/prop_sf/SKIP_AUTOGEN.rst
index f31185a5bd..2173f59964 100644
--- a/Help/prop_sf/SKIP_AUTOGEN.rst
+++ b/Help/prop_sf/SKIP_AUTOGEN.rst
@@ -1,6 +1,8 @@
SKIP_AUTOGEN
------------
+.. versionadded:: 3.8
+
Exclude the source file from :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and
:prop_tgt:`AUTORCC` processing (for Qt projects).
diff --git a/Help/prop_sf/SKIP_AUTOMOC.rst b/Help/prop_sf/SKIP_AUTOMOC.rst
index a9294489a9..e92cfe0d70 100644
--- a/Help/prop_sf/SKIP_AUTOMOC.rst
+++ b/Help/prop_sf/SKIP_AUTOMOC.rst
@@ -1,6 +1,8 @@
SKIP_AUTOMOC
------------
+.. versionadded:: 3.8
+
Exclude the source file from :prop_tgt:`AUTOMOC` processing (for Qt projects).
For broader exclusion control see :prop_sf:`SKIP_AUTOGEN`.
diff --git a/Help/prop_sf/SKIP_AUTORCC.rst b/Help/prop_sf/SKIP_AUTORCC.rst
index bccccfc936..2829c259df 100644
--- a/Help/prop_sf/SKIP_AUTORCC.rst
+++ b/Help/prop_sf/SKIP_AUTORCC.rst
@@ -1,6 +1,8 @@
SKIP_AUTORCC
------------
+.. versionadded:: 3.8
+
Exclude the source file from :prop_tgt:`AUTORCC` processing (for Qt projects).
For broader exclusion control see :prop_sf:`SKIP_AUTOGEN`.
diff --git a/Help/prop_sf/SKIP_AUTOUIC.rst b/Help/prop_sf/SKIP_AUTOUIC.rst
index 8c962dbfe8..ae9725acdd 100644
--- a/Help/prop_sf/SKIP_AUTOUIC.rst
+++ b/Help/prop_sf/SKIP_AUTOUIC.rst
@@ -1,6 +1,8 @@
SKIP_AUTOUIC
------------
+.. versionadded:: 3.8
+
Exclude the source file from :prop_tgt:`AUTOUIC` processing (for Qt projects).
:prop_sf:`SKIP_AUTOUIC` can be set on C++ header and source files and on
diff --git a/Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst b/Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst
index 0031da3466..660de3fe40 100644
--- a/Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst
+++ b/Help/prop_sf/SKIP_PRECOMPILE_HEADERS.rst
@@ -1,6 +1,8 @@
SKIP_PRECOMPILE_HEADERS
-----------------------
+.. versionadded:: 3.16
+
Is this source file skipped by :prop_tgt:`PRECOMPILE_HEADERS` feature.
This property helps with build problems that one would run into
diff --git a/Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst b/Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst
index 6d1e60d4ae..ae526ac1d6 100644
--- a/Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst
+++ b/Help/prop_sf/SKIP_UNITY_BUILD_INCLUSION.rst
@@ -1,6 +1,8 @@
SKIP_UNITY_BUILD_INCLUSION
--------------------------
+.. versionadded:: 3.16
+
Setting this property to true ensures the source file will be skipped by
unity builds when its associated target has its :prop_tgt:`UNITY_BUILD`
property set to true. The source file will instead be compiled on its own
diff --git a/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst b/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst
index faac2df7b0..a90c7ebcb6 100644
--- a/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst
+++ b/Help/prop_sf/Swift_DEPENDENCIES_FILE.rst
@@ -1,5 +1,7 @@
Swift_DEPENDENCIES_FILE
-----------------------
+.. versionadded:: 3.15
+
This property sets the path for the Swift dependency file (swiftdeps) for the
source. If one is not specified, it will default to ``<OBJECT>.swiftdeps``.
diff --git a/Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst b/Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst
index 5bf5d59cde..47d5ac3784 100644
--- a/Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst
+++ b/Help/prop_sf/Swift_DIAGNOSTICS_FILE.rst
@@ -1,4 +1,6 @@
Swift_DIAGNOSTICS_FILE
----------------------
+.. versionadded:: 3.15
+
This property controls where the Swift diagnostics are serialized.
diff --git a/Help/prop_sf/UNITY_GROUP.rst b/Help/prop_sf/UNITY_GROUP.rst
index ec6b0f6520..9c18b70587 100644
--- a/Help/prop_sf/UNITY_GROUP.rst
+++ b/Help/prop_sf/UNITY_GROUP.rst
@@ -1,5 +1,7 @@
UNITY_GROUP
-----------
+.. versionadded:: 3.18
+
This property controls which *bucket* the source will be part of when
the :prop_tgt:`UNITY_BUILD_MODE` is set to ``GROUP``.
diff --git a/Help/prop_sf/VS_COPY_TO_OUT_DIR.rst b/Help/prop_sf/VS_COPY_TO_OUT_DIR.rst
index 16c8d83076..ebc306113e 100644
--- a/Help/prop_sf/VS_COPY_TO_OUT_DIR.rst
+++ b/Help/prop_sf/VS_COPY_TO_OUT_DIR.rst
@@ -1,6 +1,8 @@
VS_COPY_TO_OUT_DIR
------------------
+.. versionadded:: 3.8
+
Sets the ``<CopyToOutputDirectory>`` tag for a source file in a
Visual Studio project file. Valid values are ``Never``, ``Always``
and ``PreserveNewest``.
diff --git a/Help/prop_sf/VS_CSHARP_tagname.rst b/Help/prop_sf/VS_CSHARP_tagname.rst
index 91c4a06c13..75720f8308 100644
--- a/Help/prop_sf/VS_CSHARP_tagname.rst
+++ b/Help/prop_sf/VS_CSHARP_tagname.rst
@@ -1,6 +1,8 @@
VS_CSHARP_<tagname>
-------------------
+.. versionadded:: 3.8
+
Visual Studio and CSharp source-file-specific configuration.
Tell the :manual:`Visual Studio generators <cmake-generators(7)>`
diff --git a/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst b/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
index 6a38478fee..ee49b2736c 100644
--- a/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
+++ b/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
@@ -1,6 +1,8 @@
VS_DEPLOYMENT_CONTENT
---------------------
+.. versionadded:: 3.1
+
Mark a source file as content for deployment with a Windows Phone or
Windows Store application when built with a
:manual:`Visual Studio generators <cmake-generators(7)>`.
diff --git a/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst b/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst
index 2ce22fced6..b17054488a 100644
--- a/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst
+++ b/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst
@@ -1,6 +1,8 @@
VS_DEPLOYMENT_LOCATION
----------------------
+.. versionadded:: 3.1
+
Specifies the deployment location for a content source file with a Windows
Phone or Windows Store application when built
with a :manual:`Visual Studio generators <cmake-generators(7)>`.
diff --git a/Help/prop_sf/VS_INCLUDE_IN_VSIX.rst b/Help/prop_sf/VS_INCLUDE_IN_VSIX.rst
index db470ef001..16c56bfaad 100644
--- a/Help/prop_sf/VS_INCLUDE_IN_VSIX.rst
+++ b/Help/prop_sf/VS_INCLUDE_IN_VSIX.rst
@@ -1,6 +1,8 @@
VS_INCLUDE_IN_VSIX
------------------
+.. versionadded:: 3.8
+
Boolean property to specify if the file should be included within a
VSIX (Visual Studio Integration Extension) extension package.
This is needed for development of Visual Studio extensions.
diff --git a/Help/prop_sf/VS_RESOURCE_GENERATOR.rst b/Help/prop_sf/VS_RESOURCE_GENERATOR.rst
index 97e5aac7a6..c5bb4f60ba 100644
--- a/Help/prop_sf/VS_RESOURCE_GENERATOR.rst
+++ b/Help/prop_sf/VS_RESOURCE_GENERATOR.rst
@@ -1,6 +1,8 @@
VS_RESOURCE_GENERATOR
---------------------
+.. versionadded:: 3.8
+
This property allows to specify the resource generator to be used
on this file. It defaults to ``PublicResXFileCodeGenerator`` if
not set.
diff --git a/Help/prop_sf/VS_SETTINGS.rst b/Help/prop_sf/VS_SETTINGS.rst
index 50034fb180..322f5a6d7f 100644
--- a/Help/prop_sf/VS_SETTINGS.rst
+++ b/Help/prop_sf/VS_SETTINGS.rst
@@ -1,6 +1,8 @@
VS_SETTINGS
-----------
+.. versionadded:: 3.18
+
Set any item metadata on a non-built file.
Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator to set
diff --git a/Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst b/Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst
index 446dd26d93..6fb677833c 100644
--- a/Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst
+++ b/Help/prop_sf/VS_SHADER_DISABLE_OPTIMIZATIONS.rst
@@ -1,6 +1,8 @@
VS_SHADER_DISABLE_OPTIMIZATIONS
-------------------------------
+.. versionadded:: 3.11
+
Disable compiler optimizations for an ``.hlsl`` source file. This adds the
``-Od`` flag to the command line for the FxCompiler tool. Specify the value
``true`` for this property to disable compiler optimizations.
diff --git a/Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst b/Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst
index c0e60a3e37..9c8f9d7e8d 100644
--- a/Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst
+++ b/Help/prop_sf/VS_SHADER_ENABLE_DEBUG.rst
@@ -1,6 +1,8 @@
VS_SHADER_ENABLE_DEBUG
----------------------
+.. versionadded:: 3.11
+
Enable debugging information for an ``.hlsl`` source file. This adds the
``-Zi`` flag to the command line for the FxCompiler tool. Specify the value
``true`` to generate debugging information for the compiled shader.
diff --git a/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst b/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst
index fe3471f251..4b311ba99d 100644
--- a/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst
+++ b/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst
@@ -1,5 +1,7 @@
VS_SHADER_ENTRYPOINT
--------------------
+.. versionadded:: 3.1
+
Specifies the name of the entry point for the shader of a ``.hlsl`` source
file.
diff --git a/Help/prop_sf/VS_SHADER_FLAGS.rst b/Help/prop_sf/VS_SHADER_FLAGS.rst
index 0a53afd1c9..07f8497e88 100644
--- a/Help/prop_sf/VS_SHADER_FLAGS.rst
+++ b/Help/prop_sf/VS_SHADER_FLAGS.rst
@@ -1,4 +1,6 @@
VS_SHADER_FLAGS
---------------
+.. versionadded:: 3.2
+
Set additional Visual Studio shader flags of a ``.hlsl`` source file.
diff --git a/Help/prop_sf/VS_SHADER_MODEL.rst b/Help/prop_sf/VS_SHADER_MODEL.rst
index b1cf0df55c..072df89aaf 100644
--- a/Help/prop_sf/VS_SHADER_MODEL.rst
+++ b/Help/prop_sf/VS_SHADER_MODEL.rst
@@ -1,5 +1,7 @@
VS_SHADER_MODEL
---------------
+.. versionadded:: 3.1
+
Specifies the shader model of a ``.hlsl`` source file. Some shader types can
only be used with recent shader models
diff --git a/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst b/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst
index 093bcc6660..3647a5ed3a 100644
--- a/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst
+++ b/Help/prop_sf/VS_SHADER_OBJECT_FILE_NAME.rst
@@ -1,6 +1,8 @@
VS_SHADER_OBJECT_FILE_NAME
--------------------------
+.. versionadded:: 3.12
+
Specifies a file name for the compiled shader object file for an ``.hlsl``
source file. This adds the ``-Fo`` flag to the command line for the FxCompiler
tool.
diff --git a/Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst b/Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst
index e6763d332c..4113a165d7 100644
--- a/Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst
+++ b/Help/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE.rst
@@ -1,5 +1,7 @@
VS_SHADER_OUTPUT_HEADER_FILE
----------------------------
+.. versionadded:: 3.10
+
Set filename for output header file containing object code of a ``.hlsl``
source file.
diff --git a/Help/prop_sf/VS_SHADER_TYPE.rst b/Help/prop_sf/VS_SHADER_TYPE.rst
index f1048379a8..3fb7e60265 100644
--- a/Help/prop_sf/VS_SHADER_TYPE.rst
+++ b/Help/prop_sf/VS_SHADER_TYPE.rst
@@ -1,4 +1,6 @@
VS_SHADER_TYPE
--------------
+.. versionadded:: 3.1
+
Set the Visual Studio shader type of a ``.hlsl`` source file.
diff --git a/Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst b/Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst
index 1a5e369217..3361b40016 100644
--- a/Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst
+++ b/Help/prop_sf/VS_SHADER_VARIABLE_NAME.rst
@@ -1,5 +1,7 @@
VS_SHADER_VARIABLE_NAME
-----------------------
+.. versionadded:: 3.10
+
Set name of variable in header file containing object code of a ``.hlsl``
source file.
diff --git a/Help/prop_sf/VS_TOOL_OVERRIDE.rst b/Help/prop_sf/VS_TOOL_OVERRIDE.rst
index 8bdc5ca50d..b2f41120fd 100644
--- a/Help/prop_sf/VS_TOOL_OVERRIDE.rst
+++ b/Help/prop_sf/VS_TOOL_OVERRIDE.rst
@@ -1,5 +1,7 @@
VS_TOOL_OVERRIDE
----------------
+.. versionadded:: 3.7
+
Override the default Visual Studio tool that will be applied to the source file
with a new tool not based on the extension of the file.
diff --git a/Help/prop_sf/VS_XAML_TYPE.rst b/Help/prop_sf/VS_XAML_TYPE.rst
index 1a274ba4ec..612b07ba22 100644
--- a/Help/prop_sf/VS_XAML_TYPE.rst
+++ b/Help/prop_sf/VS_XAML_TYPE.rst
@@ -1,6 +1,8 @@
VS_XAML_TYPE
------------
+.. versionadded:: 3.3
+
Mark a Extensible Application Markup Language (XAML) source file
as a different type than the default ``Page``.
The most common usage would be to set the default ``App.xaml`` file as
diff --git a/Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst b/Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst
index b8cf946ea4..5a50d7dcf4 100644
--- a/Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst
+++ b/Help/prop_sf/XCODE_EXPLICIT_FILE_TYPE.rst
@@ -1,6 +1,8 @@
XCODE_EXPLICIT_FILE_TYPE
------------------------
+.. versionadded:: 3.1
+
Set the :generator:`Xcode` ``explicitFileType`` attribute on its reference to a
source file. CMake computes a default based on file extension but
can be told explicitly with this property.
diff --git a/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst b/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst
index 4c93f444a6..ba51e00ef5 100644
--- a/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst
+++ b/Help/prop_sf/XCODE_FILE_ATTRIBUTES.rst
@@ -1,6 +1,8 @@
XCODE_FILE_ATTRIBUTES
---------------------
+.. versionadded:: 3.7
+
Add values to the :generator:`Xcode` ``ATTRIBUTES`` setting on its reference to a
source file. Among other things, this can be used to set the role on
a ``.mig`` file::
diff --git a/Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst b/Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst
index b21891fce0..0b84e314c3 100644
--- a/Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst
+++ b/Help/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE.rst
@@ -1,6 +1,8 @@
XCODE_LAST_KNOWN_FILE_TYPE
--------------------------
+.. versionadded:: 3.1
+
Set the :generator:`Xcode` ``lastKnownFileType`` attribute on its reference to
a source file. CMake computes a default based on file extension but
can be told explicitly with this property.
diff --git a/Help/prop_test/DISABLED.rst b/Help/prop_test/DISABLED.rst
index 1d469e80b3..cbf07a58d6 100644
--- a/Help/prop_test/DISABLED.rst
+++ b/Help/prop_test/DISABLED.rst
@@ -1,6 +1,8 @@
DISABLED
--------
+.. versionadded:: 3.9
+
If set to ``True``, the test will be skipped and its status will be 'Not Run'. A
``DISABLED`` test will not be counted in the total number of tests and its
completion status will be reported to CDash as ``Disabled``.
diff --git a/Help/prop_test/FIXTURES_CLEANUP.rst b/Help/prop_test/FIXTURES_CLEANUP.rst
index 3075b4d48b..aa043da467 100644
--- a/Help/prop_test/FIXTURES_CLEANUP.rst
+++ b/Help/prop_test/FIXTURES_CLEANUP.rst
@@ -1,6 +1,8 @@
FIXTURES_CLEANUP
----------------
+.. versionadded:: 3.7
+
Specifies a list of fixtures for which the test is to be treated as a cleanup
test. These fixture names are distinct from test case names and are not
required to have any similarity to the names of tests associated with them.
diff --git a/Help/prop_test/FIXTURES_REQUIRED.rst b/Help/prop_test/FIXTURES_REQUIRED.rst
index e3f60c4269..d92808a63d 100644
--- a/Help/prop_test/FIXTURES_REQUIRED.rst
+++ b/Help/prop_test/FIXTURES_REQUIRED.rst
@@ -1,6 +1,8 @@
FIXTURES_REQUIRED
-----------------
+.. versionadded:: 3.7
+
Specifies a list of fixtures the test requires. Fixture names are case
sensitive and they are not required to have any similarity to test names.
diff --git a/Help/prop_test/FIXTURES_SETUP.rst b/Help/prop_test/FIXTURES_SETUP.rst
index fdb21cc769..04a09d86cc 100644
--- a/Help/prop_test/FIXTURES_SETUP.rst
+++ b/Help/prop_test/FIXTURES_SETUP.rst
@@ -1,6 +1,8 @@
FIXTURES_SETUP
--------------
+.. versionadded:: 3.7
+
Specifies a list of fixtures for which the test is to be treated as a setup
test. These fixture names are distinct from test case names and are not
required to have any similarity to the names of tests associated with them.
diff --git a/Help/prop_test/PROCESSOR_AFFINITY.rst b/Help/prop_test/PROCESSOR_AFFINITY.rst
index 38ec179479..f48a69cb07 100644
--- a/Help/prop_test/PROCESSOR_AFFINITY.rst
+++ b/Help/prop_test/PROCESSOR_AFFINITY.rst
@@ -1,6 +1,8 @@
PROCESSOR_AFFINITY
------------------
+.. versionadded:: 3.12
+
Set to a true value to ask CTest to launch the test process with CPU affinity
for a fixed set of processors. If enabled and supported for the current
platform, CTest will choose a set of processors to place in the CPU affinity
diff --git a/Help/prop_test/RESOURCE_GROUPS.rst b/Help/prop_test/RESOURCE_GROUPS.rst
index 63c56ce559..26c8fa26b0 100644
--- a/Help/prop_test/RESOURCE_GROUPS.rst
+++ b/Help/prop_test/RESOURCE_GROUPS.rst
@@ -1,6 +1,8 @@
RESOURCE_GROUPS
---------------
+.. versionadded:: 3.16
+
Specify resources required by a test, grouped in a way that is meaningful to
the test. See :ref:`resource allocation <ctest-resource-allocation>`
for more information on how this property integrates into the CTest resource
diff --git a/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst b/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst
index 2c6d980494..46c4363c49 100644
--- a/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst
+++ b/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst
@@ -1,6 +1,8 @@
SKIP_REGULAR_EXPRESSION
-----------------------
+.. versionadded:: 3.16
+
If the output matches this regular expression the test will be marked as skipped.
If set, if the output matches one of specified regular expressions,
diff --git a/Help/prop_test/TIMEOUT_AFTER_MATCH.rst b/Help/prop_test/TIMEOUT_AFTER_MATCH.rst
index d607992e16..726dcab405 100644
--- a/Help/prop_test/TIMEOUT_AFTER_MATCH.rst
+++ b/Help/prop_test/TIMEOUT_AFTER_MATCH.rst
@@ -1,6 +1,8 @@
TIMEOUT_AFTER_MATCH
-------------------
+.. versionadded:: 3.6
+
Change a test's timeout duration after a matching line is encountered
in its output.
diff --git a/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst b/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst
index 3b9d965f89..dc87d23ef6 100644
--- a/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst
+++ b/Help/prop_tgt/ADDITIONAL_CLEAN_FILES.rst
@@ -1,6 +1,8 @@
ADDITIONAL_CLEAN_FILES
----------------------
+.. versionadded:: 3.15
+
A :ref:`;-list <CMake Language Lists>` of files or directories that will be
removed as a part of the global ``clean`` target. It can be used to specify
files and directories that are generated as part of building the target or
diff --git a/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst b/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst
index 15ddc0b2d9..de98fdf6ed 100644
--- a/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst
+++ b/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst
@@ -1,6 +1,8 @@
AIX_EXPORT_ALL_SYMBOLS
----------------------
+.. versionadded:: 3.17
+
On AIX, CMake automatically exports all symbols from shared libraries, and
from executables with the :prop_tgt:`ENABLE_EXPORTS` target property set.
Explicitly disable this boolean property to suppress the behavior and
diff --git a/Help/prop_tgt/ALIAS_GLOBAL.rst b/Help/prop_tgt/ALIAS_GLOBAL.rst
index 8854f571ca..a8859c6b9a 100644
--- a/Help/prop_tgt/ALIAS_GLOBAL.rst
+++ b/Help/prop_tgt/ALIAS_GLOBAL.rst
@@ -1,6 +1,8 @@
ALIAS_GLOBAL
------------
+.. versionadded:: 3.18
+
Read-only property indicating of whether an :ref:`ALIAS target <Alias Targets>`
is globally visible.
diff --git a/Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst b/Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst
index af6b40587f..eceb17de4d 100644
--- a/Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst
+++ b/Help/prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS.rst
@@ -1,6 +1,8 @@
ANDROID_ANT_ADDITIONAL_OPTIONS
------------------------------
+.. versionadded:: 3.4
+
Set the additional options for Android Ant build system. This is
a string value containing all command line options for the Ant build.
This property is initialized by the value of the
diff --git a/Help/prop_tgt/ANDROID_API.rst b/Help/prop_tgt/ANDROID_API.rst
index 63464d7a16..7664f1833f 100644
--- a/Help/prop_tgt/ANDROID_API.rst
+++ b/Help/prop_tgt/ANDROID_API.rst
@@ -1,6 +1,8 @@
ANDROID_API
-----------
+.. versionadded:: 3.1
+
When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
Edition`, this property sets the Android target API version (e.g. ``15``).
The version number must be a positive decimal integer. This property is
diff --git a/Help/prop_tgt/ANDROID_API_MIN.rst b/Help/prop_tgt/ANDROID_API_MIN.rst
index 773ab3feb4..7ca2455ec2 100644
--- a/Help/prop_tgt/ANDROID_API_MIN.rst
+++ b/Help/prop_tgt/ANDROID_API_MIN.rst
@@ -1,6 +1,8 @@
ANDROID_API_MIN
---------------
+.. versionadded:: 3.2
+
Set the Android MIN API version (e.g. ``9``). The version number
must be a positive decimal integer. This property is initialized by
the value of the :variable:`CMAKE_ANDROID_API_MIN` variable if it is set
diff --git a/Help/prop_tgt/ANDROID_ARCH.rst b/Help/prop_tgt/ANDROID_ARCH.rst
index 3e07e5a9fe..94b76dd453 100644
--- a/Help/prop_tgt/ANDROID_ARCH.rst
+++ b/Help/prop_tgt/ANDROID_ARCH.rst
@@ -1,6 +1,8 @@
ANDROID_ARCH
------------
+.. versionadded:: 3.4
+
When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
Edition`, this property sets the Android target architecture.
diff --git a/Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst
index 764a582444..b09a8b7c71 100644
--- a/Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst
+++ b/Help/prop_tgt/ANDROID_ASSETS_DIRECTORIES.rst
@@ -1,6 +1,8 @@
ANDROID_ASSETS_DIRECTORIES
--------------------------
+.. versionadded:: 3.4
+
Set the Android assets directories to copy into the main assets
folder before build. This a string property that contains the
directory paths separated by semicolon.
diff --git a/Help/prop_tgt/ANDROID_GUI.rst b/Help/prop_tgt/ANDROID_GUI.rst
index 92e2041af4..cc022dbf65 100644
--- a/Help/prop_tgt/ANDROID_GUI.rst
+++ b/Help/prop_tgt/ANDROID_GUI.rst
@@ -1,6 +1,8 @@
ANDROID_GUI
-----------
+.. versionadded:: 3.1
+
When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
Edition`, this property specifies whether to build an executable as an
application package on Android.
diff --git a/Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst b/Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst
index 42937c1b41..9880dafcc0 100644
--- a/Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst
+++ b/Help/prop_tgt/ANDROID_JAR_DEPENDENCIES.rst
@@ -1,6 +1,8 @@
ANDROID_JAR_DEPENDENCIES
------------------------
+.. versionadded:: 3.4
+
Set the Android property that specifies JAR dependencies.
This is a string value property. This property is initialized
by the value of the :variable:`CMAKE_ANDROID_JAR_DEPENDENCIES`
diff --git a/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst
index 54f0a8ff76..6fef50b2d6 100644
--- a/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst
+++ b/Help/prop_tgt/ANDROID_JAR_DIRECTORIES.rst
@@ -1,6 +1,8 @@
ANDROID_JAR_DIRECTORIES
-----------------------
+.. versionadded:: 3.4
+
Set the Android property that specifies directories to search for
the JAR libraries.
diff --git a/Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst b/Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst
index 90ef1ce930..9ea988444d 100644
--- a/Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst
+++ b/Help/prop_tgt/ANDROID_JAVA_SOURCE_DIR.rst
@@ -1,6 +1,8 @@
ANDROID_JAVA_SOURCE_DIR
-----------------------
+.. versionadded:: 3.4
+
Set the Android property that defines the Java source code root directories.
This a string property that contains the directory paths separated by semicolon.
This property is initialized by the value of the
diff --git a/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst b/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst
index 759a37b06c..3aa741f90e 100644
--- a/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst
+++ b/Help/prop_tgt/ANDROID_NATIVE_LIB_DEPENDENCIES.rst
@@ -1,6 +1,8 @@
ANDROID_NATIVE_LIB_DEPENDENCIES
-------------------------------
+.. versionadded:: 3.4
+
Set the Android property that specifies the .so dependencies.
This is a string property.
diff --git a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
index d0cd29de80..98200d9cea 100644
--- a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
+++ b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
@@ -1,6 +1,8 @@
ANDROID_NATIVE_LIB_DIRECTORIES
------------------------------
+.. versionadded:: 3.4
+
Set the Android property that specifies directories to search for the ``.so``
libraries.
diff --git a/Help/prop_tgt/ANDROID_PROCESS_MAX.rst b/Help/prop_tgt/ANDROID_PROCESS_MAX.rst
index 847acae5be..0b6aba7aa1 100644
--- a/Help/prop_tgt/ANDROID_PROCESS_MAX.rst
+++ b/Help/prop_tgt/ANDROID_PROCESS_MAX.rst
@@ -1,6 +1,8 @@
ANDROID_PROCESS_MAX
-------------------
+.. versionadded:: 3.4
+
Set the Android property that defines the maximum number of a
parallel Android NDK compiler processes (e.g. ``4``).
This property is initialized by the value of the
diff --git a/Help/prop_tgt/ANDROID_PROGUARD.rst b/Help/prop_tgt/ANDROID_PROGUARD.rst
index dafc51ee5e..b5ce166a88 100644
--- a/Help/prop_tgt/ANDROID_PROGUARD.rst
+++ b/Help/prop_tgt/ANDROID_PROGUARD.rst
@@ -1,6 +1,8 @@
ANDROID_PROGUARD
----------------
+.. versionadded:: 3.4
+
When this property is set to true that enables the ProGuard tool to shrink,
optimize, and obfuscate the code by removing unused code and renaming
classes, fields, and methods with semantically obscure names.
diff --git a/Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst b/Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst
index 0e929d16a4..6ac59d8eb7 100644
--- a/Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst
+++ b/Help/prop_tgt/ANDROID_PROGUARD_CONFIG_PATH.rst
@@ -1,6 +1,8 @@
ANDROID_PROGUARD_CONFIG_PATH
----------------------------
+.. versionadded:: 3.4
+
Set the Android property that specifies the location of the ProGuard
config file. Leave empty to use the default one.
This a string property that contains the path to ProGuard config file.
diff --git a/Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst b/Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst
index 9533f1a704..f2ffa2e354 100644
--- a/Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst
+++ b/Help/prop_tgt/ANDROID_SECURE_PROPS_PATH.rst
@@ -1,6 +1,8 @@
ANDROID_SECURE_PROPS_PATH
-------------------------
+.. versionadded:: 3.4
+
Set the Android property that states the location of the secure properties file.
This is a string property that contains the file path.
This property is initialized by the value of the
diff --git a/Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst b/Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst
index 6361896561..1a54bce918 100644
--- a/Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst
+++ b/Help/prop_tgt/ANDROID_SKIP_ANT_STEP.rst
@@ -1,6 +1,8 @@
ANDROID_SKIP_ANT_STEP
---------------------
+.. versionadded:: 3.4
+
Set the Android property that defines whether or not to skip the Ant build step.
This is a boolean property initialized by the value of the
:variable:`CMAKE_ANDROID_SKIP_ANT_STEP` variable if it is set when a target is created.
diff --git a/Help/prop_tgt/ANDROID_STL_TYPE.rst b/Help/prop_tgt/ANDROID_STL_TYPE.rst
index 386e96e6c1..c83712b25f 100644
--- a/Help/prop_tgt/ANDROID_STL_TYPE.rst
+++ b/Help/prop_tgt/ANDROID_STL_TYPE.rst
@@ -1,6 +1,8 @@
ANDROID_STL_TYPE
----------------
+.. versionadded:: 3.4
+
When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
Edition`, this property specifies the type of STL support for the project.
This is a string property that could set to the one of the following values:
diff --git a/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst b/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst
index 909b14c347..ff42ae8651 100644
--- a/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst
+++ b/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst
@@ -1,6 +1,8 @@
AUTOGEN_BUILD_DIR
-----------------
+.. versionadded:: 3.9
+
Directory where :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC`
generate files for the target.
diff --git a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
index 022bab5026..563190ad2c 100644
--- a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
+++ b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
@@ -1,6 +1,8 @@
AUTOGEN_ORIGIN_DEPENDS
----------------------
+.. versionadded:: 3.14
+
Switch for forwarding origin target dependencies to the corresponding
``_autogen`` target.
diff --git a/Help/prop_tgt/AUTOGEN_PARALLEL.rst b/Help/prop_tgt/AUTOGEN_PARALLEL.rst
index 968b619e8a..663b54eabf 100644
--- a/Help/prop_tgt/AUTOGEN_PARALLEL.rst
+++ b/Help/prop_tgt/AUTOGEN_PARALLEL.rst
@@ -1,6 +1,8 @@
AUTOGEN_PARALLEL
----------------
+.. versionadded:: 3.11
+
Number of parallel ``moc`` or ``uic`` processes to start when using
:prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
diff --git a/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst b/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst
index 57a647f3c4..89982845a2 100644
--- a/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst
+++ b/Help/prop_tgt/AUTOMOC_COMPILER_PREDEFINES.rst
@@ -1,6 +1,8 @@
AUTOMOC_COMPILER_PREDEFINES
---------------------------
+.. versionadded:: 3.10
+
Boolean value used by :prop_tgt:`AUTOMOC` to determine if the
compiler pre definitions file ``moc_predefs.h`` should be generated.
diff --git a/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst b/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst
index 6eda26c4f6..1f317009d5 100644
--- a/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst
+++ b/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst
@@ -1,6 +1,8 @@
AUTOMOC_DEPEND_FILTERS
----------------------
+.. versionadded:: 3.9
+
Filter definitions used by :prop_tgt:`AUTOMOC` to extract file names from a
source file that are registered as additional dependencies for the
``moc`` file of the source file.
diff --git a/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst b/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst
index 6b66ce81fe..f4b839653a 100644
--- a/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst
+++ b/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst
@@ -1,6 +1,8 @@
AUTOMOC_EXECUTABLE
------------------
+.. versionadded:: 3.14
+
:prop_tgt:`AUTOMOC_EXECUTABLE` is file path pointing to the ``moc``
executable to use for :prop_tgt:`AUTOMOC` enabled files. Setting
this property will make CMake skip the automatic detection of the
diff --git a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
index 5329bbac9c..a53810d156 100644
--- a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
+++ b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
@@ -1,6 +1,8 @@
AUTOMOC_MACRO_NAMES
-------------------
+.. versionadded:: 3.10
+
A :ref:`semicolon-separated list <CMake Language Lists>` list of macro names used by
:prop_tgt:`AUTOMOC` to determine if a C++ file needs to be processed by ``moc``.
diff --git a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
index 3e3059d7aa..4f85c16c8b 100644
--- a/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
+++ b/Help/prop_tgt/AUTOMOC_PATH_PREFIX.rst
@@ -1,6 +1,8 @@
AUTOMOC_PATH_PREFIX
-------------------
+.. versionadded:: 3.16
+
When this property is ``ON``, CMake will generate the ``-p`` path prefix
option for ``moc`` on :prop_tgt:`AUTOMOC` enabled Qt targets.
diff --git a/Help/prop_tgt/AUTORCC_EXECUTABLE.rst b/Help/prop_tgt/AUTORCC_EXECUTABLE.rst
index ca0fbd75be..4f85fbaa9a 100644
--- a/Help/prop_tgt/AUTORCC_EXECUTABLE.rst
+++ b/Help/prop_tgt/AUTORCC_EXECUTABLE.rst
@@ -1,6 +1,8 @@
AUTORCC_EXECUTABLE
------------------
+.. versionadded:: 3.14
+
:prop_tgt:`AUTORCC_EXECUTABLE` is file path pointing to the ``rcc``
executable to use for :prop_tgt:`AUTORCC` enabled files. Setting
this property will make CMake skip the automatic detection of the
diff --git a/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst b/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst
index 03bd554992..596632650d 100644
--- a/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst
+++ b/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst
@@ -1,6 +1,8 @@
AUTOUIC_EXECUTABLE
------------------
+.. versionadded:: 3.14
+
:prop_tgt:`AUTOUIC_EXECUTABLE` is file path pointing to the ``uic``
executable to use for :prop_tgt:`AUTOUIC` enabled files. Setting
this property will make CMake skip the automatic detection of the
diff --git a/Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst b/Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst
index 96d9f89775..87fea48b29 100644
--- a/Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst
+++ b/Help/prop_tgt/AUTOUIC_SEARCH_PATHS.rst
@@ -1,6 +1,8 @@
AUTOUIC_SEARCH_PATHS
--------------------
+.. versionadded:: 3.9
+
Search path list used by :prop_tgt:`AUTOUIC` to find included
``.ui`` files.
diff --git a/Help/prop_tgt/BINARY_DIR.rst b/Help/prop_tgt/BINARY_DIR.rst
index 246f7e6050..beab12c8ac 100644
--- a/Help/prop_tgt/BINARY_DIR.rst
+++ b/Help/prop_tgt/BINARY_DIR.rst
@@ -1,6 +1,8 @@
BINARY_DIR
----------
+.. versionadded:: 3.4
+
This read-only property reports the value of the
:variable:`CMAKE_CURRENT_BINARY_DIR` variable in the directory in which
the target was defined.
diff --git a/Help/prop_tgt/BUILD_RPATH.rst b/Help/prop_tgt/BUILD_RPATH.rst
index d978b9439c..1f917a519c 100644
--- a/Help/prop_tgt/BUILD_RPATH.rst
+++ b/Help/prop_tgt/BUILD_RPATH.rst
@@ -1,6 +1,8 @@
BUILD_RPATH
-----------
+.. versionadded:: 3.8
+
A :ref:`semicolon-separated list <CMake Language Lists>` specifying runtime path (``RPATH``)
entries to add to binaries linked in the build tree (for platforms that
support it). The entries will *not* be used for binaries in the install
diff --git a/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
index 3378797802..2cdfa0d9c1 100644
--- a/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
+++ b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
@@ -1,6 +1,8 @@
BUILD_RPATH_USE_ORIGIN
----------------------
+.. versionadded:: 3.14
+
Whether to use relative paths for the build ``RPATH``.
This property is initialized by the value of the variable
diff --git a/Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst b/Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst
index bbb9a24ba2..073dce5cb6 100644
--- a/Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst
+++ b/Help/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR.rst
@@ -1,6 +1,8 @@
BUILD_WITH_INSTALL_NAME_DIR
---------------------------
+.. versionadded:: 3.9
+
``BUILD_WITH_INSTALL_NAME_DIR`` is a boolean specifying whether the macOS
``install_name`` of a target in the build tree uses the directory given by
:prop_tgt:`INSTALL_NAME_DIR`. This setting only applies to targets on macOS.
diff --git a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst
index 052ac6df00..adfa6f77a1 100644
--- a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst
+++ b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst
@@ -1,6 +1,8 @@
COMMON_LANGUAGE_RUNTIME
-----------------------
+.. versionadded:: 3.12
+
By setting this target property, the target is configured to build with
``C++/CLI`` support.
diff --git a/Help/prop_tgt/COMPILE_FEATURES.rst b/Help/prop_tgt/COMPILE_FEATURES.rst
index 46aec4ff41..9b937ed973 100644
--- a/Help/prop_tgt/COMPILE_FEATURES.rst
+++ b/Help/prop_tgt/COMPILE_FEATURES.rst
@@ -1,6 +1,8 @@
COMPILE_FEATURES
----------------
+.. versionadded:: 3.1
+
Compiler features enabled for this target.
The list of features in this property are a subset of the features listed
diff --git a/Help/prop_tgt/COMPILE_PDB_NAME.rst b/Help/prop_tgt/COMPILE_PDB_NAME.rst
index 24a9f62d6e..b76afeb089 100644
--- a/Help/prop_tgt/COMPILE_PDB_NAME.rst
+++ b/Help/prop_tgt/COMPILE_PDB_NAME.rst
@@ -1,6 +1,8 @@
COMPILE_PDB_NAME
----------------
+.. versionadded:: 3.1
+
Output name for the MS debug symbol ``.pdb`` file generated by the
compiler while building source files.
diff --git a/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst b/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
index e4077f559a..4c9825db24 100644
--- a/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
+++ b/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
@@ -1,6 +1,8 @@
COMPILE_PDB_NAME_<CONFIG>
-------------------------
+.. versionadded:: 3.1
+
Per-configuration output name for the MS debug symbol ``.pdb`` file
generated by the compiler while building source files.
diff --git a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
index 34f49bebef..3f3df660d8 100644
--- a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
@@ -1,6 +1,8 @@
COMPILE_PDB_OUTPUT_DIRECTORY
----------------------------
+.. versionadded:: 3.1
+
Output directory for the MS debug symbol ``.pdb`` file
generated by the compiler while building source files.
diff --git a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
index f261756f12..c25c2fc4e5 100644
--- a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -1,6 +1,8 @@
COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
-------------------------------------
+.. versionadded:: 3.1
+
Per-configuration output directory for the MS debug symbol ``.pdb`` file
generated by the compiler while building source files.
diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst
index 87c5978bc9..d7fb9b18e8 100644
--- a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst
+++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst
@@ -1,6 +1,8 @@
CROSSCOMPILING_EMULATOR
-----------------------
+.. versionadded:: 3.3
+
Use the given emulator to run executables created when crosscompiling.
This command will be added as a prefix to :command:`add_test`,
:command:`add_custom_command`, and :command:`add_custom_target` commands
diff --git a/Help/prop_tgt/CUDA_ARCHITECTURES.rst b/Help/prop_tgt/CUDA_ARCHITECTURES.rst
index bae3c6f3a5..d56b76908d 100644
--- a/Help/prop_tgt/CUDA_ARCHITECTURES.rst
+++ b/Help/prop_tgt/CUDA_ARCHITECTURES.rst
@@ -1,6 +1,8 @@
CUDA_ARCHITECTURES
------------------
+.. versionadded:: 3.18
+
List of architectures to generate device code for.
An architecture can be suffixed by either ``-real`` or ``-virtual`` to specify
diff --git a/Help/prop_tgt/CUDA_EXTENSIONS.rst b/Help/prop_tgt/CUDA_EXTENSIONS.rst
index 098ca3c469..2ddba0b419 100644
--- a/Help/prop_tgt/CUDA_EXTENSIONS.rst
+++ b/Help/prop_tgt/CUDA_EXTENSIONS.rst
@@ -1,6 +1,8 @@
CUDA_EXTENSIONS
---------------
+.. versionadded:: 3.8
+
Boolean specifying whether compiler specific extensions are requested.
This property specifies whether compiler specific extensions should be
diff --git a/Help/prop_tgt/CUDA_PTX_COMPILATION.rst b/Help/prop_tgt/CUDA_PTX_COMPILATION.rst
index 0ee372b8bf..4e90afee98 100644
--- a/Help/prop_tgt/CUDA_PTX_COMPILATION.rst
+++ b/Help/prop_tgt/CUDA_PTX_COMPILATION.rst
@@ -1,6 +1,8 @@
CUDA_PTX_COMPILATION
--------------------
+.. versionadded:: 3.9
+
Compile CUDA sources to ``.ptx`` files instead of ``.obj`` files
within :ref:`Object Libraries`.
diff --git a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
index dae960fbeb..819ce3ea92 100644
--- a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
+++ b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
@@ -1,6 +1,8 @@
CUDA_RESOLVE_DEVICE_SYMBOLS
---------------------------
+.. versionadded:: 3.9
+
CUDA only: Enables device linking for the specific library target where
required.
diff --git a/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst b/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst
index 11b344c67a..e937fc68ac 100644
--- a/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst
+++ b/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst
@@ -1,6 +1,8 @@
CUDA_RUNTIME_LIBRARY
--------------------
+.. versionadded:: 3.17
+
Select the CUDA runtime library for use by compilers targeting the CUDA language.
The allowed case insensitive values are:
diff --git a/Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst b/Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst
index d306d7f82b..32222f91ba 100644
--- a/Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst
+++ b/Help/prop_tgt/CUDA_SEPARABLE_COMPILATION.rst
@@ -1,6 +1,8 @@
CUDA_SEPARABLE_COMPILATION
--------------------------
+.. versionadded:: 3.8
+
CUDA only: Enables separate compilation of device code
If set this will enable separable compilation for all CUDA files for
diff --git a/Help/prop_tgt/CUDA_STANDARD.rst b/Help/prop_tgt/CUDA_STANDARD.rst
index 6d6774e4f3..fcc472568f 100644
--- a/Help/prop_tgt/CUDA_STANDARD.rst
+++ b/Help/prop_tgt/CUDA_STANDARD.rst
@@ -1,6 +1,8 @@
CUDA_STANDARD
-------------
+.. versionadded:: 3.8
+
The CUDA/C++ standard whose features are requested to build this target.
This property specifies the CUDA/C++ standard whose features are requested
diff --git a/Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst b/Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst
index b2d5b28f35..b92380075a 100644
--- a/Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst
+++ b/Help/prop_tgt/CUDA_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
CUDA_STANDARD_REQUIRED
----------------------
+.. versionadded:: 3.8
+
Boolean describing whether the value of :prop_tgt:`CUDA_STANDARD` is a requirement.
If this property is set to ``ON``, then the value of the
diff --git a/Help/prop_tgt/CXX_EXTENSIONS.rst b/Help/prop_tgt/CXX_EXTENSIONS.rst
index 280bb3a7a3..bda531ec01 100644
--- a/Help/prop_tgt/CXX_EXTENSIONS.rst
+++ b/Help/prop_tgt/CXX_EXTENSIONS.rst
@@ -1,6 +1,8 @@
CXX_EXTENSIONS
--------------
+.. versionadded:: 3.1
+
Boolean specifying whether compiler specific extensions are requested.
This property specifies whether compiler specific extensions should be
diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst
index ccc0147900..f322ffe1f2 100644
--- a/Help/prop_tgt/CXX_STANDARD.rst
+++ b/Help/prop_tgt/CXX_STANDARD.rst
@@ -1,6 +1,8 @@
CXX_STANDARD
------------
+.. versionadded:: 3.1
+
The C++ standard whose features are requested to build this target.
This property specifies the C++ standard whose features are requested
diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst
index 697d7f60dc..2ea22155d0 100644
--- a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst
+++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
CXX_STANDARD_REQUIRED
---------------------
+.. versionadded:: 3.1
+
Boolean describing whether the value of :prop_tgt:`CXX_STANDARD` is a requirement.
If this property is set to ``ON``, then the value of the
diff --git a/Help/prop_tgt/C_EXTENSIONS.rst b/Help/prop_tgt/C_EXTENSIONS.rst
index 05b14ce703..b2abb462fc 100644
--- a/Help/prop_tgt/C_EXTENSIONS.rst
+++ b/Help/prop_tgt/C_EXTENSIONS.rst
@@ -1,6 +1,8 @@
C_EXTENSIONS
------------
+.. versionadded:: 3.1
+
Boolean specifying whether compiler specific extensions are requested.
This property specifies whether compiler specific extensions should be
diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst
index 6a051393a9..999a9e7633 100644
--- a/Help/prop_tgt/C_STANDARD.rst
+++ b/Help/prop_tgt/C_STANDARD.rst
@@ -1,6 +1,8 @@
C_STANDARD
----------
+.. versionadded:: 3.1
+
The C standard whose features are requested to build this target.
This property specifies the C standard whose features are requested
diff --git a/Help/prop_tgt/C_STANDARD_REQUIRED.rst b/Help/prop_tgt/C_STANDARD_REQUIRED.rst
index acfad986b5..c1b58a0ceb 100644
--- a/Help/prop_tgt/C_STANDARD_REQUIRED.rst
+++ b/Help/prop_tgt/C_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
C_STANDARD_REQUIRED
-------------------
+.. versionadded:: 3.1
+
Boolean describing whether the value of :prop_tgt:`C_STANDARD` is a requirement.
If this property is set to ``ON``, then the value of the
diff --git a/Help/prop_tgt/DEBUG_POSTFIX.rst b/Help/prop_tgt/DEBUG_POSTFIX.rst
index 04e312e373..eca7cb0966 100644
--- a/Help/prop_tgt/DEBUG_POSTFIX.rst
+++ b/Help/prop_tgt/DEBUG_POSTFIX.rst
@@ -1,7 +1,7 @@
DEBUG_POSTFIX
-------------
-See target property ``<CONFIG>_POSTFIX``.
+See target property :prop_tgt:`<CONFIG>_POSTFIX`.
-This property is a special case of the more-general ``<CONFIG>_POSTFIX``
+This property is a special case of the more-general :prop_tgt:`<CONFIG>_POSTFIX`
property for the ``DEBUG`` configuration.
diff --git a/Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst b/Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst
index 5e9c191589..f11fe7ce2b 100644
--- a/Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst
+++ b/Help/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES.rst
@@ -1,6 +1,8 @@
DEPLOYMENT_ADDITIONAL_FILES
---------------------------
+.. versionadded:: 3.13
+
Set the WinCE project ``AdditionalFiles`` in ``DeploymentTool`` in ``.vcproj``
files generated by the :generator:`Visual Studio 9 2008` generator.
This is useful when you want to debug on remote WinCE device.
diff --git a/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst b/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst
index 368768ae78..0680238217 100644
--- a/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst
+++ b/Help/prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY.rst
@@ -1,6 +1,8 @@
DEPLOYMENT_REMOTE_DIRECTORY
---------------------------
+.. versionadded:: 3.6
+
Set the WinCE project ``RemoteDirectory`` in ``DeploymentTool`` and
``RemoteExecutable`` in ``DebuggerTool`` in ``.vcproj`` files generated
by the :generator:`Visual Studio 9 2008` generator.
diff --git a/Help/prop_tgt/DEPRECATION.rst b/Help/prop_tgt/DEPRECATION.rst
index fef2e2e3aa..45ca848f1b 100644
--- a/Help/prop_tgt/DEPRECATION.rst
+++ b/Help/prop_tgt/DEPRECATION.rst
@@ -1,6 +1,8 @@
DEPRECATION
-----------
+.. versionadded:: 3.17
+
Deprecation message from imported target's developer.
``DEPRECATION`` is the message regarding a deprecation status to be displayed
diff --git a/Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst b/Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst
index 4cef0231af..7b3826b4ff 100644
--- a/Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst
+++ b/Help/prop_tgt/DISABLE_PRECOMPILE_HEADERS.rst
@@ -1,6 +1,8 @@
DISABLE_PRECOMPILE_HEADERS
--------------------------
+.. versionadded:: 3.16
+
Disables the precompilation of header files specified by
:prop_tgt:`PRECOMPILE_HEADERS` property.
diff --git a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst
index 8698eb67b9..3ba4e25021 100644
--- a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst
+++ b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK.rst
@@ -1,6 +1,8 @@
DOTNET_TARGET_FRAMEWORK
-----------------------
+.. versionadded:: 3.17
+
Specify the .NET target framework.
Used to specify the .NET target framework for C++/CLI and C#. For
diff --git a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst
index b33f4fb480..fbd1aab471 100644
--- a/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst
+++ b/Help/prop_tgt/DOTNET_TARGET_FRAMEWORK_VERSION.rst
@@ -1,6 +1,8 @@
DOTNET_TARGET_FRAMEWORK_VERSION
-------------------------------
+.. versionadded:: 3.12
+
Specify the .NET target framework version.
Used to specify the .NET target framework version for C++/CLI and C#.
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index c9ece22de6..f0200f38bc 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -19,3 +19,10 @@ If a target has ``EXCLUDE_FROM_ALL`` set to true, it may still be listed
in an :command:`install(TARGETS)` command, but the user is responsible for
ensuring that the target's build artifacts are not missing or outdated when
an install is performed.
+
+This property may use "generator expressions" with the syntax ``$<...>``. See
+the :manual:`cmake-generator-expressions(7)` manual for available expressions.
+
+Only the "Ninja Multi-Config" generator supports a property value that varies by
+configuration. For all other generators the value of this property must be the
+same for all configurations.
diff --git a/Help/prop_tgt/EXPORT_PROPERTIES.rst b/Help/prop_tgt/EXPORT_PROPERTIES.rst
index bcf47a6241..34c054fa6b 100644
--- a/Help/prop_tgt/EXPORT_PROPERTIES.rst
+++ b/Help/prop_tgt/EXPORT_PROPERTIES.rst
@@ -1,6 +1,8 @@
EXPORT_PROPERTIES
-----------------
+.. versionadded:: 3.12
+
List additional properties to export for a target.
This property contains a list of property names that should be exported by
diff --git a/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst b/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
index 243c0cd4be..84d0c1e257 100644
--- a/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
+++ b/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
@@ -1,6 +1,8 @@
FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>
---------------------------------------
+.. versionadded:: 3.18
+
Postfix to append to the framework file name for configuration ``<CONFIG>``,
when using a multi-config generator (like Xcode and Ninja Multi-Config).
diff --git a/Help/prop_tgt/FRAMEWORK_VERSION.rst b/Help/prop_tgt/FRAMEWORK_VERSION.rst
index c2ae7b98f6..38b81373e2 100644
--- a/Help/prop_tgt/FRAMEWORK_VERSION.rst
+++ b/Help/prop_tgt/FRAMEWORK_VERSION.rst
@@ -1,6 +1,8 @@
FRAMEWORK_VERSION
-----------------
+.. versionadded:: 3.4
+
Version of a framework created using the :prop_tgt:`FRAMEWORK` target
property (e.g. ``A``).
diff --git a/Help/prop_tgt/Fortran_PREPROCESS.rst b/Help/prop_tgt/Fortran_PREPROCESS.rst
index 47a15c0566..e7e2fbaf85 100644
--- a/Help/prop_tgt/Fortran_PREPROCESS.rst
+++ b/Help/prop_tgt/Fortran_PREPROCESS.rst
@@ -1,6 +1,8 @@
Fortran_PREPROCESS
------------------
+.. versionadded:: 3.18
+
Control whether the Fortran source file should be unconditionally
preprocessed.
diff --git a/Help/prop_tgt/GHS_INTEGRITY_APP.rst b/Help/prop_tgt/GHS_INTEGRITY_APP.rst
index b6697817a9..cccd087b82 100644
--- a/Help/prop_tgt/GHS_INTEGRITY_APP.rst
+++ b/Help/prop_tgt/GHS_INTEGRITY_APP.rst
@@ -1,6 +1,8 @@
GHS_INTEGRITY_APP
-----------------
+.. versionadded:: 3.14
+
``ON`` / ``OFF`` boolean to determine if an executable target should
be treated as an `Integrity Application`.
diff --git a/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
index 11ce0b2238..fe6b8e68ae 100644
--- a/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
+++ b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
@@ -1,6 +1,8 @@
GHS_NO_SOURCE_GROUP_FILE
------------------------
+.. versionadded:: 3.14
+
``ON`` / ``OFF`` boolean to control if the project file for a target should
be one single file or multiple files.
diff --git a/Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst b/Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst
index 99e3bc45e8..8c20e07e2b 100644
--- a/Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst
+++ b/Help/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME.rst
@@ -1,6 +1,8 @@
IMPORTED_COMMON_LANGUAGE_RUNTIME
--------------------------------
+.. versionadded:: 3.12
+
Property to define if the target uses ``C++/CLI``.
Ignored for non-imported targets.
diff --git a/Help/prop_tgt/IMPORTED_GLOBAL.rst b/Help/prop_tgt/IMPORTED_GLOBAL.rst
index 1a9129fd75..176127f43c 100644
--- a/Help/prop_tgt/IMPORTED_GLOBAL.rst
+++ b/Help/prop_tgt/IMPORTED_GLOBAL.rst
@@ -1,6 +1,8 @@
IMPORTED_GLOBAL
---------------
+.. versionadded:: 3.11
+
Indication of whether an :ref:`IMPORTED target <Imported Targets>` is
globally visible.
diff --git a/Help/prop_tgt/IMPORTED_LIBNAME.rst b/Help/prop_tgt/IMPORTED_LIBNAME.rst
index 1943dbaaa1..7a83906e1c 100644
--- a/Help/prop_tgt/IMPORTED_LIBNAME.rst
+++ b/Help/prop_tgt/IMPORTED_LIBNAME.rst
@@ -1,6 +1,8 @@
IMPORTED_LIBNAME
----------------
+.. versionadded:: 3.8
+
Specify the link library name for an :ref:`imported <Imported Targets>`
:ref:`Interface Library <Interface Libraries>`.
diff --git a/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst b/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst
index a28b838822..df64769fec 100644
--- a/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst
+++ b/Help/prop_tgt/IMPORTED_LIBNAME_CONFIG.rst
@@ -1,6 +1,8 @@
IMPORTED_LIBNAME_<CONFIG>
-------------------------
+.. versionadded:: 3.8
+
<CONFIG>-specific version of :prop_tgt:`IMPORTED_LIBNAME` property.
Configuration names correspond to those provided by the project from
diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst
index 50a329fb3b..bbbcd866da 100644
--- a/Help/prop_tgt/IMPORTED_OBJECTS.rst
+++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst
@@ -1,6 +1,8 @@
IMPORTED_OBJECTS
----------------
+.. versionadded:: 3.9
+
A :ref:`semicolon-separated list <CMake Language Lists>` of absolute paths to the object
files on disk for an :ref:`imported <Imported targets>`
:ref:`object library <object libraries>`.
diff --git a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
index 4419ed1d1f..b12ca38873 100644
--- a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
+++ b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
@@ -1,6 +1,8 @@
IMPORTED_OBJECTS_<CONFIG>
-------------------------
+.. versionadded:: 3.9
+
<CONFIG>-specific version of :prop_tgt:`IMPORTED_OBJECTS` property.
Configuration names correspond to those provided by the project from
diff --git a/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst b/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
index 72dcaa0b1f..f41e41c66a 100644
--- a/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
+++ b/Help/prop_tgt/INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
@@ -1,6 +1,8 @@
INSTALL_REMOVE_ENVIRONMENT_RPATH
--------------------------------
+.. versionadded:: 3.16
+
Controls whether toolchain-defined rpaths should be removed during installation.
When a target is being installed, CMake may need to rewrite its rpath
diff --git a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst
index 31b594f82d..0db3b0cbdc 100644
--- a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst
+++ b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst
@@ -1,6 +1,8 @@
INTERFACE_COMPILE_FEATURES
--------------------------
+.. versionadded:: 3.1
+
.. |property_name| replace:: compile features
.. |command_name| replace:: :command:`target_compile_features`
.. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_FEATURES``
diff --git a/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst b/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst
index 790554d9fa..9c8275d5f2 100644
--- a/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_DEPENDS.rst
@@ -1,6 +1,8 @@
INTERFACE_LINK_DEPENDS
----------------------
+.. versionadded:: 3.13
+
Additional public interface files on which a target binary depends for linking.
This property is supported only by :generator:`Ninja` and
diff --git a/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst
index 56a4ec0ec9..de1dabbcf6 100644
--- a/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst
@@ -1,6 +1,8 @@
INTERFACE_LINK_DIRECTORIES
--------------------------
+.. versionadded:: 3.13
+
.. |property_name| replace:: link directories
.. |command_name| replace:: :command:`target_link_directories`
.. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_LINK_DIRECTORIES``
diff --git a/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst b/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst
index c293b986df..4245fe9f2d 100644
--- a/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst
@@ -1,6 +1,8 @@
INTERFACE_LINK_OPTIONS
----------------------
+.. versionadded:: 3.13
+
.. |property_name| replace:: link options
.. |command_name| replace:: :command:`target_link_options`
.. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_LINK_OPTIONS``
diff --git a/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst b/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst
index e2854074c1..2299264535 100644
--- a/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst
+++ b/Help/prop_tgt/INTERFACE_PRECOMPILE_HEADERS.rst
@@ -1,6 +1,8 @@
INTERFACE_PRECOMPILE_HEADERS
----------------------------
+.. versionadded:: 3.16
+
List of interface header files to precompile into consuming targets.
Targets may populate this property to publish the header files
diff --git a/Help/prop_tgt/INTERFACE_SOURCES.rst b/Help/prop_tgt/INTERFACE_SOURCES.rst
index a224b68597..759c482110 100644
--- a/Help/prop_tgt/INTERFACE_SOURCES.rst
+++ b/Help/prop_tgt/INTERFACE_SOURCES.rst
@@ -1,6 +1,8 @@
INTERFACE_SOURCES
-----------------
+.. versionadded:: 3.1
+
List of interface sources to compile into consuming targets.
Targets may populate this property to publish the sources
diff --git a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst
index 59f67a7ebe..23a86e64d0 100644
--- a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst
+++ b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst
@@ -1,6 +1,8 @@
IOS_INSTALL_COMBINED
--------------------
+.. versionadded:: 3.5
+
Build a combined (device and simulator) target when installing.
When this property is set to set to false (which is the default) then it will
diff --git a/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst b/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst
index ece28a4e81..42cace0283 100644
--- a/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst
+++ b/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst
@@ -1,6 +1,8 @@
JOB_POOL_PRECOMPILE_HEADER
--------------------------
+.. versionadded:: 3.17
+
Ninja only: Pool used for generating pre-compiled headers.
The number of parallel compile processes could be limited by defining
diff --git a/Help/prop_tgt/LANG_CLANG_TIDY.rst b/Help/prop_tgt/LANG_CLANG_TIDY.rst
index 2bfef66730..7fc23721c7 100644
--- a/Help/prop_tgt/LANG_CLANG_TIDY.rst
+++ b/Help/prop_tgt/LANG_CLANG_TIDY.rst
@@ -1,6 +1,8 @@
<LANG>_CLANG_TIDY
-----------------
+.. versionadded:: 3.6
+
This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
diff --git a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
index a6f2b24f62..77ae1f6c1e 100644
--- a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
+++ b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
@@ -1,6 +1,8 @@
<LANG>_COMPILER_LAUNCHER
------------------------
+.. versionadded:: 3.4
+
This property is implemented only when ``<LANG>`` is ``C``, ``CXX``,
``Fortran``, ``OBJC``, ``OBJCXX``, or ``CUDA``.
diff --git a/Help/prop_tgt/LANG_CPPCHECK.rst b/Help/prop_tgt/LANG_CPPCHECK.rst
index 60785d062a..80acbc02a9 100644
--- a/Help/prop_tgt/LANG_CPPCHECK.rst
+++ b/Help/prop_tgt/LANG_CPPCHECK.rst
@@ -1,6 +1,8 @@
<LANG>_CPPCHECK
---------------
+.. versionadded:: 3.10
+
This property is supported only when ``<LANG>`` is ``C`` or ``CXX``.
Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line
diff --git a/Help/prop_tgt/LANG_CPPLINT.rst b/Help/prop_tgt/LANG_CPPLINT.rst
index 9944c88ba2..be6db46b36 100644
--- a/Help/prop_tgt/LANG_CPPLINT.rst
+++ b/Help/prop_tgt/LANG_CPPLINT.rst
@@ -1,6 +1,8 @@
<LANG>_CPPLINT
--------------
+.. versionadded:: 3.8
+
This property is supported only when ``<LANG>`` is ``C`` or ``CXX``.
Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line
diff --git a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
index 35220e414a..eebef561bb 100644
--- a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
+++ b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
@@ -1,6 +1,8 @@
<LANG>_INCLUDE_WHAT_YOU_USE
---------------------------
+.. versionadded:: 3.3
+
This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
diff --git a/Help/prop_tgt/LINK_DIRECTORIES.rst b/Help/prop_tgt/LINK_DIRECTORIES.rst
index c2905b37da..67be494ce9 100644
--- a/Help/prop_tgt/LINK_DIRECTORIES.rst
+++ b/Help/prop_tgt/LINK_DIRECTORIES.rst
@@ -1,6 +1,8 @@
LINK_DIRECTORIES
----------------
+.. versionadded:: 3.13
+
List of directories to use for the link step of shared library, module
and executable targets.
diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst
index ff3ee87e3a..8c0dfc4266 100644
--- a/Help/prop_tgt/LINK_OPTIONS.rst
+++ b/Help/prop_tgt/LINK_OPTIONS.rst
@@ -1,6 +1,8 @@
LINK_OPTIONS
------------
+.. versionadded:: 3.13
+
List of options to use for the link step of shared library, module
and executable targets as well as the device link step. Targets that are static
libraries need to use the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
diff --git a/Help/prop_tgt/LINK_WHAT_YOU_USE.rst b/Help/prop_tgt/LINK_WHAT_YOU_USE.rst
index 32d6edb076..2ed93adfd9 100644
--- a/Help/prop_tgt/LINK_WHAT_YOU_USE.rst
+++ b/Help/prop_tgt/LINK_WHAT_YOU_USE.rst
@@ -1,6 +1,8 @@
LINK_WHAT_YOU_USE
---------------------------
+.. versionadded:: 3.7
+
This is a boolean option that when set to ``TRUE`` will automatically run
``ldd -r -u`` on the target after it is linked. In addition, the linker flag
``-Wl,--no-as-needed`` will be passed to the target with the link command so
diff --git a/Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst b/Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst
index 26d5cc86c9..a24b25519f 100644
--- a/Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst
+++ b/Help/prop_tgt/MACHO_COMPATIBILITY_VERSION.rst
@@ -1,6 +1,8 @@
MACHO_COMPATIBILITY_VERSION
---------------------------
+.. versionadded:: 3.17
+
What compatibility version number is this target for Mach-O binaries.
For shared libraries on Mach-O systems (e.g. macOS, iOS)
diff --git a/Help/prop_tgt/MACHO_CURRENT_VERSION.rst b/Help/prop_tgt/MACHO_CURRENT_VERSION.rst
index 9afb356995..530f79b1ad 100644
--- a/Help/prop_tgt/MACHO_CURRENT_VERSION.rst
+++ b/Help/prop_tgt/MACHO_CURRENT_VERSION.rst
@@ -1,6 +1,8 @@
MACHO_CURRENT_VERSION
---------------------
+.. versionadded:: 3.17
+
What current version number is this target for Mach-O binaries.
For shared libraries on Mach-O systems (e.g. macOS, iOS)
diff --git a/Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst b/Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst
index c12ea147cc..72871b3e6a 100644
--- a/Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst
+++ b/Help/prop_tgt/MANUALLY_ADDED_DEPENDENCIES.rst
@@ -1,6 +1,8 @@
MANUALLY_ADDED_DEPENDENCIES
---------------------------
+.. versionadded:: 3.8
+
Get manually added dependencies to other top-level targets.
This read-only property can be used to query all dependencies that
diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
index 73792def10..9b978b28d5 100644
--- a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
+++ b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
@@ -1,6 +1,8 @@
MSVC_RUNTIME_LIBRARY
--------------------
+.. versionadded:: 3.15
+
Select the MSVC runtime library for use by compilers targeting the MSVC ABI.
The allowed values are:
diff --git a/Help/prop_tgt/OBJCXX_EXTENSIONS.rst b/Help/prop_tgt/OBJCXX_EXTENSIONS.rst
index 9f9d804b66..8a254f20a5 100644
--- a/Help/prop_tgt/OBJCXX_EXTENSIONS.rst
+++ b/Help/prop_tgt/OBJCXX_EXTENSIONS.rst
@@ -1,6 +1,8 @@
OBJCXX_EXTENSIONS
-----------------
+.. versionadded:: 3.16
+
Boolean specifying whether compiler specific extensions are requested.
This property specifies whether compiler specific extensions should be
diff --git a/Help/prop_tgt/OBJCXX_STANDARD.rst b/Help/prop_tgt/OBJCXX_STANDARD.rst
index 3c925dcba6..1067153e61 100644
--- a/Help/prop_tgt/OBJCXX_STANDARD.rst
+++ b/Help/prop_tgt/OBJCXX_STANDARD.rst
@@ -1,6 +1,8 @@
OBJCXX_STANDARD
---------------
+.. versionadded:: 3.16
+
The ObjC++ standard whose features are requested to build this target.
This property specifies the ObjC++ standard whose features are requested
diff --git a/Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst
index c330abfdd8..3cee740417 100644
--- a/Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst
+++ b/Help/prop_tgt/OBJCXX_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
OBJCXX_STANDARD_REQUIRED
------------------------
+.. versionadded:: 3.16
+
Boolean describing whether the value of :prop_tgt:`OBJCXX_STANDARD` is a requirement.
If this property is set to ``ON``, then the value of the
diff --git a/Help/prop_tgt/OBJC_EXTENSIONS.rst b/Help/prop_tgt/OBJC_EXTENSIONS.rst
index 2de9e48fed..ef1c7543cd 100644
--- a/Help/prop_tgt/OBJC_EXTENSIONS.rst
+++ b/Help/prop_tgt/OBJC_EXTENSIONS.rst
@@ -1,6 +1,8 @@
OBJC_EXTENSIONS
---------------
+.. versionadded:: 3.16
+
Boolean specifying whether compiler specific extensions are requested.
This property specifies whether compiler specific extensions should be
diff --git a/Help/prop_tgt/OBJC_STANDARD.rst b/Help/prop_tgt/OBJC_STANDARD.rst
index d1e1b24258..2143ff92d9 100644
--- a/Help/prop_tgt/OBJC_STANDARD.rst
+++ b/Help/prop_tgt/OBJC_STANDARD.rst
@@ -1,6 +1,8 @@
OBJC_STANDARD
-------------
+.. versionadded:: 3.16
+
The OBJC standard whose features are requested to build this target.
This property specifies the OBJC standard whose features are requested
diff --git a/Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst b/Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst
index 8cf377cd18..11547c8362 100644
--- a/Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst
+++ b/Help/prop_tgt/OBJC_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
OBJC_STANDARD_REQUIRED
----------------------
+.. versionadded:: 3.16
+
Boolean describing whether the value of :prop_tgt:`OBJC_STANDARD` is a requirement.
If this property is set to ``ON``, then the value of the
diff --git a/Help/prop_tgt/PCH_WARN_INVALID.rst b/Help/prop_tgt/PCH_WARN_INVALID.rst
index 96e1abdf89..2d5ec55caa 100644
--- a/Help/prop_tgt/PCH_WARN_INVALID.rst
+++ b/Help/prop_tgt/PCH_WARN_INVALID.rst
@@ -1,6 +1,8 @@
PCH_WARN_INVALID
----------------
+.. versionadded:: 3.18
+
When this property is set to true, the precompile header compiler options
will contain a compiler flag which should warn about invalid precompiled
headers e.g. ``-Winvalid-pch`` for GNU compiler.
diff --git a/Help/prop_tgt/PRECOMPILE_HEADERS.rst b/Help/prop_tgt/PRECOMPILE_HEADERS.rst
index 9e70b654d0..af27947631 100644
--- a/Help/prop_tgt/PRECOMPILE_HEADERS.rst
+++ b/Help/prop_tgt/PRECOMPILE_HEADERS.rst
@@ -1,6 +1,8 @@
PRECOMPILE_HEADERS
------------------
+.. versionadded:: 3.16
+
List of header files to precompile.
This property holds a :ref:`semicolon-separated list <CMake Language Lists>`
diff --git a/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst b/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst
index 9c3e7eaf31..6f5635b4e4 100644
--- a/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst
+++ b/Help/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM.rst
@@ -1,6 +1,8 @@
PRECOMPILE_HEADERS_REUSE_FROM
-----------------------------
+.. versionadded:: 3.16
+
Target from which to reuse the precompiled headers build artifact.
See the second signature of :command:`target_precompile_headers` command
diff --git a/Help/prop_tgt/SOURCE_DIR.rst b/Help/prop_tgt/SOURCE_DIR.rst
index b25813bff5..78ce220ec7 100644
--- a/Help/prop_tgt/SOURCE_DIR.rst
+++ b/Help/prop_tgt/SOURCE_DIR.rst
@@ -1,6 +1,8 @@
SOURCE_DIR
----------
+.. versionadded:: 3.4
+
This read-only property reports the value of the
:variable:`CMAKE_CURRENT_SOURCE_DIR` variable in the directory in which
the target was defined.
diff --git a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
index d05fda4aaa..2f4a3baab3 100644
--- a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
+++ b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
@@ -1,6 +1,8 @@
STATIC_LIBRARY_OPTIONS
----------------------
+.. versionadded:: 3.13
+
Archiver (or MSVC librarian) flags for a static library target.
Targets that are shared libraries, modules, or executables need to use
the :prop_tgt:`LINK_OPTIONS` target property.
diff --git a/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst b/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst
index 46c9a1d9bd..0f944b60a9 100644
--- a/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst
+++ b/Help/prop_tgt/Swift_DEPENDENCIES_FILE.rst
@@ -1,5 +1,7 @@
Swift_DEPENDENCIES_FILE
-----------------------
+.. versionadded:: 3.15
+
This property sets the path for the Swift dependency file (swiftdep) for the
target. If one is not specified, it will default to ``<TARGET>.swiftdeps``.
diff --git a/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst b/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst
index 7579447a47..afc6b31253 100644
--- a/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst
+++ b/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst
@@ -1,6 +1,8 @@
Swift_LANGUAGE_VERSION
----------------------
+.. versionadded:: 3.16
+
This property sets the language version for the Swift sources in the target. If
one is not specified, it will default to ``<CMAKE_Swift_LANGUAGE_VERSION>`` if
specified, otherwise it is the latest version supported by the compiler.
diff --git a/Help/prop_tgt/Swift_MODULE_DIRECTORY.rst b/Help/prop_tgt/Swift_MODULE_DIRECTORY.rst
index d404251669..a6484f2fd4 100644
--- a/Help/prop_tgt/Swift_MODULE_DIRECTORY.rst
+++ b/Help/prop_tgt/Swift_MODULE_DIRECTORY.rst
@@ -1,6 +1,8 @@
Swift_MODULE_DIRECTORY
----------------------
+.. versionadded:: 3.15
+
Specify output directory for Swift modules provided by the target.
If the target contains Swift source files, this specifies the directory in which
diff --git a/Help/prop_tgt/Swift_MODULE_NAME.rst b/Help/prop_tgt/Swift_MODULE_NAME.rst
index 28660203ec..d941b54304 100644
--- a/Help/prop_tgt/Swift_MODULE_NAME.rst
+++ b/Help/prop_tgt/Swift_MODULE_NAME.rst
@@ -1,5 +1,7 @@
Swift_MODULE_NAME
-----------------
+.. versionadded:: 3.15
+
This property specifies the name of the Swift module. It is defaulted to the
name of the target.
diff --git a/Help/prop_tgt/UNITY_BUILD.rst b/Help/prop_tgt/UNITY_BUILD.rst
index e140952110..04cede61ef 100644
--- a/Help/prop_tgt/UNITY_BUILD.rst
+++ b/Help/prop_tgt/UNITY_BUILD.rst
@@ -1,6 +1,8 @@
UNITY_BUILD
-----------
+.. versionadded:: 3.16
+
When this property is set to true, the target source files will be combined
into batches for faster compilation. This is done by creating a (set of)
unity sources which ``#include`` the original sources, then compiling these
diff --git a/Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst b/Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst
index 44ffe27840..3886ec992a 100644
--- a/Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst
+++ b/Help/prop_tgt/UNITY_BUILD_BATCH_SIZE.rst
@@ -1,6 +1,8 @@
UNITY_BUILD_BATCH_SIZE
----------------------
+.. versionadded:: 3.16
+
Specifies the maximum number of source files that can be combined into any one
unity source file when unity builds are enabled by the :prop_tgt:`UNITY_BUILD`
target property. The original source files will be distributed across as many
diff --git a/Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst b/Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst
index 7231b61162..ac2b19c212 100644
--- a/Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst
+++ b/Help/prop_tgt/UNITY_BUILD_CODE_AFTER_INCLUDE.rst
@@ -1,6 +1,8 @@
UNITY_BUILD_CODE_AFTER_INCLUDE
------------------------------
+.. versionadded:: 3.16
+
Code snippet which is included verbatim by the :prop_tgt:`UNITY_BUILD`
feature just after every ``#include`` statement in the generated unity
source files. For example:
diff --git a/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst b/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst
index 7ed6fa10aa..6f0d56b721 100644
--- a/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst
+++ b/Help/prop_tgt/UNITY_BUILD_CODE_BEFORE_INCLUDE.rst
@@ -1,6 +1,8 @@
UNITY_BUILD_CODE_BEFORE_INCLUDE
-------------------------------
+.. versionadded:: 3.16
+
Code snippet which is included verbatim by the :prop_tgt:`UNITY_BUILD`
feature just before every ``#include`` statement in the generated unity
source files. For example:
diff --git a/Help/prop_tgt/UNITY_BUILD_MODE.rst b/Help/prop_tgt/UNITY_BUILD_MODE.rst
index 1ebab2319c..003451ee42 100644
--- a/Help/prop_tgt/UNITY_BUILD_MODE.rst
+++ b/Help/prop_tgt/UNITY_BUILD_MODE.rst
@@ -1,6 +1,8 @@
UNITY_BUILD_MODE
----------------
+.. versionadded:: 3.18
+
CMake provides different algorithms for selecting which sources are grouped
together into a *bucket*. Selection is decided by this property,
which has the following acceptable values:
diff --git a/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst b/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst
index 640bed596a..4adffd4f23 100644
--- a/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst
+++ b/Help/prop_tgt/VS_CONFIGURATION_TYPE.rst
@@ -1,6 +1,8 @@
VS_CONFIGURATION_TYPE
---------------------
+.. versionadded:: 3.6
+
Visual Studio project configuration type.
Sets the ``ConfigurationType`` attribute for a generated Visual Studio project.
diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst
index ba5fd0aeba..58476d6e2f 100644
--- a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst
+++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst
@@ -1,6 +1,8 @@
VS_DEBUGGER_COMMAND
-------------------
+.. versionadded:: 3.12
+
Sets the local debugger command for Visual Studio C++ targets.
The property value may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst
index 06ef5d5fc0..6c26601a8e 100644
--- a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst
+++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst
@@ -1,6 +1,8 @@
VS_DEBUGGER_COMMAND_ARGUMENTS
-----------------------------
+.. versionadded:: 3.13
+
Sets the local debugger command line arguments for Visual Studio C++ targets.
The property value may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst
index f55ac7bee2..2f59a8219f 100644
--- a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst
+++ b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst
@@ -1,6 +1,8 @@
VS_DEBUGGER_ENVIRONMENT
-----------------------
+.. versionadded:: 3.13
+
Sets the local debugger environment for Visual Studio C++ targets.
The property value may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst
index 008bbf6e62..c163abf92d 100644
--- a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst
+++ b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst
@@ -1,6 +1,8 @@
VS_DEBUGGER_WORKING_DIRECTORY
-----------------------------
+.. versionadded:: 3.8
+
Sets the local debugger working directory for Visual Studio C++ targets.
The property value may use
:manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst
index 19d1620495..5fd23e1875 100644
--- a/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst
+++ b/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst
@@ -1,6 +1,8 @@
VS_DESKTOP_EXTENSIONS_VERSION
-----------------------------
+.. versionadded:: 3.4
+
Visual Studio Windows 10 Desktop Extensions Version
Specifies the version of the Desktop Extensions that should be included in the
diff --git a/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst b/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst
index 1bc361c3da..a3882569e0 100644
--- a/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst
+++ b/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst
@@ -1,6 +1,8 @@
VS_DOTNET_DOCUMENTATION_FILE
----------------------------
+.. versionadded:: 3.17
+
Visual Studio managed project .NET documentation output
Sets the target XML documentation file output.
diff --git a/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst b/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst
index ab311eaf61..5b9caee08e 100644
--- a/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst
+++ b/Help/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname.rst
@@ -1,6 +1,8 @@
VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>
-----------------------------------------------
+.. versionadded:: 3.10
+
Defines an XML property ``<tagname>`` for a .NET reference
``<refname>``.
diff --git a/Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst b/Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst
index 7641ba5ff6..556fa8acc1 100644
--- a/Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst
+++ b/Help/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL.rst
@@ -1,6 +1,8 @@
VS_DOTNET_REFERENCES_COPY_LOCAL
-------------------------------
+.. versionadded:: 3.8
+
Sets the **Copy Local** property for all .NET hint references in the target
Boolean property to enable/disable copying of .NET hint references to
diff --git a/Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst b/Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst
index 5814005328..9c4d34abe9 100644
--- a/Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst
+++ b/Help/prop_tgt/VS_DOTNET_REFERENCE_refname.rst
@@ -1,6 +1,8 @@
VS_DOTNET_REFERENCE_<refname>
-----------------------------
+.. versionadded:: 3.8
+
Visual Studio managed project .NET reference with name ``<refname>``
and hint path.
diff --git a/Help/prop_tgt/VS_DPI_AWARE.rst b/Help/prop_tgt/VS_DPI_AWARE.rst
index 82640cc60f..47ce1ce2a8 100644
--- a/Help/prop_tgt/VS_DPI_AWARE.rst
+++ b/Help/prop_tgt/VS_DPI_AWARE.rst
@@ -1,6 +1,8 @@
VS_DPI_AWARE
------------
+.. versionadded:: 3.16
+
Set the Manifest Tool -> Input and Output -> DPI Awareness in the Visual Studio
target project properties.
diff --git a/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst
index 27c8a3df3b..ca6a3ca006 100644
--- a/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst
+++ b/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst
@@ -1,6 +1,8 @@
VS_IOT_EXTENSIONS_VERSION
-------------------------
+.. versionadded:: 3.4
+
Visual Studio Windows 10 IoT Extensions Version
Specifies the version of the IoT Extensions that should be included in the
diff --git a/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst b/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst
index add50cb240..259055d4e7 100644
--- a/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst
+++ b/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst
@@ -1,6 +1,8 @@
VS_IOT_STARTUP_TASK
-------------------
+.. versionadded:: 3.4
+
Visual Studio Windows 10 IoT Continuous Background Task
Specifies that the target should be compiled as a Continuous Background Task library.
diff --git a/Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst b/Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst
index 42fb8ad86c..724bd2f47f 100644
--- a/Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst
+++ b/Help/prop_tgt/VS_JUST_MY_CODE_DEBUGGING.rst
@@ -1,6 +1,8 @@
VS_JUST_MY_CODE_DEBUGGING
-------------------------
+.. versionadded:: 3.15
+
Enable Just My Code with Visual Studio debugger.
Supported on :ref:`Visual Studio Generators` for VS 2010 and higher,
diff --git a/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst
index be3c9a018c..b307e84e84 100644
--- a/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst
+++ b/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst
@@ -1,6 +1,8 @@
VS_MOBILE_EXTENSIONS_VERSION
----------------------------
+.. versionadded:: 3.4
+
Visual Studio Windows 10 Mobile Extensions Version
Specifies the version of the Mobile Extensions that should be included in the
diff --git a/Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst b/Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst
index ffcbde5722..bf6ac10923 100644
--- a/Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst
+++ b/Help/prop_tgt/VS_NO_SOLUTION_DEPLOY.rst
@@ -1,6 +1,8 @@
VS_NO_SOLUTION_DEPLOY
---------------------
+.. versionadded:: 3.15
+
Specify that the target should not be marked for deployment to a Windows CE
or Windows Phone device in the generated Visual Studio solution.
diff --git a/Help/prop_tgt/VS_PACKAGE_REFERENCES.rst b/Help/prop_tgt/VS_PACKAGE_REFERENCES.rst
index 5a0465bcc6..ec17567724 100644
--- a/Help/prop_tgt/VS_PACKAGE_REFERENCES.rst
+++ b/Help/prop_tgt/VS_PACKAGE_REFERENCES.rst
@@ -1,6 +1,8 @@
VS_PACKAGE_REFERENCES
---------------------
+.. versionadded:: 3.15
+
Visual Studio package references for nuget.
Adds one or more semicolon-delimited package references to a generated
diff --git a/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst b/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst
index f8f2e8e79d..27a92d6b9d 100644
--- a/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst
+++ b/Help/prop_tgt/VS_PLATFORM_TOOLSET.rst
@@ -1,6 +1,8 @@
VS_PLATFORM_TOOLSET
-------------------
+.. versionadded:: 3.18
+
Overrides the platform toolset used to build a target.
Only supported when the compiler used by the given toolset is the
diff --git a/Help/prop_tgt/VS_PROJECT_IMPORT.rst b/Help/prop_tgt/VS_PROJECT_IMPORT.rst
index 569c8ea742..f5e9698a3f 100644
--- a/Help/prop_tgt/VS_PROJECT_IMPORT.rst
+++ b/Help/prop_tgt/VS_PROJECT_IMPORT.rst
@@ -1,6 +1,8 @@
VS_PROJECT_IMPORT
-----------------
+.. versionadded:: 3.15
+
Visual Studio managed project imports
Adds to a generated Visual Studio project one or more semicolon-delimited paths
diff --git a/Help/prop_tgt/VS_SDK_REFERENCES.rst b/Help/prop_tgt/VS_SDK_REFERENCES.rst
index 99987f5614..9a082e7fde 100644
--- a/Help/prop_tgt/VS_SDK_REFERENCES.rst
+++ b/Help/prop_tgt/VS_SDK_REFERENCES.rst
@@ -1,6 +1,8 @@
VS_SDK_REFERENCES
-----------------
+.. versionadded:: 3.7
+
Visual Studio project SDK references.
Specify a :ref:`semicolon-separated list <CMake Language Lists>` of SDK references
to be added to a generated Visual Studio project, e.g.
diff --git a/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst b/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst
index eef848f990..e56f411bd7 100644
--- a/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst
+++ b/Help/prop_tgt/VS_SOLUTION_DEPLOY.rst
@@ -1,6 +1,8 @@
VS_SOLUTION_DEPLOY
------------------
+.. versionadded:: 3.18
+
Specify that the target should be marked for deployment when not targeting
Windows CE, Windows Phone or a Windows Store application.
diff --git a/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst b/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst
index 738a91211f..b5a76fc444 100644
--- a/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst
+++ b/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst
@@ -1,6 +1,8 @@
VS_SOURCE_SETTINGS_<tool>
-------------------------
+.. versionadded:: 3.18
+
Set any item metadata on all non-built files that use <tool>.
Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator
diff --git a/Help/prop_tgt/VS_USER_PROPS.rst b/Help/prop_tgt/VS_USER_PROPS.rst
index 1be222ba62..8f2a105831 100644
--- a/Help/prop_tgt/VS_USER_PROPS.rst
+++ b/Help/prop_tgt/VS_USER_PROPS.rst
@@ -1,6 +1,8 @@
VS_USER_PROPS
-------------
+.. versionadded:: 3.8
+
Sets the user props file to be included in the visual studio
C++ project file. The standard path is
``$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props``, which is
diff --git a/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst b/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst
index 1ad7a7164d..50cf203b06 100644
--- a/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst
+++ b/Help/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION.rst
@@ -1,6 +1,8 @@
VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
--------------------------------------
+.. versionadded:: 3.4
+
Visual Studio Windows Target Platform Minimum Version
For Windows 10. Specifies the minimum version of the OS that is being
diff --git a/Help/prop_tgt/VS_WINRT_COMPONENT.rst b/Help/prop_tgt/VS_WINRT_COMPONENT.rst
index e160bd64be..8b4aaf7ac0 100644
--- a/Help/prop_tgt/VS_WINRT_COMPONENT.rst
+++ b/Help/prop_tgt/VS_WINRT_COMPONENT.rst
@@ -1,6 +1,8 @@
VS_WINRT_COMPONENT
------------------
+.. versionadded:: 3.1
+
Mark a target as a Windows Runtime component for the Visual Studio generator.
Compile the target with ``C++/CX`` language extensions for Windows Runtime.
For ``SHARED`` and ``MODULE`` libraries, this also defines the
diff --git a/Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst b/Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst
index 86711bf29d..00f32f61ea 100644
--- a/Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst
+++ b/Help/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.rst
@@ -1,6 +1,8 @@
WINDOWS_EXPORT_ALL_SYMBOLS
--------------------------
+.. versionadded:: 3.4
+
This property is implemented only for MS-compatible tools on Windows.
Enable this boolean property to automatically create a module definition
diff --git a/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst b/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst
index dc9290217c..e01a0342b8 100644
--- a/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst
+++ b/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst
@@ -1,6 +1,8 @@
XCODE_EXPLICIT_FILE_TYPE
------------------------
+.. versionadded:: 3.8
+
Set the Xcode ``explicitFileType`` attribute on its reference to a
target. CMake computes a default based on target type but
can be told explicitly with this property.
diff --git a/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst b/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst
index c32b4dea32..06a3cf9921 100644
--- a/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst
+++ b/Help/prop_tgt/XCODE_GENERATE_SCHEME.rst
@@ -1,6 +1,8 @@
XCODE_GENERATE_SCHEME
---------------------
+.. versionadded:: 3.15
+
If enabled, the :generator:`Xcode` generator will generate schema files. These
are useful to invoke analyze, archive, build-for-testing and test
actions from the command line.
diff --git a/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst b/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst
index f4ef5c0ce8..17a9c3f303 100644
--- a/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst
+++ b/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst
@@ -1,6 +1,8 @@
XCODE_PRODUCT_TYPE
------------------
+.. versionadded:: 3.8
+
Set the Xcode ``productType`` attribute on its reference to a
target. CMake computes a default based on target type but
can be told explicitly with this property.
diff --git a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst
index cc9bac2e64..c72ec06888 100644
--- a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_ADDRESS_SANITIZER
------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Address Sanitizer`` in the Diagnostics
section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst
index 37a043a1aa..293b5d4aa4 100644
--- a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
-----------------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Detect use of stack after return``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst b/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst
index 1f228e34c9..2bfcb41b37 100644
--- a/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_ARGUMENTS
----------------------
+.. versionadded:: 3.13
+
Specify command line arguments that should be added to the Arguments
section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst b/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst
index 5407e807b4..2523deb568 100644
--- a/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_DEBUG_AS_ROOT
--------------------------
+.. versionadded:: 3.15
+
Whether to debug the target as 'root'.
Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
diff --git a/Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst b/Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst
index 9afeedd99a..bbcae356a9 100644
--- a/Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
--------------------------------------
+.. versionadded:: 3.16
+
Whether to enable
``Allow debugging when using document Versions Browser``
in the Options section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst b/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst
index 1a6fcfd2e9..3d315a2bf6 100644
--- a/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
----------------------------------------
+.. versionadded:: 3.13
+
Whether to disable the ``Main Thread Checker``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst
index 922402290e..2ca20f72e1 100644
--- a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
----------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Dynamic Library Loads``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst
index 203c803294..278c9ef107 100644
--- a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
-------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Dynamic Linker API usage``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst b/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst
index c6d875e88c..16542f841a 100644
--- a/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_ENVIRONMENT
------------------------
+.. versionadded:: 3.13
+
Specify environment variables that should be added to the Arguments
section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst b/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst
index 104841b7c2..b453f108d1 100644
--- a/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_EXECUTABLE
-----------------------
+.. versionadded:: 3.13
+
Specify path to executable in the Info section of the generated
Xcode scheme. If not set the schema generator will select the
current target if it is actually executable.
diff --git a/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst b/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst
index c4e83da2f8..4b242a2efe 100644
--- a/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_GUARD_MALLOC
------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Guard Malloc``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst
index 73992c3c36..2a813aaadf 100644
--- a/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
-------------------------------------
+.. versionadded:: 3.13
+
Whether to enable the ``Main Thread Checker`` option
``Pause on issues``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst
index ca761c05bf..750da748c7 100644
--- a/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_MALLOC_GUARD_EDGES
-------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Malloc Guard Edges``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst
index c5ddb950fa..4ebd21b350 100644
--- a/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_MALLOC_SCRIBBLE
------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Malloc Scribble``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst
index 170f33d90a..5afe34e4f1 100644
--- a/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_MALLOC_STACK
-------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Malloc Stack`` in the Diagnostics
section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst
index bb70141f3b..cc774c440e 100644
--- a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_THREAD_SANITIZER
-----------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Thread Sanitizer`` in the Diagnostics
section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst
index 5deadb16eb..3bb25964de 100644
--- a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_THREAD_SANITIZER_STOP
----------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Thread Sanitizer - Pause on issues``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst
index 0cd823dec4..1146130ede 100644
--- a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
------------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Undefined Behavior Sanitizer``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst
index d1a9bca2c1..358f298da2 100644
--- a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
-----------------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Undefined Behavior Sanitizer`` option
``Pause on issues``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst b/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst
index f538f1da82..d8d56fc387 100644
--- a/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_WORKING_DIRECTORY
------------------------------
+.. versionadded:: 3.17
+
Specify the ``Working Directory`` of the *Run* and *Profile*
actions in the generated Xcode scheme. In case the value contains
generator expressions those are evaluated.
diff --git a/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst b/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst
index 6e70e8be9b..6030109ce6 100644
--- a/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst
+++ b/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst
@@ -1,6 +1,8 @@
XCODE_SCHEME_ZOMBIE_OBJECTS
------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Zombie Objects``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/prop_tgt/XCTEST.rst b/Help/prop_tgt/XCTEST.rst
index eb47e606f7..67e9a70459 100644
--- a/Help/prop_tgt/XCTEST.rst
+++ b/Help/prop_tgt/XCTEST.rst
@@ -1,6 +1,8 @@
XCTEST
------
+.. versionadded:: 3.3
+
This target is a XCTest CFBundle on the Mac.
This property will usually get set via the :command:`xctest_add_bundle`
diff --git a/Help/release/3.1.rst b/Help/release/3.1.rst
index 8bea28f702..3f4712b84a 100644
--- a/Help/release/3.1.rst
+++ b/Help/release/3.1.rst
@@ -83,7 +83,7 @@ Commands
:manual:`generator expression <cmake-generator-expressions(7)>`.
* The :command:`string` command learned a new ``UUID`` subcommand
- to generate a univerally unique identifier.
+ to generate a universally unique identifier.
* New :command:`target_compile_features` command allows populating the
:prop_tgt:`COMPILE_FEATURES` target property, just like any other
diff --git a/Help/release/3.3.rst b/Help/release/3.3.rst
index 6657e8df12..44f4e19a1b 100644
--- a/Help/release/3.3.rst
+++ b/Help/release/3.3.rst
@@ -196,7 +196,7 @@ CPack
:prop_inst:`CPACK_START_MENU_SHORTCUTS`,
:prop_inst:`CPACK_DESKTOP_SHORTCUTS` and
:prop_inst:`CPACK_STARTUP_SHORTCUTS` installed file properties which can
- be used to install shorcuts in the Start Menu, on the Desktop and
+ be used to install shortcuts in the Start Menu, on the Desktop and
in the Startup Folder respectively.
Other
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
new file mode 100644
index 0000000000..e4cc01e23f
--- /dev/null
+++ b/Help/release/dev/0-sample-topic.rst
@@ -0,0 +1,7 @@
+0-sample-topic
+--------------
+
+* This is a sample release note for the change in a topic.
+ Developers should add similar notes for each topic branch
+ making a noteworthy change. Each document should be named
+ and titled to match the topic name to avoid merge conflicts.
diff --git a/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst b/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst
new file mode 100644
index 0000000000..af446d2993
--- /dev/null
+++ b/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst
@@ -0,0 +1,4 @@
+CPACK_EXTERNAL_BUILT_PACKAGES
+-----------------------------
+
+* :cpack_gen:`CPack External Generator` learned the :variable:`CPACK_EXTERNAL_BUILT_PACKAGES` variable.
diff --git a/Help/release/dev/EXCLUDE_FROM_ALL-genex.rst b/Help/release/dev/EXCLUDE_FROM_ALL-genex.rst
new file mode 100644
index 0000000000..4d5a83c810
--- /dev/null
+++ b/Help/release/dev/EXCLUDE_FROM_ALL-genex.rst
@@ -0,0 +1,5 @@
+EXCLUDE_FROM_ALL-genex
+----------------------
+
+* The :prop_tgt:`EXCLUDE_FROM_ALL` target property gained support for
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/release/dev/FindSDL-update.rst b/Help/release/dev/FindSDL-update.rst
new file mode 100644
index 0000000000..a85d2b9ac4
--- /dev/null
+++ b/Help/release/dev/FindSDL-update.rst
@@ -0,0 +1,11 @@
+FindSDL-update
+--------------
+
+* The :module:`FindSDL` module now provides:
+
+ * imported target ``SDL::SDL``,
+
+ * result variables ``SDL_LIBRARIES`` and ``SDL_INCLUDE_DIRS``,
+
+ * version variables ``SDL_VERSION``, ``SDL_VERSION_MAJOR``
+ ``SDL_VERSION_MINOR``, and ``SDL_VERSION_PATCH``.
diff --git a/Help/release/dev/FindTIFF-tiffxx.rst b/Help/release/dev/FindTIFF-tiffxx.rst
new file mode 100644
index 0000000000..656d38f1d9
--- /dev/null
+++ b/Help/release/dev/FindTIFF-tiffxx.rst
@@ -0,0 +1,5 @@
+FindTIFF-tiffxx
+---------------
+
+* The :module:`FindTIFF` module gained a ``CXX`` component to
+ find the ``tiffxx`` library containing C++ bindings.
diff --git a/Help/release/dev/FindVulkan-glslc.rst b/Help/release/dev/FindVulkan-glslc.rst
new file mode 100644
index 0000000000..246bc8fd18
--- /dev/null
+++ b/Help/release/dev/FindVulkan-glslc.rst
@@ -0,0 +1,10 @@
+FindVulkan-glslc
+----------------
+
+* The :module:`FindVulkan` module gained a new output variable
+ ``Vulkan_GLSLC_EXECUTABLE`` which contains the path to the
+ GLSL SPIR-V compiler.
+
+* The :module:`FindVulkan` module gained a new target
+ ``Vulkan::glslc`` which contains the path to the
+ GLSL SPIR-V compiler.
diff --git a/Help/release/dev/cmake-E-create_hardlink.rst b/Help/release/dev/cmake-E-create_hardlink.rst
new file mode 100644
index 0000000000..66cdc87a0f
--- /dev/null
+++ b/Help/release/dev/cmake-E-create_hardlink.rst
@@ -0,0 +1,5 @@
+cmake-E-create_hardlink
+-----------------------
+
+* The :manual:`cmake(1)` gained a ``-E create_hardlink`` command-line tool
+ that can be used to create hardlinks between files.
diff --git a/Help/release/dev/configure_file-permission-control.rst b/Help/release/dev/configure_file-permission-control.rst
new file mode 100644
index 0000000000..54b52b7dc0
--- /dev/null
+++ b/Help/release/dev/configure_file-permission-control.rst
@@ -0,0 +1,5 @@
+configure_file-permission-control
+---------------------------------
+
+* The :command:`configure_file` command gained a ``NO_SOURCE_PERMISSIONS``
+ option to suppress copying the input file's permissions to the output file.
diff --git a/Help/release/dev/cpack-pre-and-post-build-scripts.rst b/Help/release/dev/cpack-pre-and-post-build-scripts.rst
new file mode 100644
index 0000000000..bf7958be98
--- /dev/null
+++ b/Help/release/dev/cpack-pre-and-post-build-scripts.rst
@@ -0,0 +1,5 @@
+cpack-pre-and-post-build-scripts
+--------------------------------
+
+* CPack learned the :variable:`CPACK_PRE_BUILD_SCRIPTS`, :variable:`CPACK_POST_BUILD_SCRIPTS`,
+ and :variable:`CPACK_PACKAGE_FILES` variables.
diff --git a/Help/release/dev/ctest-cuda-memcheck.rst b/Help/release/dev/ctest-cuda-memcheck.rst
new file mode 100644
index 0000000000..f8f861a3b9
--- /dev/null
+++ b/Help/release/dev/ctest-cuda-memcheck.rst
@@ -0,0 +1,8 @@
+CTest
+-----
+
+* :manual:`ctest(1)` gained support for cuda-memcheck as ``CTEST_MEMORYCHECK_COMMAND``.
+ The different tools (memcheck, racecheck, synccheck, initcheck) supplied by
+ cuda-memcheck can be selected by setting the appropriate flags using the
+ ``CTEST_MEMORYCHECK_COMMAND_OPTIONS`` variable.
+ The default flags are `--tool memcheck --leak-check full`.
diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst
new file mode 100644
index 0000000000..1dc01ccfa6
--- /dev/null
+++ b/Help/release/dev/deprecate-policy-old.rst
@@ -0,0 +1,13 @@
+deprecate-policy-old
+--------------------
+
+* An explicit deprecation diagnostic was added for policy ``CMP0071``
+ (``CMP0071`` and below were already deprecated).
+ The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
+ of all policies are deprecated and that projects should port to the
+ NEW behaviors.
+
+* Compatibility with versions of CMake older than 2.8.12 is now deprecated
+ and will be removed from a future version. Calls to
+ :command:`cmake_minimum_required` or :command:`cmake_policy` that set
+ the policy version to an older value now issue a deprecation diagnostic.
diff --git a/Help/release/dev/file-download-optional-file.rst b/Help/release/dev/file-download-optional-file.rst
new file mode 100644
index 0000000000..f3dc24cb50
--- /dev/null
+++ b/Help/release/dev/file-download-optional-file.rst
@@ -0,0 +1,5 @@
+file-download-optional-file
+---------------------------
+
+* The ``<file>`` argument is now optional for :command:`file(DOWNLOAD)`. If it
+ is not specified, the file is not saved.
diff --git a/Help/release/dev/fileapi-codemodel-2.2.rst b/Help/release/dev/fileapi-codemodel-2.2.rst
new file mode 100644
index 0000000000..5954df6511
--- /dev/null
+++ b/Help/release/dev/fileapi-codemodel-2.2.rst
@@ -0,0 +1,7 @@
+fileapi-codemodel-2.2
+---------------------
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
+ been updated to 2.2.
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
+ a new ``languageStandard`` field in the ``compileGroups`` objects.
diff --git a/Help/release/dev/find_program-exe-no-read.rst b/Help/release/dev/find_program-exe-no-read.rst
new file mode 100644
index 0000000000..161b5dba93
--- /dev/null
+++ b/Help/release/dev/find_program-exe-no-read.rst
@@ -0,0 +1,5 @@
+find_program-exe-no-read
+------------------------
+
+* The :command:`find_program` command now requires permission to execute
+ but not to read the file found. See policy :policy:`CMP0109`.
diff --git a/Help/release/dev/install-default-directory-permissions.rst b/Help/release/dev/install-default-directory-permissions.rst
new file mode 100644
index 0000000000..27cffeeaa7
--- /dev/null
+++ b/Help/release/dev/install-default-directory-permissions.rst
@@ -0,0 +1,5 @@
+install-default-directory-permissions
+-------------------------------------
+
+* The ``--install`` argument of the :manual:`cmake(1)` command line tool gained a
+ ``--default-directory-permissions`` argument.
diff --git a/Help/release/dev/macOS-sdk-latest.rst b/Help/release/dev/macOS-sdk-latest.rst
new file mode 100644
index 0000000000..c5ac3a6983
--- /dev/null
+++ b/Help/release/dev/macOS-sdk-latest.rst
@@ -0,0 +1,10 @@
+macOS-sdk-latest
+----------------
+
+* Building for macOS will now use the latest SDK available on the system,
+ unless the user has explicitly chosen a SDK using :variable:`CMAKE_OSX_SYSROOT`.
+
+ The deployment target or system macOS version will not affect
+ the choice of SDK.
+
+* macOS SDKs older than 10.5 are no longer supported.
diff --git a/Help/release/dev/remove-cmake-gui-qt4.rst b/Help/release/dev/remove-cmake-gui-qt4.rst
new file mode 100644
index 0000000000..2b29b75e7f
--- /dev/null
+++ b/Help/release/dev/remove-cmake-gui-qt4.rst
@@ -0,0 +1,5 @@
+remove-cmake-gui-qt4
+--------------------
+
+* :manual:`cmake-gui(1)` now requires Qt5. Support for compiling with Qt4 has
+ been removed.
diff --git a/Help/release/dev/remove-warn-unused-vars.rst b/Help/release/dev/remove-warn-unused-vars.rst
new file mode 100644
index 0000000000..7a06e91492
--- /dev/null
+++ b/Help/release/dev/remove-warn-unused-vars.rst
@@ -0,0 +1,6 @@
+remove-warn-unused-vars
+-----------------------
+
+* The :manual:`cmake(1)` command-line option ``--warn-unused-vars`` has
+ been removed and is now silently ignored. The option has not worked
+ correctly since CMake 3.3.
diff --git a/Help/release/dev/visual-studio-android.rst b/Help/release/dev/visual-studio-android.rst
new file mode 100644
index 0000000000..4e1a1101b4
--- /dev/null
+++ b/Help/release/dev/visual-studio-android.rst
@@ -0,0 +1,7 @@
+visual-studio-android
+---------------------
+
+* The :ref:`Visual Studio Generators` for Visual Studio 2015 and above gained
+ support for the Visual Studio Tools for Android. This allows you to set
+ :variable:`CMAKE_SYSTEM_NAME` to `Android` to generate `.vcxproj` files for
+ the Android tools.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 4578b3a647..cdc3e8bbf4 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -7,6 +7,8 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
+.. include:: dev.txt
+
Releases
========
diff --git a/Help/variable/ANDROID.rst b/Help/variable/ANDROID.rst
index fede4caf3e..68dccf2061 100644
--- a/Help/variable/ANDROID.rst
+++ b/Help/variable/ANDROID.rst
@@ -1,5 +1,7 @@
ANDROID
-------
+.. versionadded:: 3.7
+
Set to ``1`` when the target system (:variable:`CMAKE_SYSTEM_NAME`) is
``Android``.
diff --git a/Help/variable/CACHE.rst b/Help/variable/CACHE.rst
index 2cef27efa0..d5489c87c6 100644
--- a/Help/variable/CACHE.rst
+++ b/Help/variable/CACHE.rst
@@ -1,6 +1,8 @@
CACHE
-----
+.. versionadded:: 3.13
+
Operator to read cache variables.
Use the syntax ``$CACHE{VAR}`` to read cache entry ``VAR``.
diff --git a/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst b/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst
index c64dd4892f..699fe0f03b 100644
--- a/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst
+++ b/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst
@@ -1,6 +1,8 @@
CMAKE_AIX_EXPORT_ALL_SYMBOLS
----------------------------
+.. versionadded:: 3.17
+
Default value for :prop_tgt:`AIX_EXPORT_ALL_SYMBOLS` target property.
This variable is used to initialize the property on each target as it is
created.
diff --git a/Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst b/Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst
index 8862ba91d5..2d6b4b92a0 100644
--- a/Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst
+++ b/Help/variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS
------------------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_ANT_ADDITIONAL_OPTIONS` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_API.rst b/Help/variable/CMAKE_ANDROID_API.rst
index c07a05a641..4388bf2e05 100644
--- a/Help/variable/CMAKE_ANDROID_API.rst
+++ b/Help/variable/CMAKE_ANDROID_API.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_API
-----------------
+.. versionadded:: 3.1
+
When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
Edition`, this variable may be set to specify the default value for the
:prop_tgt:`ANDROID_API` target property. See that target property for
diff --git a/Help/variable/CMAKE_ANDROID_API_MIN.rst b/Help/variable/CMAKE_ANDROID_API_MIN.rst
index 0246c75b9f..a0d2ab460d 100644
--- a/Help/variable/CMAKE_ANDROID_API_MIN.rst
+++ b/Help/variable/CMAKE_ANDROID_API_MIN.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_API_MIN
---------------------
+.. versionadded:: 3.2
+
Default value for the :prop_tgt:`ANDROID_API_MIN` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_ARCH.rst b/Help/variable/CMAKE_ANDROID_ARCH.rst
index b91ca57a37..9f12742917 100644
--- a/Help/variable/CMAKE_ANDROID_ARCH.rst
+++ b/Help/variable/CMAKE_ANDROID_ARCH.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_ARCH
------------------
+.. versionadded:: 3.4
+
When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
Edition`, this variable may be set to specify the default value for the
:prop_tgt:`ANDROID_ARCH` target property. See that target property for
diff --git a/Help/variable/CMAKE_ANDROID_ARCH_ABI.rst b/Help/variable/CMAKE_ANDROID_ARCH_ABI.rst
index 0a3ed3c168..5a2e3ecacf 100644
--- a/Help/variable/CMAKE_ANDROID_ARCH_ABI.rst
+++ b/Help/variable/CMAKE_ANDROID_ARCH_ABI.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_ARCH_ABI
----------------------
+.. versionadded:: 3.7
+
When :ref:`Cross Compiling for Android`, this variable specifies the
target architecture and ABI to be used. Valid values are:
diff --git a/Help/variable/CMAKE_ANDROID_ARM_MODE.rst b/Help/variable/CMAKE_ANDROID_ARM_MODE.rst
index ad3c37c86a..973ff7ef49 100644
--- a/Help/variable/CMAKE_ANDROID_ARM_MODE.rst
+++ b/Help/variable/CMAKE_ANDROID_ARM_MODE.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_ARM_MODE
----------------------
+.. versionadded:: 3.7
+
When :ref:`Cross Compiling for Android` and :variable:`CMAKE_ANDROID_ARCH_ABI`
is set to one of the ``armeabi`` architectures, set ``CMAKE_ANDROID_ARM_MODE``
to ``ON`` to target 32-bit ARM processors (``-marm``). Otherwise, the
diff --git a/Help/variable/CMAKE_ANDROID_ARM_NEON.rst b/Help/variable/CMAKE_ANDROID_ARM_NEON.rst
index 4b7ae0397e..6b9cf087d1 100644
--- a/Help/variable/CMAKE_ANDROID_ARM_NEON.rst
+++ b/Help/variable/CMAKE_ANDROID_ARM_NEON.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_ARM_NEON
----------------------
+.. versionadded:: 3.7
+
When :ref:`Cross Compiling for Android` and :variable:`CMAKE_ANDROID_ARCH_ABI`
is set to ``armeabi-v7a`` set ``CMAKE_ANDROID_ARM_NEON`` to ``ON`` to target
ARM NEON devices.
diff --git a/Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst b/Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst
index c372fe4493..3de2be4c9f 100644
--- a/Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_ANDROID_ASSETS_DIRECTORIES.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_ASSETS_DIRECTORIES
--------------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_ASSETS_DIRECTORIES` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_GUI.rst b/Help/variable/CMAKE_ANDROID_GUI.rst
index 175537527d..821bbee1f5 100644
--- a/Help/variable/CMAKE_ANDROID_GUI.rst
+++ b/Help/variable/CMAKE_ANDROID_GUI.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_GUI
-----------------
+.. versionadded:: 3.1
+
Default value for the :prop_tgt:`ANDROID_GUI` target property of
executables. See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst b/Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst
index 451a92960b..80ab842c6a 100644
--- a/Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst
+++ b/Help/variable/CMAKE_ANDROID_JAR_DEPENDENCIES.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_JAR_DEPENDENCIES
------------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_JAR_DEPENDENCIES` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst b/Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst
index af83e34308..4d148d81b0 100644
--- a/Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_ANDROID_JAR_DIRECTORIES.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_JAR_DIRECTORIES
-----------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_JAR_DIRECTORIES` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst b/Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst
index 3dc05e05ed..021baa080f 100644
--- a/Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst
+++ b/Help/variable/CMAKE_ANDROID_JAVA_SOURCE_DIR.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_JAVA_SOURCE_DIR
-----------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_JAVA_SOURCE_DIR` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst b/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst
index 4191907d49..41d4cc3930 100644
--- a/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst
+++ b/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES
-------------------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_NATIVE_LIB_DEPENDENCIES` target
property. See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst b/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst
index 7cb95274e1..e87547de46 100644
--- a/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES
------------------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_NATIVE_LIB_DIRECTORIES` target
property. See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_NDK.rst b/Help/variable/CMAKE_ANDROID_NDK.rst
index d241dd0009..72ac99e2ac 100644
--- a/Help/variable/CMAKE_ANDROID_NDK.rst
+++ b/Help/variable/CMAKE_ANDROID_NDK.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_NDK
-----------------
+.. versionadded:: 3.7
+
When :ref:`Cross Compiling for Android with the NDK`, this variable holds
the absolute path to the root directory of the NDK. The directory must
contain a ``platforms`` subdirectory holding the ``android-<api>``
diff --git a/Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst b/Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst
index 8ea12578c6..40a5c1a697 100644
--- a/Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst
+++ b/Help/variable/CMAKE_ANDROID_NDK_DEPRECATED_HEADERS.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_NDK_DEPRECATED_HEADERS
------------------------------------
+.. versionadded:: 3.9
+
When :ref:`Cross Compiling for Android with the NDK`, this variable
may be set to specify whether to use the deprecated per-api-level
headers instead of the unified headers.
diff --git a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst
index 207019a7f4..9d61fa46a9 100644
--- a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst
+++ b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG
------------------------------------
+.. versionadded:: 3.7.1
+
When :ref:`Cross Compiling for Android with the NDK`, this variable
provides the NDK's "host tag" used to construct the path to prebuilt
toolchains that run on the host.
diff --git a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst
index 22808e3ed4..15fe18f9c4 100644
--- a/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst
+++ b/Help/variable/CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION
-----------------------------------
+.. versionadded:: 3.7
+
When :ref:`Cross Compiling for Android with the NDK`, this variable
may be set to specify the version of the toolchain to be used
as the compiler.
diff --git a/Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst b/Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst
index 19fb527f79..be241c2e71 100644
--- a/Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst
+++ b/Help/variable/CMAKE_ANDROID_PROCESS_MAX.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_PROCESS_MAX
-------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_PROCESS_MAX` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_PROGUARD.rst b/Help/variable/CMAKE_ANDROID_PROGUARD.rst
index b8fdd46cc6..bb001d3abb 100644
--- a/Help/variable/CMAKE_ANDROID_PROGUARD.rst
+++ b/Help/variable/CMAKE_ANDROID_PROGUARD.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_PROGUARD
----------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_PROGUARD` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst b/Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst
index 8dea009072..6fd4067b80 100644
--- a/Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst
+++ b/Help/variable/CMAKE_ANDROID_PROGUARD_CONFIG_PATH.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_PROGUARD_CONFIG_PATH
----------------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_PROGUARD_CONFIG_PATH` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst b/Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst
index 69a4d0b56f..9f5743e842 100644
--- a/Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst
+++ b/Help/variable/CMAKE_ANDROID_SECURE_PROPS_PATH.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_SECURE_PROPS_PATH
-------------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_SECURE_PROPS_PATH` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst b/Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst
index 0a96df9fae..588769bac8 100644
--- a/Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst
+++ b/Help/variable/CMAKE_ANDROID_SKIP_ANT_STEP.rst
@@ -1,5 +1,7 @@
CMAKE_ANDROID_SKIP_ANT_STEP
---------------------------
+.. versionadded:: 3.4
+
Default value for the :prop_tgt:`ANDROID_SKIP_ANT_STEP` target property.
See that target property for additional information.
diff --git a/Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst b/Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst
index ea62cabf6e..3ca89f5977 100644
--- a/Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst
+++ b/Help/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_STANDALONE_TOOLCHAIN
----------------------------------
+.. versionadded:: 3.7
+
When :ref:`Cross Compiling for Android with a Standalone Toolchain`, this
variable holds the absolute path to the root directory of the toolchain.
The specified directory must contain a ``sysroot`` subdirectory.
diff --git a/Help/variable/CMAKE_ANDROID_STL_TYPE.rst b/Help/variable/CMAKE_ANDROID_STL_TYPE.rst
index d174575c84..3778181af4 100644
--- a/Help/variable/CMAKE_ANDROID_STL_TYPE.rst
+++ b/Help/variable/CMAKE_ANDROID_STL_TYPE.rst
@@ -1,6 +1,8 @@
CMAKE_ANDROID_STL_TYPE
----------------------
+.. versionadded:: 3.4
+
When :ref:`Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
Edition`, this variable may be set to specify the default value for the
:prop_tgt:`ANDROID_STL_TYPE` target property. See that target property
diff --git a/Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst
index 94c2b6efa1..d8bd82c6c0 100644
--- a/Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst
@@ -1,6 +1,8 @@
CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
---------------------------------------
+.. versionadded:: 3.3
+
Where to put all the :ref:`ARCHIVE <Archive Output Artifacts>`
target files when built for a specific configuration.
diff --git a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
index 1398e7856c..c24e46261d 100644
--- a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
+++ b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
@@ -1,6 +1,8 @@
CMAKE_AUTOGEN_ORIGIN_DEPENDS
----------------------------
+.. versionadded:: 3.14
+
Switch for forwarding origin target dependencies to the corresponding
``_autogen`` targets.
diff --git a/Help/variable/CMAKE_AUTOGEN_PARALLEL.rst b/Help/variable/CMAKE_AUTOGEN_PARALLEL.rst
index dd9499af38..2ada012ec9 100644
--- a/Help/variable/CMAKE_AUTOGEN_PARALLEL.rst
+++ b/Help/variable/CMAKE_AUTOGEN_PARALLEL.rst
@@ -1,6 +1,8 @@
CMAKE_AUTOGEN_PARALLEL
----------------------
+.. versionadded:: 3.11
+
Number of parallel ``moc`` or ``uic`` processes to start when using
:prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
diff --git a/Help/variable/CMAKE_AUTOGEN_VERBOSE.rst b/Help/variable/CMAKE_AUTOGEN_VERBOSE.rst
index bad9cf2b35..f77ed6afb9 100644
--- a/Help/variable/CMAKE_AUTOGEN_VERBOSE.rst
+++ b/Help/variable/CMAKE_AUTOGEN_VERBOSE.rst
@@ -1,6 +1,8 @@
CMAKE_AUTOGEN_VERBOSE
---------------------
+.. versionadded:: 3.13
+
Sets the verbosity of :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and
:prop_tgt:`AUTORCC`. A positive integer value or a true boolean value
lets the ``AUTO*`` generators output additional processing information.
diff --git a/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst b/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst
index 7e1c53d06b..f1b03a0f5a 100644
--- a/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst
+++ b/Help/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES.rst
@@ -1,6 +1,8 @@
CMAKE_AUTOMOC_COMPILER_PREDEFINES
---------------------------------
+.. versionadded:: 3.10
+
This variable is used to initialize the :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES`
property on all the targets. See that target property for additional
information.
diff --git a/Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst b/Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst
index 5c3662d9a8..2c1551abfb 100644
--- a/Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst
+++ b/Help/variable/CMAKE_AUTOMOC_DEPEND_FILTERS.rst
@@ -1,6 +1,8 @@
CMAKE_AUTOMOC_DEPEND_FILTERS
----------------------------
+.. versionadded:: 3.9
+
Filter definitions used by :variable:`CMAKE_AUTOMOC`
to extract file names from source code as additional dependencies
for the ``moc`` file.
diff --git a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
index ba1b9d27a6..8e34df2168 100644
--- a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
+++ b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
@@ -1,6 +1,8 @@
CMAKE_AUTOMOC_MACRO_NAMES
----------------------------
+.. versionadded:: 3.10
+
:ref:`Semicolon-separated list <CMake Language Lists>` list of macro names used by
:variable:`CMAKE_AUTOMOC` to determine if a C++ file needs to be
processed by ``moc``.
diff --git a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
index dca0b0657d..07a6cc8093 100644
--- a/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
+++ b/Help/variable/CMAKE_AUTOMOC_PATH_PREFIX.rst
@@ -1,6 +1,8 @@
CMAKE_AUTOMOC_PATH_PREFIX
-------------------------
+.. versionadded:: 3.16
+
Whether to generate the ``-p`` path prefix option for ``moc`` on
:prop_tgt:`AUTOMOC` enabled Qt targets.
diff --git a/Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst b/Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst
index aa132bf77a..02623686be 100644
--- a/Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst
+++ b/Help/variable/CMAKE_AUTOUIC_SEARCH_PATHS.rst
@@ -1,6 +1,8 @@
CMAKE_AUTOUIC_SEARCH_PATHS
--------------------------
+.. versionadded:: 3.9
+
Search path list used by :variable:`CMAKE_AUTOUIC` to find included
``.ui`` files.
diff --git a/Help/variable/CMAKE_BUILD_RPATH.rst b/Help/variable/CMAKE_BUILD_RPATH.rst
index f5d53b88c1..7a8ace7aab 100644
--- a/Help/variable/CMAKE_BUILD_RPATH.rst
+++ b/Help/variable/CMAKE_BUILD_RPATH.rst
@@ -1,6 +1,8 @@
CMAKE_BUILD_RPATH
-----------------
+.. versionadded:: 3.8
+
:ref:`Semicolon-separated list <CMake Language Lists>` specifying runtime path (``RPATH``)
entries to add to binaries linked in the build tree (for platforms that
support it). The entries will *not* be used for binaries in the install
diff --git a/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst b/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst
index e34ede6ade..ecd92780fa 100644
--- a/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst
+++ b/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst
@@ -1,6 +1,8 @@
CMAKE_BUILD_RPATH_USE_ORIGIN
----------------------------
+.. versionadded:: 3.14
+
Whether to use relative paths for the build ``RPATH``.
This is used to initialize the :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target
diff --git a/Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst b/Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst
index 30d5d3bd65..5ba775c928 100644
--- a/Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst
+++ b/Help/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR.rst
@@ -1,6 +1,8 @@
CMAKE_BUILD_WITH_INSTALL_NAME_DIR
---------------------------------
+.. versionadded:: 3.9
+
Whether to use :prop_tgt:`INSTALL_NAME_DIR` on targets in the build tree.
This variable is used to initialize the :prop_tgt:`BUILD_WITH_INSTALL_NAME_DIR`
diff --git a/Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst b/Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst
index ad2709dc3f..0b2b0a03da 100644
--- a/Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_CODEBLOCKS_COMPILER_ID.rst
@@ -1,6 +1,8 @@
CMAKE_CODEBLOCKS_COMPILER_ID
----------------------------
+.. versionadded:: 3.11
+
Change the compiler id in the generated CodeBlocks project files.
CodeBlocks uses its own compiler id string which differs from
diff --git a/Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst b/Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst
index 80ffce3a7f..dbb8606766 100644
--- a/Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst
+++ b/Help/variable/CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES.rst
@@ -1,6 +1,8 @@
CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES
---------------------------------------
+.. versionadded:: 3.10
+
Change the way the CodeBlocks generator creates project files.
If this variable evaluates to ``ON`` the generator excludes from
diff --git a/Help/variable/CMAKE_CODELITE_USE_TARGETS.rst b/Help/variable/CMAKE_CODELITE_USE_TARGETS.rst
index 33cdf6ca66..21af5f7d93 100644
--- a/Help/variable/CMAKE_CODELITE_USE_TARGETS.rst
+++ b/Help/variable/CMAKE_CODELITE_USE_TARGETS.rst
@@ -1,6 +1,8 @@
CMAKE_CODELITE_USE_TARGETS
--------------------------
+.. versionadded:: 3.7
+
Change the way the CodeLite generator creates projectfiles.
If this variable evaluates to ``ON`` at the end of the top-level
diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst b/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst
index a40667e800..91cf84829e 100644
--- a/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst
+++ b/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst
@@ -1,5 +1,7 @@
CMAKE_COMPILER_IS_GNUCC
-----------------------
+.. versionadded:: 3.7
+
True if the ``C`` compiler is GNU.
Use :variable:`CMAKE_C_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead.
diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst b/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst
index f1f5cf7976..e67718a5c8 100644
--- a/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst
+++ b/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst
@@ -1,5 +1,7 @@
CMAKE_COMPILER_IS_GNUCXX
------------------------
+.. versionadded:: 3.7
+
True if the C++ (``CXX``) compiler is GNU.
Use :variable:`CMAKE_CXX_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead.
diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst b/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst
index 3d6dab44c9..f69c01afec 100644
--- a/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst
+++ b/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst
@@ -1,5 +1,7 @@
CMAKE_COMPILER_IS_GNUG77
------------------------
+.. versionadded:: 3.7
+
True if the ``Fortran`` compiler is GNU.
Use :variable:`CMAKE_Fortran_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead.
diff --git a/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst b/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst
index ea33c7d646..11f52c74f5 100644
--- a/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY.rst
@@ -1,6 +1,8 @@
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
----------------------------------
+.. versionadded:: 3.1
+
Output directory for MS debug symbol ``.pdb`` files
generated by the compiler while building source files.
diff --git a/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
index fdeb9abdd3..99d0bdcfbf 100644
--- a/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -1,6 +1,8 @@
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
-------------------------------------------
+.. versionadded:: 3.1
+
Per-configuration output directory for MS debug symbol ``.pdb`` files
generated by the compiler while building source files.
diff --git a/Help/variable/CMAKE_CPACK_COMMAND.rst b/Help/variable/CMAKE_CPACK_COMMAND.rst
index 559108a1ac..3a81d68167 100644
--- a/Help/variable/CMAKE_CPACK_COMMAND.rst
+++ b/Help/variable/CMAKE_CPACK_COMMAND.rst
@@ -1,6 +1,8 @@
CMAKE_CPACK_COMMAND
-------------------
+.. versionadded:: 3.13
+
Full path to :manual:`cpack(1)` command installed with CMake.
This is the full path to the CPack executable :manual:`cpack(1)` which is
diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst
index 1d013b7a66..815da00d10 100644
--- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst
+++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst
@@ -1,6 +1,8 @@
CMAKE_CROSSCOMPILING_EMULATOR
-----------------------------
+.. versionadded:: 3.3
+
This variable is only used when :variable:`CMAKE_CROSSCOMPILING` is on. It
should point to a command on the host system that can run executable built
for the target system.
diff --git a/Help/variable/CMAKE_CROSS_CONFIGS.rst b/Help/variable/CMAKE_CROSS_CONFIGS.rst
index 94157f3bbd..be921d6ff4 100644
--- a/Help/variable/CMAKE_CROSS_CONFIGS.rst
+++ b/Help/variable/CMAKE_CROSS_CONFIGS.rst
@@ -1,6 +1,8 @@
CMAKE_CROSS_CONFIGS
-------------------
+.. versionadded:: 3.17
+
Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of
configurations available from all ``build-<Config>.ninja`` files in the
:generator:`Ninja Multi-Config` generator. This variable activates
diff --git a/Help/variable/CMAKE_CTEST_ARGUMENTS.rst b/Help/variable/CMAKE_CTEST_ARGUMENTS.rst
index 0940b4646a..4dfc8fe515 100644
--- a/Help/variable/CMAKE_CTEST_ARGUMENTS.rst
+++ b/Help/variable/CMAKE_CTEST_ARGUMENTS.rst
@@ -1,6 +1,8 @@
CMAKE_CTEST_ARGUMENTS
---------------------
+.. versionadded:: 3.17
+
Set this to a :ref:`semicolon-separated list <CMake Language Lists>` of
command-line arguments to pass to :manual:`ctest(1)` when running tests
through the ``test`` (or ``RUN_TESTS``) target of the generated build system.
diff --git a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
index 149bffad66..985040d738 100644
--- a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
+++ b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_ARCHITECTURES
------------------------
+.. versionadded:: 3.18
+
Default value for :prop_tgt:`CUDA_ARCHITECTURES` property of targets.
This is initialized as follows depending on :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>`:
diff --git a/Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst b/Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst
index 2cd2650c4d..c1c270cbf3 100644
--- a/Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst
+++ b/Help/variable/CMAKE_CUDA_COMPILE_FEATURES.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_COMPILE_FEATURES
---------------------------
+.. versionadded:: 3.17
+
List of features known to the CUDA compiler
These features are known to be available for use with the CUDA compiler. This
diff --git a/Help/variable/CMAKE_CUDA_EXTENSIONS.rst b/Help/variable/CMAKE_CUDA_EXTENSIONS.rst
index 4fe758e90e..b86c0ea39c 100644
--- a/Help/variable/CMAKE_CUDA_EXTENSIONS.rst
+++ b/Help/variable/CMAKE_CUDA_EXTENSIONS.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_EXTENSIONS
---------------------
+.. versionadded:: 3.8
+
Default value for :prop_tgt:`CUDA_EXTENSIONS` property of targets.
This variable is used to initialize the :prop_tgt:`CUDA_EXTENSIONS`
diff --git a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst
index 6d34c5ccc1..07342b592b 100644
--- a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst
+++ b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst
@@ -1,8 +1,25 @@
CMAKE_CUDA_HOST_COMPILER
------------------------
-Executable to use when compiling host code when compiling ``CUDA`` language
-files. Maps to the ``nvcc -ccbin`` option. Will only be used by CMake on the first
-configuration to determine a valid host compiler for ``CUDA``. After a valid
-host compiler has been found, this value is read-only. This variable takes
-priority over the :envvar:`CUDAHOSTCXX` environment variable.
+.. versionadded:: 3.10
+
+When :variable:`CMAKE_CUDA_COMPILER <CMAKE_<LANG>_COMPILER>` is set to
+NVIDIA ``nvcc``, ``CMAKE_CUDA_HOST_COMPILER`` selects the compiler
+executable to use when compiling host code for ``CUDA`` language files.
+This maps to the ``nvcc -ccbin`` option.
+
+The ``CMAKE_CUDA_HOST_COMPILER`` variable may be set explicitly before CUDA is
+first enabled by a :command:`project` or :command:`enable_language` command.
+This can be done via ``-DCMAKE_CUDA_HOST_COMPILER=...`` on the command line
+or in a :ref:`toolchain file <Cross Compiling Toolchain>`. Or, one may set
+the :envvar:`CUDAHOSTCXX` environment variable to provide a default value.
+
+Once the CUDA language is enabled, the ``CMAKE_CUDA_HOST_COMPILER`` variable
+is read-only and changes to it are undefined behavior.
+
+.. note::
+
+ Since ``CMAKE_CUDA_HOST_COMPILER`` is meaningful only when the
+ ``CMAKE_CUDA_COMPILER`` is ``nvcc``, it does not make sense to
+ set ``CMAKE_CUDA_HOST_COMPILER`` explicitly without also setting
+ ``CMAKE_CUDA_COMPILER`` explicitly to be sure it is ``nvcc``.
diff --git a/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst
index fc835cd126..474baeec6d 100644
--- a/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst
+++ b/Help/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
---------------------------------
+.. versionadded:: 3.16
+
Default value for :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target
property. This variable is used to initialize the property on each target as
it is created.
diff --git a/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst b/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst
index e3205d318b..69b9d932a1 100644
--- a/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst
+++ b/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_RUNTIME_LIBRARY
--------------------------
+.. versionadded:: 3.17
+
Select the CUDA runtime library for use when compiling and linking CUDA.
This variable is used to initialize the :prop_tgt:`CUDA_RUNTIME_LIBRARY`
property on all targets as they are created.
diff --git a/Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst b/Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst
index eef92fb16c..3dbaef9d2d 100644
--- a/Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst
+++ b/Help/variable/CMAKE_CUDA_SEPARABLE_COMPILATION.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_SEPARABLE_COMPILATION
--------------------------------
+.. versionadded:: 3.11
+
Default value for :prop_tgt:`CUDA_SEPARABLE_COMPILATION` target property.
This variable is used to initialize the property on each target as it is
created.
diff --git a/Help/variable/CMAKE_CUDA_STANDARD.rst b/Help/variable/CMAKE_CUDA_STANDARD.rst
index 6c23031ce1..798ab1e744 100644
--- a/Help/variable/CMAKE_CUDA_STANDARD.rst
+++ b/Help/variable/CMAKE_CUDA_STANDARD.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_STANDARD
-------------------
+.. versionadded:: 3.8
+
Default value for :prop_tgt:`CUDA_STANDARD` property of targets.
This variable is used to initialize the :prop_tgt:`CUDA_STANDARD`
diff --git a/Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst
index 935d605832..ae2f52f8bc 100644
--- a/Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst
+++ b/Help/variable/CMAKE_CUDA_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_STANDARD_REQUIRED
----------------------------
+.. versionadded:: 3.8
+
Default value for :prop_tgt:`CUDA_STANDARD_REQUIRED` property of targets.
This variable is used to initialize the :prop_tgt:`CUDA_STANDARD_REQUIRED`
diff --git a/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
index 7de50a5a78..e586dab69e 100644
--- a/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
@@ -1,6 +1,8 @@
CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
--------------------------------------
+.. versionadded:: 3.8
+
When the ``CUDA`` language has been enabled, this provides a
:ref:`semicolon-separated list <CMake Language Lists>` of include directories provided
by the CUDA Toolkit. The value may be useful for C++ source files
diff --git a/Help/variable/CMAKE_CURRENT_FUNCTION.rst b/Help/variable/CMAKE_CURRENT_FUNCTION.rst
index fb7f61060a..5d1a4e98e6 100644
--- a/Help/variable/CMAKE_CURRENT_FUNCTION.rst
+++ b/Help/variable/CMAKE_CURRENT_FUNCTION.rst
@@ -1,6 +1,8 @@
CMAKE_CURRENT_FUNCTION
----------------------
+.. versionadded:: 3.17
+
When executing code inside a :command:`function`, this variable
contains the name of the current function. It can be useful for
diagnostic or debug messages.
diff --git a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst
index 44ae1e5d8b..f8f553d3c1 100644
--- a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst
+++ b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_DIR.rst
@@ -1,6 +1,8 @@
CMAKE_CURRENT_FUNCTION_LIST_DIR
-------------------------------
+.. versionadded:: 3.17
+
When executing code inside a :command:`function`, this variable
contains the full directory of the listfile that defined the current function.
diff --git a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst
index c737af9a9c..437dfec9c0 100644
--- a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst
+++ b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_FILE.rst
@@ -1,6 +1,8 @@
CMAKE_CURRENT_FUNCTION_LIST_FILE
--------------------------------
+.. versionadded:: 3.17
+
When executing code inside a :command:`function`, this variable
contains the full path to the listfile that defined the current function.
diff --git a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst
index ad6282eda7..2fc701246a 100644
--- a/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst
+++ b/Help/variable/CMAKE_CURRENT_FUNCTION_LIST_LINE.rst
@@ -1,6 +1,8 @@
CMAKE_CURRENT_FUNCTION_LIST_LINE
--------------------------------
+.. versionadded:: 3.17
+
When executing code inside a :command:`function`, this variable
contains the line number in the listfile where the current function
was defined.
diff --git a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst
index 5c59f95031..8fcfbaebe0 100644
--- a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst
@@ -1,6 +1,8 @@
CMAKE_CXX_COMPILE_FEATURES
--------------------------
+.. versionadded:: 3.1
+
List of features known to the C++ compiler
These features are known to be available for use with the C++ compiler. This
diff --git a/Help/variable/CMAKE_CXX_EXTENSIONS.rst b/Help/variable/CMAKE_CXX_EXTENSIONS.rst
index 4a92425e64..ea8c4be705 100644
--- a/Help/variable/CMAKE_CXX_EXTENSIONS.rst
+++ b/Help/variable/CMAKE_CXX_EXTENSIONS.rst
@@ -1,6 +1,8 @@
CMAKE_CXX_EXTENSIONS
--------------------
+.. versionadded:: 3.1
+
Default value for :prop_tgt:`CXX_EXTENSIONS` property of targets.
This variable is used to initialize the :prop_tgt:`CXX_EXTENSIONS`
diff --git a/Help/variable/CMAKE_CXX_STANDARD.rst b/Help/variable/CMAKE_CXX_STANDARD.rst
index 8a8bdff29f..8ef8c80e31 100644
--- a/Help/variable/CMAKE_CXX_STANDARD.rst
+++ b/Help/variable/CMAKE_CXX_STANDARD.rst
@@ -1,6 +1,8 @@
CMAKE_CXX_STANDARD
------------------
+.. versionadded:: 3.1
+
Default value for :prop_tgt:`CXX_STANDARD` property of targets.
This variable is used to initialize the :prop_tgt:`CXX_STANDARD`
diff --git a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst
index 4c710580a0..f7b2ae92ea 100644
--- a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst
+++ b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
CMAKE_CXX_STANDARD_REQUIRED
---------------------------
+.. versionadded:: 3.1
+
Default value for :prop_tgt:`CXX_STANDARD_REQUIRED` property of targets.
This variable is used to initialize the :prop_tgt:`CXX_STANDARD_REQUIRED`
diff --git a/Help/variable/CMAKE_C_COMPILE_FEATURES.rst b/Help/variable/CMAKE_C_COMPILE_FEATURES.rst
index 8d1eca06ad..2b306a33cc 100644
--- a/Help/variable/CMAKE_C_COMPILE_FEATURES.rst
+++ b/Help/variable/CMAKE_C_COMPILE_FEATURES.rst
@@ -1,6 +1,8 @@
CMAKE_C_COMPILE_FEATURES
------------------------
+.. versionadded:: 3.1
+
List of features known to the C compiler
These features are known to be available for use with the C compiler. This
diff --git a/Help/variable/CMAKE_C_EXTENSIONS.rst b/Help/variable/CMAKE_C_EXTENSIONS.rst
index fa510d4a83..fce8fc7220 100644
--- a/Help/variable/CMAKE_C_EXTENSIONS.rst
+++ b/Help/variable/CMAKE_C_EXTENSIONS.rst
@@ -1,6 +1,8 @@
CMAKE_C_EXTENSIONS
------------------
+.. versionadded:: 3.1
+
Default value for :prop_tgt:`C_EXTENSIONS` property of targets.
This variable is used to initialize the :prop_tgt:`C_EXTENSIONS`
diff --git a/Help/variable/CMAKE_C_STANDARD.rst b/Help/variable/CMAKE_C_STANDARD.rst
index b55e00cd9e..64ef8ce296 100644
--- a/Help/variable/CMAKE_C_STANDARD.rst
+++ b/Help/variable/CMAKE_C_STANDARD.rst
@@ -1,6 +1,8 @@
CMAKE_C_STANDARD
----------------
+.. versionadded:: 3.1
+
Default value for :prop_tgt:`C_STANDARD` property of targets.
This variable is used to initialize the :prop_tgt:`C_STANDARD`
diff --git a/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst
index 7f70f6edb6..e70b6bd26a 100644
--- a/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst
+++ b/Help/variable/CMAKE_C_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
CMAKE_C_STANDARD_REQUIRED
-------------------------
+.. versionadded:: 3.1
+
Default value for :prop_tgt:`C_STANDARD_REQUIRED` property of targets.
This variable is used to initialize the :prop_tgt:`C_STANDARD_REQUIRED`
diff --git a/Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst b/Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst
index aa4f82dbd0..cadbf3a135 100644
--- a/Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst
+++ b/Help/variable/CMAKE_DEFAULT_BUILD_TYPE.rst
@@ -1,6 +1,8 @@
CMAKE_DEFAULT_BUILD_TYPE
------------------------
+.. versionadded:: 3.17
+
Specifies the configuration to use by default in a ``build.ninja`` file in the
:generator:`Ninja Multi-Config` generator. If this variable is specified,
``build.ninja`` uses build rules from ``build-<Config>.ninja`` by default. All
diff --git a/Help/variable/CMAKE_DEFAULT_CONFIGS.rst b/Help/variable/CMAKE_DEFAULT_CONFIGS.rst
index 84c642aa58..65a5f0ddf5 100644
--- a/Help/variable/CMAKE_DEFAULT_CONFIGS.rst
+++ b/Help/variable/CMAKE_DEFAULT_CONFIGS.rst
@@ -1,6 +1,8 @@
CMAKE_DEFAULT_CONFIGS
---------------------
+.. versionadded:: 3.17
+
Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of configurations
to build for a target in ``build.ninja`` if no ``:<Config>`` suffix is specified in
the :generator:`Ninja Multi-Config` generator. If it is set to ``all``, all
diff --git a/Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst b/Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst
index 7179071451..bfe9402e55 100644
--- a/Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst
+++ b/Help/variable/CMAKE_DEPENDS_IN_PROJECT_ONLY.rst
@@ -1,6 +1,8 @@
CMAKE_DEPENDS_IN_PROJECT_ONLY
-----------------------------
+.. versionadded:: 3.6
+
When set to ``TRUE`` in a directory, the build system produced by the
:ref:`Makefile Generators` is set up to only consider dependencies on source
files that appear either in the source or in the binary directories. Changes
diff --git a/Help/variable/CMAKE_DIRECTORY_LABELS.rst b/Help/variable/CMAKE_DIRECTORY_LABELS.rst
index 2a6c41000c..81d6dd1301 100644
--- a/Help/variable/CMAKE_DIRECTORY_LABELS.rst
+++ b/Help/variable/CMAKE_DIRECTORY_LABELS.rst
@@ -1,6 +1,8 @@
CMAKE_DIRECTORY_LABELS
-----------------------
+.. versionadded:: 3.10
+
Specify labels for the current directory.
This is used to initialize the :prop_dir:`LABELS` directory property.
diff --git a/Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst b/Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst
index 7c30edebcd..cf52776010 100644
--- a/Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst
+++ b/Help/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS.rst
@@ -1,6 +1,8 @@
CMAKE_DISABLE_PRECOMPILE_HEADERS
--------------------------------
+.. versionadded:: 3.16
+
Default value for :prop_tgt:`DISABLE_PRECOMPILE_HEADERS` of targets.
By default ``CMAKE_DISABLE_PRECOMPILE_HEADERS`` is ``OFF``.
diff --git a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst
index 8edcd1ef97..29249d609b 100644
--- a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst
+++ b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK.rst
@@ -1,6 +1,8 @@
CMAKE_DOTNET_TARGET_FRAMEWORK
-----------------------------
+.. versionadded:: 3.17
+
Default value for :prop_tgt:`DOTNET_TARGET_FRAMEWORK` property of
targets.
diff --git a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst
index c2eef9edd0..fc3c360099 100644
--- a/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst
+++ b/Help/variable/CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION.rst
@@ -1,6 +1,8 @@
CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION
-------------------------------------
+.. versionadded:: 3.12
+
Default value for :prop_tgt:`DOTNET_TARGET_FRAMEWORK_VERSION`
property of targets.
diff --git a/Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst b/Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst
index 331aae8773..548c563b64 100644
--- a/Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst
+++ b/Help/variable/CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES.rst
@@ -1,6 +1,8 @@
CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
---------------------------------------
+.. versionadded:: 3.6
+
This cache variable is used by the Eclipse project generator. See
:manual:`cmake-generators(7)`.
diff --git a/Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst b/Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst
index 7b4367d19e..fc28ebbeb0 100644
--- a/Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst
+++ b/Help/variable/CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT.rst
@@ -1,6 +1,8 @@
CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
-------------------------------------
+.. versionadded:: 3.6
+
This cache variable is used by the Eclipse project generator. See
:manual:`cmake-generators(7)`.
diff --git a/Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst b/Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst
index 6e8a408877..90e36f5fb7 100644
--- a/Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst
+++ b/Help/variable/CMAKE_ECLIPSE_MAKE_ARGUMENTS.rst
@@ -1,6 +1,8 @@
CMAKE_ECLIPSE_MAKE_ARGUMENTS
----------------------------
+.. versionadded:: 3.6
+
This cache variable is used by the Eclipse project generator. See
:manual:`cmake-generators(7)`.
diff --git a/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst b/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst
index 314efe5fe2..492acd88f0 100644
--- a/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst
+++ b/Help/variable/CMAKE_ECLIPSE_RESOURCE_ENCODING.rst
@@ -1,6 +1,8 @@
CMAKE_ECLIPSE_RESOURCE_ENCODING
-------------------------------
+.. versionadded:: 3.16
+
This cache variable tells the :generator:`Eclipse CDT4` project generator
to set the resource encoding to the given value in generated project files.
If no value is given, no encoding will be set.
diff --git a/Help/variable/CMAKE_ECLIPSE_VERSION.rst b/Help/variable/CMAKE_ECLIPSE_VERSION.rst
index 8cc7882d9e..db65d89f41 100644
--- a/Help/variable/CMAKE_ECLIPSE_VERSION.rst
+++ b/Help/variable/CMAKE_ECLIPSE_VERSION.rst
@@ -1,6 +1,8 @@
CMAKE_ECLIPSE_VERSION
---------------------
+.. versionadded:: 3.6
+
This cache variable is used by the Eclipse project generator. See
:manual:`cmake-generators(7)`.
diff --git a/Help/variable/CMAKE_ENABLE_EXPORTS.rst b/Help/variable/CMAKE_ENABLE_EXPORTS.rst
index 8848da1234..9f43de3fac 100644
--- a/Help/variable/CMAKE_ENABLE_EXPORTS.rst
+++ b/Help/variable/CMAKE_ENABLE_EXPORTS.rst
@@ -1,6 +1,8 @@
CMAKE_ENABLE_EXPORTS
--------------------
+.. versionadded:: 3.4
+
Specify whether executables export symbols for loadable modules.
This variable is used to initialize the :prop_tgt:`ENABLE_EXPORTS` target
diff --git a/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst b/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst
index 76561d82bc..90a16c38ec 100644
--- a/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst
+++ b/Help/variable/CMAKE_EXECUTE_PROCESS_COMMAND_ECHO.rst
@@ -1,6 +1,8 @@
CMAKE_EXECUTE_PROCESS_COMMAND_ECHO
----------------------------------
+.. versionadded:: 3.15
+
If this variable is set to ``STDERR``, ``STDOUT`` or ``NONE`` then commands
in :command:`execute_process` calls will be printed to either stderr or
stdout or not at all.
diff --git a/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst
index 592a36973b..4d2718a03c 100644
--- a/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst
+++ b/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT
------------------------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_EXE_LINKER_FLAGS_<CONFIG>`
cache entry the first time a build tree is configured.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst b/Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst
index 0b8afe4fe4..6e3927c1d5 100644
--- a/Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst
+++ b/Help/variable/CMAKE_EXE_LINKER_FLAGS_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_EXE_LINKER_FLAGS_INIT
---------------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_EXE_LINKER_FLAGS`
cache entry the first time a build tree is configured.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
index 6d2450bc70..724f30989f 100644
--- a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
+++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
@@ -1,6 +1,8 @@
CMAKE_EXPORT_COMPILE_COMMANDS
-----------------------------
+.. versionadded:: 3.5
+
Enable/Disable output of compile commands during generation.
If enabled, generates a ``compile_commands.json`` file containing the exact
diff --git a/Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst
index 768ed64bf2..5772490165 100644
--- a/Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst
+++ b/Help/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.rst
@@ -1,6 +1,8 @@
CMAKE_EXPORT_NO_PACKAGE_REGISTRY
--------------------------------
+.. versionadded:: 3.1
+
Disable the :command:`export(PACKAGE)` command when :policy:`CMP0090`
is not set to ``NEW``.
diff --git a/Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst
index 3476a199ce..663639bf41 100644
--- a/Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst
+++ b/Help/variable/CMAKE_EXPORT_PACKAGE_REGISTRY.rst
@@ -1,6 +1,8 @@
CMAKE_EXPORT_PACKAGE_REGISTRY
-----------------------------
+.. versionadded:: 3.15
+
Enables the :command:`export(PACKAGE)` command when :policy:`CMP0090`
is set to ``NEW``.
diff --git a/Help/variable/CMAKE_FIND_APPBUNDLE.rst b/Help/variable/CMAKE_FIND_APPBUNDLE.rst
index 7a05facf86..17563f3014 100644
--- a/Help/variable/CMAKE_FIND_APPBUNDLE.rst
+++ b/Help/variable/CMAKE_FIND_APPBUNDLE.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_APPBUNDLE
--------------------
+.. versionadded:: 3.4
+
This variable affects how ``find_*`` commands choose between
macOS Application Bundles and unix-style package components.
diff --git a/Help/variable/CMAKE_FIND_DEBUG_MODE.rst b/Help/variable/CMAKE_FIND_DEBUG_MODE.rst
index f5fd8ce9f3..8f2a82f24d 100644
--- a/Help/variable/CMAKE_FIND_DEBUG_MODE.rst
+++ b/Help/variable/CMAKE_FIND_DEBUG_MODE.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_DEBUG_MODE
---------------------
+.. versionadded:: 3.17
+
Print extra find call information for the following commands to standard
error:
diff --git a/Help/variable/CMAKE_FIND_FRAMEWORK.rst b/Help/variable/CMAKE_FIND_FRAMEWORK.rst
index 4d5078fb69..3b62cda1c6 100644
--- a/Help/variable/CMAKE_FIND_FRAMEWORK.rst
+++ b/Help/variable/CMAKE_FIND_FRAMEWORK.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_FRAMEWORK
--------------------
+.. versionadded:: 3.4
+
This variable affects how ``find_*`` commands choose between
macOS Frameworks and unix-style package components.
diff --git a/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst b/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst
index ada89559f5..ca2ad7f239 100644
--- a/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst
+++ b/Help/variable/CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX
------------------------------------
+.. versionadded:: 3.9
+
Specify a ``<suffix>`` to tell the :command:`find_library` command to
search in a ``lib<suffix>`` directory before each ``lib`` directory that
would normally be searched.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst b/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst
index bd1a30f52d..fc1fd43753 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_PACKAGE_NAME
-----------------------
+.. versionadded:: 3.1.1
+
Defined by the :command:`find_package` command while loading
a find module to record the caller-specified package name.
See command documentation for details.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst
index 4ee9d8b815..8d86a94296 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
--------------------------------------
+.. versionadded:: 3.1
+
.. deprecated:: 3.16
Use the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY` variable instead.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst
index 107c183eb8..cc67f08d26 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
---------------------------------------------
+.. versionadded:: 3.1
+
.. deprecated:: 3.16
Use the :variable:`CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY` variable instead.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst b/Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst
index db658a1e0e..ba81529ad0 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_PACKAGE_PREFER_CONFIG
---------------------------------
+.. versionadded:: 3.15
+
Tell :command:`find_package` to try "Config" mode before "Module" mode if no
mode was specified.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst b/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst
index dfbde20351..86d75e7d97 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
-----------------------------------
+.. versionadded:: 3.14
+
Set to ``TRUE`` to tell :command:`find_package` calls to resolve symbolic
links in the value of ``<PackageName>_DIR``.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst b/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
index 99e4ec1250..98c2a8f9ad 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_PACKAGE_SORT_DIRECTION
---------------------------------
+.. versionadded:: 3.7
+
The sorting direction used by :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER`.
It can assume one of the following values:
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst b/Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst
index ba5f3a8c76..1725ba1445 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_SORT_ORDER.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_PACKAGE_SORT_ORDER
-----------------------------
+.. versionadded:: 3.7
+
The default order for sorting packages found using :command:`find_package`.
It can assume one of the following values:
diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst
index 957e956f35..de1bad7063 100644
--- a/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH
-------------------------------------
+.. versionadded:: 3.16
+
Controls the default behavior of the following commands for whether or not to
search paths provided by cmake-specific environment variables:
diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst
index d2bdb09b5a..47ce3a3825 100644
--- a/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_CMAKE_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_USE_CMAKE_PATH
-------------------------
+.. versionadded:: 3.16
+
Controls the default behavior of the following commands for whether or not to
search paths provided by cmake-specific cache variables:
diff --git a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst
index b99081d3ea..2fd00dfcf4 100644
--- a/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_CMAKE_SYSTEM_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH
--------------------------------
+.. versionadded:: 3.16
+
Controls the default behavior of the following commands for whether or not to
search paths provided by platform-specific cmake variables:
diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst
index 7c7ca3618d..312720615f 100644
--- a/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst
+++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_REGISTRY.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_USE_PACKAGE_REGISTRY
-------------------------------
+.. versionadded:: 3.16
+
Controls the default behavior of the :command:`find_package` command for
whether or not to search paths provided by the :ref:`User Package Registry`.
diff --git a/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst
index e7f5b0ff83..64e5c6d6b2 100644
--- a/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_USE_PACKAGE_ROOT_PATH
--------------------------------
+.. versionadded:: 3.16
+
Controls the default behavior of the following commands for whether or not to
search paths provided by :variable:`<PackageName>_ROOT` variables:
diff --git a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst
index fbaba5a73a..a0a86e43a9 100644
--- a/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst
+++ b/Help/variable/CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH
--------------------------------------
+.. versionadded:: 3.16
+
Controls the default behavior of the following commands for whether or not to
search paths provided by standard system environment variables:
diff --git a/Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst b/Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst
index cb4eec5d17..504b7e872f 100644
--- a/Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst
+++ b/Help/variable/CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY.rst
@@ -1,6 +1,8 @@
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY
--------------------------------------
+.. versionadded:: 3.16
+
Controls searching the :ref:`System Package Registry` by the
:command:`find_package` command.
diff --git a/Help/variable/CMAKE_FOLDER.rst b/Help/variable/CMAKE_FOLDER.rst
index 50a2b88d7b..37f137c2f0 100644
--- a/Help/variable/CMAKE_FOLDER.rst
+++ b/Help/variable/CMAKE_FOLDER.rst
@@ -1,6 +1,8 @@
CMAKE_FOLDER
------------
+.. versionadded:: 3.12
+
Set the folder name. Use to organize targets in an IDE.
This variable is used to initialize the :prop_tgt:`FOLDER` property on all the
diff --git a/Help/variable/CMAKE_FRAMEWORK.rst b/Help/variable/CMAKE_FRAMEWORK.rst
index 591041c8bf..37385bf76e 100644
--- a/Help/variable/CMAKE_FRAMEWORK.rst
+++ b/Help/variable/CMAKE_FRAMEWORK.rst
@@ -1,6 +1,8 @@
CMAKE_FRAMEWORK
---------------
+.. versionadded:: 3.15
+
Default value for :prop_tgt:`FRAMEWORK` of targets.
This variable is used to initialize the :prop_tgt:`FRAMEWORK` property on
diff --git a/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst b/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
index 5c7cd23732..47fb66e410 100644
--- a/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
+++ b/Help/variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
@@ -1,6 +1,8 @@
CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>
---------------------------------------------
+.. versionadded:: 3.18
+
Default framework filename postfix under configuration ``<CONFIG>`` when
using a multi-config generator.
diff --git a/Help/variable/CMAKE_Fortran_PREPROCESS.rst b/Help/variable/CMAKE_Fortran_PREPROCESS.rst
index 74b2d8be0d..7d405f354c 100644
--- a/Help/variable/CMAKE_Fortran_PREPROCESS.rst
+++ b/Help/variable/CMAKE_Fortran_PREPROCESS.rst
@@ -1,6 +1,8 @@
CMAKE_Fortran_PREPROCESS
------------------------
+.. versionadded:: 3.18
+
Default value for :prop_tgt:`Fortran_PREPROCESS` of targets.
This variable is used to initialize the :prop_tgt:`Fortran_PREPROCESS`
diff --git a/Help/variable/CMAKE_GENERATOR_INSTANCE.rst b/Help/variable/CMAKE_GENERATOR_INSTANCE.rst
index 3657ed4ffa..5858d7a771 100644
--- a/Help/variable/CMAKE_GENERATOR_INSTANCE.rst
+++ b/Help/variable/CMAKE_GENERATOR_INSTANCE.rst
@@ -1,6 +1,8 @@
CMAKE_GENERATOR_INSTANCE
------------------------
+.. versionadded:: 3.11
+
Generator-specific instance specification provided by user.
Some CMake generators support selection of an instance of the native build
diff --git a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
index 2c115a3abf..b17d83acf3 100644
--- a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
+++ b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
@@ -1,6 +1,8 @@
CMAKE_GENERATOR_PLATFORM
------------------------
+.. versionadded:: 3.1
+
Generator-specific target platform specification provided by user.
Some CMake generators support a target platform name to be given
diff --git a/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
index b6768a131a..0e8ae5ed74 100644
--- a/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
+++ b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
@@ -1,6 +1,8 @@
CMAKE_GHS_NO_SOURCE_GROUP_FILE
------------------------------
+.. versionadded:: 3.14
+
``ON`` / ``OFF`` boolean to control if the project file for a target should
be one single file or multiple files. Refer to
:prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` for further details.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
index 85877426bd..96e9907383 100644
--- a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
@@ -1,6 +1,8 @@
CMAKE_GLOBAL_AUTOGEN_TARGET
---------------------------
+.. versionadded:: 3.14
+
Switch to enable generation of a global ``autogen`` target.
When :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled, a custom target
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
index c86a5d0aff..4af4bc38fd 100644
--- a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
@@ -1,6 +1,8 @@
CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
--------------------------------
+.. versionadded:: 3.14
+
Change the name of the global ``autogen`` target.
When :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled, a global custom target
diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
index f92128cdaf..efea5bec81 100644
--- a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
+++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
@@ -1,6 +1,8 @@
CMAKE_GLOBAL_AUTORCC_TARGET
---------------------------
+.. versionadded:: 3.14
+
Switch to enable generation of a global ``autorcc`` target.
When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a custom target
diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
index c6e05de4eb..4d2e313ffd 100644
--- a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
+++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
@@ -1,6 +1,8 @@
CMAKE_GLOBAL_AUTORCC_TARGET_NAME
--------------------------------
+.. versionadded:: 3.14
+
Change the name of the global ``autorcc`` target.
When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a global custom target
diff --git a/Help/variable/CMAKE_HOST_SOLARIS.rst b/Help/variable/CMAKE_HOST_SOLARIS.rst
index 82b5d69cd6..7054acd405 100644
--- a/Help/variable/CMAKE_HOST_SOLARIS.rst
+++ b/Help/variable/CMAKE_HOST_SOLARIS.rst
@@ -1,6 +1,8 @@
CMAKE_HOST_SOLARIS
------------------
+.. versionadded:: 3.6
+
``True`` for Oracle Solaris operating systems.
Set to ``true`` when the host system is Oracle Solaris.
diff --git a/Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst b/Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst
index f994fbe876..aad99e4406 100644
--- a/Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst
+++ b/Help/variable/CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst
@@ -1,6 +1,8 @@
CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
-------------------------------------------
+.. versionadded:: 3.11
+
Default permissions for directories created implicitly during installation
of files by :command:`install` and :command:`file(INSTALL)`.
diff --git a/Help/variable/CMAKE_INSTALL_MESSAGE.rst b/Help/variable/CMAKE_INSTALL_MESSAGE.rst
index 304df268c7..4f39cfeb50 100644
--- a/Help/variable/CMAKE_INSTALL_MESSAGE.rst
+++ b/Help/variable/CMAKE_INSTALL_MESSAGE.rst
@@ -1,6 +1,8 @@
CMAKE_INSTALL_MESSAGE
---------------------
+.. versionadded:: 3.1
+
Specify verbosity of installation script code generated by the
:command:`install` command (using the :command:`file(INSTALL)` command).
For paths that are newly installed or updated, installation
diff --git a/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst b/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst
index 2a5842d4c3..93cc3190b1 100644
--- a/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst
+++ b/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst
@@ -1,6 +1,8 @@
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
-------------------------------------------
+.. versionadded:: 3.7.1
+
CMake sets this variable to a ``TRUE`` value when the
:variable:`CMAKE_INSTALL_PREFIX` has just been initialized to
its default value, typically on the first run of CMake within
diff --git a/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst b/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
index 76ca3da022..c86e433b36 100644
--- a/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
+++ b/Help/variable/CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH.rst
@@ -1,6 +1,8 @@
CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH
--------------------------------------
+.. versionadded:: 3.16
+
Sets the default for whether toolchain-defined rpaths should be removed during
installation.
diff --git a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst
index b0cbb62b96..cf7da76604 100644
--- a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst
+++ b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst
@@ -1,6 +1,8 @@
CMAKE_INTERPROCEDURAL_OPTIMIZATION
----------------------------------
+.. versionadded:: 3.9
+
Default value for :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` of targets.
This variable is used to initialize the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION`
diff --git a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
index b291102de8..5b3ee7705b 100644
--- a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
+++ b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
@@ -1,6 +1,8 @@
CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
-------------------------------------------
+.. versionadded:: 3.9
+
Default value for :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION_<CONFIG>` of targets.
This variable is used to initialize the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION_<CONFIG>`
diff --git a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst
index c5cb9b647d..cd7fd8dcea 100644
--- a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst
+++ b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst
@@ -1,6 +1,8 @@
CMAKE_IOS_INSTALL_COMBINED
--------------------------
+.. versionadded:: 3.5
+
Default value for :prop_tgt:`IOS_INSTALL_COMBINED` of targets.
This variable is used to initialize the :prop_tgt:`IOS_INSTALL_COMBINED`
diff --git a/Help/variable/CMAKE_JOB_POOLS.rst b/Help/variable/CMAKE_JOB_POOLS.rst
index 72b50b4905..43d3c84201 100644
--- a/Help/variable/CMAKE_JOB_POOLS.rst
+++ b/Help/variable/CMAKE_JOB_POOLS.rst
@@ -1,6 +1,8 @@
CMAKE_JOB_POOLS
---------------
+.. versionadded:: 3.11
+
If the :prop_gbl:`JOB_POOLS` global property is not set, the value
of this variable is used in its place. See :prop_gbl:`JOB_POOLS`
for additional information.
diff --git a/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst b/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst
index f9467b32a3..1a6f66a414 100644
--- a/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst
+++ b/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst
@@ -1,6 +1,8 @@
CMAKE_JOB_POOL_PRECOMPILE_HEADER
--------------------------------
+.. versionadded:: 3.17
+
This variable is used to initialize the :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER`
property on all the targets. See :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER`
for additional information.
diff --git a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst
index d336364811..f5392771cc 100644
--- a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst
+++ b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE
--------------------------------------
+.. versionadded:: 3.7.1
+
When :ref:`Cross Compiling for Android` this variable contains the
toolchain binutils machine name (e.g. ``gcc -dumpmachine``). The
binutils typically have a ``<machine>-`` prefix on their name.
diff --git a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst
index db04af35b8..ff072caf0a 100644
--- a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst
+++ b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX
-------------------------------------
+.. versionadded:: 3.7
+
When :ref:`Cross Compiling for Android` this variable contains the absolute
path prefixing the toolchain GNU compiler and its binutils.
diff --git a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst
index 159eb22fab..d595280372 100644
--- a/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst
+++ b/Help/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX
-------------------------------------
+.. versionadded:: 3.7
+
When :ref:`Cross Compiling for Android` this variable contains the
host platform suffix of the toolchain GNU compiler and its binutils.
diff --git a/Help/variable/CMAKE_LANG_CLANG_TIDY.rst b/Help/variable/CMAKE_LANG_CLANG_TIDY.rst
index bd49de3697..78f0f6a21f 100644
--- a/Help/variable/CMAKE_LANG_CLANG_TIDY.rst
+++ b/Help/variable/CMAKE_LANG_CLANG_TIDY.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_CLANG_TIDY
-----------------------
+.. versionadded:: 3.6
+
Default value for :prop_tgt:`<LANG>_CLANG_TIDY` target property
when ``<LANG>`` is ``C`` or ``CXX``.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_AR.rst b/Help/variable/CMAKE_LANG_COMPILER_AR.rst
index b83a1d40cb..74f2758a34 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_AR.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_AR.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_COMPILER_AR
------------------------
+.. versionadded:: 3.9
+
A wrapper around ``ar`` adding the appropriate ``--plugin`` option for the
compiler.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
index 054c648841..8057566026 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID
-------------------------------------
+.. versionadded:: 3.10
+
An internal variable subject to change.
This is used to identify the variant of a compiler based on its target
diff --git a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
index c76e2d0587..98634c245e 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_COMPILER_LAUNCHER
------------------------------
+.. versionadded:: 3.4
+
Default value for :prop_tgt:`<LANG>_COMPILER_LAUNCHER` target property.
This variable is used to initialize the property on each target as it is
created. This is done only when ``<LANG>`` is ``C``, ``CXX``, ``Fortran``,
diff --git a/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst b/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst
index e050f43e63..935329a4b0 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND
----------------------------------------
+.. versionadded:: 3.10
+
Command that outputs the compiler pre definitions.
See :prop_tgt:`AUTOMOC` which uses
diff --git a/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst b/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst
index 945160b586..1d10b557f7 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_COMPILER_RANLIB
----------------------------
+.. versionadded:: 3.9
+
A wrapper around ``ranlib`` adding the appropriate ``--plugin`` option for the
compiler.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst b/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst
index c3cd9801aa..596a989305 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_COMPILER_VERSION_INTERNAL
--------------------------------------
+.. versionadded:: 3.10
+
An internal variable subject to change.
This is used to identify the variant of a compiler based on an internal
diff --git a/Help/variable/CMAKE_LANG_CPPCHECK.rst b/Help/variable/CMAKE_LANG_CPPCHECK.rst
index 50b478fd03..5ae5fafb50 100644
--- a/Help/variable/CMAKE_LANG_CPPCHECK.rst
+++ b/Help/variable/CMAKE_LANG_CPPCHECK.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_CPPCHECK
---------------------
+.. versionadded:: 3.10
+
Default value for :prop_tgt:`<LANG>_CPPCHECK` target property. This variable
is used to initialize the property on each target as it is created. This
is done only when ``<LANG>`` is ``C`` or ``CXX``.
diff --git a/Help/variable/CMAKE_LANG_CPPLINT.rst b/Help/variable/CMAKE_LANG_CPPLINT.rst
index 3b6f45206c..ab7b0fcb06 100644
--- a/Help/variable/CMAKE_LANG_CPPLINT.rst
+++ b/Help/variable/CMAKE_LANG_CPPLINT.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_CPPLINT
--------------------
+.. versionadded:: 3.8
+
Default value for :prop_tgt:`<LANG>_CPPLINT` target property. This variable
is used to initialize the property on each target as it is created. This
is done only when ``<LANG>`` is ``C`` or ``CXX``.
diff --git a/Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst b/Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst
index 1dbd03640d..628b62ba2d 100644
--- a/Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS_CONFIG.rst
@@ -1,4 +1,6 @@
CMAKE_<LANG>_FLAGS_<CONFIG>
---------------------------
+.. versionadded:: 3.11
+
Flags for language ``<LANG>`` when building for the ``<CONFIG>`` configuration.
diff --git a/Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst
index 1eb5b3f617..17669a207c 100644
--- a/Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS_CONFIG_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_FLAGS_<CONFIG>_INIT
--------------------------------
+.. versionadded:: 3.11
+
Value used to initialize the :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` cache
entry the first time a build tree is configured for language ``<LANG>``.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst
index de7fcfc1d4..49c9e99508 100644
--- a/Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS_DEBUG_INIT.rst
@@ -1,5 +1,7 @@
CMAKE_<LANG>_FLAGS_DEBUG_INIT
-----------------------------
+.. versionadded:: 3.7
+
This variable is the ``Debug`` variant of the
:variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable.
diff --git a/Help/variable/CMAKE_LANG_FLAGS_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_INIT.rst
index 4a034e84c0..67ff2cb3eb 100644
--- a/Help/variable/CMAKE_LANG_FLAGS_INIT.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_FLAGS_INIT
-----------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_<LANG>_FLAGS` cache entry
the first time a build tree is configured for language ``<LANG>``.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst
index 1e7003cecd..3600909e25 100644
--- a/Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS_MINSIZEREL_INIT.rst
@@ -1,5 +1,7 @@
CMAKE_<LANG>_FLAGS_MINSIZEREL_INIT
----------------------------------
+.. versionadded:: 3.7
+
This variable is the ``MinSizeRel`` variant of the
:variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable.
diff --git a/Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst
index e7c73fea61..e8898524d6 100644
--- a/Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS_RELEASE_INIT.rst
@@ -1,5 +1,7 @@
CMAKE_<LANG>_FLAGS_RELEASE_INIT
-------------------------------
+.. versionadded:: 3.7
+
This variable is the ``Release`` variant of the
:variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable.
diff --git a/Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst
index 3ab39753d0..b42caeefbc 100644
--- a/Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT.rst
@@ -1,5 +1,7 @@
CMAKE_<LANG>_FLAGS_RELWITHDEBINFO_INIT
--------------------------------------
+.. versionadded:: 3.7
+
This variable is the ``RelWithDebInfo`` variant of the
:variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable.
diff --git a/Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst b/Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst
index 2c8028a607..be6c21094c 100644
--- a/Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst
+++ b/Help/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE
---------------------------------
+.. versionadded:: 3.3
+
Default value for :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE` target property.
This variable is used to initialize the property on each target as it is
created. This is done only when ``<LANG>`` is ``C`` or ``CXX``.
diff --git a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
index df514075c6..471c351f37 100644
--- a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
+++ b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_LINKER_WRAPPER_FLAG
--------------------------------
+.. versionadded:: 3.13
+
Defines the syntax of compiler driver option to pass options to the linker
tool. It will be used to translate the ``LINKER:`` prefix in the link options
(see :command:`add_link_options` and :command:`target_link_options`).
diff --git a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst
index faf14815cd..a3895af613 100644
--- a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst
+++ b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP
------------------------------------
+.. versionadded:: 3.13
+
This variable is used with :variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG`
variable to format ``LINKER:`` prefix in the link options
(see :command:`add_link_options` and :command:`target_link_options`).
diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst
index d54f080222..23ece882da 100644
--- a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst
+++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_LINK_LIBRARY_FILE_FLAG
-----------------------------------
+.. versionadded:: 3.16
+
Language-specific flag to be used to link a library specified by
a path to its file.
diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst
index d7bb0d8752..0f528dbff3 100644
--- a/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst
+++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_FLAG.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_LINK_LIBRARY_FLAG
------------------------------
+.. versionadded:: 3.16
+
Flag to be used to link a library into a shared library or executable.
This flag will be used to specify a library to link to a shared library or an
diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst
index a378657955..359e29f8d1 100644
--- a/Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst
+++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_LINK_LIBRARY_SUFFIX
--------------------------------
+.. versionadded:: 3.16
+
Language-specific suffix for libraries that you link to.
The suffix to use for the end of a library filename, ``.lib`` on Windows.
diff --git a/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst
index c8e3d578c5..24aca8b1e1 100644
--- a/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES
-----------------------------------------
+.. versionadded:: 3.6
+
Include directories to be used for every source file compiled with
the ``<LANG>`` compiler. This is meant for specification of system
include directories needed by the language for the current platform.
diff --git a/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst b/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst
index ba6df933ab..d5f3351118 100644
--- a/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst
+++ b/Help/variable/CMAKE_LANG_STANDARD_LIBRARIES.rst
@@ -1,6 +1,8 @@
CMAKE_<LANG>_STANDARD_LIBRARIES
-------------------------------
+.. versionadded:: 3.6
+
Libraries linked into every executable and shared library linked
for language ``<LANG>``. This is meant for specification of system
libraries needed by the language for the current platform.
diff --git a/Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst
index e069cdd8b2..08f95c4b8c 100644
--- a/Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG.rst
@@ -1,6 +1,8 @@
CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
---------------------------------------
+.. versionadded:: 3.3
+
Where to put all the :ref:`LIBRARY <Library Output Artifacts>`
target files when built for a specific configuration.
diff --git a/Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst b/Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst
index 026ca35b3f..f120866425 100644
--- a/Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst
+++ b/Help/variable/CMAKE_LINK_DIRECTORIES_BEFORE.rst
@@ -1,6 +1,8 @@
CMAKE_LINK_DIRECTORIES_BEFORE
-----------------------------
+.. versionadded:: 3.13
+
Whether to append or prepend directories by default in
:command:`link_directories`.
diff --git a/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst b/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
index 54cdaaa8e8..f4ccc04154 100644
--- a/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
+++ b/Help/variable/CMAKE_LINK_SEARCH_END_STATIC.rst
@@ -1,6 +1,8 @@
CMAKE_LINK_SEARCH_END_STATIC
----------------------------
+.. versionadded:: 3.4
+
End a link line such that static system libraries are used.
Some linkers support switches such as ``-Bstatic`` and ``-Bdynamic`` to
diff --git a/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst b/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
index 0d52a31438..2025c72b42 100644
--- a/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
+++ b/Help/variable/CMAKE_LINK_SEARCH_START_STATIC.rst
@@ -1,6 +1,8 @@
CMAKE_LINK_SEARCH_START_STATIC
------------------------------
+.. versionadded:: 3.4
+
Assume the linker looks for static libraries by default.
Some linkers support switches such as ``-Bstatic`` and ``-Bdynamic`` to
diff --git a/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst b/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst
index 90c4d3ff2a..06b3aa89ba 100644
--- a/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst
+++ b/Help/variable/CMAKE_LINK_WHAT_YOU_USE.rst
@@ -1,6 +1,8 @@
CMAKE_LINK_WHAT_YOU_USE
---------------------------------
+.. versionadded:: 3.7
+
Default value for :prop_tgt:`LINK_WHAT_YOU_USE` target property.
This variable is used to initialize the property on each target as it is
created.
diff --git a/Help/variable/CMAKE_MATCH_COUNT.rst b/Help/variable/CMAKE_MATCH_COUNT.rst
index 355e834056..deeec8b426 100644
--- a/Help/variable/CMAKE_MATCH_COUNT.rst
+++ b/Help/variable/CMAKE_MATCH_COUNT.rst
@@ -1,6 +1,8 @@
CMAKE_MATCH_COUNT
-----------------
+.. versionadded:: 3.2
+
The number of matches with the last regular expression.
When a regular expression match is used, CMake fills in
diff --git a/Help/variable/CMAKE_MATCH_n.rst b/Help/variable/CMAKE_MATCH_n.rst
index c7dd623396..a92788eb41 100644
--- a/Help/variable/CMAKE_MATCH_n.rst
+++ b/Help/variable/CMAKE_MATCH_n.rst
@@ -1,6 +1,8 @@
CMAKE_MATCH_<n>
---------------
+.. versionadded:: 3.9
+
Capture group ``<n>`` matched by the last regular expression, for groups
0 through 9. Group 0 is the entire match. Groups 1 through 9 are the
subexpressions captured by ``()`` syntax.
diff --git a/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
index 7110b16851..59c60d3acc 100644
--- a/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
+++ b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
@@ -1,6 +1,8 @@
CMAKE_MAXIMUM_RECURSION_DEPTH
-----------------------------
+.. versionadded:: 3.14
+
Maximum recursion depth for CMake scripts. It is intended to be set on the
command line with ``-DCMAKE_MAXIMUM_RECURSION_DEPTH=<x>``, or within
``CMakeLists.txt`` by projects that require a large recursion depth. Projects
diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst
index 6b4ca40329..41ace436fc 100644
--- a/Help/variable/CMAKE_MESSAGE_CONTEXT.rst
+++ b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst
@@ -1,6 +1,8 @@
CMAKE_MESSAGE_CONTEXT
---------------------
+.. versionadded:: 3.17
+
When enabled by the :manual:`cmake <cmake(1)>` ``--log-context`` command line
option or the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` variable, the
:command:`message` command converts the ``CMAKE_MESSAGE_CONTEXT`` list into a
diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst
index 7ec218e04e..382e9ff7d7 100644
--- a/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst
+++ b/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst
@@ -1,6 +1,8 @@
CMAKE_MESSAGE_CONTEXT_SHOW
--------------------------
+.. versionadded:: 3.17
+
Setting this variable to true enables showing a context with each line
logged by the :command:`message` command (see :variable:`CMAKE_MESSAGE_CONTEXT`
for how the context itself is specified).
diff --git a/Help/variable/CMAKE_MESSAGE_INDENT.rst b/Help/variable/CMAKE_MESSAGE_INDENT.rst
index 7e44a4cad5..c6263d2e26 100644
--- a/Help/variable/CMAKE_MESSAGE_INDENT.rst
+++ b/Help/variable/CMAKE_MESSAGE_INDENT.rst
@@ -1,6 +1,8 @@
CMAKE_MESSAGE_INDENT
--------------------
+.. versionadded:: 3.16
+
The :command:`message` command joins the strings from this list and for
log levels of ``NOTICE`` and below, it prepends the resultant string to
each line of the message.
diff --git a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
index 1d4cfe6c60..3b45d1ddfd 100644
--- a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
+++ b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
@@ -1,6 +1,8 @@
CMAKE_MESSAGE_LOG_LEVEL
-----------------------
+.. versionadded:: 3.17
+
When set, this variable specifies the logging level used by the
:command:`message` command. Valid values are the same as those for the
``--log-level`` command line option of the :manual:`cmake(1)` program.
diff --git a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst
index 3279014090..e8a6401a18 100644
--- a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst
+++ b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_MODULE_LINKER_FLAGS_<CONFIG>_INIT
---------------------------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_MODULE_LINKER_FLAGS_<CONFIG>`
cache entry the first time a build tree is configured.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst
index 91b39f6ddf..d59e9bf70b 100644
--- a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst
+++ b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_MODULE_LINKER_FLAGS_INIT
------------------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_MODULE_LINKER_FLAGS`
cache entry the first time a build tree is configured.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst b/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst
index 22e727f377..721ceaac57 100644
--- a/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst
+++ b/Help/variable/CMAKE_MSVCIDE_RUN_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_MSVCIDE_RUN_PATH
----------------------
+.. versionadded:: 3.10
+
Extra PATH locations that should be used when executing
:command:`add_custom_command` or :command:`add_custom_target` when using the
:generator:`Visual Studio 9 2008` (or above) generator. This allows
diff --git a/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst b/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
index 8b54e7ecc9..14806e6cbb 100644
--- a/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
+++ b/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
@@ -1,6 +1,8 @@
CMAKE_MSVC_RUNTIME_LIBRARY
--------------------------
+.. versionadded:: 3.15
+
Select the MSVC runtime library for use by compilers targeting the MSVC ABI.
This variable is used to initialize the :prop_tgt:`MSVC_RUNTIME_LIBRARY`
property on all targets as they are created. It is also propagated by
diff --git a/Help/variable/CMAKE_NETRC.rst b/Help/variable/CMAKE_NETRC.rst
index 903ec31b60..2c64a81495 100644
--- a/Help/variable/CMAKE_NETRC.rst
+++ b/Help/variable/CMAKE_NETRC.rst
@@ -1,6 +1,8 @@
CMAKE_NETRC
-----------
+.. versionadded:: 3.11
+
This variable is used to initialize the ``NETRC`` option for
:command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands and the
module :module:`ExternalProject`. See those commands for additional
diff --git a/Help/variable/CMAKE_NETRC_FILE.rst b/Help/variable/CMAKE_NETRC_FILE.rst
index 0f09afe869..97a645efea 100644
--- a/Help/variable/CMAKE_NETRC_FILE.rst
+++ b/Help/variable/CMAKE_NETRC_FILE.rst
@@ -1,6 +1,8 @@
CMAKE_NETRC_FILE
----------------
+.. versionadded:: 3.11
+
This variable is used to initialize the ``NETRC_FILE`` option for
:command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands and the
module :module:`ExternalProject`. See those commands for additional
diff --git a/Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst b/Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst
index 64091aaaf5..a8c40359a5 100644
--- a/Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst
+++ b/Help/variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX.rst
@@ -1,6 +1,8 @@
CMAKE_NINJA_OUTPUT_PATH_PREFIX
------------------------------
+.. versionadded:: 3.6
+
Set output files path prefix for the :generator:`Ninja` generator.
Every output files listed in the generated ``build.ninja`` will be
diff --git a/Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst b/Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst
index 8afa6f2752..b5225ea68f 100644
--- a/Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst
+++ b/Help/variable/CMAKE_OBJCXX_EXTENSIONS.rst
@@ -1,6 +1,8 @@
CMAKE_OBJCXX_EXTENSIONS
-----------------------
+.. versionadded:: 3.16
+
Default value for :prop_tgt:`OBJCXX_EXTENSIONS` property of targets.
This variable is used to initialize the :prop_tgt:`OBJCXX_EXTENSIONS`
diff --git a/Help/variable/CMAKE_OBJCXX_STANDARD.rst b/Help/variable/CMAKE_OBJCXX_STANDARD.rst
index 4e5016a408..98e462414f 100644
--- a/Help/variable/CMAKE_OBJCXX_STANDARD.rst
+++ b/Help/variable/CMAKE_OBJCXX_STANDARD.rst
@@ -1,6 +1,8 @@
CMAKE_OBJCXX_STANDARD
---------------------
+.. versionadded:: 3.16
+
Default value for :prop_tgt:`OBJCXX_STANDARD` property of targets.
This variable is used to initialize the :prop_tgt:`OBJCXX_STANDARD`
diff --git a/Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst
index 3a0602acf2..4b5e77cf05 100644
--- a/Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst
+++ b/Help/variable/CMAKE_OBJCXX_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
CMAKE_OBJCXX_STANDARD_REQUIRED
------------------------------
+.. versionadded:: 3.16
+
Default value for :prop_tgt:`OBJCXX_STANDARD_REQUIRED` property of targets.
This variable is used to initialize the :prop_tgt:`OBJCXX_STANDARD_REQUIRED`
diff --git a/Help/variable/CMAKE_OBJC_EXTENSIONS.rst b/Help/variable/CMAKE_OBJC_EXTENSIONS.rst
index d9619d8f26..d6e3c7dc0d 100644
--- a/Help/variable/CMAKE_OBJC_EXTENSIONS.rst
+++ b/Help/variable/CMAKE_OBJC_EXTENSIONS.rst
@@ -1,6 +1,8 @@
CMAKE_OBJC_EXTENSIONS
---------------------
+.. versionadded:: 3.16
+
Default value for :prop_tgt:`OBJC_EXTENSIONS` property of targets.
This variable is used to initialize the :prop_tgt:`OBJC_EXTENSIONS`
diff --git a/Help/variable/CMAKE_OBJC_STANDARD.rst b/Help/variable/CMAKE_OBJC_STANDARD.rst
index 976c441458..fde367dfd2 100644
--- a/Help/variable/CMAKE_OBJC_STANDARD.rst
+++ b/Help/variable/CMAKE_OBJC_STANDARD.rst
@@ -1,6 +1,8 @@
CMAKE_OBJC_STANDARD
-------------------
+.. versionadded:: 3.16
+
Default value for :prop_tgt:`OBJC_STANDARD` property of targets.
This variable is used to initialize the :prop_tgt:`OBJC_STANDARD`
diff --git a/Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst
index 5c02096dc7..8d26d952a3 100644
--- a/Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst
+++ b/Help/variable/CMAKE_OBJC_STANDARD_REQUIRED.rst
@@ -1,6 +1,8 @@
CMAKE_OBJC_STANDARD_REQUIRED
----------------------------
+.. versionadded:: 3.16
+
Default value for :prop_tgt:`OBJC_STANDARD_REQUIRED` property of targets.
This variable is used to initialize the :prop_tgt:`OBJC_STANDARD_REQUIRED`
diff --git a/Help/variable/CMAKE_PCH_WARN_INVALID.rst b/Help/variable/CMAKE_PCH_WARN_INVALID.rst
index e152abd9d4..457a4287e7 100644
--- a/Help/variable/CMAKE_PCH_WARN_INVALID.rst
+++ b/Help/variable/CMAKE_PCH_WARN_INVALID.rst
@@ -1,5 +1,7 @@
CMAKE_PCH_WARN_INVALID
----------------------
+.. versionadded:: 3.18
+
This variable is used to initialize the :prop_tgt:`PCH_WARN_INVALID`
property of targets when they are created.
diff --git a/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst b/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst
index 51b0592ea4..95cbe408f0 100644
--- a/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst
+++ b/Help/variable/CMAKE_PROJECT_DESCRIPTION.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_DESCRIPTION
-------------------------
+.. versionadded:: 3.9
+
The description of the top level project.
This variable holds the description of the project as specified in the top
diff --git a/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst b/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst
index ee0bf7c190..4c5debe6c2 100644
--- a/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst
+++ b/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_HOMEPAGE_URL
--------------------------
+.. versionadded:: 3.12
+
The homepage URL of the top level project.
This variable holds the homepage URL of the project as specified in the top
diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE.rst
index 5835264497..41d9e5db2c 100644
--- a/Help/variable/CMAKE_PROJECT_INCLUDE.rst
+++ b/Help/variable/CMAKE_PROJECT_INCLUDE.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_INCLUDE
---------------------
+.. versionadded:: 3.15
+
A CMake language file or module to be included as the last step of all
:command:`project` command calls. This is intended for injecting custom code
into project builds without modifying their source.
diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
index 280c14a0ea..c2fd0f8c40 100644
--- a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
+++ b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_INCLUDE_BEFORE
----------------------------
+.. versionadded:: 3.15
+
A CMake language file or module to be included as the first step of all
:command:`project` command calls. This is intended for injecting custom code
into project builds without modifying their source.
diff --git a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst
index db1432de65..39abb1220b 100644
--- a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst
+++ b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE
-------------------------------------------
+.. versionadded:: 3.17
+
A CMake language file or module to be included as the first step of any
:command:`project` command calls that specify ``<PROJECT-NAME>`` as the project
name. This is intended for injecting custom code into project builds without
diff --git a/Help/variable/CMAKE_PROJECT_VERSION.rst b/Help/variable/CMAKE_PROJECT_VERSION.rst
index 4f8f556055..450c13615f 100644
--- a/Help/variable/CMAKE_PROJECT_VERSION.rst
+++ b/Help/variable/CMAKE_PROJECT_VERSION.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_VERSION
---------------------
+.. versionadded:: 3.12
+
The version of the top level project.
This variable holds the version of the project as specified in the top
diff --git a/Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst b/Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst
index f1001acafa..c7511e7378 100644
--- a/Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst
+++ b/Help/variable/CMAKE_PROJECT_VERSION_MAJOR.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_VERSION_MAJOR
---------------------------
+.. versionadded:: 3.12
+
The major version of the top level project.
This variable holds the major version of the project as specified in the top
diff --git a/Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst b/Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst
index 13202be982..dd91dcfcb3 100644
--- a/Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst
+++ b/Help/variable/CMAKE_PROJECT_VERSION_MINOR.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_VERSION_MINOR
---------------------------
+.. versionadded:: 3.12
+
The minor version of the top level project.
This variable holds the minor version of the project as specified in the top
diff --git a/Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst b/Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst
index b8570d9fe0..61fd1f3210 100644
--- a/Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst
+++ b/Help/variable/CMAKE_PROJECT_VERSION_PATCH.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_VERSION_PATCH
---------------------------
+.. versionadded:: 3.12
+
The patch version of the top level project.
This variable holds the patch version of the project as specified in the top
diff --git a/Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst b/Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst
index e1ad4be330..0deae8b007 100644
--- a/Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst
+++ b/Help/variable/CMAKE_PROJECT_VERSION_TWEAK.rst
@@ -1,6 +1,8 @@
CMAKE_PROJECT_VERSION_TWEAK
---------------------------
+.. versionadded:: 3.12
+
The tweak version of the top level project.
This variable holds the tweak version of the project as specified in the top
diff --git a/Help/variable/CMAKE_RULE_MESSAGES.rst b/Help/variable/CMAKE_RULE_MESSAGES.rst
index 7460a81ee9..39be2e9459 100644
--- a/Help/variable/CMAKE_RULE_MESSAGES.rst
+++ b/Help/variable/CMAKE_RULE_MESSAGES.rst
@@ -1,6 +1,8 @@
CMAKE_RULE_MESSAGES
-------------------
+.. versionadded:: 3.13
+
Specify whether to report a message for each make rule.
If set in the cache it is used to initialize the value of the :prop_gbl:`RULE_MESSAGES` property.
diff --git a/Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst b/Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst
index 080dea667b..c9c55c53fb 100644
--- a/Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY_CONFIG.rst
@@ -1,6 +1,8 @@
CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
---------------------------------------
+.. versionadded:: 3.3
+
Where to put all the :ref:`RUNTIME <Runtime Output Artifacts>`
target files when built for a specific configuration.
diff --git a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst
index 185df387da..7f3dec7abc 100644
--- a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst
+++ b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_SHARED_LINKER_FLAGS_<CONFIG>_INIT
---------------------------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_SHARED_LINKER_FLAGS_<CONFIG>`
cache entry the first time a build tree is configured.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst
index cb819a7d94..6d51afe3fd 100644
--- a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst
+++ b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_SHARED_LINKER_FLAGS_INIT
------------------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_SHARED_LINKER_FLAGS`
cache entry the first time a build tree is configured.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst
index a49d1cb744..5e65ef2dec 100644
--- a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst
+++ b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_STATIC_LINKER_FLAGS_<CONFIG>_INIT
---------------------------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_STATIC_LINKER_FLAGS_<CONFIG>`
cache entry the first time a build tree is configured.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst
index 113ca710f0..cbf681c510 100644
--- a/Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst
+++ b/Help/variable/CMAKE_STATIC_LINKER_FLAGS_INIT.rst
@@ -1,6 +1,8 @@
CMAKE_STATIC_LINKER_FLAGS_INIT
------------------------------
+.. versionadded:: 3.7
+
Value used to initialize the :variable:`CMAKE_STATIC_LINKER_FLAGS`
cache entry the first time a build tree is configured.
This variable is meant to be set by a :variable:`toolchain file
diff --git a/Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst b/Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst
index 02c8663b49..5c1c8d1d2d 100644
--- a/Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst
+++ b/Help/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS.rst
@@ -1,6 +1,8 @@
CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS
---------------------------------
+.. versionadded:: 3.8
+
This variable contains a list of env vars as a list of tokens with the
syntax ``var=value``.
diff --git a/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst b/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst
index d65442512d..28b0dbd954 100644
--- a/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst
+++ b/Help/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE.rst
@@ -1,6 +1,8 @@
CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE
---------------------------------------
+.. versionadded:: 3.8
+
If this variable evaluates to ``ON`` at the end of the top-level
``CMakeLists.txt`` file, the :generator:`Sublime Text 2` extra generator
excludes the build tree from the ``.sublime-project`` if it is inside the
diff --git a/Help/variable/CMAKE_SUPPRESS_REGENERATION.rst b/Help/variable/CMAKE_SUPPRESS_REGENERATION.rst
index 96184dd5ed..48490ffbc5 100644
--- a/Help/variable/CMAKE_SUPPRESS_REGENERATION.rst
+++ b/Help/variable/CMAKE_SUPPRESS_REGENERATION.rst
@@ -1,6 +1,8 @@
CMAKE_SUPPRESS_REGENERATION
---------------------------
+.. versionadded:: 3.12
+
If ``CMAKE_SUPPRESS_REGENERATION`` is ``OFF``, which is default, then CMake
adds a special target on which all other targets depend that checks the build
system and optionally re-runs CMake to regenerate the build system when
diff --git a/Help/variable/CMAKE_SYSROOT_COMPILE.rst b/Help/variable/CMAKE_SYSROOT_COMPILE.rst
index e96c62b719..4aea48e293 100644
--- a/Help/variable/CMAKE_SYSROOT_COMPILE.rst
+++ b/Help/variable/CMAKE_SYSROOT_COMPILE.rst
@@ -1,6 +1,8 @@
CMAKE_SYSROOT_COMPILE
---------------------
+.. versionadded:: 3.9
+
Path to pass to the compiler in the ``--sysroot`` flag when compiling source
files. This is the same as :variable:`CMAKE_SYSROOT` but is used only for
compiling sources and not linking.
diff --git a/Help/variable/CMAKE_SYSROOT_LINK.rst b/Help/variable/CMAKE_SYSROOT_LINK.rst
index 88b48eff03..9749b7b336 100644
--- a/Help/variable/CMAKE_SYSROOT_LINK.rst
+++ b/Help/variable/CMAKE_SYSROOT_LINK.rst
@@ -1,6 +1,8 @@
CMAKE_SYSROOT_LINK
------------------
+.. versionadded:: 3.9
+
Path to pass to the compiler in the ``--sysroot`` flag when linking. This is
the same as :variable:`CMAKE_SYSROOT` but is used only for linking and not
compiling sources.
diff --git a/Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst b/Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst
index 666af46153..06a99a8cc1 100644
--- a/Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_APPBUNDLE_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_SYSTEM_APPBUNDLE_PATH
---------------------------
+.. versionadded:: 3.4
+
Search path for macOS application bundles used by the :command:`find_program`,
and :command:`find_package` commands. By default it contains the standard
directories for the current system. It is *not* intended to be modified by
diff --git a/Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst b/Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst
index 14ba18eff0..1a402c15d1 100644
--- a/Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_FRAMEWORK_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_SYSTEM_FRAMEWORK_PATH
---------------------------
+.. versionadded:: 3.4
+
Search path for macOS frameworks used by the :command:`find_library`,
:command:`find_package`, :command:`find_path`, and :command:`find_file`
commands. By default it contains the standard directories for the
diff --git a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
index b4a74eb036..fce6fa726c 100644
--- a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
+++ b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
@@ -1,6 +1,8 @@
CMAKE_Swift_LANGUAGE_VERSION
----------------------------
+.. versionadded:: 3.7
+
Set to the Swift language version number. If not set, the oldest legacy
version known to be available in the host Xcode version is assumed:
diff --git a/Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst b/Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst
index b11253bc13..36949739ff 100644
--- a/Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst
+++ b/Help/variable/CMAKE_Swift_MODULE_DIRECTORY.rst
@@ -1,6 +1,8 @@
CMAKE_Swift_MODULE_DIRECTORY
----------------------------
+.. versionadded:: 3.15
+
Swift module output directory.
This variable is used to initialise the :prop_tgt:`Swift_MODULE_DIRECTORY`
diff --git a/Help/variable/CMAKE_Swift_NUM_THREADS.rst b/Help/variable/CMAKE_Swift_NUM_THREADS.rst
index cb33678555..e1dafb05a2 100644
--- a/Help/variable/CMAKE_Swift_NUM_THREADS.rst
+++ b/Help/variable/CMAKE_Swift_NUM_THREADS.rst
@@ -1,6 +1,8 @@
CMAKE_Swift_NUM_THREADS
-----------------------
+.. versionadded:: 3.15.1
+
Number of threads for parallel compilation for Swift targets.
This variable controls the number of parallel jobs that the swift driver creates
diff --git a/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst b/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst
index 0f967876b2..d17851304b 100644
--- a/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst
+++ b/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst
@@ -1,6 +1,8 @@
CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
------------------------------------
+.. versionadded:: 3.6
+
List of variables that the :command:`try_compile` command source file signature
must propagate into the test project in order to target the same platform as
the host project.
diff --git a/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst b/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
index 5fa8dfcb67..b60539fb37 100644
--- a/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+++ b/Help/variable/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
@@ -1,6 +1,8 @@
CMAKE_TRY_COMPILE_TARGET_TYPE
-----------------------------
+.. versionadded:: 3.6
+
Type of target generated for :command:`try_compile` calls using the
source file signature. Valid values are:
diff --git a/Help/variable/CMAKE_UNITY_BUILD.rst b/Help/variable/CMAKE_UNITY_BUILD.rst
index a86cd67ff2..54a781ab3b 100644
--- a/Help/variable/CMAKE_UNITY_BUILD.rst
+++ b/Help/variable/CMAKE_UNITY_BUILD.rst
@@ -1,6 +1,8 @@
CMAKE_UNITY_BUILD
-----------------
+.. versionadded:: 3.16
+
This variable is used to initialize the :prop_tgt:`UNITY_BUILD`
property of targets when they are created. Setting it to true
enables batch compilation of multiple sources within each target.
diff --git a/Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst b/Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst
index 7988d4b286..7733fe8eff 100644
--- a/Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst
+++ b/Help/variable/CMAKE_UNITY_BUILD_BATCH_SIZE.rst
@@ -1,6 +1,8 @@
CMAKE_UNITY_BUILD_BATCH_SIZE
----------------------------
+.. versionadded:: 3.16
+
This variable is used to initialize the :prop_tgt:`UNITY_BUILD_BATCH_SIZE`
property of targets when they are created. It specifies the default upper
limit on the number of source files that may be combined in any one unity
diff --git a/Help/variable/CMAKE_VS_GLOBALS.rst b/Help/variable/CMAKE_VS_GLOBALS.rst
index 83777b619f..d4514fe4b1 100644
--- a/Help/variable/CMAKE_VS_GLOBALS.rst
+++ b/Help/variable/CMAKE_VS_GLOBALS.rst
@@ -1,6 +1,8 @@
CMAKE_VS_GLOBALS
----------------
+.. versionadded:: 3.13
+
List of ``Key=Value`` records to be set per target as target properties
:prop_tgt:`VS_GLOBAL_<variable>` with ``variable=Key`` and value ``Value``.
diff --git a/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst b/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst
index f54472ad1f..ace94e48b0 100644
--- a/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst
+++ b/Help/variable/CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD.rst
@@ -1,6 +1,8 @@
CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
-----------------------------------------
+.. versionadded:: 3.3
+
Include ``INSTALL`` target to default build.
In Visual Studio solution, by default the ``INSTALL`` target will not be part
diff --git a/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst b/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst
index 693ba45d38..ab4d0fa1b8 100644
--- a/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst
+++ b/Help/variable/CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD.rst
@@ -1,6 +1,8 @@
CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD
-----------------------------------------
+.. versionadded:: 3.8
+
Include ``PACKAGE`` target to default build.
In Visual Studio solution, by default the ``PACKAGE`` target will not be part
diff --git a/Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst b/Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst
index 546cdf4920..0a02a321e8 100644
--- a/Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst
+++ b/Help/variable/CMAKE_VS_JUST_MY_CODE_DEBUGGING.rst
@@ -1,6 +1,8 @@
CMAKE_VS_JUST_MY_CODE_DEBUGGING
-------------------------------
+.. versionadded:: 3.15
+
Enable Just My Code with Visual Studio debugger.
This variable is used to initialize the :prop_tgt:`VS_JUST_MY_CODE_DEBUGGING`
diff --git a/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst b/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst
index 386c3a9de6..2982b39d52 100644
--- a/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst
+++ b/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst
@@ -1,6 +1,8 @@
CMAKE_VS_NsightTegra_VERSION
----------------------------
+.. versionadded:: 3.1
+
When using a Visual Studio generator with the
:variable:`CMAKE_SYSTEM_NAME` variable set to ``Android``,
this variable contains the version number of the
diff --git a/Help/variable/CMAKE_VS_PLATFORM_NAME.rst b/Help/variable/CMAKE_VS_PLATFORM_NAME.rst
index 7a4642a314..7d08add653 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_NAME.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_NAME.rst
@@ -1,6 +1,8 @@
CMAKE_VS_PLATFORM_NAME
----------------------
+.. versionadded:: 3.1
+
Visual Studio target platform name used by the current generator.
VS 8 and above allow project files to specify a target platform.
diff --git a/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst b/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst
index c18e6fd37e..64401748e3 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_NAME_DEFAULT.rst
@@ -1,6 +1,8 @@
CMAKE_VS_PLATFORM_NAME_DEFAULT
------------------------------
+.. versionadded:: 3.14.3
+
Default for the Visual Studio target platform name for the current generator
without considering the value of the :variable:`CMAKE_GENERATOR_PLATFORM`
variable. For :ref:`Visual Studio Generators` for VS 2017 and below this is
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst
index 67b7f74019..e66378de6d 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA.rst
@@ -1,6 +1,8 @@
CMAKE_VS_PLATFORM_TOOLSET_CUDA
------------------------------
+.. versionadded:: 3.9
+
NVIDIA CUDA Toolkit version whose Visual Studio toolset to use.
The :ref:`Visual Studio Generators` for VS 2010 and above support using
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst
index 060648afc0..74db6b143f 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR.rst
@@ -1,6 +1,8 @@
CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR
-----------------------------------------
+.. versionadded:: 3.16
+
Path to standalone NVIDIA CUDA Toolkit (eg. extracted from installer).
The :ref:`Visual Studio Generators` for VS 2010 and above support using
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
index 99ac90ddc6..84d72128c4 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
@@ -1,6 +1,8 @@
CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
-------------------------------------------
+.. versionadded:: 3.8
+
Visual Studio preferred tool architecture.
The :ref:`Visual Studio Generators` for VS 2013 and above support using
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst
index 4d9b978f45..64f2e39cbd 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION.rst
@@ -1,6 +1,8 @@
CMAKE_VS_PLATFORM_TOOLSET_VERSION
---------------------------------
+.. versionadded:: 3.12
+
Visual Studio Platform Toolset version.
The :ref:`Visual Studio Generators` for VS 2017 and above allow to
diff --git a/Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst
index 36c4dccca6..969f328933 100644
--- a/Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_VS_SDK_EXCLUDE_DIRECTORIES.rst
@@ -1,4 +1,6 @@
CMAKE_VS_SDK_EXCLUDE_DIRECTORIES
--------------------------------
+.. versionadded:: 3.12
+
This variable allows to override Visual Studio default Exclude Directories.
diff --git a/Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst
index 3ec755ba95..7455e102e0 100644
--- a/Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES.rst
@@ -1,4 +1,6 @@
CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES
-----------------------------------
+.. versionadded:: 3.12
+
This variable allows to override Visual Studio default Executable Directories.
diff --git a/Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst
index da10bdea9b..3f27aea92b 100644
--- a/Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_VS_SDK_INCLUDE_DIRECTORIES.rst
@@ -1,4 +1,6 @@
CMAKE_VS_SDK_INCLUDE_DIRECTORIES
--------------------------------
+.. versionadded:: 3.12
+
This variable allows to override Visual Studio default Include Directories.
diff --git a/Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst
index b33754a47d..35e45a3e5a 100644
--- a/Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_VS_SDK_LIBRARY_DIRECTORIES.rst
@@ -1,4 +1,6 @@
CMAKE_VS_SDK_LIBRARY_DIRECTORIES
--------------------------------
+.. versionadded:: 3.12
+
This variable allows to override Visual Studio default Library Directories.
diff --git a/Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst
index b0222157b7..24b90b6012 100644
--- a/Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES.rst
@@ -1,5 +1,7 @@
CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES
--------------------------------------
+.. versionadded:: 3.12
+
This variable allows to override Visual Studio default Library WinRT
Directories.
diff --git a/Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst
index c03f0aed22..00382fe4b1 100644
--- a/Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_VS_SDK_REFERENCE_DIRECTORIES.rst
@@ -1,4 +1,6 @@
CMAKE_VS_SDK_REFERENCE_DIRECTORIES
----------------------------------
+.. versionadded:: 3.12
+
This variable allows to override Visual Studio default Reference Directories.
diff --git a/Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst b/Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst
index 0c73f064a6..b98c9995ce 100644
--- a/Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_VS_SDK_SOURCE_DIRECTORIES.rst
@@ -1,4 +1,6 @@
CMAKE_VS_SDK_SOURCE_DIRECTORIES
-------------------------------
+.. versionadded:: 3.12
+
This variable allows to override Visual Studio default Source Directories.
diff --git a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
index 83b9bc1fdd..cb55bc28ab 100644
--- a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
+++ b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
@@ -1,6 +1,8 @@
CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
----------------------------------------
+.. versionadded:: 3.4
+
Visual Studio Windows Target Platform Version.
When targeting Windows 10 and above Visual Studio 2015 and above support
diff --git a/Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst b/Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst
index 2eea4240c9..9ded85ffd0 100644
--- a/Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst
+++ b/Help/variable/CMAKE_VS_WINRT_BY_DEFAULT.rst
@@ -1,6 +1,8 @@
CMAKE_VS_WINRT_BY_DEFAULT
-------------------------
+.. versionadded:: 3.13
+
Inform :ref:`Visual Studio Generators` for VS 2010 and above that the
target platform enables WinRT compilation by default and it needs to
be explicitly disabled if ``/ZW`` or :prop_tgt:`VS_WINRT_COMPONENT` is
diff --git a/Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst b/Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst
index 1636842d9e..7b0118597d 100644
--- a/Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst
+++ b/Help/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.rst
@@ -1,6 +1,8 @@
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
--------------------------------
+.. versionadded:: 3.4
+
Default value for :prop_tgt:`WINDOWS_EXPORT_ALL_SYMBOLS` target property.
This variable is used to initialize the property on each target as it is
created.
diff --git a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst
index be683d6680..90e4c0eacc 100644
--- a/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst
+++ b/Help/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_ATTRIBUTE_<an-attribute>
------------------------------------
+.. versionadded:: 3.1
+
Set Xcode target attributes directly.
Tell the :generator:`Xcode` generator to set '<an-attribute>' to a given value
diff --git a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
index 5b1a003f0f..40070e1555 100644
--- a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
+++ b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_GENERATE_SCHEME
---------------------------
+.. versionadded:: 3.9
+
If enabled, the :generator:`Xcode` generator will generate schema files. These
are useful to invoke analyze, archive, build-for-testing and test
actions from the command line.
diff --git a/Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst b/Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst
index ea3e240b18..38d043caf0 100644
--- a/Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst
+++ b/Help/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY
-------------------------------------------
+.. versionadded:: 3.11
+
If enabled, the :generator:`Xcode` generator will generate only a
single Xcode project file for the topmost :command:`project()` command
instead of generating one for every ``project()`` command.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst
index b972ba573b..b3fa93be89 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER
------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Address Sanitizer`` in the Diagnostics
section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst
index 59eb32df38..1a0a17a830 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
-----------------------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Detect use of stack after return``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst b/Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst
index a264d36c85..917fc7faa7 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
--------------------------------------------
+.. versionadded:: 3.16
+
Whether to enable
``Allow debugging when using document Versions Browser``
in the Options section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst b/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst
index 71bcf42359..b604598f6c 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
----------------------------------------------
+.. versionadded:: 3.13
+
Whether to disable the ``Main Thread Checker``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst
index 53f55e604c..070ddfcb33 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
----------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Dynamic Library Loads``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst
index 784ceb6b76..4291816e67 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
-------------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Dynamic Linker API usage``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst b/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst
index 4832659ce7..62b698dab5 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_ENVIRONMENT
------------------------------
+.. versionadded:: 3.17
+
Specify environment variables that should be added to the Arguments
section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst b/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst
index 9350244b01..48b481e765 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_GUARD_MALLOC
-------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Guard Malloc``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst
index 45a2dad691..ef8ed9b669 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
-------------------------------------------
+.. versionadded:: 3.13
+
Whether to enable the ``Main Thread Checker`` option
``Pause on issues``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst
index 94d1c61fb7..d4ae9eb946 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
-------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Malloc Guard Edges``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst
index 9bf0eb4196..e28f6a1838 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE
----------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Malloc Scribble``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst
index 4cc21ee2b5..59fcfd32f5 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_MALLOC_STACK
-------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Malloc Stack`` in the Diagnostics
section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst
index 6d1b56eea9..511eb04bba 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_THREAD_SANITIZER
-----------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Thread Sanitizer`` in the Diagnostics
section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst
index de40478ea5..6f3b8ce9e7 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP
----------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Thread Sanitizer - Pause on issues``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst
index ec5df6613b..46d3ccfa36 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
------------------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Undefined Behavior Sanitizer``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst
index dcec9b0ead..8fa5ececb7 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
-----------------------------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Undefined Behavior Sanitizer`` option
``Pause on issues``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst b/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst
index 5bb7907976..4221e4898c 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_WORKING_DIRECTORY
------------------------------------
+.. versionadded:: 3.17
+
Specify the ``Working Directory`` of the *Run* and *Profile*
actions in the generated Xcode scheme.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst b/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst
index 82e9d76cc5..fd9488efe2 100644
--- a/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst
+++ b/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst
@@ -1,6 +1,8 @@
CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS
---------------------------------
+.. versionadded:: 3.13
+
Whether to enable ``Zombie Objects``
in the Diagnostics section of the generated Xcode scheme.
diff --git a/Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst b/Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst
index 83d5ce7fcf..01fb189ffd 100644
--- a/Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst
+++ b/Help/variable/CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.rst
@@ -1,6 +1,8 @@
CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
-------------------------------------------
+.. versionadded:: 3.11
+
Default permissions for implicitly created directories during packaging.
This variable serves the same purpose during packaging as the
diff --git a/Help/variable/CTEST_BINARY_DIRECTORY.rst b/Help/variable/CTEST_BINARY_DIRECTORY.rst
index fd8461fd6a..8413e3776a 100644
--- a/Help/variable/CTEST_BINARY_DIRECTORY.rst
+++ b/Help/variable/CTEST_BINARY_DIRECTORY.rst
@@ -1,5 +1,7 @@
CTEST_BINARY_DIRECTORY
----------------------
+.. versionadded:: 3.1
+
Specify the CTest ``BuildDirectory`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_BUILD_COMMAND.rst b/Help/variable/CTEST_BUILD_COMMAND.rst
index 7b13ba06bb..31c44e2526 100644
--- a/Help/variable/CTEST_BUILD_COMMAND.rst
+++ b/Help/variable/CTEST_BUILD_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_BUILD_COMMAND
-------------------
+.. versionadded:: 3.1
+
Specify the CTest ``MakeCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_BUILD_NAME.rst b/Help/variable/CTEST_BUILD_NAME.rst
index d25d84c0a8..3d08397627 100644
--- a/Help/variable/CTEST_BUILD_NAME.rst
+++ b/Help/variable/CTEST_BUILD_NAME.rst
@@ -1,5 +1,7 @@
CTEST_BUILD_NAME
----------------
+.. versionadded:: 3.1
+
Specify the CTest ``BuildName`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_BZR_COMMAND.rst b/Help/variable/CTEST_BZR_COMMAND.rst
index 474d6213e2..0c05d1a23c 100644
--- a/Help/variable/CTEST_BZR_COMMAND.rst
+++ b/Help/variable/CTEST_BZR_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_BZR_COMMAND
-----------------
+.. versionadded:: 3.1
+
Specify the CTest ``BZRCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst b/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst
index d0f9579804..4dd5e5b3cb 100644
--- a/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst
+++ b/Help/variable/CTEST_BZR_UPDATE_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_BZR_UPDATE_OPTIONS
------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``BZRUpdateOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CHANGE_ID.rst b/Help/variable/CTEST_CHANGE_ID.rst
index a423f49004..a6d15f740d 100644
--- a/Help/variable/CTEST_CHANGE_ID.rst
+++ b/Help/variable/CTEST_CHANGE_ID.rst
@@ -1,6 +1,8 @@
CTEST_CHANGE_ID
---------------
+.. versionadded:: 3.4
+
Specify the CTest ``ChangeId`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CHECKOUT_COMMAND.rst b/Help/variable/CTEST_CHECKOUT_COMMAND.rst
index da256f24f5..852c28e1e1 100644
--- a/Help/variable/CTEST_CHECKOUT_COMMAND.rst
+++ b/Help/variable/CTEST_CHECKOUT_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_CHECKOUT_COMMAND
----------------------
+.. versionadded:: 3.1
+
Tell the :command:`ctest_start` command how to checkout or initialize
the source directory in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CONFIGURATION_TYPE.rst b/Help/variable/CTEST_CONFIGURATION_TYPE.rst
index 9e277fa7cb..392845e29b 100644
--- a/Help/variable/CTEST_CONFIGURATION_TYPE.rst
+++ b/Help/variable/CTEST_CONFIGURATION_TYPE.rst
@@ -1,6 +1,8 @@
CTEST_CONFIGURATION_TYPE
------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``DefaultCTestConfigurationType`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CONFIGURE_COMMAND.rst b/Help/variable/CTEST_CONFIGURE_COMMAND.rst
index 5561b6dcfe..992ef477b5 100644
--- a/Help/variable/CTEST_CONFIGURE_COMMAND.rst
+++ b/Help/variable/CTEST_CONFIGURE_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_CONFIGURE_COMMAND
-----------------------
+.. versionadded:: 3.1
+
Specify the CTest ``ConfigureCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_COVERAGE_COMMAND.rst b/Help/variable/CTEST_COVERAGE_COMMAND.rst
index a78792ea51..f5425cbea2 100644
--- a/Help/variable/CTEST_COVERAGE_COMMAND.rst
+++ b/Help/variable/CTEST_COVERAGE_COMMAND.rst
@@ -1,6 +1,8 @@
CTEST_COVERAGE_COMMAND
----------------------
+.. versionadded:: 3.1
+
Specify the CTest ``CoverageCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst b/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst
index 298195508b..39d9b5d877 100644
--- a/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst
+++ b/Help/variable/CTEST_COVERAGE_EXTRA_FLAGS.rst
@@ -1,5 +1,7 @@
CTEST_COVERAGE_EXTRA_FLAGS
--------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``CoverageExtraFlags`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CURL_OPTIONS.rst b/Help/variable/CTEST_CURL_OPTIONS.rst
index fc5dfc488d..14af4e48a9 100644
--- a/Help/variable/CTEST_CURL_OPTIONS.rst
+++ b/Help/variable/CTEST_CURL_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_CURL_OPTIONS
------------------
+.. versionadded:: 3.1
+
Specify the CTest ``CurlOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst b/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
index d5893c9f89..84ba12de96 100644
--- a/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
+++ b/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_COVERAGE_EXCLUDE
-----------------------------
+.. versionadded:: 3.4
+
A list of regular expressions which will be used to exclude files by their
path from coverage output by the :command:`ctest_coverage` command.
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst b/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
index cd65ae3279..7191ce4a21 100644
--- a/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
+++ b/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_ERROR_EXCEPTION
----------------------------
+.. versionadded:: 3.4
+
A list of regular expressions which will be used to exclude when detecting
error messages in build outputs by the :command:`ctest_test` command.
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst b/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
index 558f5e5801..5d213f297c 100644
--- a/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
+++ b/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_ERROR_MATCH
------------------------
+.. versionadded:: 3.4
+
A list of regular expressions which will be used to detect error messages in
build outputs by the :command:`ctest_test` command.
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst b/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
index 614859bc82..452d060be1 100644
--- a/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
+++ b/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_ERROR_POST_CONTEXT
-------------------------------
+.. versionadded:: 3.4
+
The number of lines to include as context which follow an error message by the
:command:`ctest_test` command. The default is 10.
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst b/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
index 74dc47ad2a..b7717dd476 100644
--- a/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
+++ b/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_ERROR_PRE_CONTEXT
------------------------------
+.. versionadded:: 3.4
+
The number of lines to include as context which precede an error message by
the :command:`ctest_test` command. The default is 10.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
index 5aeae88a4e..31ba09955a 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
--------------------------------------------
+.. versionadded:: 3.4
+
When saving a failing test's output, this is the maximum size, in bytes, that
will be collected by the :command:`ctest_test` command. Defaults to 307200
(300 KiB).
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
index 920cb04769..e5be1ad265 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS
-------------------------------------
+.. versionadded:: 3.4
+
The maximum number of errors in a single build step which will be detected.
After this, the :command:`ctest_test` command will truncate the output.
Defaults to 50.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
index a1f1cc14b0..b513a5cfe5 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS
---------------------------------------
+.. versionadded:: 3.4
+
The maximum number of warnings in a single build step which will be detected.
After this, the :command:`ctest_test` command will truncate the output.
Defaults to 50.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
index 1fbb8c53f4..08762d83b2 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
--------------------------------------------
+.. versionadded:: 3.4
+
When saving a passing test's output, this is the maximum size, in bytes, that
will be collected by the :command:`ctest_test` command. Defaults to 1024
(1 KiB).
diff --git a/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst b/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
index 578576cd65..405fc33467 100644
--- a/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
+++ b/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_MEMCHECK_IGNORE
----------------------------
+.. versionadded:: 3.4
+
A list of regular expressions to use to exclude tests during the
:command:`ctest_memcheck` command.
diff --git a/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst b/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
index 40291febdc..5e488a7389 100644
--- a/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
+++ b/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_POST_MEMCHECK
--------------------------
+.. versionadded:: 3.4
+
A list of commands to run at the end of the :command:`ctest_memcheck` command.
.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_POST_TEST.rst b/Help/variable/CTEST_CUSTOM_POST_TEST.rst
index 791292cd00..7ec42f7ec1 100644
--- a/Help/variable/CTEST_CUSTOM_POST_TEST.rst
+++ b/Help/variable/CTEST_CUSTOM_POST_TEST.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_POST_TEST
----------------------
+.. versionadded:: 3.4
+
A list of commands to run at the end of the :command:`ctest_test` command.
.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst b/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
index 00de8aa2b9..99e47bdad6 100644
--- a/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
+++ b/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_PRE_MEMCHECK
-------------------------
+.. versionadded:: 3.4
+
A list of commands to run at the start of the :command:`ctest_memcheck`
command.
diff --git a/Help/variable/CTEST_CUSTOM_PRE_TEST.rst b/Help/variable/CTEST_CUSTOM_PRE_TEST.rst
index 6af7152efb..95c6314038 100644
--- a/Help/variable/CTEST_CUSTOM_PRE_TEST.rst
+++ b/Help/variable/CTEST_CUSTOM_PRE_TEST.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_PRE_TEST
----------------------
+.. versionadded:: 3.4
+
A list of commands to run at the start of the :command:`ctest_test` command.
.. include:: CTEST_CUSTOM_XXX.txt
diff --git a/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
index 57222ca1e8..27a75d9b1a 100644
--- a/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
+++ b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_TESTS_IGNORE
-------------------------
+.. versionadded:: 3.14
+
A list of regular expressions to use to exclude tests during the
:command:`ctest_test` command.
diff --git a/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst b/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
index a03d473423..539760b127 100644
--- a/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
+++ b/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_WARNING_EXCEPTION
------------------------------
+.. versionadded:: 3.4
+
A list of regular expressions which will be used to exclude when detecting
warning messages in build outputs by the :command:`ctest_build` command.
diff --git a/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst b/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
index 18aa6b31d7..53e77073e8 100644
--- a/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
+++ b/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
@@ -1,6 +1,8 @@
CTEST_CUSTOM_WARNING_MATCH
--------------------------
+.. versionadded:: 3.4
+
A list of regular expressions which will be used to detect warning messages in
build outputs by the :command:`ctest_build` command.
diff --git a/Help/variable/CTEST_CVS_CHECKOUT.rst b/Help/variable/CTEST_CVS_CHECKOUT.rst
index 6431c0266e..32cf9ebda7 100644
--- a/Help/variable/CTEST_CVS_CHECKOUT.rst
+++ b/Help/variable/CTEST_CVS_CHECKOUT.rst
@@ -1,4 +1,6 @@
CTEST_CVS_CHECKOUT
------------------
+.. versionadded:: 3.1
+
Deprecated. Use :variable:`CTEST_CHECKOUT_COMMAND` instead.
diff --git a/Help/variable/CTEST_CVS_COMMAND.rst b/Help/variable/CTEST_CVS_COMMAND.rst
index 049700b3a1..79320708e7 100644
--- a/Help/variable/CTEST_CVS_COMMAND.rst
+++ b/Help/variable/CTEST_CVS_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_CVS_COMMAND
-----------------
+.. versionadded:: 3.1
+
Specify the CTest ``CVSCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst b/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst
index d7f2f7c2c9..359e708ec0 100644
--- a/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst
+++ b/Help/variable/CTEST_CVS_UPDATE_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_CVS_UPDATE_OPTIONS
------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``CVSUpdateOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_LOCATION.rst b/Help/variable/CTEST_DROP_LOCATION.rst
index c0f22158dc..f66793b326 100644
--- a/Help/variable/CTEST_DROP_LOCATION.rst
+++ b/Help/variable/CTEST_DROP_LOCATION.rst
@@ -1,5 +1,7 @@
CTEST_DROP_LOCATION
-------------------
+.. versionadded:: 3.1
+
Specify the CTest ``DropLocation`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_METHOD.rst b/Help/variable/CTEST_DROP_METHOD.rst
index 50fbd4de9e..3a84658e4e 100644
--- a/Help/variable/CTEST_DROP_METHOD.rst
+++ b/Help/variable/CTEST_DROP_METHOD.rst
@@ -1,5 +1,7 @@
CTEST_DROP_METHOD
-----------------
+.. versionadded:: 3.1
+
Specify the CTest ``DropMethod`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_SITE.rst b/Help/variable/CTEST_DROP_SITE.rst
index d15d99be24..9c871e3580 100644
--- a/Help/variable/CTEST_DROP_SITE.rst
+++ b/Help/variable/CTEST_DROP_SITE.rst
@@ -1,5 +1,7 @@
CTEST_DROP_SITE
---------------
+.. versionadded:: 3.1
+
Specify the CTest ``DropSite`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_SITE_CDASH.rst b/Help/variable/CTEST_DROP_SITE_CDASH.rst
index 22b9776325..dcdb286a9a 100644
--- a/Help/variable/CTEST_DROP_SITE_CDASH.rst
+++ b/Help/variable/CTEST_DROP_SITE_CDASH.rst
@@ -1,5 +1,7 @@
CTEST_DROP_SITE_CDASH
---------------------
+.. versionadded:: 3.1
+
Specify the CTest ``IsCDash`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_SITE_PASSWORD.rst b/Help/variable/CTEST_DROP_SITE_PASSWORD.rst
index 904d2c8a82..8259651ea7 100644
--- a/Help/variable/CTEST_DROP_SITE_PASSWORD.rst
+++ b/Help/variable/CTEST_DROP_SITE_PASSWORD.rst
@@ -1,5 +1,7 @@
CTEST_DROP_SITE_PASSWORD
------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``DropSitePassword`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_DROP_SITE_USER.rst b/Help/variable/CTEST_DROP_SITE_USER.rst
index a860a03fe5..8d2e3a3f36 100644
--- a/Help/variable/CTEST_DROP_SITE_USER.rst
+++ b/Help/variable/CTEST_DROP_SITE_USER.rst
@@ -1,5 +1,7 @@
CTEST_DROP_SITE_USER
--------------------
+.. versionadded:: 3.1
+
Specify the CTest ``DropSiteUser`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst b/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst
index 286f7dfed1..1d7e8d4442 100644
--- a/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst
+++ b/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst
@@ -1,6 +1,8 @@
CTEST_EXTRA_COVERAGE_GLOB
-------------------------
+.. versionadded:: 3.4
+
A list of regular expressions which will be used to find files which should be
covered by the :command:`ctest_coverage` command.
diff --git a/Help/variable/CTEST_GIT_COMMAND.rst b/Help/variable/CTEST_GIT_COMMAND.rst
index eb83792ecf..eb9b440860 100644
--- a/Help/variable/CTEST_GIT_COMMAND.rst
+++ b/Help/variable/CTEST_GIT_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_GIT_COMMAND
-----------------
+.. versionadded:: 3.1
+
Specify the CTest ``GITCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst b/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst
index fd270030de..529bfc76af 100644
--- a/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst
+++ b/Help/variable/CTEST_GIT_INIT_SUBMODULES.rst
@@ -1,5 +1,7 @@
CTEST_GIT_INIT_SUBMODULES
-------------------------
+.. versionadded:: 3.6
+
Specify the CTest ``GITInitSubmodules`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst b/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst
index 0c479e604a..82a8a6ac08 100644
--- a/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst
+++ b/Help/variable/CTEST_GIT_UPDATE_CUSTOM.rst
@@ -1,5 +1,7 @@
CTEST_GIT_UPDATE_CUSTOM
-----------------------
+.. versionadded:: 3.1
+
Specify the CTest ``GITUpdateCustom`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst b/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst
index 4590a786de..15682392a2 100644
--- a/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst
+++ b/Help/variable/CTEST_GIT_UPDATE_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_GIT_UPDATE_OPTIONS
------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``GITUpdateOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_HG_COMMAND.rst b/Help/variable/CTEST_HG_COMMAND.rst
index 3854950af8..3372fe4daf 100644
--- a/Help/variable/CTEST_HG_COMMAND.rst
+++ b/Help/variable/CTEST_HG_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_HG_COMMAND
----------------
+.. versionadded:: 3.1
+
Specify the CTest ``HGCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst b/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst
index 9049c1f45e..85c6b03ff5 100644
--- a/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst
+++ b/Help/variable/CTEST_HG_UPDATE_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_HG_UPDATE_OPTIONS
-----------------------
+.. versionadded:: 3.1
+
Specify the CTest ``HGUpdateOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst b/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst
index 959596bf32..dd6d1259be 100644
--- a/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst
+++ b/Help/variable/CTEST_LABELS_FOR_SUBPROJECTS.rst
@@ -1,5 +1,7 @@
CTEST_LABELS_FOR_SUBPROJECTS
----------------------------
+.. versionadded:: 3.10
+
Specify the CTest ``LabelsForSubprojects`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst b/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst
index 8c199bac20..25f1bd906f 100644
--- a/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst
+++ b/Help/variable/CTEST_MEMORYCHECK_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_MEMORYCHECK_COMMAND
-------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``MemoryCheckCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst b/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst
index 3e26ab5151..51830d5442 100644
--- a/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst
+++ b/Help/variable/CTEST_MEMORYCHECK_COMMAND_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_MEMORYCHECK_COMMAND_OPTIONS
---------------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``MemoryCheckCommandOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst b/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst
index 2de5fb6b83..6cd51fa18e 100644
--- a/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst
+++ b/Help/variable/CTEST_MEMORYCHECK_SANITIZER_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_MEMORYCHECK_SANITIZER_OPTIONS
-----------------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``MemoryCheckSanitizerOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst b/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst
index 1147ee8e84..a61a3efcb8 100644
--- a/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst
+++ b/Help/variable/CTEST_MEMORYCHECK_SUPPRESSIONS_FILE.rst
@@ -1,5 +1,7 @@
CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
-----------------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``MemoryCheckSuppressionFile`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
index 4e7d5c0ef3..245222836b 100644
--- a/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
+++ b/Help/variable/CTEST_MEMORYCHECK_TYPE.rst
@@ -1,6 +1,8 @@
CTEST_MEMORYCHECK_TYPE
----------------------
+.. versionadded:: 3.1
+
Specify the CTest ``MemoryCheckType`` setting
in a :manual:`ctest(1)` dashboard client script.
Valid values are ``Valgrind``, ``Purify``, ``BoundsChecker``, ``DrMemory`` and
diff --git a/Help/variable/CTEST_NIGHTLY_START_TIME.rst b/Help/variable/CTEST_NIGHTLY_START_TIME.rst
index 90841f9068..2d707d591d 100644
--- a/Help/variable/CTEST_NIGHTLY_START_TIME.rst
+++ b/Help/variable/CTEST_NIGHTLY_START_TIME.rst
@@ -1,6 +1,8 @@
CTEST_NIGHTLY_START_TIME
------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``NightlyStartTime`` setting in a :manual:`ctest(1)`
dashboard client script.
diff --git a/Help/variable/CTEST_P4_CLIENT.rst b/Help/variable/CTEST_P4_CLIENT.rst
index 347ea549e5..0778c5b106 100644
--- a/Help/variable/CTEST_P4_CLIENT.rst
+++ b/Help/variable/CTEST_P4_CLIENT.rst
@@ -1,5 +1,7 @@
CTEST_P4_CLIENT
---------------
+.. versionadded:: 3.1
+
Specify the CTest ``P4Client`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_P4_COMMAND.rst b/Help/variable/CTEST_P4_COMMAND.rst
index defab12be9..5cc2a81291 100644
--- a/Help/variable/CTEST_P4_COMMAND.rst
+++ b/Help/variable/CTEST_P4_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_P4_COMMAND
----------------
+.. versionadded:: 3.1
+
Specify the CTest ``P4Command`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_P4_OPTIONS.rst b/Help/variable/CTEST_P4_OPTIONS.rst
index fee4ce2d80..01b65347d0 100644
--- a/Help/variable/CTEST_P4_OPTIONS.rst
+++ b/Help/variable/CTEST_P4_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_P4_OPTIONS
----------------
+.. versionadded:: 3.1
+
Specify the CTest ``P4Options`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst b/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst
index 0e2790fb56..365aa3fdf8 100644
--- a/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst
+++ b/Help/variable/CTEST_P4_UPDATE_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_P4_UPDATE_OPTIONS
-----------------------
+.. versionadded:: 3.1
+
Specify the CTest ``P4UpdateOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst b/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst
index a6fdbc9efb..8e9bf01409 100644
--- a/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst
+++ b/Help/variable/CTEST_RESOURCE_SPEC_FILE.rst
@@ -1,6 +1,8 @@
CTEST_RESOURCE_SPEC_FILE
------------------------
+.. versionadded:: 3.18
+
Specify the CTest ``ResourceSpecFile`` setting in a :manual:`ctest(1)`
dashboard client script.
diff --git a/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst b/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst
index abc123c091..32c85ad5c3 100644
--- a/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst
+++ b/Help/variable/CTEST_RUN_CURRENT_SCRIPT.rst
@@ -1,5 +1,7 @@
CTEST_RUN_CURRENT_SCRIPT
------------------------
+.. versionadded:: 3.11
+
Setting this to 0 prevents :manual:`ctest(1)` from being run again when it
reaches the end of a script run by calling ``ctest -S``.
diff --git a/Help/variable/CTEST_SCP_COMMAND.rst b/Help/variable/CTEST_SCP_COMMAND.rst
index 19ea8b33d8..155b05875f 100644
--- a/Help/variable/CTEST_SCP_COMMAND.rst
+++ b/Help/variable/CTEST_SCP_COMMAND.rst
@@ -1,4 +1,6 @@
CTEST_SCP_COMMAND
-----------------
+.. versionadded:: 3.1
+
Legacy option. Not used.
diff --git a/Help/variable/CTEST_SITE.rst b/Help/variable/CTEST_SITE.rst
index 8a5ec253d6..526e6eda68 100644
--- a/Help/variable/CTEST_SITE.rst
+++ b/Help/variable/CTEST_SITE.rst
@@ -1,5 +1,7 @@
CTEST_SITE
----------
+.. versionadded:: 3.1
+
Specify the CTest ``Site`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SOURCE_DIRECTORY.rst b/Help/variable/CTEST_SOURCE_DIRECTORY.rst
index b6837d1a0d..4c6ac547ad 100644
--- a/Help/variable/CTEST_SOURCE_DIRECTORY.rst
+++ b/Help/variable/CTEST_SOURCE_DIRECTORY.rst
@@ -1,5 +1,7 @@
CTEST_SOURCE_DIRECTORY
----------------------
+.. versionadded:: 3.1
+
Specify the CTest ``SourceDirectory`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SUBMIT_URL.rst b/Help/variable/CTEST_SUBMIT_URL.rst
index 7d84da4b42..b6e7f68b6c 100644
--- a/Help/variable/CTEST_SUBMIT_URL.rst
+++ b/Help/variable/CTEST_SUBMIT_URL.rst
@@ -1,5 +1,7 @@
CTEST_SUBMIT_URL
----------------
+.. versionadded:: 3.14
+
Specify the CTest ``SubmitURL`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SVN_COMMAND.rst b/Help/variable/CTEST_SVN_COMMAND.rst
index af9014361f..e97acd0ad2 100644
--- a/Help/variable/CTEST_SVN_COMMAND.rst
+++ b/Help/variable/CTEST_SVN_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_SVN_COMMAND
-----------------
+.. versionadded:: 3.1
+
Specify the CTest ``SVNCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SVN_OPTIONS.rst b/Help/variable/CTEST_SVN_OPTIONS.rst
index 76551dc110..5326e200fa 100644
--- a/Help/variable/CTEST_SVN_OPTIONS.rst
+++ b/Help/variable/CTEST_SVN_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_SVN_OPTIONS
-----------------
+.. versionadded:: 3.1
+
Specify the CTest ``SVNOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst b/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst
index 5f01a193a0..24e0bbf5cd 100644
--- a/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst
+++ b/Help/variable/CTEST_SVN_UPDATE_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_SVN_UPDATE_OPTIONS
------------------------
+.. versionadded:: 3.1
+
Specify the CTest ``SVNUpdateOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_TEST_LOAD.rst b/Help/variable/CTEST_TEST_LOAD.rst
index 80823fe4e4..b6a9d62371 100644
--- a/Help/variable/CTEST_TEST_LOAD.rst
+++ b/Help/variable/CTEST_TEST_LOAD.rst
@@ -1,6 +1,8 @@
CTEST_TEST_LOAD
---------------
+.. versionadded:: 3.4
+
Specify the ``TestLoad`` setting in the :ref:`CTest Test Step`
of a :manual:`ctest(1)` dashboard client script. This sets the
default value for the ``TEST_LOAD`` option of the :command:`ctest_test`
diff --git a/Help/variable/CTEST_TEST_TIMEOUT.rst b/Help/variable/CTEST_TEST_TIMEOUT.rst
index c031437f0c..61d91915ad 100644
--- a/Help/variable/CTEST_TEST_TIMEOUT.rst
+++ b/Help/variable/CTEST_TEST_TIMEOUT.rst
@@ -1,5 +1,7 @@
CTEST_TEST_TIMEOUT
------------------
+.. versionadded:: 3.1
+
Specify the CTest ``TimeOut`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_TRIGGER_SITE.rst b/Help/variable/CTEST_TRIGGER_SITE.rst
index a50e405cc6..6abb852842 100644
--- a/Help/variable/CTEST_TRIGGER_SITE.rst
+++ b/Help/variable/CTEST_TRIGGER_SITE.rst
@@ -1,4 +1,6 @@
CTEST_TRIGGER_SITE
------------------
+.. versionadded:: 3.1
+
Legacy option. Not used.
diff --git a/Help/variable/CTEST_UPDATE_COMMAND.rst b/Help/variable/CTEST_UPDATE_COMMAND.rst
index 90155d07f2..c4ed6457ec 100644
--- a/Help/variable/CTEST_UPDATE_COMMAND.rst
+++ b/Help/variable/CTEST_UPDATE_COMMAND.rst
@@ -1,5 +1,7 @@
CTEST_UPDATE_COMMAND
--------------------
+.. versionadded:: 3.1
+
Specify the CTest ``UpdateCommand`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_UPDATE_OPTIONS.rst b/Help/variable/CTEST_UPDATE_OPTIONS.rst
index e43d61d1cd..96c4b6cef7 100644
--- a/Help/variable/CTEST_UPDATE_OPTIONS.rst
+++ b/Help/variable/CTEST_UPDATE_OPTIONS.rst
@@ -1,5 +1,7 @@
CTEST_UPDATE_OPTIONS
--------------------
+.. versionadded:: 3.1
+
Specify the CTest ``UpdateOptions`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_UPDATE_VERSION_ONLY.rst b/Help/variable/CTEST_UPDATE_VERSION_ONLY.rst
index a862baa14d..f7c863c918 100644
--- a/Help/variable/CTEST_UPDATE_VERSION_ONLY.rst
+++ b/Help/variable/CTEST_UPDATE_VERSION_ONLY.rst
@@ -1,5 +1,7 @@
CTEST_UPDATE_VERSION_ONLY
-------------------------
+.. versionadded:: 3.1
+
Specify the CTest :ref:`UpdateVersionOnly <UpdateVersionOnly>` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst b/Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst
index 39fbaba79a..87918cb638 100644
--- a/Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst
+++ b/Help/variable/CTEST_UPDATE_VERSION_OVERRIDE.rst
@@ -1,5 +1,7 @@
CTEST_UPDATE_VERSION_OVERRIDE
-----------------------------
+.. versionadded:: 3.15
+
Specify the CTest :ref:`UpdateVersionOverride <UpdateVersionOverride>` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_USE_LAUNCHERS.rst b/Help/variable/CTEST_USE_LAUNCHERS.rst
index 9f48a2e426..728cdc51d5 100644
--- a/Help/variable/CTEST_USE_LAUNCHERS.rst
+++ b/Help/variable/CTEST_USE_LAUNCHERS.rst
@@ -1,5 +1,7 @@
CTEST_USE_LAUNCHERS
-------------------
+.. versionadded:: 3.1
+
Specify the CTest ``UseLaunchers`` setting
in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/GHS-MULTI.rst b/Help/variable/GHS-MULTI.rst
index fe3b17e189..bb139affd4 100644
--- a/Help/variable/GHS-MULTI.rst
+++ b/Help/variable/GHS-MULTI.rst
@@ -1,4 +1,6 @@
GHS-MULTI
---------
+.. versionadded:: 3.3
+
``True`` when using :generator:`Green Hills MULTI` generator.
diff --git a/Help/variable/IOS.rst b/Help/variable/IOS.rst
index e5cc3f69c2..b27be55ae8 100644
--- a/Help/variable/IOS.rst
+++ b/Help/variable/IOS.rst
@@ -1,4 +1,6 @@
IOS
---
+.. versionadded:: 3.14
+
Set to ``1`` when the target system (:variable:`CMAKE_SYSTEM_NAME`) is ``iOS``.
diff --git a/Help/variable/MINGW.rst b/Help/variable/MINGW.rst
index 6d29be462d..27c56eafe2 100644
--- a/Help/variable/MINGW.rst
+++ b/Help/variable/MINGW.rst
@@ -1,6 +1,8 @@
MINGW
-----
+.. versionadded:: 3.2
+
``True`` when using MinGW
Set to ``true`` when the compiler is some version of MinGW.
diff --git a/Help/variable/MSVC14.rst b/Help/variable/MSVC14.rst
index 79e0c10b58..1eb5183bc7 100644
--- a/Help/variable/MSVC14.rst
+++ b/Help/variable/MSVC14.rst
@@ -1,6 +1,8 @@
MSVC14
------
+.. versionadded:: 3.1
+
Discouraged. Use the :variable:`MSVC_VERSION` variable instead.
``True`` when using the Microsoft Visual Studio ``v140`` or ``v141``
diff --git a/Help/variable/MSVC_TOOLSET_VERSION.rst b/Help/variable/MSVC_TOOLSET_VERSION.rst
index f4a33e246a..c642a9f1d7 100644
--- a/Help/variable/MSVC_TOOLSET_VERSION.rst
+++ b/Help/variable/MSVC_TOOLSET_VERSION.rst
@@ -1,6 +1,8 @@
MSVC_TOOLSET_VERSION
--------------------
+.. versionadded:: 3.12
+
The toolset version of Microsoft Visual C/C++ being used if any.
If MSVC-like is being used, this variable is set based on the version
of the compiler as given by the :variable:`MSVC_VERSION` variable.
diff --git a/Help/variable/MSYS.rst b/Help/variable/MSYS.rst
index 25ddc7f739..6be7681bff 100644
--- a/Help/variable/MSYS.rst
+++ b/Help/variable/MSYS.rst
@@ -1,4 +1,6 @@
MSYS
----
+.. versionadded:: 3.14
+
``True`` when using the :generator:`MSYS Makefiles` generator.
diff --git a/Help/variable/PROJECT-NAME_DESCRIPTION.rst b/Help/variable/PROJECT-NAME_DESCRIPTION.rst
index 2b88b1acf4..f372f5cd1f 100644
--- a/Help/variable/PROJECT-NAME_DESCRIPTION.rst
+++ b/Help/variable/PROJECT-NAME_DESCRIPTION.rst
@@ -1,5 +1,7 @@
<PROJECT-NAME>_DESCRIPTION
--------------------------
+.. versionadded:: 3.12
+
Value given to the ``DESCRIPTION`` option of the most recent call to the
:command:`project` command with project name ``<PROJECT-NAME>``, if any.
diff --git a/Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst b/Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst
index 22cc304b06..4800b13a8e 100644
--- a/Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst
+++ b/Help/variable/PROJECT-NAME_HOMEPAGE_URL.rst
@@ -1,5 +1,7 @@
<PROJECT-NAME>_HOMEPAGE_URL
---------------------------
+.. versionadded:: 3.12
+
Value given to the ``HOMEPAGE_URL`` option of the most recent call to the
:command:`project` command with project name ``<PROJECT-NAME>``, if any.
diff --git a/Help/variable/PROJECT_DESCRIPTION.rst b/Help/variable/PROJECT_DESCRIPTION.rst
index 2833e1101f..1fefcdc3b8 100644
--- a/Help/variable/PROJECT_DESCRIPTION.rst
+++ b/Help/variable/PROJECT_DESCRIPTION.rst
@@ -1,6 +1,8 @@
PROJECT_DESCRIPTION
-------------------
+.. versionadded:: 3.9
+
Short project description given to the project command.
This is the description given to the most recently called :command:`project`
diff --git a/Help/variable/PROJECT_HOMEPAGE_URL.rst b/Help/variable/PROJECT_HOMEPAGE_URL.rst
index 754c9e8b3a..0d2c937945 100644
--- a/Help/variable/PROJECT_HOMEPAGE_URL.rst
+++ b/Help/variable/PROJECT_HOMEPAGE_URL.rst
@@ -1,6 +1,8 @@
PROJECT_HOMEPAGE_URL
--------------------
+.. versionadded:: 3.12
+
The homepage URL of the project.
This is the homepage URL given to the most recently called :command:`project`
diff --git a/Help/variable/PackageName_ROOT.rst b/Help/variable/PackageName_ROOT.rst
index 1c2fd34f3b..3f7ee4cf2e 100644
--- a/Help/variable/PackageName_ROOT.rst
+++ b/Help/variable/PackageName_ROOT.rst
@@ -1,6 +1,8 @@
<PackageName>_ROOT
------------------
+.. versionadded:: 3.12.1
+
Calls to :command:`find_package(<PackageName>)` will search in prefixes
specified by the ``<PackageName>_ROOT`` CMake variable, where
``<PackageName>`` is the name given to the :command:`find_package` call
diff --git a/Help/variable/WINCE.rst b/Help/variable/WINCE.rst
index 54ff7dee27..4dca29716e 100644
--- a/Help/variable/WINCE.rst
+++ b/Help/variable/WINCE.rst
@@ -1,5 +1,7 @@
WINCE
-----
+.. versionadded:: 3.1
+
True when the :variable:`CMAKE_SYSTEM_NAME` variable is set
to ``WindowsCE``.
diff --git a/Help/variable/WINDOWS_PHONE.rst b/Help/variable/WINDOWS_PHONE.rst
index 61d91b00aa..bf7099dce8 100644
--- a/Help/variable/WINDOWS_PHONE.rst
+++ b/Help/variable/WINDOWS_PHONE.rst
@@ -1,5 +1,7 @@
WINDOWS_PHONE
-------------
+.. versionadded:: 3.1
+
True when the :variable:`CMAKE_SYSTEM_NAME` variable is set
to ``WindowsPhone``.
diff --git a/Help/variable/WINDOWS_STORE.rst b/Help/variable/WINDOWS_STORE.rst
index dae3b539b7..13831c2d4b 100644
--- a/Help/variable/WINDOWS_STORE.rst
+++ b/Help/variable/WINDOWS_STORE.rst
@@ -1,5 +1,7 @@
WINDOWS_STORE
-------------
+.. versionadded:: 3.1
+
True when the :variable:`CMAKE_SYSTEM_NAME` variable is set
to ``WindowsStore``.
diff --git a/Help/variable/XCODE.rst b/Help/variable/XCODE.rst
index 99f20fb7ae..167ca86419 100644
--- a/Help/variable/XCODE.rst
+++ b/Help/variable/XCODE.rst
@@ -1,4 +1,6 @@
XCODE
-----
+.. versionadded:: 3.7
+
``True`` when using :generator:`Xcode` generator.
diff --git a/Modules/AndroidTestUtilities.cmake b/Modules/AndroidTestUtilities.cmake
index 95e2ef7e94..ddccf586bb 100644
--- a/Modules/AndroidTestUtilities.cmake
+++ b/Modules/AndroidTestUtilities.cmake
@@ -5,6 +5,8 @@
AndroidTestUtilities
------------------------
+.. versionadded:: 3.7
+
Create a test that automatically loads specified data onto an Android device.
Introduction
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 2f3b9e1d30..f521d22200 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -894,11 +894,16 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
# to install_name_tool:
#
if(changes)
- set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}")
- execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
- if(NOT install_name_tool_result EQUAL 0)
- string(REPLACE ";" "' '" msg "'${cmd}'")
- message(FATAL_ERROR "Command failed:\n ${msg}")
+ # Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang)
+ file(READ ${resolved_embedded_item} file_contents LIMIT 5)
+ if(NOT "${resolved_embedded_item}" MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" AND
+ NOT file_contents MATCHES "^#!")
+ set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}")
+ execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
+ if(NOT install_name_tool_result EQUAL 0)
+ string(REPLACE ";" "' '" msg "'${cmd}'")
+ message(FATAL_ERROR "Command failed:\n ${msg}")
+ endif()
endif()
endif()
endfunction()
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 03195ccec6..2dc1585dfa 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -96,15 +96,5 @@ if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
set(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
endif()
-# to be done
-if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
- set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
-endif()
-
-if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
- set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
-endif()
-
set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
-
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 86683d1bad..13117199de 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -87,7 +87,9 @@ else()
"--target=arm-arm-none-eabi -mcpu=cortex-m3"
)
endif()
-
+if(CMAKE_C_COMPILER_TARGET)
+ list(PREPEND CMAKE_C_COMPILER_ID_TEST_FLAGS "-c --target=${CMAKE_C_COMPILER_TARGET}")
+endif()
# Build a small source file to identify the compiler.
if(NOT CMAKE_C_COMPILER_ID_RUN)
set(CMAKE_C_COMPILER_ID_RUN 1)
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index fa497cd99a..0c586f5cb9 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -232,7 +232,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
list(APPEND CMAKE_CUDA_COMPILER_ID_TEST_FLAGS_FIRST "${clang_test_flags}")
# We perform compiler identification for a second time to extract implicit linking info and host compiler for NVCC.
- # We also use it to verify that CMAKE_CUDA_ARCHITECTURES and additionaly on Clang that CUDA toolkit path works.
+ # We also use it to verify that CMAKE_CUDA_ARCHITECTURES and additionally on Clang that CUDA toolkit path works.
# The latter could be done during compiler testing in the future to avoid doing this for Clang.
# We need to unset the compiler ID otherwise CMAKE_DETERMINE_COMPILER_ID() doesn't work.
set(CMAKE_CUDA_COMPILER_ID)
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 662b831afb..46f1ee119a 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -83,6 +83,10 @@ else()
)
endif()
+if(CMAKE_CXX_COMPILER_TARGET)
+ list(PREPEND CMAKE_CXX_COPMILER_ID_TEST_FLAGS "-c --target=${CMAKE_CXX_COMPILER_TARGET}")
+endif()
+
# Build a small source file to identify the compiler.
if(NOT CMAKE_CXX_COMPILER_ID_RUN)
set(CMAKE_CXX_COMPILER_ID_RUN 1)
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 44332a66a8..832b18de06 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -248,7 +248,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_PostBuildEvent_Command "")
if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$")
set(id_cl_var "ClangClExecutable")
- elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg][Cc][Ll]$")
+ elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg]([Cc][Ll]$|_[0-9])")
set(id_cl "$(CLToolExe)")
elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
set(id_cl clang.exe)
@@ -310,17 +310,36 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_PreferredToolArchitecture "")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
+ set(id_keyword "Win32Proj")
set(id_system "<ApplicationType>Windows Phone</ApplicationType>")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(id_keyword "Win32Proj")
set(id_system "<ApplicationType>Windows Store</ApplicationType>")
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ set(id_keyword "Android")
+ set(id_system "<ApplicationType>Android</ApplicationType>")
else()
+ set(id_keyword "Win32Proj")
set(id_system "")
endif()
- if(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
+ if(id_keyword STREQUAL "Android")
+ if(CMAKE_GENERATOR MATCHES "Visual Studio 14")
+ set(id_system_version "<ApplicationTypeRevision>2.0</ApplicationTypeRevision>")
+ elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]")
+ set(id_system_version "<ApplicationTypeRevision>3.0</ApplicationTypeRevision>")
+ else()
+ set(id_system_version "")
+ endif()
+ elseif(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
set(id_system_version "<ApplicationTypeRevision>${CMAKE_MATCH_1}</ApplicationTypeRevision>")
else()
set(id_system_version "")
endif()
+ if(id_keyword STREQUAL "Android")
+ set(id_config_type "DynamicLibrary")
+ else()
+ set(id_config_type "Application")
+ endif()
if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>")
endif()
@@ -333,9 +352,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
string(APPEND id_CustomGlobals "<${CMAKE_MATCH_1}>${CMAKE_MATCH_2}</${CMAKE_MATCH_1}>\n ")
endif()
endforeach()
- if(id_platform STREQUAL ARM64)
+ if(id_keyword STREQUAL "Android")
+ set(id_WindowsSDKDesktopARMSupport "")
+ elseif(id_platform STREQUAL "ARM64")
set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>")
- elseif(id_platform STREQUAL ARM)
+ elseif(id_platform STREQUAL "ARM")
set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>")
else()
set(id_WindowsSDKDesktopARMSupport "")
@@ -702,7 +723,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
# The IAR-AVR compiler uses a binary format that places a '6'
# character (0x34) before each character in the string. Strip
- # out these characters without removing any legitamate characters.
+ # out these characters without removing any legitimate characters.
if("${info}" MATCHES "(.)I.N.F.O.:.")
string(REGEX REPLACE "${CMAKE_MATCH_1}(.)" "\\1" info "${info}")
endif()
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake
index ff4c32561c..7cd75488cd 100644
--- a/Modules/CMakeParseImplicitIncludeInfo.cmake
+++ b/Modules/CMakeParseImplicitIncludeInfo.cmake
@@ -7,7 +7,7 @@
# for compilers that report them that way. on success we return the
# list of dirs in id_var and set state_var to the 'done' state.
function(cmake_parse_implicit_include_line line lang id_var log_var state_var)
- # clear variables we append to (avoids possible polution from parent scopes)
+ # clear variables we append to (avoids possible pollution from parent scopes)
unset(rv)
set(log "")
@@ -162,7 +162,7 @@ endfunction()
function(cmake_parse_implicit_include_info text lang dir_var log_var state_var)
set(state start) # values: start, loading, done
- # clear variables we append to (avoids possible polution from parent scopes)
+ # clear variables we append to (avoids possible pollution from parent scopes)
set(implicit_dirs_tmp)
set(log "")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 40668a3e6b..0b81c88ebe 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -206,6 +206,24 @@
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
+
+#elif defined(__TI_COMPILER_VERSION__)
+# if defined(__TI_ARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__MSP430__)
+# define ARCHITECTURE_ID "MSP430"
+
+# elif defined(__TMS320C28XX__)
+# define ARCHITECTURE_ID "TMS320C28x"
+
+# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
+# define ARCHITECTURE_ID "TMS320C6x"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
#else
# define ARCHITECTURE_ID
#endif
@@ -283,4 +301,3 @@ char const info_simulate_version[] = {
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
-
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 3734ec46ac..03f2db2d22 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -11,7 +11,7 @@ endif()
include(CMakeTestCompilerCommon)
-# work around enforced code signing and / or missing exectuable target type
+# work around enforced code signing and / or missing executable target type
set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index b9cb1dd0eb..0d2d0b0530 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -11,7 +11,7 @@ endif()
include(CMakeTestCompilerCommon)
-# work around enforced code signing and / or missing exectuable target type
+# work around enforced code signing and / or missing executable target type
set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake
index 0e333c0eff..298272b85a 100644
--- a/Modules/CMakeTestOBJCCompiler.cmake
+++ b/Modules/CMakeTestOBJCCompiler.cmake
@@ -11,7 +11,7 @@ endif()
include(CMakeTestCompilerCommon)
-# work around enforced code signing and / or missing exectuable target type
+# work around enforced code signing and / or missing executable target type
set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
diff --git a/Modules/CMakeTestOBJCXXCompiler.cmake b/Modules/CMakeTestOBJCXXCompiler.cmake
index dc153a7b93..36e3efc509 100644
--- a/Modules/CMakeTestOBJCXXCompiler.cmake
+++ b/Modules/CMakeTestOBJCXXCompiler.cmake
@@ -11,7 +11,7 @@ endif()
include(CMakeTestCompilerCommon)
-# work around enforced code signing and / or missing exectuable target type
+# work around enforced code signing and / or missing executable target type
set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index d0cfc2b18a..8a0ef3050a 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -22,9 +22,13 @@ section below for details.
The generated binary installers will contain all files that have been installed
via CMake's :command:`install` command (and the deprecated commands
:command:`install_files`, :command:`install_programs`, and
-:command:`install_targets`). Certain kinds of binary installers can be
-configured such that users can select individual application components to
-install. See the :module:`CPackComponent` module for further details.
+:command:`install_targets`). Note that the ``DESTINATION`` option of the
+:command:`install` command must be a relative path; otherwise installed files
+are ignored by CPack.
+
+Certain kinds of binary installers can be configured such that users can select
+individual application components to install. See the :module:`CPackComponent`
+module for further details.
Source packages (configured through ``CPackSourceConfig.cmake`` and generated
by the :cpack_gen:`CPack Archive Generator`) will contain all source files in
@@ -386,6 +390,21 @@ 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
@@ -420,7 +439,7 @@ endmacro()
# find any variable that starts with CPACK and create a variable
# _CPACK_OTHER_VARIABLES_ that contains SET commands for
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
-# used as an @ replacment in configure_file for the CPackConfig.
+# used as an @ replacement in configure_file for the CPackConfig.
function(cpack_encode_variables)
set(commands "")
get_cmake_property(res VARIABLES)
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 80a907ffd2..58e6a375f4 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -5,6 +5,8 @@
CPackIFW
--------
+.. versionadded:: 3.1
+
This module looks for the location of the command-line utilities supplied with the
`Qt Installer Framework <http://doc.qt.io/qtinstallerframework/index.html>`_
(QtIFW).
diff --git a/Modules/CPackIFWConfigureFile.cmake b/Modules/CPackIFWConfigureFile.cmake
index 0abe0da371..296b13f725 100644
--- a/Modules/CPackIFWConfigureFile.cmake
+++ b/Modules/CPackIFWConfigureFile.cmake
@@ -5,6 +5,8 @@
CPackIFWConfigureFile
---------------------
+.. versionadded:: 3.8
+
The module defines :command:`configure_file` similar command to
configure file templates prepared in QtIFW/SDK/Creator style.
diff --git a/Modules/CSharpUtilities.cmake b/Modules/CSharpUtilities.cmake
index 6a4b5c7f7b..dedb146ac1 100644
--- a/Modules/CSharpUtilities.cmake
+++ b/Modules/CSharpUtilities.cmake
@@ -5,6 +5,8 @@
CSharpUtilities
---------------
+.. versionadded:: 3.8
+
Functions to make configuration of CSharp/.NET targets easier.
A collection of CMake utility functions useful for dealing with CSharp
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index b1268bebf2..a01a2fea22 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -5,6 +5,8 @@
CTestCoverageCollectGCOV
------------------------
+.. versionadded:: 3.2
+
This module provides the ``ctest_coverage_collect_gcov`` function.
This function runs gcov on all .gcda files found in the binary tree
diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake
index 299cd8cfc8..b8fac97cc5 100644
--- a/Modules/CheckFortranCompilerFlag.cmake
+++ b/Modules/CheckFortranCompilerFlag.cmake
@@ -5,6 +5,8 @@
CheckFortranCompilerFlag
------------------------
+.. versionadded:: 3.3
+
Check whether the Fortran compiler supports a given flag.
.. command:: check_fortran_compiler_flag
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index 3354bfb25f..d776b0c13b 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -5,6 +5,8 @@
CheckFortranSourceCompiles
--------------------------
+.. versionadded:: 3.1
+
Check if given Fortran source compiles and links into an executable.
.. command:: check_fortran_source_compiles
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index f858b84a81..a710352325 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -5,6 +5,8 @@
CheckFortranSourceRuns
----------------------
+.. versionadded:: 3.14
+
Check if given Fortran source compiles and links into an executable and can
subsequently be run.
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index 90a9f61804..1dd951d83c 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -5,6 +5,8 @@
CheckIPOSupported
-----------------
+.. versionadded:: 3.9
+
Check whether the compiler supports an interprocedural optimization (IPO/LTO).
Use this before enabling the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target
property.
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake
index d67d8d3ac2..44387d4b44 100644
--- a/Modules/CheckLanguage.cmake
+++ b/Modules/CheckLanguage.cmake
@@ -20,7 +20,7 @@ test project. The result is cached in :variable:`CMAKE_<LANG>_COMPILER`
as the compiler that was found, or ``NOTFOUND`` if the language cannot be
enabled. For CUDA which can have an explicit host compiler, the cache
:variable:`CMAKE_CUDA_HOST_COMPILER` variable will be set if it was required
-for compilation.
+for compilation (and cleared if it was not).
Example:
diff --git a/Modules/CheckLinkerFlag.cmake b/Modules/CheckLinkerFlag.cmake
index beda5fe3c3..cd7301f941 100644
--- a/Modules/CheckLinkerFlag.cmake
+++ b/Modules/CheckLinkerFlag.cmake
@@ -5,6 +5,8 @@
CheckLinkerFlag
---------------
+.. versionadded:: 3.18
+
Check whether the compiler supports a given link flag.
.. command:: check_linker_flag
diff --git a/Modules/CheckOBJCCompilerFlag.cmake b/Modules/CheckOBJCCompilerFlag.cmake
index 1d975da882..a98f4293c9 100644
--- a/Modules/CheckOBJCCompilerFlag.cmake
+++ b/Modules/CheckOBJCCompilerFlag.cmake
@@ -5,6 +5,8 @@
CheckOBJCCompilerFlag
---------------------
+.. versionadded:: 3.16
+
Check whether the Objective-C compiler supports a given flag.
.. command:: check_objc_compiler_flag
diff --git a/Modules/CheckOBJCSourceCompiles.cmake b/Modules/CheckOBJCSourceCompiles.cmake
index 601f1fa443..502ed74725 100644
--- a/Modules/CheckOBJCSourceCompiles.cmake
+++ b/Modules/CheckOBJCSourceCompiles.cmake
@@ -5,6 +5,8 @@
CheckOBJCSourceCompiles
-----------------------
+.. versionadded:: 3.16
+
Check if given Objective-C source compiles and links into an executable.
.. command:: check_objc_source_compiles
diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake
index 6684693916..9d4fb1bacc 100644
--- a/Modules/CheckOBJCSourceRuns.cmake
+++ b/Modules/CheckOBJCSourceRuns.cmake
@@ -5,6 +5,8 @@
CheckOBJCSourceRuns
-------------------
+.. versionadded:: 3.16
+
Check if given Objective-C source compiles and links into an executable and can
subsequently be run.
diff --git a/Modules/CheckOBJCXXCompilerFlag.cmake b/Modules/CheckOBJCXXCompilerFlag.cmake
index c32741b54a..7944ab07a0 100644
--- a/Modules/CheckOBJCXXCompilerFlag.cmake
+++ b/Modules/CheckOBJCXXCompilerFlag.cmake
@@ -5,6 +5,8 @@
CheckOBJCXXCompilerFlag
-----------------------
+.. versionadded:: 3.16
+
Check whether the Objective-C++ compiler supports a given flag.
.. command:: check_objcxx_compiler_flag
diff --git a/Modules/CheckOBJCXXSourceCompiles.cmake b/Modules/CheckOBJCXXSourceCompiles.cmake
index 2ee79f48a7..7b839e4cbf 100644
--- a/Modules/CheckOBJCXXSourceCompiles.cmake
+++ b/Modules/CheckOBJCXXSourceCompiles.cmake
@@ -5,6 +5,8 @@
CheckOBJCXXSourceCompiles
-------------------------
+.. versionadded:: 3.16
+
Check if given Objective-C++ source compiles and links into an executable.
.. command:: check_objcxx_source_compiles
diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake
index 7f7e04f77e..c32759899e 100644
--- a/Modules/CheckOBJCXXSourceRuns.cmake
+++ b/Modules/CheckOBJCXXSourceRuns.cmake
@@ -5,6 +5,8 @@
CheckOBJCXXSourceRuns
---------------------
+.. versionadded:: 3.16
+
Check if given Objective-C++ source compiles and links into an executable and can
subsequently be run.
diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake
index 6d63f0bada..a99d8c41f1 100644
--- a/Modules/CheckPIESupported.cmake
+++ b/Modules/CheckPIESupported.cmake
@@ -5,6 +5,8 @@
CheckPIESupported
-----------------
+.. versionadded:: 3.14
+
Check whether the linker supports Position Independent Code (PIE) or No
Position Independent Code (NO_PIE) for executables.
Use this to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 2b07b7cc03..17beadcb10 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -89,17 +89,38 @@ function(__check_type_size_impl type var map builtin language)
message(CHECK_START "Check size of ${type}")
endif()
+ # Perform language check
+ if(language STREQUAL "C")
+ set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
+ elseif(language STREQUAL "CXX")
+ set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
+ else()
+ message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n")
+ endif()
+
# Include header files.
set(headers)
if(builtin)
- if(HAVE_SYS_TYPES_H)
- string(APPEND headers "#include <sys/types.h>\n")
- endif()
- if(HAVE_STDINT_H)
- string(APPEND headers "#include <stdint.h>\n")
- endif()
- if(HAVE_STDDEF_H)
- string(APPEND headers "#include <stddef.h>\n")
+ if(language STREQUAL "CXX" AND type MATCHES "^std::")
+ if(HAVE_SYS_TYPES_H)
+ string(APPEND headers "#include <sys/types.h>\n")
+ endif()
+ if(HAVE_CSTDINT)
+ string(APPEND headers "#include <cstdint>\n")
+ endif()
+ if(HAVE_CSTDDEF)
+ string(APPEND headers "#include <cstddef>\n")
+ endif()
+ else()
+ if(HAVE_SYS_TYPES_H)
+ string(APPEND headers "#include <sys/types.h>\n")
+ endif()
+ if(HAVE_STDINT_H)
+ string(APPEND headers "#include <stdint.h>\n")
+ endif()
+ if(HAVE_STDDEF_H)
+ string(APPEND headers "#include <stddef.h>\n")
+ endif()
endif()
endif()
foreach(h ${CMAKE_EXTRA_INCLUDE_FILES})
@@ -107,14 +128,6 @@ function(__check_type_size_impl type var map builtin language)
endforeach()
# Perform the check.
-
- if(language STREQUAL "C")
- set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
- elseif(language STREQUAL "CXX")
- set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
- else()
- message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n")
- endif()
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
try_compile(HAVE_${var} ${CMAKE_BINARY_DIR} ${src}
@@ -232,8 +245,13 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
check_include_file(stddef.h HAVE_STDDEF_H)
elseif(_language STREQUAL "CXX")
check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
- check_include_file_cxx(stdint.h HAVE_STDINT_H)
- check_include_file_cxx(stddef.h HAVE_STDDEF_H)
+ if("${TYPE}" MATCHES "^std::")
+ check_include_file_cxx(cstdint HAVE_CSTDINT)
+ check_include_file_cxx(cstddef HAVE_CSTDDEF)
+ else()
+ check_include_file_cxx(stdint.h HAVE_STDINT_H)
+ check_include_file_cxx(stddef.h HAVE_STDDEF_H)
+ endif()
endif()
endif()
unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY)
diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake
index 01ce91d4a0..70e6ffbd31 100644
--- a/Modules/Compiler/ARMClang.cmake
+++ b/Modules/Compiler/ARMClang.cmake
@@ -98,7 +98,7 @@ macro(__compiler_armclang lang)
set(__mcpu_flag_set TRUE)
endif()
if(NOT __march_flag_set AND NOT __mcpu_flag_set)
- message(FATAL_ERROR "Atleast one of the variables CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH must be set for ARMClang\n"
+ message(FATAL_ERROR "At least one of the variables CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH must be set for ARMClang\n"
"Supported processor: ${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}\n"
" Supported Architecture: ${CMAKE_${lang}_COMPILER_ARCH_LIST}")
endif()
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 2794f52bbb..26a4bbd335 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -1,6 +1,8 @@
include(Compiler/Clang)
__compiler_clang(C)
+set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index 15edc21e99..611c674576 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -1,6 +1,8 @@
include(Compiler/Clang)
__compiler_clang(CXX)
+set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+
if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index 7c4a263f6a..fb6ffa7b00 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -8,6 +8,8 @@ endif()
if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
+elseif("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 789e991594..311d2b07f6 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -2,7 +2,9 @@ include(Compiler/Clang)
__compiler_clang(CXX)
__compiler_clang_cxx_standards(CXX)
+
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index ca286b3975..8105a77f62 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -1,6 +1,8 @@
include(Compiler/GNU)
__compiler_gnu(C)
+set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index fcaaeab433..59ec05691c 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -1,6 +1,8 @@
include(Compiler/GNU)
__compiler_gnu(CXX)
+set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+
if (WIN32)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport")
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index ec3bfd88fa..322f63d0d2 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -28,6 +28,8 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
else()
+ set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index b71b946e92..42adfd10c7 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -42,6 +42,8 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
else()
+ set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
diff --git a/Modules/Compiler/OpenWatcom.cmake b/Modules/Compiler/OpenWatcom.cmake
index 9efbfc282e..a9625137aa 100644
--- a/Modules/Compiler/OpenWatcom.cmake
+++ b/Modules/Compiler/OpenWatcom.cmake
@@ -86,7 +86,7 @@ set(CMAKE_C_CREATE_STATIC_LIBRARY
set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
-# old CMake internaly used OpenWatcom version macros
+# old CMake internally used OpenWatcom version macros
# for backward compatibility
if(NOT _CMAKE_WATCOM_VERSION)
set(_CMAKE_WATCOM_VERSION 1)
diff --git a/Modules/Compiler/PGI-CXX.cmake b/Modules/Compiler/PGI-CXX.cmake
index c77de3605b..2d7a303c9b 100644
--- a/Modules/Compiler/PGI-CXX.cmake
+++ b/Modules/Compiler/PGI-CXX.cmake
@@ -4,19 +4,19 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10)
- set(CMAKE_CXX98_STANDARD_COMPILE_OPTION -A)
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --gnu_extensions)
set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.10)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION --c++11 -A)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION --c++11)
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION --c++11 --gnu_extensions)
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.7)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14 -A)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14)
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION --c++14 --gnu_extensions)
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.1)
- set(CMAKE_CXX17_STANDARD_COMPILE_OPTION --c++17 -A)
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION --c++17)
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION --c++17 --gnu_extensions)
set(CMAKE_CXX17_STANDARD__HAS_FULL_SUPPORT ON)
endif()
diff --git a/Modules/Compiler/TI-ASM.cmake b/Modules/Compiler/TI-ASM.cmake
index a566d70e16..01965d2e5e 100644
--- a/Modules/Compiler/TI-ASM.cmake
+++ b/Modules/Compiler/TI-ASM.cmake
@@ -1,8 +1,4 @@
-set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
-set(CMAKE_LINK_LIBRARY_FLAG "--library=")
-set(CMAKE_INCLUDE_FLAG_ASM "--include_path=")
-
-set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> --compile_only --asm_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
-set(CMAKE_ASM_LINK_EXECUTABLE "<CMAKE_ASM_COMPILER> <OBJECTS> --run_linker --output_file=<TARGET> <CMAKE_ASM_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
+include(Compiler/TI)
+__compiler_ti(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm;s;abs)
diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake
index b060ee9bbd..8ea01b59e0 100644
--- a/Modules/Compiler/TI-C.cmake
+++ b/Modules/Compiler/TI-C.cmake
@@ -1,22 +1,8 @@
-set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
-set(CMAKE_LINK_LIBRARY_FLAG "--library=")
-set(CMAKE_INCLUDE_FLAG_C "--include_path=")
+include(Compiler/TI)
+__compiler_ti(C)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "--c89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--c89 --relaxed_ansi")
set(CMAKE_C99_STANDARD_COMPILE_OPTION "--c99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--c99 --relaxed_ansi")
-
-set(CMAKE_DEPFILE_FLAGS_C "--preproc_with_compile --preproc_dependency=<DEPFILE>")
-
-set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> --compile_only --skip_assembler --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")
-set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> --preproc_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
-
-set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> --compile_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
-set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
-set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
-set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
-set(CMAKE_ASM_RESPONSE_FILE_FLAG "--cmd_file=")
-set(CMAKE_C_RESPONSE_FILE_FLAG "--cmd_file=")
-set(CMAKE_C_RESPONSE_FILE_LINK_FLAG " ")
diff --git a/Modules/Compiler/TI-CXX.cmake b/Modules/Compiler/TI-CXX.cmake
index 783654373d..c08d9a14a6 100644
--- a/Modules/Compiler/TI-CXX.cmake
+++ b/Modules/Compiler/TI-CXX.cmake
@@ -1,15 +1,2 @@
-set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
-set(CMAKE_LINK_LIBRARY_FLAG "--library=")
-set(CMAKE_INCLUDE_FLAG_CXX "--include_path=")
-
-set(CMAKE_DEPFILE_FLAGS_CXX "--preproc_with_compile --preproc_dependency=<DEPFILE>")
-
-set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> --compile_only --skip_assembler --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")
-set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> --preproc_only --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
-
-set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> --compile_only --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
-set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
-set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
-set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
-set(CMAKE_CXX_RESPONSE_FILE_FLAG "--cmd_file=")
-set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG " ")
+include(Compiler/TI)
+__compiler_ti(CXX)
diff --git a/Modules/Compiler/TI.cmake b/Modules/Compiler/TI.cmake
new file mode 100644
index 0000000000..9f2e8130d8
--- /dev/null
+++ b/Modules/Compiler/TI.cmake
@@ -0,0 +1,40 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+# This module is shared by multiple languages; use include blocker.
+if(__COMPILER_TI)
+ return()
+endif()
+set(__COMPILER_TI 1)
+
+macro(__compiler_ti lang)
+ string(TOLOWER ${lang} prefix)
+ if("x${lang}" STREQUAL "xCXX")
+ set(prefix "cpp")
+ endif()
+
+ set(CMAKE_${lang}_RESPONSE_FILE_FLAG "--cmd_file=")
+
+ set(CMAKE_INCLUDE_FLAG_${lang} "--include_path=")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--preproc_with_compile --preproc_dependency=<DEPFILE>")
+
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> --preproc_only --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> --compile_only --skip_assembler --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")
+
+ set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> --compile_only --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
+
+ set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_FINISH "")
+
+ # After the --run_linker flag a response file is not possible
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "")
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 0)
+
+ set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
+endmacro()
+
+set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
+set(CMAKE_LINK_LIBRARY_FLAG "--library=")
diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake
index 2077bdabdf..78c44d5d72 100644
--- a/Modules/Compiler/XL-C.cmake
+++ b/Modules/Compiler/XL-C.cmake
@@ -6,6 +6,8 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
# -qthreaded = Ensures that all optimizations will be thread-safe
string(APPEND CMAKE_C_FLAGS_INIT " -qthreaded")
+set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -qsourcetype=c)
+
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-qlanglvl=stdc89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-qlanglvl=extc89")
diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake
index 41e3e11194..3b911f3d6c 100644
--- a/Modules/Compiler/XL-CXX.cmake
+++ b/Modules/Compiler/XL-CXX.cmake
@@ -6,6 +6,8 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
# -qthreaded = Ensures that all optimizations will be thread-safe
string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded")
+set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -+)
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
if(CMAKE_SYSTEM MATCHES "Linux")
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
@@ -32,6 +34,3 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
endif ()
__compiler_check_default_language_standard(CXX 10.1 98)
-
-set(CMAKE_CXX_COMPILE_OBJECT
- "<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
diff --git a/Modules/Compiler/XLClang-C.cmake b/Modules/Compiler/XLClang-C.cmake
index 54c18a668a..1668a4d0f9 100644
--- a/Modules/Compiler/XLClang-C.cmake
+++ b/Modules/Compiler/XLClang-C.cmake
@@ -1,6 +1,8 @@
include(Compiler/XLClang)
__compiler_xlclang(C)
+set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
diff --git a/Modules/Compiler/XLClang-CXX.cmake b/Modules/Compiler/XLClang-CXX.cmake
index 9ea3d7cace..02638c7917 100644
--- a/Modules/Compiler/XLClang-CXX.cmake
+++ b/Modules/Compiler/XLClang-CXX.cmake
@@ -1,6 +1,8 @@
include(Compiler/XLClang)
__compiler_xlclang(CXX)
+set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
index b48a3323f9..3598fc7e20 100644
--- a/Modules/CompilerId/VS-10.vcxproj.in
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -9,7 +9,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{CAE07175-D007-4FC3-BFE8-47B392814159}</ProjectGuid>
<RootNamespace>CompilerId@id_lang@</RootNamespace>
- <Keyword>Win32Proj</Keyword>
+ <Keyword>@id_keyword@</Keyword>
@id_system@
@id_system_version@
@id_WindowsTargetPlatformVersion@
@@ -24,7 +24,7 @@
@id_PreferredToolArchitecture@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
+ <ConfigurationType>@id_config_type@</ConfigurationType>
@id_toolset@
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index e05ca96921..c85e2d8370 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -5,6 +5,8 @@
FetchContent
------------------
+.. versionadded:: 3.11
+
.. only:: html
.. contents::
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index 243b9e077c..c8a31a0386 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -84,6 +84,7 @@ if(_ARMA_USE_WRAPPER)
# Link to the armadillo wrapper library.
find_library(ARMADILLO_LIBRARY
NAMES armadillo
+ NAMES_PER_DIR
PATHS
"$ENV{ProgramFiles}/Armadillo/lib"
"$ENV{ProgramFiles}/Armadillo/lib64"
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 60f178be74..88a252d602 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -36,7 +36,7 @@ The following variables may be set to influence this module's behavior:
* ``SCSL``
* ``SGIMATH``
* ``IBMESSL``
- * ``Intel10_32`` (intel mkl v10 32 bit)
+ * ``Intel10_32`` (intel mkl v10 32 bit, threaded code)
* ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model)
* ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model)
* ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model)
@@ -208,6 +208,7 @@ macro(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _add
if(_libraries_work)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
+ NAMES_PER_DIR
PATHS ${_extaddlibdir}
PATH_SUFFIXES ${_subdirs}
)
@@ -397,6 +398,10 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
# Add threading/sequential libs
set(BLAS_SEARCH_LIBS_WIN_THREAD "")
+ if(BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
+ list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
+ "libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
+ endif()
if(BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
@@ -441,7 +446,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
"${BLAS_mkl_START_GROUP} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core ${BLAS_mkl_END_GROUP}")
endif()
- #older vesions of intel mkl libs
+ #older versions of intel mkl libs
if(BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl")
@@ -483,7 +488,9 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endif()
set(BLAS_mkl_LIB_PATH_SUFFIXES
"compiler/lib" "compiler/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}"
+ "compiler/lib/${BLAS_mkl_ARCH_NAME}"
"mkl/lib" "mkl/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}"
+ "mkl/lib/${BLAS_mkl_ARCH_NAME}"
"lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}")
foreach(IT ${BLAS_SEARCH_LIBS})
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 98ab72cd85..5704d1d83c 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -45,8 +45,8 @@ set(_BZIP2_PATHS PATHS
find_path(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include)
if (NOT BZIP2_LIBRARIES)
- find_library(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 libbz2 libbzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib)
- find_library(BZIP2_LIBRARY_DEBUG NAMES bz2d bzip2d libbz2d libbzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+ find_library(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 libbz2 libbzip2 NAMES_PER_DIR ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+ find_library(BZIP2_LIBRARY_DEBUG NAMES bz2d bzip2d libbz2d libbzip2d NAMES_PER_DIR ${_BZIP2_PATHS} PATH_SUFFIXES lib)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(BZIP2)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 13981d3b84..ec087ad432 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -305,7 +305,7 @@ function(_boost_get_canonical_target_name component target_var)
endfunction()
macro(_boost_set_in_parent_scope name value)
- # Set a variable in parent scope and make it visibile in current scope
+ # Set a variable in parent scope and make it visible in current scope
set(${name} "${value}" PARENT_SCOPE)
set(${name} "${value}")
endmacro()
@@ -1270,10 +1270,8 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp")
set(_Boost_WAVE_HEADERS "boost/wave.hpp")
set(_Boost_WSERIALIZATION_HEADERS "boost/archive/text_wiarchive.hpp")
- if(WIN32)
- set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
- set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
- endif()
+ set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
+ set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
string(TOUPPER ${component} uppercomponent)
set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE)
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index ba3543306b..17e12f8cf7 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -155,7 +155,7 @@ macro(cuda_execute_process status command)
# copy and paste a runnable command line.
set(cuda_execute_process_string)
foreach(arg ${ARGN})
- # If there are quotes, excape them, so they come through.
+ # If there are quotes, escape them, so they come through.
string(REPLACE "\"" "\\\"" arg ${arg})
# Args with spaces need quotes around them to get them to be parsed as a single argument.
if(arg MATCHES " ")
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 47bc5466c0..e3acc3f0f0 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -5,6 +5,8 @@
FindCUDAToolkit
---------------
+.. versionadded:: 3.17
+
This script locates the NVIDIA CUDA toolkit and the associated libraries, but
does not require the ``CUDA`` language be enabled for a given project. This
module does not search for the NVIDIA CUDA Samples.
@@ -431,7 +433,7 @@ Result variables
``CUDAToolkit_TARGET_DIR``
The path to the CUDA Toolkit directory including the target architecture
- when cross-compiling. When not cross-compiling this will be equivalant to
+ when cross-compiling. When not cross-compiling this will be equivalent to
``CUDAToolkit_ROOT_DIR``.
``CUDAToolkit_NVCC_EXECUTABLE``
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index be7e16ea54..74b36c6f7c 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -92,6 +92,7 @@ if(NOT CURL_LIBRARY)
curllib_static
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
libcurl
+ NAMES_PER_DIR
HINTS ${PC_CURL_LIBRARY_DIRS}
)
mark_as_advanced(CURL_LIBRARY_RELEASE)
@@ -100,6 +101,7 @@ if(NOT CURL_LIBRARY)
# Windows MSVC CMake builds in debug configuration on vcpkg:
libcurl-d_imp
libcurl-d
+ NAMES_PER_DIR
HINTS ${PC_CURL_LIBRARY_DIRS}
)
mark_as_advanced(CURL_LIBRARY_DEBUG)
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index ba56078a50..cde3a4d2d7 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -156,7 +156,9 @@ if(CURSES_USE_NCURSES)
CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
cbreak "" CURSES_NCURSES_HAS_CBREAK)
- if(NOT CURSES_NCURSES_HAS_CBREAK)
+ CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
+ nodelay "" CURSES_NCURSES_HAS_NODELAY)
+ if(NOT CURSES_NCURSES_HAS_CBREAK OR NOT CURSES_NCURSES_HAS_NODELAY)
find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" HINTS "${_cursesLibDir}")
find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" )
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 15b419a614..b0bb02a566 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -38,7 +38,7 @@ pkg_check_modules(PC_EXPAT QUIET expat)
find_path(EXPAT_INCLUDE_DIR NAMES expat.h HINTS ${PC_EXPAT_INCLUDE_DIRS})
# Look for the library.
-find_library(EXPAT_LIBRARY NAMES expat libexpat HINTS ${PC_EXPAT_LIBRARY_DIRS})
+find_library(EXPAT_LIBRARY NAMES expat libexpat NAMES_PER_DIR HINTS ${PC_EXPAT_LIBRARY_DIRS})
if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
diff --git a/Modules/FindEnvModules.cmake b/Modules/FindEnvModules.cmake
index 4dd5116cd7..a4ac0b47f3 100644
--- a/Modules/FindEnvModules.cmake
+++ b/Modules/FindEnvModules.cmake
@@ -5,6 +5,8 @@
FindEnvModules
--------------
+.. versionadded:: 3.15
+
Locate an environment module implementation and make commands available to
CMake scripts to use them. This is compatible with both Lua-based Lmod
and TCL-based EnvironmentModules.
diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake
index a6f0180b37..5228831374 100644
--- a/Modules/FindFontconfig.cmake
+++ b/Modules/FindFontconfig.cmake
@@ -5,6 +5,8 @@
FindFontconfig
--------------
+.. versionadded:: 3.14
+
Find Fontconfig headers and library.
Imported Targets
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index d5a143e81d..cea9cd8c7e 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -60,6 +60,7 @@ set(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
find_library(GIF_LIBRARY
NAMES ${POTENTIAL_GIF_LIBS}
+ NAMES_PER_DIR
HINTS
ENV GIF_DIR
PATH_SUFFIXES lib
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index 27ffa13475..080371a915 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -139,11 +139,13 @@ __glew_set_find_library_suffix(SHARED)
find_library(GLEW_SHARED_LIBRARY_RELEASE
NAMES GLEW glew glew32
+ NAMES_PER_DIR
PATH_SUFFIXES lib lib64 libx32 lib/Release/${_arch}
PATHS ENV GLEW_ROOT)
find_library(GLEW_SHARED_LIBRARY_DEBUG
NAMES GLEWd glewd glew32d
+ NAMES_PER_DIR
PATH_SUFFIXES lib lib64
PATHS ENV GLEW_ROOT)
@@ -152,11 +154,13 @@ __glew_set_find_library_suffix(STATIC)
find_library(GLEW_STATIC_LIBRARY_RELEASE
NAMES GLEW glew glew32s
+ NAMES_PER_DIR
PATH_SUFFIXES lib lib64 libx32 lib/Release/${_arch}
PATHS ENV GLEW_ROOT)
find_library(GLEW_STATIC_LIBRARY_DEBUG
NAMES GLEWds glewds glew32ds
+ NAMES_PER_DIR
PATH_SUFFIXES lib lib64
PATHS ENV GLEW_ROOT)
diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake
index da1b3c4e4d..3d4e7f939f 100644
--- a/Modules/FindGSL.cmake
+++ b/Modules/FindGSL.cmake
@@ -5,6 +5,8 @@
FindGSL
--------
+.. versionadded:: 3.2
+
Find the native GNU Scientific Library (GSL) includes and libraries.
The GNU Scientific Library (GSL) is a numerical library for C and C++
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index 53cab1a760..10e31b29fc 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -96,6 +96,27 @@ function(__gtest_find_library _name)
mark_as_advanced(${_name})
endfunction()
+function(__gtest_find_library_configuration _name _lib _cfg_suffix)
+ set(_libs ${_lib})
+ if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD")
+ # The provided /MD project files for Google Test add -md suffixes to the
+ # library names.
+ list(INSERT _libs 0 ${_lib}-md)
+ endif()
+ list(TRANSFORM _libs APPEND "${_cfg_suffix}")
+
+ __gtest_find_library(${_name} ${_libs})
+endfunction()
+
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+function(__gtest_find_and_select_library_configurations _basename _lib)
+ __gtest_find_library_configuration(${_basename}_LIBRARY_RELEASE ${_lib} "")
+ __gtest_find_library_configuration(${_basename}_LIBRARY_DEBUG ${_lib} "d")
+
+ select_library_configurations(${_basename})
+ set(${_basename}_LIBRARY ${${_basename}_LIBRARY} PARENT_SCOPE)
+endfunction()
+
macro(__gtest_determine_windows_library_type _var)
if(EXISTS "${${_var}}")
file(TO_NATIVE_PATH "${${_var}}" _lib_path)
@@ -187,18 +208,13 @@ find_path(GTEST_INCLUDE_DIR gtest/gtest.h
)
mark_as_advanced(GTEST_INCLUDE_DIR)
-if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD")
- # The provided /MD project files for Google Test add -md suffixes to the
- # library names.
- __gtest_find_library(GTEST_LIBRARY gtest-md gtest)
- __gtest_find_library(GTEST_LIBRARY_DEBUG gtest-mdd gtestd)
- __gtest_find_library(GTEST_MAIN_LIBRARY gtest_main-md gtest_main)
- __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_main-mdd gtest_maind)
-else()
- __gtest_find_library(GTEST_LIBRARY gtest)
- __gtest_find_library(GTEST_LIBRARY_DEBUG gtestd)
- __gtest_find_library(GTEST_MAIN_LIBRARY gtest_main)
- __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind)
+# 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()
+if(NOT GTEST_MAIN_LIBRARY)
+ __gtest_find_and_select_library_configurations(GTEST_MAIN gtest_main)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 60a313d737..7a1c252183 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -125,8 +125,6 @@ The following variables can be set to guide the search for HDF5 libraries and in
Set ``true`` to skip trying to find ``hdf5-config.cmake``.
#]=======================================================================]
-# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>.
-
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
@@ -347,6 +345,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
# wrapper exists, but not the compiler. E.g. Miniconda / Anaconda Python
execute_process(
COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} ${test_file}
+ WORKING_DIRECTORY ${scratch_dir}
RESULT_VARIABLE return_value
)
if(return_value)
@@ -355,6 +354,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
else()
execute_process(
COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file}
+ WORKING_DIRECTORY ${scratch_dir}
OUTPUT_VARIABLE output
ERROR_VARIABLE output
RESULT_VARIABLE return_value
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index 38081f5fa2..c8b3e1fb75 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -5,6 +5,8 @@
FindICU
-------
+.. versionadded:: 3.7
+
Find the International Components for Unicode (ICU) libraries and
programs.
diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake
index 5ce2b42d9f..0f821e886f 100644
--- a/Modules/FindIce.cmake
+++ b/Modules/FindIce.cmake
@@ -5,6 +5,8 @@
FindIce
-------
+.. versionadded:: 3.1
+
Find the ZeroC Internet Communication Engine (ICE) programs,
libraries and datafiles.
diff --git a/Modules/FindIconv.cmake b/Modules/FindIconv.cmake
index bf20f6f7ea..41b75509fa 100644
--- a/Modules/FindIconv.cmake
+++ b/Modules/FindIconv.cmake
@@ -5,6 +5,8 @@
FindIconv
---------
+.. versionadded:: 3.11
+
This module finds the ``iconv()`` POSIX.1 functions on the system.
These functions might be provided in the regular C library or externally
in the form of an additional library.
@@ -110,6 +112,7 @@ endif()
find_library(Iconv_LIBRARY
NAMES ${Iconv_LIBRARY_NAMES}
+ NAMES_PER_DIR
DOC "iconv library (potentially the C library)")
mark_as_advanced(Iconv_INCLUDE_DIR)
diff --git a/Modules/FindIntl.cmake b/Modules/FindIntl.cmake
index 3818d45ec9..1a09a60972 100644
--- a/Modules/FindIntl.cmake
+++ b/Modules/FindIntl.cmake
@@ -5,6 +5,8 @@
FindIntl
--------
+.. versionadded:: 3.2
+
Find the Gettext libintl headers and libraries.
This module reports information about the Gettext libintl
@@ -40,7 +42,7 @@ find_path(Intl_INCLUDE_DIR
mark_as_advanced(Intl_INCLUDE_DIR)
# Find all Intl libraries
-find_library(Intl_LIBRARY "intl"
+find_library(Intl_LIBRARY "intl" NAMES_PER_DIR
DOC "libintl libraries (if not in the C library)")
mark_as_advanced(Intl_LIBRARY)
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 0bb698979f..632fc9aa0f 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -58,8 +58,8 @@ foreach(name ${jpeg_names})
endforeach()
if(NOT JPEG_LIBRARY)
- find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names})
- find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug})
+ find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names} NAMES_PER_DIR)
+ find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug} NAMES_PER_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(JPEG)
mark_as_advanced(JPEG_LIBRARY_RELEASE JPEG_LIBRARY_DEBUG)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 31e7de68c0..f996d4c0fe 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -28,7 +28,7 @@ The following variables may be set to influence this module's behavior:
* ``OpenBLAS``
* ``FLAME``
- * ``Intel10_32`` (intel mkl v10 32 bit)
+ * ``Intel10_32`` (intel mkl v10 32 bit, threaded code)
* ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model)
* ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model)
* ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model)
@@ -162,6 +162,7 @@ macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _a
if(_libraries_work)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
+ NAMES_PER_DIR
PATHS ${_extaddlibdir}
PATH_SUFFIXES ${_subdirs}
)
@@ -289,7 +290,9 @@ if(BLAS_FOUND)
endif()
set(LAPACK_mkl_LIB_PATH_SUFFIXES
"compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
+ "compiler/lib/${LAPACK_mkl_ARCH_NAME}"
"mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
+ "mkl/lib/${LAPACK_mkl_ARCH_NAME}"
"lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}")
# First try empty lapack libs
diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake
index 9cd17eb05c..f478e4d240 100644
--- a/Modules/FindLTTngUST.cmake
+++ b/Modules/FindLTTngUST.cmake
@@ -5,6 +5,8 @@
FindLTTngUST
------------
+.. versionadded:: 3.6
+
Find
`Linux Trace Toolkit Next Generation (LTTng-UST) <http://lttng.org/>`__ library.
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 200d6bf8d6..4a79a1028b 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -43,8 +43,8 @@ This module will set the following variables in your project:
find_path(LIBLZMA_INCLUDE_DIR lzma.h )
if(NOT LIBLZMA_LIBRARY)
- find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma PATH_SUFFIXES lib)
- find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad PATH_SUFFIXES lib)
+ find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib)
+ find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad NAMES_PER_DIR PATH_SUFFIXES lib)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(LIBLZMA)
else()
diff --git a/Modules/FindLibinput.cmake b/Modules/FindLibinput.cmake
index c1fe45562e..88d5b2fb3a 100644
--- a/Modules/FindLibinput.cmake
+++ b/Modules/FindLibinput.cmake
@@ -5,6 +5,8 @@
FindLibinput
------------
+.. versionadded:: 3.14
+
Find libinput headers and library.
Imported Targets
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 25de562e2e..b2526c1209 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -760,7 +760,7 @@ function (_MPI_interrogate_compiler LANG)
# Save the explicitly given link directories
set(MPI_LINK_DIRECTORIES_LEFTOVER "${MPI_LINK_DIRECTORIES_WORK}")
- # An MPI compiler wrapper could have its MPI libraries in the implictly
+ # An MPI compiler wrapper could have its MPI libraries in the implicitly
# linked directories of the compiler itself.
if(DEFINED CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES)
list(APPEND MPI_LINK_DIRECTORIES_WORK "${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}")
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index e42c20654d..05ec3ae5df 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -992,7 +992,10 @@ function(matlab_add_mex)
endif()
endif()
- if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4") # For 9.4 (R2018a) and newer, add API macro
+ # For 9.4 (R2018a) and newer, add API macro.
+ # Add it for unknown versions too, just in case.
+ if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4"
+ OR Matlab_VERSION_STRING STREQUAL "unknown")
if(${${prefix}_R2018a})
set(MEX_API_MACRO "MATLAB_DEFAULT_RELEASE=R2018a")
else()
diff --git a/Modules/FindODBC.cmake b/Modules/FindODBC.cmake
index 3f710dbb95..884653c752 100644
--- a/Modules/FindODBC.cmake
+++ b/Modules/FindODBC.cmake
@@ -5,6 +5,8 @@
FindODBC
--------
+.. versionadded:: 3.12
+
Find an Open Database Connectivity (ODBC) include directory and library.
On Windows, when building with Visual Studio, this module assumes the ODBC
diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake
index 398dcf54f3..ed52e3591f 100644
--- a/Modules/FindOpenACC.cmake
+++ b/Modules/FindOpenACC.cmake
@@ -5,6 +5,8 @@
FindOpenACC
-----------
+.. versionadded:: 3.10
+
Detect OpenACC support by the compiler.
This module can be used to detect OpenACC support in a compiler.
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index 34a203e137..b3e5a9f8de 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -5,6 +5,8 @@
FindOpenCL
----------
+.. versionadded:: 3.1
+
Finds Open Computing Language (OpenCL)
IMPORTED Targets
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index ee40696eb7..9196851c6a 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -27,11 +27,11 @@ This module defines the following :prop_tgt:`IMPORTED` targets:
projects under MSVC. This target is available only if found OpenSSL version
is not less than 0.9.8. By linking this target the above OpenSSL targets can
be linked even if the project has different MSVC runtime configurations with
- the above OpenSSL targets. This target has no effect on plaforms other than
+ the above OpenSSL targets. This target has no effect on platforms other than
MSVC.
NOTE: Due to how ``INTERFACE_SOURCES`` are consumed by the consuming target,
-unless you certainly know what you are doing, it is always prefered to link
+unless you certainly know what you are doing, it is always preferred to link
``OpenSSL::applink`` target as ``PRIVATE`` and to make sure that this target is
linked at most once for the whole dependency graph of any library or
executable:
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index f1fe89af1e..fd0e4e93e9 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -76,8 +76,8 @@ if(ZLIB_FOUND)
# For compatibility with versions prior to this multi-config search, honor
# any PNG_LIBRARY that is already specified and skip the search.
if(NOT PNG_LIBRARY)
- find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES})
- find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG})
+ find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES} NAMES_PER_DIR)
+ find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG} NAMES_PER_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(PNG)
mark_as_advanced(PNG_LIBRARY_RELEASE PNG_LIBRARY_DEBUG)
diff --git a/Modules/FindPatch.cmake b/Modules/FindPatch.cmake
index 49988395bc..41086517d9 100644
--- a/Modules/FindPatch.cmake
+++ b/Modules/FindPatch.cmake
@@ -5,6 +5,8 @@
FindPatch
---------
+.. versionadded:: 3.10
+
The module defines the following variables:
``Patch_EXECUTABLE``
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index e09717db8b..f6d8fe3100 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -376,11 +376,13 @@ function(_protobuf_find_libraries name filename)
else()
find_library(${name}_LIBRARY_RELEASE
NAMES ${filename}
+ NAMES_PER_DIR
PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release)
mark_as_advanced(${name}_LIBRARY_RELEASE)
find_library(${name}_LIBRARY_DEBUG
NAMES ${filename}d ${filename}
+ NAMES_PER_DIR
PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
mark_as_advanced(${name}_LIBRARY_DEBUG)
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 01b82c4b21..d89029a263 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -5,6 +5,8 @@
FindPython
----------
+.. versionadded:: 3.12
+
Find Python interpreter, compiler and development environment (include
directories and libraries).
@@ -44,7 +46,7 @@ To manage concurrent versions 3 and 2 of Python, use :module:`FindPython3` and
If components ``Interpreter`` and ``Development`` (or one of its
sub-components) are both specified, this module search only for interpreter
with same platform architecture as the one defined by ``CMake``
- configuration. This contraint does not apply if only ``Interpreter``
+ configuration. This constraint does not apply if only ``Interpreter``
component is specified.
Imported Targets
@@ -155,7 +157,7 @@ This module will set the following variables in your project
``Python_NumPy_FOUND``
System has the NumPy.
``Python_NumPy_INCLUDE_DIRS``
- The NumPy include directries.
+ The NumPy include directories.
``Python_NumPy_VERSION``
The NumPy version.
@@ -189,7 +191,7 @@ Hints
* ``ON``: Corresponding flag is selected.
* ``OFF``: Corresponding flag is not selected.
- * ``ANY``: The two posibilties (``ON`` and ``OFF``) will be searched.
+ * ``ANY``: The two possibilities (``ON`` and ``OFF``) will be searched.
From this 3-tuple, various ABIs will be searched starting from the most
specialized to the most general. Moreover, ``debug`` versions will be
@@ -347,7 +349,7 @@ setting the following variables:
When an artifact is specified, all ``HINTS`` will be ignored and no search
will be performed for this artifact.
- If more than one artifact is specified, it is the user's responsability to
+ If more than one artifact is specified, it is the user's responsibility to
ensure the consistency of the various artifacts.
By default, this module supports multiple calls in different directories of a
@@ -355,7 +357,7 @@ project with different version/component requirements while providing correct
and consistent results for each call. To support this behavior, ``CMake`` cache
is not used in the traditional way which can be problematic for interactive
specification. So, to enable also interactive specification, module behavior
-can be controled with the following variable:
+can be controlled with the following variable:
``Python_ARTIFACTS_INTERACTIVE``
Selects the behavior of the module. This is a boolean variable:
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 84c0c73b60..f5ad4545bd 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -5,6 +5,8 @@
FindPython2
-----------
+.. versionadded:: 3.12
+
Find Python 2 interpreter, compiler and development environment (include
directories and libraries).
@@ -45,7 +47,7 @@ for you.
If components ``Interpreter`` and ``Development`` (or one of its
sub-components) are both specified, this module search only for interpreter
with same platform architecture as the one defined by ``CMake``
- configuration. This contraint does not apply if only ``Interpreter``
+ configuration. This constraint does not apply if only ``Interpreter``
component is specified.
Imported Targets
@@ -147,7 +149,7 @@ This module will set the following variables in your project
``Python2_NumPy_FOUND``
System has the NumPy.
``Python2_NumPy_INCLUDE_DIRS``
- The NumPy include directries.
+ The NumPy include directories.
``Python2_NumPy_VERSION``
The NumPy version.
@@ -294,7 +296,7 @@ setting the following variables:
When an artifact is specified, all ``HINTS`` will be ignored and no search
will be performed for this artifact.
- If more than one artifact is specified, it is the user's responsability to
+ If more than one artifact is specified, it is the user's responsibility to
ensure the consistency of the various artifacts.
By default, this module supports multiple calls in different directories of a
@@ -302,7 +304,7 @@ project with different version/component requirements while providing correct
and consistent results for each call. To support this behavior, ``CMake`` cache
is not used in the traditional way which can be problematic for interactive
specification. So, to enable also interactive specification, module behavior
-can be controled with the following variable:
+can be controlled with the following variable:
``Python2_ARTIFACTS_INTERACTIVE``
Selects the behavior of the module. This is a boolean variable:
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index f142c07ee6..bacdc4260b 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -5,6 +5,8 @@
FindPython3
-----------
+.. versionadded:: 3.12
+
Find Python 3 interpreter, compiler and development environment (include
directories and libraries).
@@ -45,7 +47,7 @@ for you.
If components ``Interpreter`` and ``Development`` (or one of its
sub-components) are both specified, this module search only for interpreter
with same platform architecture as the one defined by ``CMake``
- configuration. This contraint does not apply if only ``Interpreter``
+ configuration. This constraint does not apply if only ``Interpreter``
component is specified.
Imported Targets
@@ -156,7 +158,7 @@ This module will set the following variables in your project
``Python3_NumPy_FOUND``
System has the NumPy.
``Python3_NumPy_INCLUDE_DIRS``
- The NumPy include directries.
+ The NumPy include directories.
``Python3_NumPy_VERSION``
The NumPy version.
@@ -186,7 +188,7 @@ Hints
* ``ON``: Corresponding flag is selected.
* ``OFF``: Corresponding flag is not selected.
- * ``ANY``: The two posibilties (``ON`` and ``OFF``) will be searched.
+ * ``ANY``: The two possibilities (``ON`` and ``OFF``) will be searched.
From this 3-tuple, various ABIs will be searched starting from the most
specialized to the most general. Moreover, ``debug`` versions will be
@@ -344,7 +346,7 @@ setting the following variables:
When an artifact is specified, all ``HINTS`` will be ignored and no search
will be performed for this artifact.
- If more than one artifact is specified, it is the user's responsability to
+ If more than one artifact is specified, it is the user's responsibility to
ensure the consistency of the various artifacts.
By default, this module supports multiple calls in different directories of a
@@ -352,7 +354,7 @@ project with different version/component requirements while providing correct
and consistent results for each call. To support this behavior, ``CMake`` cache
is not used in the traditional way which can be problematic for interactive
specification. So, to enable also interactive specification, module behavior
-can be controled with the following variable:
+can be controlled with the following variable:
``Python3_ARTIFACTS_INTERACTIVE``
Selects the behavior of the module. This is a boolean variable:
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 399396802c..29b1ef8930 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -147,7 +147,7 @@ more-manual way. Several macros are available to add targets for such uses.
in: directories sources ts_files
options: flags to pass to lupdate, such as -extensions to specify
extensions for a directory scan.
- generates commands to create .ts (vie lupdate) and .qm
+ generates commands to create .ts (via lupdate) and .qm
(via lrelease) - files from directories and/or sources. The ts files are
created and/or updated in the source tree (unless given with full paths).
The qm files are generated in the build tree.
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 8d793a9750..59eddbbc99 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -5,24 +5,54 @@
FindSDL
-------
-Locate SDL library
+Locate the SDL library
-This module defines
-::
+Imported targets
+^^^^^^^^^^^^^^^^
- SDL_LIBRARY, the name of the library to link against
- SDL_FOUND, if false, do not try to link to SDL
- SDL_INCLUDE_DIR, where to find SDL.h
- SDL_VERSION_STRING, human-readable string containing the version of SDL
+This module defines the following :prop_tgt:`IMPORTED` target:
+``SDL::SDL``
+ The SDL library, if found
+Result variables
+^^^^^^^^^^^^^^^^
-This module responds to the flag:
+This module will set the following variables in your project:
+
+``SDL_INCLUDE_DIRS``
+ where to find SDL.h
+``SDL_LIBRARIES``
+ the name of the library to link against
+``SDL_FOUND``
+ if false, do not try to link to SDL
+``SDL_VERSION``
+ the human-readable string containing the version of SDL if found
+``SDL_VERSION_MAJOR``
+ SDL major version
+``SDL_VERSION_MINOR``
+ SDL minor version
+``SDL_VERSION_PATCH``
+ SDL patch version
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+These variables may optionally be set to help this module find the correct files:
-::
+``SDL_INCLUDE_DIR``
+ where to find SDL.h
+``SDL_LIBRARY``
+ the name of the library to link against
+
+
+Variables for locating SDL
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This module responds to the flag:
- SDL_BUILDING_LIBRARY
+``SDL_BUILDING_LIBRARY``
If this is defined, then no SDL_main will be linked in because
only applications need main().
Otherwise, it is assumed you are building an application and this
@@ -30,6 +60,15 @@ This module responds to the flag:
as part of the returned SDL_LIBRARY variable.
+Obsolete variables
+^^^^^^^^^^^^^^^^^^
+
+These variables are obsolete and provided for backwards compatibility:
+
+``SDL_VERSION_STRING``
+ the human-readable string containing the version of SDL if found.
+ Identical to SDL_VERSION
+
Don't forget to include SDLmain.h and SDLmain.m your project for the
OS X framework based version. (Other versions link to -lSDLmain which
@@ -52,15 +91,6 @@ does not get created.
$SDLDIR is an environment variable that would correspond to the
./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02
-Modified by Eric Wing. Added code to assist with automated building
-by using environmental variables and providing a more
-controlled/consistent search behavior. Added new modifications to
-recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
-Also corrected the header search path to follow "proper" SDL
-guidelines. Added a search for SDLmain which is needed by some
-platforms. Added a search for threads which is needed by some
-platforms. Added needed compile switches for MinGW.
-
On OSX, this will prefer the Framework version (if found) over others.
People will have to manually change the cache values of SDL_LIBRARY to
override this selection or set the CMake environment
@@ -174,13 +204,11 @@ if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h")
string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MAJOR "${SDL_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MINOR "${SDL_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_VERSION_PATCH "${SDL_VERSION_PATCH_LINE}")
- set(SDL_VERSION_STRING ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH})
unset(SDL_VERSION_MAJOR_LINE)
unset(SDL_VERSION_MINOR_LINE)
unset(SDL_VERSION_PATCH_LINE)
- unset(SDL_VERSION_MAJOR)
- unset(SDL_VERSION_MINOR)
- unset(SDL_VERSION_PATCH)
+ set(SDL_VERSION ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH})
+ set(SDL_VERSION_STRING ${SDL_VERSION})
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
@@ -188,3 +216,14 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR
VERSION_VAR SDL_VERSION_STRING)
+
+if(SDL_FOUND)
+ set(SDL_LIBRARIES ${SDL_LIBRARY})
+ set(SDL_INCLUDE_DIRS ${SDL_INCLUDE_DIR})
+ if(NOT TARGET SDL::SDL)
+ add_library(SDL::SDL INTERFACE IMPORTED)
+ set_target_properties(SDL::SDL PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${SDL_INCLUDE_DIR}"
+ INTERFACE_LINK_LIBRARIES "${SDL_LIBRARY}")
+ endif()
+endif()
diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake
index 374d7af6c2..88c7dd2098 100644
--- a/Modules/FindSQLite3.cmake
+++ b/Modules/FindSQLite3.cmake
@@ -5,6 +5,8 @@
FindSQLite3
-----------
+.. versionadded:: 3.14
+
Find the SQLite libraries, v3
IMPORTED targets
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index 00a3a415ac..3b74c94f0c 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -5,7 +5,14 @@
FindTIFF
--------
-Find the TIFF library (``libtiff``).
+Find the TIFF library (``libtiff``, https://libtiff.gitlab.io/libtiff/).
+
+Optional COMPONENTS
+^^^^^^^^^^^^^^^^^^^
+
+This module supports the optional component `CXX`, for use with the COMPONENTS
+argument of the :command:`find_package` command. This component has an associated
+imported target, as described below.
Imported targets
^^^^^^^^^^^^^^^^
@@ -15,6 +22,11 @@ This module defines the following :prop_tgt:`IMPORTED` targets:
``TIFF::TIFF``
The TIFF library, if found.
+``TIFF::CXX``
+ The C++ wrapper libtiffxx, if requested by the `COMPONENTS CXX` option,
+ if the compiler is not MSVC (which includes the C++ wrapper in libtiff),
+ and if found.
+
Result variables
^^^^^^^^^^^^^^^^
@@ -36,10 +48,19 @@ The following cache variables may also be set:
``TIFF_INCLUDE_DIR``
the directory containing the TIFF headers
-``TIFF_LIBRARY``
- the path to the TIFF library
+``TIFF_LIBRARY_RELEASE``
+ the path to the TIFF library for release configurations
+``TIFF_LIBRARY_DEBUG``
+ the path to the TIFF library for debug configurations
+``TIFFXX_LIBRARY_RELEASE``
+ the path to the TIFFXX library for release configurations
+``TIFFXX_LIBRARY_DEBUG``
+ the path to the TIFFXX library for debug configurations
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0057 NEW)
+
find_path(TIFF_INCLUDE_DIR tiff.h)
set(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3)
@@ -54,8 +75,6 @@ if(NOT TIFF_LIBRARY)
select_library_configurations(TIFF)
mark_as_advanced(TIFF_LIBRARY_RELEASE TIFF_LIBRARY_DEBUG)
endif()
-unset(TIFF_NAMES)
-unset(TIFF_NAMES_DEBUG)
if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
file(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str
@@ -66,13 +85,46 @@ if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
unset(tiff_version_str)
endif()
+foreach(_comp IN LISTS TIFF_FIND_COMPONENTS)
+ if(_comp STREQUAL "CXX")
+ if(MSVC)
+ # C++ bindings are built into the main tiff library.
+ set(TIFF_CXX_FOUND 1)
+ else()
+ foreach(name ${TIFF_NAMES})
+ list(APPEND TIFFXX_NAMES "${name}xx")
+ list(APPEND TIFFXX_NAMES_DEBUG "${name}xxd")
+ endforeach()
+ find_library(TIFFXX_LIBRARY_RELEASE NAMES ${TIFFXX_NAMES})
+ find_library(TIFFXX_LIBRARY_DEBUG NAMES ${TIFFXX_NAMES_DEBUG})
+ include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+ select_library_configurations(TIFFXX)
+ mark_as_advanced(TIFFXX_LIBRARY_RELEASE TIFFXX_LIBRARY_DEBUG)
+ unset(TIFFXX_NAMES)
+ unset(TIFFXX_NAMES_DEBUG)
+ if(TIFFXX_LIBRARY)
+ set(TIFF_CXX_FOUND 1)
+ endif()
+ endif()
+ endif()
+endforeach()
+unset(_comp)
+
+unset(TIFF_NAMES)
+unset(TIFF_NAMES_DEBUG)
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF
+ HANDLE_COMPONENTS
REQUIRED_VARS TIFF_LIBRARY TIFF_INCLUDE_DIR
VERSION_VAR TIFF_VERSION_STRING)
if(TIFF_FOUND)
set(TIFF_LIBRARIES ${TIFF_LIBRARY})
+ if("CXX" IN_LIST TIFF_FIND_COMPONENTS AND NOT MSVC)
+ list(APPEND TIFF_LIBRARIES ${TIFFXX_LIBRARY})
+ endif()
+
set(TIFF_INCLUDE_DIRS "${TIFF_INCLUDE_DIR}")
if(NOT TARGET TIFF::TIFF)
@@ -101,6 +153,41 @@ if(TIFF_FOUND)
IMPORTED_LOCATION_DEBUG "${TIFF_LIBRARY_DEBUG}")
endif()
endif()
+
+ if(NOT TARGET TIFF::CXX)
+ if(MSVC)
+ add_library(TIFF::CXX INTERFACE IMPORTED)
+ set_property(TARGET TIFF::CXX PROPERTY INTERFACE_LINK_LIBRARIES TIFF::TIFF)
+ else()
+ add_library(TIFF::CXX UNKNOWN IMPORTED)
+ set_property(TARGET TIFF::CXX PROPERTY INTERFACE_LINK_LIBRARIES TIFF::TIFF)
+ if(TIFF_INCLUDE_DIRS)
+ set_target_properties(TIFF::CXX PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${TIFF_INCLUDE_DIRS}")
+ endif()
+ if(EXISTS "${TIFFXX_LIBRARY}")
+ set_target_properties(TIFF::CXX PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${TIFFXX_LIBRARY}")
+ endif()
+ if(EXISTS "${TIFFXX_LIBRARY_RELEASE}")
+ set_property(TARGET TIFF::CXX APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(TIFF::CXX PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
+ IMPORTED_LOCATION_RELEASE "${TIFFXX_LIBRARY_RELEASE}")
+ endif()
+ if(EXISTS "${TIFFXX_LIBRARY_DEBUG}")
+ set_property(TARGET TIFF::CXX APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(TIFF::CXX PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
+ IMPORTED_LOCATION_DEBUG "${TIFFXX_LIBRARY_DEBUG}")
+ endif()
+ endif()
+ endif()
+
endif()
-mark_as_advanced(TIFF_INCLUDE_DIR TIFF_LIBRARY)
+mark_as_advanced(TIFF_INCLUDE_DIR)
+cmake_policy(POP)
diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake
index 4b999b62a0..0ec60133ce 100644
--- a/Modules/FindVulkan.cmake
+++ b/Modules/FindVulkan.cmake
@@ -5,6 +5,8 @@
FindVulkan
----------
+.. versionadded:: 3.7
+
Find Vulkan, which is a low-overhead, cross-platform 3D graphics
and computing API.
@@ -14,6 +16,9 @@ IMPORTED Targets
This module defines :prop_tgt:`IMPORTED` target ``Vulkan::Vulkan``, if
Vulkan has been found.
+This module defines :prop_tgt:`IMPORTED` target ``Vulkan::glslc``, if
+Vulkan and the GLSLC SPIR-V compiler has been found.
+
Result Variables
^^^^^^^^^^^^^^^^
@@ -23,10 +28,11 @@ This module defines the following variables::
Vulkan_INCLUDE_DIRS - include directories for Vulkan
Vulkan_LIBRARIES - link against this library to use Vulkan
-The module will also define two cache variables::
+The module will also define three cache variables::
- Vulkan_INCLUDE_DIR - the Vulkan include directory
- Vulkan_LIBRARY - the path to the Vulkan library
+ Vulkan_INCLUDE_DIR - the Vulkan include directory
+ Vulkan_LIBRARY - the path to the Vulkan library
+ Vulkan_GLSLC_EXECUTABLE - the path to the GLSL SPIR-V compiler
Hints
^^^^^
@@ -53,6 +59,11 @@ if(WIN32)
"$ENV{VULKAN_SDK}/Lib"
"$ENV{VULKAN_SDK}/Bin"
)
+ find_program(Vulkan_GLSLC_EXECUTABLE
+ NAMES glslc
+ HINTS
+ "$ENV{VULKAN_SDK}/Bin"
+ )
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
find_library(Vulkan_LIBRARY
NAMES vulkan-1
@@ -60,6 +71,11 @@ if(WIN32)
"$ENV{VULKAN_SDK}/Lib32"
"$ENV{VULKAN_SDK}/Bin32"
)
+ find_program(Vulkan_GLSLC_EXECUTABLE
+ NAMES glslc
+ HINTS
+ "$ENV{VULKAN_SDK}/Bin32"
+ )
endif()
else()
find_path(Vulkan_INCLUDE_DIR
@@ -68,6 +84,9 @@ else()
find_library(Vulkan_LIBRARY
NAMES vulkan
HINTS "$ENV{VULKAN_SDK}/lib")
+ find_program(Vulkan_GLSLC_EXECUTABLE
+ NAMES glslc
+ HINTS "$ENV{VULKAN_SDK}/bin")
endif()
set(Vulkan_LIBRARIES ${Vulkan_LIBRARY})
@@ -78,7 +97,7 @@ find_package_handle_standard_args(Vulkan
DEFAULT_MSG
Vulkan_LIBRARY Vulkan_INCLUDE_DIR)
-mark_as_advanced(Vulkan_INCLUDE_DIR Vulkan_LIBRARY)
+mark_as_advanced(Vulkan_INCLUDE_DIR Vulkan_LIBRARY Vulkan_GLSLC_EXECUTABLE)
if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan)
add_library(Vulkan::Vulkan UNKNOWN IMPORTED)
@@ -86,3 +105,8 @@ if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan)
IMPORTED_LOCATION "${Vulkan_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}")
endif()
+
+if(Vulkan_FOUND AND Vulkan_GLSLC_EXECUTABLE AND NOT TARGET Vulkan::glslc)
+ add_executable(Vulkan::glslc IMPORTED)
+ set_property(TARGET Vulkan::glslc PROPERTY IMPORTED_LOCATION "${Vulkan_GLSLC_EXECUTABLE}")
+endif()
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index aa83575ebe..958a22ebe3 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -59,6 +59,7 @@ and also the following more fine grained variables and targets:
X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
+ X11_Xaw_INCLUDE_PATH, X11_Xaw_LIB X11_Xaw_FOUND X11::Xaw
#]=======================================================================]
if (UNIX)
@@ -100,6 +101,7 @@ if (UNIX)
find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xaw_INCLUDE_PATH X11/Xaw/Intrinsic.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_INCLUDE_PATH xcb/xcb.h ${X11_INC_SEARCH_PATH})
find_path(X11_X11_xcb_INCLUDE_PATH X11/Xlib-xcb.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_icccm_INCLUDE_PATH xcb/xcb_icccm.h ${X11_INC_SEARCH_PATH})
@@ -134,6 +136,8 @@ if (UNIX)
find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
+
+
# Backwards compatibility.
set(X11_Xinput_INCLUDE_PATH "${X11_Xi_INCLUDE_PATH}")
set(X11_xf86misc_INCLUDE_PATH "${X11_Xxf86misc_INCLUDE_PATH}")
@@ -148,6 +152,7 @@ if (UNIX)
find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xaw_LIB Xaw ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH})
find_library(X11_X11_xcb_LIB X11-xcb ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_icccm_LIB xcb-icccm ${X11_LIB_SEARCH_PATH})
@@ -392,6 +397,10 @@ if (UNIX)
set(X11_SM_FOUND TRUE)
endif()
+ if(X11_Xaw_LIB AND X11_Xaw_INCLUDE_PATH)
+ set(X11_Xaw_FOUND TRUE)
+ endif()
+
# Most of the X11 headers will be in the same directories, avoid
# creating a huge list of duplicates.
if (X11_INCLUDE_DIR)
@@ -519,6 +528,14 @@ if (UNIX)
INTERFACE_INCLUDE_DIRECTORIES "${X11_Xau_INCLUDE_PATH}")
endif ()
+ if (X11_Xaw_FOUND AND NOT TARGET X11::Xaw)
+ add_library(X11::Xaw UNKNOWN IMPORTED)
+ set_target_properties(X11::Xaw PROPERTIES
+ IMPORTED_LOCATION "${X11_Xaw_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xaw_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xext;X11::Xmu;X11::Xt;X11::Xpm;X11::X11")
+ endif ()
+
if (X11_xcb_FOUND AND NOT TARGET X11::xcb)
add_library(X11::xcb UNKNOWN IMPORTED)
set_target_properties(X11::xcb PROPERTIES
@@ -817,6 +834,8 @@ if (UNIX)
X11_SM_LIB
X11_SM_INCLUDE_PATH
X11_XSync_INCLUDE_PATH
+ X11_Xaw_LIB
+ X11_Xaw_INCLUDE_PATH
)
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake
index 15721e1849..1f6e825138 100644
--- a/Modules/FindXCTest.cmake
+++ b/Modules/FindXCTest.cmake
@@ -5,6 +5,8 @@
FindXCTest
----------
+.. versionadded:: 3.3
+
Functions to help creating and executing XCTest bundles.
An XCTest bundle is a CFBundle with a special product-type
diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
index 54783e3948..a7fb766cae 100644
--- a/Modules/FindXalanC.cmake
+++ b/Modules/FindXalanC.cmake
@@ -5,6 +5,8 @@
FindXalanC
-----------
+.. versionadded:: 3.5
+
Find the Apache Xalan-C++ XSL transform processor headers and libraries.
Imported targets
diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake
index db78b61bdf..abe18c0570 100644
--- a/Modules/FindXercesC.cmake
+++ b/Modules/FindXercesC.cmake
@@ -5,6 +5,8 @@
FindXercesC
-----------
+.. versionadded:: 3.1
+
Find the Apache Xerces-C++ validating XML parser headers and libraries.
Imported targets
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index 35840f5f95..07fbc1bff8 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -307,7 +307,7 @@ if(WIN32_STYLE_FIND)
else ()
## WX is built as multiple small pieces libraries instead of monolithic
- ## DEPECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF
+ ## DEPRECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF
# option(WXWINDOWS_SEPARATE_LIBS_BUILD "Is wxWindows build with separate libs?" OFF)
## HACK: This is very dirty.
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 5c8c196711..c99c7725a9 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -61,7 +61,7 @@ is the name of a CMake variable to contain the results.
exclude "system" prerequisites. If <recurse> is set to 1 all
prerequisites will be found recursively, if set to 0 only direct
prerequisites are listed. <exepath> is the path to the top level
-executable used for @executable_path replacment on the Mac. <dirs> is
+executable used for @executable_path replacement on the Mac. <dirs> is
a list of paths where libraries might be found: these paths are
searched first when a target without any path info is given. Then
standard system locations are also searched: PATH, Framework
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index b210a77153..057b29d6da 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -5,6 +5,8 @@
GoogleTest
----------
+.. versionadded:: 3.9
+
This module defines functions to help use the Google Test infrastructure. Two
mechanisms for adding tests are provided. :command:`gtest_add_tests` has been
around for some time, originally via ``find_package(GTest)``.
@@ -493,7 +495,7 @@ function(gtest_discover_tests TARGET)
string(CONCAT ctest_include_content
"if(EXISTS \"$<TARGET_FILE:${TARGET}>\")" "\n"
" if(\"$<TARGET_FILE:${TARGET}>\" IS_NEWER_THAN \"${ctest_tests_file}\")" "\n"
- " include(GoogleTestAddTests)" "\n"
+ " include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
" gtest_discover_tests_impl(" "\n"
" TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
" TEST_EXECUTOR" " [==[" "${crosscompiling_emulator}" "]==]" "\n"
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index db35e3afb4..431b074c91 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -547,8 +547,8 @@ function(cpack_deb_prepare_package_vars)
message(FATAL_ERROR _description_failure_message)
endif()
- # Ok, description has set. According to the `Debian Policy Manual`_ the frist
- # line is a pacakge summary. Try to get it as well...
+ # Ok, description has set. According to the `Debian Policy Manual`_ the first
+ # line is a package summary. Try to get it as well...
# See also: https://www.debian.org/doc/debian-policy/ch-controlfields.html#description
elseif(CPACK_PACKAGE_DESCRIPTION_SUMMARY AND
NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY STREQUAL CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY)
diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake
index 759448b8ec..160eadae01 100644
--- a/Modules/Platform/Android-Clang.cmake
+++ b/Modules/Platform/Android-Clang.cmake
@@ -53,4 +53,7 @@ macro(__android_compiler_clang lang)
endif()
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
endif()
+ if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ set(_ANDROID_STL_NOSTDLIBXX 1)
+ endif()
endmacro()
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index 2225897fab..11a050425a 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -7,8 +7,8 @@
# 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.
-if(CMAKE_GENERATOR MATCHES "Visual Studio")
+# that functionality for now.
+if(CMAKE_GENERATOR_PLATFORM STREQUAL "Tegra-Android")
return()
endif()
@@ -27,6 +27,63 @@ endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+# If using Android tools for Visual Studio, compile a sample project to get the
+# sysroot.
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ if(NOT CMAKE_SYSROOT)
+ set(vcx_platform ${CMAKE_GENERATOR_PLATFORM})
+ if(CMAKE_GENERATOR MATCHES "Visual Studio 1[45]")
+ set(vcx_sysroot_var "Sysroot")
+ else()
+ set(vcx_sysroot_var "SysrootLink")
+ endif()
+ if(CMAKE_GENERATOR MATCHES "Visual Studio 14")
+ set(vcx_revision "2.0")
+ elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]")
+ set(vcx_revision "3.0")
+ else()
+ set(vcx_revision "")
+ endif()
+ configure_file(${CMAKE_ROOT}/Modules/Platform/Android/VCXProjInspect.vcxproj.in
+ ${CMAKE_PLATFORM_INFO_DIR}/VCXProjInspect.vcxproj @ONLY)
+ execute_process(
+ COMMAND "${CMAKE_VS_MSBUILD_COMMAND}" "VCXProjInspect.vcxproj"
+ "/p:Configuration=Debug" "/p:Platform=${vcx_platform}"
+ WORKING_DIRECTORY ${CMAKE_PLATFORM_INFO_DIR}
+ OUTPUT_VARIABLE VCXPROJ_INSPECT_OUTPUT
+ ERROR_VARIABLE VCXPROJ_INSPECT_OUTPUT
+ RESULT_VARIABLE VCXPROJ_INSPECT_RESULT
+ )
+ if(NOT CMAKE_SYSROOT AND VCXPROJ_INSPECT_OUTPUT MATCHES "CMAKE_SYSROOT=([^%\r\n]+)[\r\n]")
+ # Strip VS diagnostic output from the end of the line.
+ string(REGEX REPLACE " \\(TaskId:[0-9]*\\)$" "" _sysroot "${CMAKE_MATCH_1}")
+ if(EXISTS "${_sysroot}")
+ file(TO_CMAKE_PATH "${_sysroot}" CMAKE_SYSROOT)
+ endif()
+ endif()
+ if(VCXPROJ_INSPECT_RESULT)
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining the sysroot for the Android NDK failed.
+The output was:
+${VCXPROJ_INSPECT_RESULT}
+${VCXPROJ_INSPECT_OUTPUT}
+
+")
+ else()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining the sysroot for the Android NDK succeeded.
+The output was:
+${VCXPROJ_INSPECT_RESULT}
+${VCXPROJ_INSPECT_OUTPUT}
+
+")
+ endif()
+ endif()
+ if(NOT CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION)
+ set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang")
+ endif()
+endif()
+
# If the user provided CMAKE_SYSROOT for us, extract information from it.
set(_ANDROID_SYSROOT_NDK "")
set(_ANDROID_SYSROOT_API "")
diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake
index b90dd7a569..5019c28bdc 100644
--- a/Modules/Platform/Android-Initialize.cmake
+++ b/Modules/Platform/Android-Initialize.cmake
@@ -6,7 +6,7 @@
# 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.
+# that functionality for now.
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
return()
endif()
diff --git a/Modules/Platform/Android/Determine-Compiler-NDK.cmake b/Modules/Platform/Android/Determine-Compiler-NDK.cmake
index f56e1d5e58..a4d67c4387 100644
--- a/Modules/Platform/Android/Determine-Compiler-NDK.cmake
+++ b/Modules/Platform/Android/Determine-Compiler-NDK.cmake
@@ -184,7 +184,7 @@ foreach(line IN LISTS _ANDROID_TOOL_SETUP)
# We just matched the gcc toolchain name without version number. Save it for later.
set(_ANDROID_TOOL_NAME_ONLY "${CMAKE_MATCH_1}")
elseif(line MATCHES [[^TOOLCHAIN_PREFIX +:= +.*/bin/(\$\(TOOLCHAIN_NAME\)-) *$]])
- # We just matched the toolchain prefix with a name placholder, so substitute it.
+ # We just matched the toolchain prefix with a name placeholder, so substitute it.
# The gcc toolchain name will have already been extracted without version number from a TOOLCHAIN_NAME line.
string(REPLACE "$(TOOLCHAIN_NAME)" "${_ANDROID_TOOL_NAME_ONLY}" _ANDROID_TOOL_PREFIX "${CMAKE_MATCH_1}")
elseif(line MATCHES [[^LLVM_VERSION +:= +([0-9.]+)$]])
diff --git a/Modules/Platform/Android/VCXProjInspect.vcxproj.in b/Modules/Platform/Android/VCXProjInspect.vcxproj.in
new file mode 100644
index 0000000000..6919d2cd85
--- /dev/null
+++ b/Modules/Platform/Android/VCXProjInspect.vcxproj.in
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|@vcx_platform@">
+ <Configuration>Debug</Configuration>
+ <Platform>@vcx_platform@</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{14D44772-ECF7-47BD-9E29-BC62FAF940A5}</ProjectGuid>
+ <RootNamespace>VCXProjInspect</RootNamespace>
+ <Keyword>Android</Keyword>
+ <ApplicationType>Android</ApplicationType>
+ <ApplicationTypeRevision>@vcx_revision@</ApplicationTypeRevision>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'">
+ <PostBuildEvent>
+ <Command>%40echo CMAKE_SYSROOT=$(@vcx_sysroot_var@)</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 80e9a40195..d0874124d5 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -62,45 +62,36 @@ elseif("${CMAKE_GENERATOR}" MATCHES Xcode
# Find installed SDKs in either Xcode-4.3+ or pre-4.3 SDKs directory.
set(_CMAKE_OSX_SDKS_DIR "")
if(OSX_DEVELOPER_ROOT)
- foreach(d Platforms/MacOSX.platform/Developer/SDKs SDKs)
- file(GLOB _CMAKE_OSX_SDKS ${OSX_DEVELOPER_ROOT}/${d}/*)
+ foreach(_d Platforms/MacOSX.platform/Developer/SDKs SDKs)
+ file(GLOB _CMAKE_OSX_SDKS ${OSX_DEVELOPER_ROOT}/${_d}/*)
if(_CMAKE_OSX_SDKS)
- set(_CMAKE_OSX_SDKS_DIR ${OSX_DEVELOPER_ROOT}/${d})
+ set(_CMAKE_OSX_SDKS_DIR ${OSX_DEVELOPER_ROOT}/${_d})
break()
endif()
endforeach()
endif()
if(_CMAKE_OSX_SDKS_DIR)
- # Select SDK for current OSX version accounting for the known
- # specially named SDKs.
- set(_CMAKE_OSX_SDKS_VER_SUFFIX_10.4 "u")
- set(_CMAKE_OSX_SDKS_VER_SUFFIX_10.3 ".9")
-
- # find the latest SDK
+ # Find the latest SDK as recommended by Apple (Technical Q&A QA1806)
set(_CMAKE_OSX_LATEST_SDK_VERSION "0.0")
file(GLOB _CMAKE_OSX_SDKS RELATIVE "${_CMAKE_OSX_SDKS_DIR}" "${_CMAKE_OSX_SDKS_DIR}/MacOSX*.sdk")
foreach(_SDK ${_CMAKE_OSX_SDKS})
- if(_SDK MATCHES "MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk" AND CMAKE_MATCH_1 VERSION_GREATER ${_CMAKE_OSX_LATEST_SDK_VERSION})
+ if(IS_DIRECTORY "${_CMAKE_OSX_SDKS_DIR}/${_SDK}"
+ AND _SDK MATCHES "MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk"
+ AND CMAKE_MATCH_1 VERSION_GREATER ${_CMAKE_OSX_LATEST_SDK_VERSION})
set(_CMAKE_OSX_LATEST_SDK_VERSION "${CMAKE_MATCH_1}")
endif()
endforeach()
- # pick an SDK that works
- set(_CMAKE_OSX_SYSROOT_DEFAULT)
- foreach(ver ${CMAKE_OSX_DEPLOYMENT_TARGET}
- ${_CURRENT_OSX_VERSION}
- ${_CMAKE_OSX_LATEST_SDK_VERSION})
- set(_CMAKE_OSX_DEPLOYMENT_TARGET ${ver})
- set(_CMAKE_OSX_SDKS_VER ${_CMAKE_OSX_DEPLOYMENT_TARGET}${_CMAKE_OSX_SDKS_VER_SUFFIX_${_CMAKE_OSX_DEPLOYMENT_TARGET}})
- set(_CMAKE_OSX_SYSROOT_CHECK "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CMAKE_OSX_SDKS_VER}.sdk")
- if(IS_DIRECTORY "${_CMAKE_OSX_SYSROOT_CHECK}")
- set(_CMAKE_OSX_SYSROOT_DEFAULT "${_CMAKE_OSX_SYSROOT_CHECK}")
- break()
- endif()
- endforeach()
+ if(NOT _CMAKE_OSX_LATEST_SDK_VERSION STREQUAL "0.0")
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CMAKE_OSX_LATEST_SDK_VERSION}.sdk")
+ else()
+ message(WARNING "Could not find any valid SDKs in ${_CMAKE_OSX_SDKS_DIR}")
+ endif()
- if(NOT CMAKE_CROSSCOMPILING AND NOT CMAKE_OSX_DEPLOYMENT_TARGET AND _CURRENT_OSX_VERSION VERSION_LESS _CMAKE_OSX_DEPLOYMENT_TARGET)
+ if(NOT CMAKE_CROSSCOMPILING AND NOT CMAKE_OSX_DEPLOYMENT_TARGET
+ AND (_CURRENT_OSX_VERSION VERSION_LESS _CMAKE_OSX_LATEST_SDK_VERSION
+ OR _CMAKE_OSX_LATEST_SDK_VERSION STREQUAL "0.0"))
set(CMAKE_OSX_DEPLOYMENT_TARGET ${_CURRENT_OSX_VERSION} CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value." FORCE)
endif()
@@ -113,8 +104,8 @@ endif()
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
# Choose the type based on the current value.
set(_CMAKE_OSX_SYSROOT_TYPE STRING)
-foreach(v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT)
- if("x${${v}}" MATCHES "/")
+foreach(_v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT)
+ if("x${${_v}}" MATCHES "/")
set(_CMAKE_OSX_SYSROOT_TYPE PATH)
break()
endif()
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index 9572a7ebb0..425a13f451 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -22,7 +22,7 @@ set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
# set flags for gcc support
include(Platform/UnixPaths)
-# Look in both 32-bit and 64-bit implict link directories, but tell
+# Look in both 32-bit and 64-bit implicit link directories, but tell
# CMake not to pass the paths to the linker. The linker will find the
# library for the proper architecture. In the future we should detect
# which path will be used by the linker. Since the pointer type size
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 2476a338e6..e272da94fb 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -356,6 +356,11 @@ macro(__windows_compiler_msvc lang)
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-target ")
+ else()
+ set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "--target=")
+ endif()
# '-flto=thin' available since Clang 3.9 and Xcode 8
# * http://clang.llvm.org/docs/ThinLTO.html#clang-llvm
# * https://trac.macports.org/wiki/XcodeVersionInfo
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index a60e05e6ee..b75eb5e22e 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -83,7 +83,7 @@ Defines the following command for use with ``SWIG``:
``SOURCES``
List of sources for the library. Files with extension ``.i`` will be
identified as sources for the ``SWIG`` tool. Other files will be handled in
- the standard way. This behavior can be overriden by specifying the variable
+ the standard way. This behavior can be overridden by specifying the variable
``SWIG_SOURCE_FILE_EXTENSIONS``.
.. note::
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 23d81b5fcd..5100035b39 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -5,6 +5,8 @@
WriteCompilerDetectionHeader
----------------------------
+.. versionadded:: 3.1
+
This module provides the function ``write_compiler_detection_header()``.
This function can be used to generate a file suitable for preprocessor
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 1b6bb00d4c..ee8767ff14 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -412,6 +412,8 @@ set(SRCS
cmSourceFileLocationKind.h
cmSourceGroup.cxx
cmSourceGroup.h
+ cmStandardLevelResolver.cxx
+ cmStandardLevelResolver.h
cmState.cxx
cmState.h
cmStateDirectory.cxx
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index cdadbe7f87..091f97fb0a 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 18)
-set(CMake_VERSION_PATCH 1)
+set(CMake_VERSION_PATCH 20200806)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 3d5fe6b9de..560e5c1dc5 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -696,57 +696,57 @@ int cmCPackDebGenerator::createDeb()
const char* debian_pkg_source =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE");
- if (debian_pkg_source && *debian_pkg_source) {
+ if (cmNonempty(debian_pkg_source)) {
controlValues["Source"] = debian_pkg_source;
}
const char* debian_pkg_dep =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_DEPENDS");
- if (debian_pkg_dep && *debian_pkg_dep) {
+ if (cmNonempty(debian_pkg_dep)) {
controlValues["Depends"] = debian_pkg_dep;
}
const char* debian_pkg_rec =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_RECOMMENDS");
- if (debian_pkg_rec && *debian_pkg_rec) {
+ if (cmNonempty(debian_pkg_rec)) {
controlValues["Recommends"] = debian_pkg_rec;
}
const char* debian_pkg_sug =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SUGGESTS");
- if (debian_pkg_sug && *debian_pkg_sug) {
+ if (cmNonempty(debian_pkg_sug)) {
controlValues["Suggests"] = debian_pkg_sug;
}
const char* debian_pkg_url =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_HOMEPAGE");
- if (debian_pkg_url && *debian_pkg_url) {
+ if (cmNonempty(debian_pkg_url)) {
controlValues["Homepage"] = debian_pkg_url;
}
const char* debian_pkg_predep =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PREDEPENDS");
- if (debian_pkg_predep && *debian_pkg_predep) {
+ if (cmNonempty(debian_pkg_predep)) {
controlValues["Pre-Depends"] = debian_pkg_predep;
}
const char* debian_pkg_enhances =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_ENHANCES");
- if (debian_pkg_enhances && *debian_pkg_enhances) {
+ if (cmNonempty(debian_pkg_enhances)) {
controlValues["Enhances"] = debian_pkg_enhances;
}
const char* debian_pkg_breaks =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_BREAKS");
- if (debian_pkg_breaks && *debian_pkg_breaks) {
+ if (cmNonempty(debian_pkg_breaks)) {
controlValues["Breaks"] = debian_pkg_breaks;
}
const char* debian_pkg_conflicts =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_CONFLICTS");
- if (debian_pkg_conflicts && *debian_pkg_conflicts) {
+ if (cmNonempty(debian_pkg_conflicts)) {
controlValues["Conflicts"] = debian_pkg_conflicts;
}
const char* debian_pkg_provides =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_PROVIDES");
- if (debian_pkg_provides && *debian_pkg_provides) {
+ if (cmNonempty(debian_pkg_provides)) {
controlValues["Provides"] = debian_pkg_provides;
}
const char* debian_pkg_replaces =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_REPLACES");
- if (debian_pkg_replaces && *debian_pkg_replaces) {
+ if (cmNonempty(debian_pkg_replaces)) {
controlValues["Replaces"] = debian_pkg_replaces;
}
@@ -756,7 +756,7 @@ int cmCPackDebGenerator::createDeb()
const char* debian_pkg_shlibs =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SHLIBS");
const bool gen_shibs = this->IsOn("CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS") &&
- debian_pkg_shlibs && *debian_pkg_shlibs;
+ cmNonempty(debian_pkg_shlibs);
if (gen_shibs) {
cmGeneratedFileStream out;
out.Open(shlibsfilename, false, true);
@@ -832,11 +832,11 @@ int cmCPackDebGenerator::createDbgsymDDeb()
const char* debian_pkg_source =
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_SOURCE");
- if (debian_pkg_source && *debian_pkg_source) {
+ if (cmNonempty(debian_pkg_source)) {
controlValues["Source"] = debian_pkg_source;
}
const char* debian_build_ids = this->GetOption("GEN_BUILD_IDS");
- if (debian_build_ids && *debian_build_ids) {
+ if (cmNonempty(debian_build_ids)) {
controlValues["Build-Ids"] = debian_build_ids;
}
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index fe7abf4223..cefb906bb6 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -8,7 +8,9 @@
#include <map>
#include <CoreFoundation/CoreFoundation.h>
+#include <cm3p/kwiml/abi.h>
+#include "cmsys/Base64.h"
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
@@ -18,6 +20,7 @@
#include "cmGeneratedFileStream.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmXMLWriter.h"
#ifdef HAVE_CoreServices
// For the old LocaleStringToLangAndRegionCodes() function, to convert
@@ -26,36 +29,28 @@
# include <CoreServices/CoreServices.h>
#endif
-static const char* SLAHeader =
- "data 'LPic' (5000) {\n"
- " $\"0002 0011 0003 0001 0000 0000 0002 0000\"\n"
- " $\"0008 0003 0000 0001 0004 0000 0004 0005\"\n"
- " $\"0000 000E 0006 0001 0005 0007 0000 0007\"\n"
- " $\"0008 0000 0047 0009 0000 0034 000A 0001\"\n"
- " $\"0035 000B 0001 0020 000C 0000 0011 000D\"\n"
- " $\"0000 005B 0004 0000 0033 000F 0001 000C\"\n"
- " $\"0010 0000 000B 000E 0000\"\n"
- "};\n"
- "\n";
-
-static const char* SLASTREnglish =
- "resource 'STR#' (5002, \"English\") {\n"
- " {\n"
- " \"English\",\n"
- " \"Agree\",\n"
- " \"Disagree\",\n"
- " \"Print\",\n"
- " \"Save...\",\n"
- " \"You agree to the License Agreement terms when you click \"\n"
- " \"the \\\"Agree\\\" button.\",\n"
- " \"Software License Agreement\",\n"
- " \"This text cannot be saved. This disk may be full or locked, "
- "or the \"\n"
- " \"file may be locked.\",\n"
- " \"Unable to print. Make sure you have selected a printer.\"\n"
- " }\n"
- "};\n"
- "\n";
+static const uint16_t DefaultLpic[] = {
+ /* clang-format off */
+ 0x0002, 0x0011, 0x0003, 0x0001, 0x0000, 0x0000, 0x0002, 0x0000,
+ 0x0008, 0x0003, 0x0000, 0x0001, 0x0004, 0x0000, 0x0004, 0x0005,
+ 0x0000, 0x000E, 0x0006, 0x0001, 0x0005, 0x0007, 0x0000, 0x0007,
+ 0x0008, 0x0000, 0x0047, 0x0009, 0x0000, 0x0034, 0x000A, 0x0001,
+ 0x0035, 0x000B, 0x0001, 0x0020, 0x000C, 0x0000, 0x0011, 0x000D,
+ 0x0000, 0x005B, 0x0004, 0x0000, 0x0033, 0x000F, 0x0001, 0x000C,
+ 0x0010, 0x0000, 0x000B, 0x000E, 0x0000
+ /* clang-format on */
+};
+
+static const std::vector<std::string> DefaultMenu = {
+ { "English", "Agree", "Disagree", "Print", "Save...",
+ // NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
+ "You agree to the License Agreement terms when "
+ "you click the \"Agree\" button.",
+ "Software License Agreement",
+ "This text cannot be saved. "
+ "This disk may be full or locked, or the file may be locked.",
+ "Unable to print. Make sure you have selected a printer." }
+};
cmCPackDragNDropGenerator::cmCPackDragNDropGenerator()
: singleLicense(false)
@@ -523,22 +518,43 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
}
}
+ // Create the final compressed read-only disk image ...
+ std::ostringstream final_image_command;
+ final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
+ final_image_command << " convert \"" << temp_image << "\"";
+ final_image_command << " -format ";
+ final_image_command << cpack_dmg_format;
+ final_image_command << " -imagekey";
+ final_image_command << " zlib-level=9";
+ final_image_command << " -o \"" << output_file << "\"";
+
+ std::string convert_error;
+
+ if (!this->RunCommand(final_image_command, &convert_error)) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error compressing disk image." << std::endl
+ << convert_error
+ << std::endl);
+
+ return 0;
+ }
+
if (!cpack_license_file.empty() || !slaDirectory.empty()) {
// Use old hardcoded style if sla_dir is not set
bool oldStyle = slaDirectory.empty();
- std::string sla_r =
- cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/sla.r");
+ std::string sla_xml =
+ cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/sla.xml");
std::vector<std::string> languages;
if (!oldStyle) {
cmExpandList(cpack_dmg_languages, languages);
}
- cmGeneratedFileStream ofs(sla_r);
- ofs << "#include <CoreServices/CoreServices.r>\n\n";
+ std::vector<uint16_t> header_data;
if (oldStyle) {
- ofs << SLAHeader;
- ofs << "\n";
+ header_data = std::vector<uint16_t>(
+ DefaultLpic,
+ DefaultLpic + (sizeof(DefaultLpic) / sizeof(*DefaultLpic)));
} else {
/*
* LPic Layout
@@ -558,8 +574,6 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
* }
*/
- // Create vector first for readability, then iterate to write to ofs
- std::vector<uint16_t> header_data;
header_data.push_back(0);
header_data.push_back(languages.size());
for (size_t i = 0; i < languages.size(); ++i) {
@@ -596,52 +610,50 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
header_data.push_back(0);
#endif
}
- ofs << "data 'LPic' (5000) {\n";
- ofs << std::hex << std::uppercase << std::setfill('0');
-
- for (size_t i = 0; i < header_data.size(); ++i) {
- if (i % 8 == 0) {
- ofs << " $\"";
- }
-
- ofs << std::setw(4) << header_data[i];
+ }
- if (i % 8 == 7 || i == header_data.size() - 1) {
- ofs << "\"\n";
- } else {
- ofs << " ";
- }
+ RezDoc rez;
+
+ {
+ RezDict lpic = { {}, 5000, {} };
+ lpic.Data.reserve(header_data.size() * sizeof(header_data[0]));
+ for (uint16_t x : header_data) {
+ // LPic header is big-endian.
+ char* d = reinterpret_cast<char*>(&x);
+#if KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_LITTLE
+ lpic.Data.push_back(d[1]);
+ lpic.Data.push_back(d[0]);
+#else
+ lpic.Data.push_back(d[0]);
+ lpic.Data.push_back(d[1]);
+#endif
}
- ofs << "};\n\n";
- // Reset ofs options
- ofs << std::dec << std::nouppercase << std::setfill(' ');
+ rez.LPic.Entries.emplace_back(std::move(lpic));
}
bool have_write_license_error = false;
std::string error;
if (oldStyle) {
- if (!this->WriteLicense(ofs, 0, "", cpack_license_file, &error)) {
+ if (!this->WriteLicense(rez, 0, "", cpack_license_file, &error)) {
have_write_license_error = true;
}
} else {
for (size_t i = 0; i < languages.size() && !have_write_license_error;
++i) {
if (singleLicense) {
- if (!this->WriteLicense(ofs, i + 5000, languages[i],
+ if (!this->WriteLicense(rez, i + 5000, languages[i],
cpack_license_file, &error)) {
have_write_license_error = true;
}
} else {
- if (!this->WriteLicense(ofs, i + 5000, languages[i], "", &error)) {
+ if (!this->WriteLicense(rez, i + 5000, languages[i], "", &error)) {
have_write_license_error = true;
}
}
}
}
- ofs.Close();
-
if (have_write_license_error) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error writing license file to SLA." << std::endl
@@ -650,96 +662,27 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0;
}
- if (temp_image_format != "UDZO") {
- temp_image_format = "UDZO";
- // convert to UDZO to enable unflatten/flatten
- std::string temp_udzo = cmStrCat(
- this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), "/temp-udzo.dmg");
+ this->WriteRezXML(sla_xml, rez);
- std::ostringstream udco_image_command;
- udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
- udco_image_command << " convert \"" << temp_image << "\"";
- udco_image_command << " -format UDZO";
- udco_image_command << " -ov -o \"" << temp_udzo << "\"";
-
- if (!this->RunCommand(udco_image_command, &error)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error converting to UDCO dmg for adding SLA."
- << std::endl
- << error << std::endl);
- return 0;
- }
- temp_image = temp_udzo;
- }
-
- // unflatten dmg
- std::ostringstream unflatten_command;
- unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
- unflatten_command << " unflatten ";
- unflatten_command << "\"" << temp_image << "\"";
-
- if (!this->RunCommand(unflatten_command, &error)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error unflattening dmg for adding SLA." << std::endl
- << error
- << std::endl);
- return 0;
- }
-
- // Rez the SLA
+ // Create the final compressed read-only disk image ...
std::ostringstream embed_sla_command;
- embed_sla_command << this->GetOption("CPACK_COMMAND_REZ");
- const char* sysroot = this->GetOption("CPACK_OSX_SYSROOT");
- if (sysroot && sysroot[0] != '\0') {
- embed_sla_command << " -isysroot \"" << sysroot << "\"";
- }
- embed_sla_command << " \"" << sla_r << "\"";
- embed_sla_command << " -a -o ";
- embed_sla_command << "\"" << temp_image << "\"";
-
- if (!this->RunCommand(embed_sla_command, &error)) {
+ embed_sla_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
+ embed_sla_command << " udifrez";
+ embed_sla_command << " -xml";
+ embed_sla_command << " \"" << sla_xml << "\"";
+ embed_sla_command << " FIXME_WHY_IS_THIS_ARGUMENT_NEEDED";
+ embed_sla_command << " \"" << output_file << "\"";
+ std::string embed_error;
+ if (!this->RunCommand(embed_sla_command, &embed_error)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error adding SLA." << std::endl
- << error << std::endl);
- return 0;
- }
-
- // flatten dmg
- std::ostringstream flatten_command;
- flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
- flatten_command << " flatten ";
- flatten_command << "\"" << temp_image << "\"";
+ "Error compressing disk image." << std::endl
+ << embed_error
+ << std::endl);
- if (!this->RunCommand(flatten_command, &error)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error flattening dmg for adding SLA." << std::endl
- << error
- << std::endl);
return 0;
}
}
- // Create the final compressed read-only disk image ...
- std::ostringstream final_image_command;
- final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
- final_image_command << " convert \"" << temp_image << "\"";
- final_image_command << " -format ";
- final_image_command << cpack_dmg_format;
- final_image_command << " -imagekey";
- final_image_command << " zlib-level=9";
- final_image_command << " -o \"" << output_file << "\"";
-
- std::string convert_error;
-
- if (!this->RunCommand(final_image_command, &convert_error)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error compressing disk image." << std::endl
- << convert_error
- << std::endl);
-
- return 0;
- }
-
return 1;
}
@@ -788,10 +731,67 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
return GetComponentPackageFileName(package_file_name, componentName, false);
}
-bool cmCPackDragNDropGenerator::WriteLicense(
- cmGeneratedFileStream& outputStream, int licenseNumber,
- std::string licenseLanguage, const std::string& licenseFile,
- std::string* error)
+void cmCPackDragNDropGenerator::WriteRezXML(std::string const& file,
+ RezDoc const& rez)
+{
+ cmGeneratedFileStream fxml(file);
+ cmXMLWriter xml(fxml);
+ xml.StartDocument();
+ xml.StartElement("plist");
+ xml.Attribute("version", "1.0");
+ xml.StartElement("dict");
+ this->WriteRezArray(xml, rez.LPic);
+ this->WriteRezArray(xml, rez.Menu);
+ this->WriteRezArray(xml, rez.Text);
+ this->WriteRezArray(xml, rez.RTF);
+ xml.EndElement(); // dict
+ xml.EndElement(); // plist
+ xml.EndDocument();
+ fxml.Close();
+}
+
+void cmCPackDragNDropGenerator::WriteRezArray(cmXMLWriter& xml,
+ RezArray const& array)
+{
+ if (array.Entries.empty()) {
+ return;
+ }
+ xml.StartElement("key");
+ xml.Content(array.Key);
+ xml.EndElement(); // key
+ xml.StartElement("array");
+ for (RezDict const& dict : array.Entries) {
+ this->WriteRezDict(xml, dict);
+ }
+ xml.EndElement(); // array
+}
+
+void cmCPackDragNDropGenerator::WriteRezDict(cmXMLWriter& xml,
+ RezDict const& dict)
+{
+ std::vector<char> base64buf(dict.Data.size() * 3 / 2 + 5);
+ size_t base64len =
+ cmsysBase64_Encode(dict.Data.data(), dict.Data.size(),
+ reinterpret_cast<unsigned char*>(base64buf.data()), 0);
+ std::string base64data(base64buf.data(), base64len);
+ /* clang-format off */
+ xml.StartElement("dict");
+ xml.StartElement("key"); xml.Content("Attributes"); xml.EndElement();
+ xml.StartElement("string"); xml.Content("0x0000"); xml.EndElement();
+ xml.StartElement("key"); xml.Content("Data"); xml.EndElement();
+ xml.StartElement("data"); xml.Content(base64data); xml.EndElement();
+ xml.StartElement("key"); xml.Content("ID"); xml.EndElement();
+ xml.StartElement("string"); xml.Content(dict.ID); xml.EndElement();
+ xml.StartElement("key"); xml.Content("Name"); xml.EndElement();
+ xml.StartElement("string"); xml.Content(dict.Name); xml.EndElement();
+ xml.EndElement(); // dict
+ /* clang-format on */
+}
+
+bool cmCPackDragNDropGenerator::WriteLicense(RezDoc& rez, size_t licenseNumber,
+ std::string licenseLanguage,
+ const std::string& licenseFile,
+ std::string* error)
{
if (!licenseFile.empty() && !singleLicense) {
licenseNumber = 5002;
@@ -799,11 +799,11 @@ bool cmCPackDragNDropGenerator::WriteLicense(
}
// License file
- std::string license_format = "TEXT";
+ RezArray* licenseArray = &rez.Text;
std::string actual_license;
if (!licenseFile.empty()) {
if (cmHasLiteralSuffix(licenseFile, ".rtf")) {
- license_format = "RTF ";
+ licenseArray = &rez.RTF;
}
actual_license = licenseFile;
} else {
@@ -812,85 +812,86 @@ bool cmCPackDragNDropGenerator::WriteLicense(
if (cmSystemTools::FileExists(license_wo_ext + ".txt")) {
actual_license = license_wo_ext + ".txt";
} else {
- license_format = "RTF ";
+ licenseArray = &rez.RTF;
actual_license = license_wo_ext + ".rtf";
}
}
- // License header
- outputStream << "data '" << license_format << "' (" << licenseNumber
- << ", \"" << licenseLanguage << "\") {\n";
// License body
- cmsys::ifstream license_ifs;
- license_ifs.open(actual_license.c_str());
- if (license_ifs.is_open()) {
- while (license_ifs.good()) {
- std::string line;
- std::getline(license_ifs, line);
- if (!line.empty()) {
- EscapeQuotesAndBackslashes(line);
- std::vector<std::string> lines;
- if (!this->BreakLongLine(line, lines, error)) {
- return false;
- }
- for (auto const& l : lines) {
- outputStream << " \"" << l << "\"\n";
- }
- }
- outputStream << " \"\\n\"\n";
+ {
+ RezDict license = { licenseLanguage, licenseNumber, {} };
+ std::vector<std::string> lines;
+ if (!this->ReadFile(actual_license, lines, error)) {
+ return false;
}
- license_ifs.close();
+ this->EncodeLicense(license, lines);
+ licenseArray->Entries.emplace_back(std::move(license));
}
- // End of License
- outputStream << "};\n\n";
- if (!licenseFile.empty() && !singleLicense) {
- outputStream << SLASTREnglish;
- } else {
- // Menu header
- outputStream << "resource 'STR#' (" << licenseNumber << ", \""
- << licenseLanguage << "\") {\n";
- outputStream << " {\n";
-
- // Menu body
- cmsys::ifstream menu_ifs;
- menu_ifs.open(
- (slaDirectory + "/" + licenseLanguage + ".menu.txt").c_str());
- if (menu_ifs.is_open()) {
- size_t lines_written = 0;
- while (menu_ifs.good()) {
- // Lines written from original file, not from broken up lines
- std::string line;
- std::getline(menu_ifs, line);
- if (!line.empty()) {
- EscapeQuotesAndBackslashes(line);
- std::vector<std::string> lines;
- if (!this->BreakLongLine(line, lines, error)) {
- return false;
- }
- for (size_t i = 0; i < lines.size(); ++i) {
- std::string comma;
- // We need a comma after every complete string,
- // but not on the very last line
- if (lines_written != 8 && i == lines.size() - 1) {
- comma = ",";
- } else {
- comma = "";
- }
- outputStream << " \"" << lines[i] << "\"" << comma << "\n";
- }
- ++lines_written;
- }
+ // Menu body
+ {
+ RezDict menu = { licenseLanguage, licenseNumber, {} };
+ if (!licenseFile.empty() && !singleLicense) {
+ this->EncodeMenu(menu, DefaultMenu);
+ } else {
+ std::vector<std::string> lines;
+ std::string actual_menu =
+ slaDirectory + "/" + licenseLanguage + ".menu.txt";
+ if (!this->ReadFile(actual_menu, lines, error)) {
+ return false;
}
- menu_ifs.close();
+ this->EncodeMenu(menu, lines);
}
+ rez.Menu.Entries.emplace_back(std::move(menu));
+ }
+
+ return true;
+}
+
+void cmCPackDragNDropGenerator::EncodeLicense(
+ RezDict& dict, std::vector<std::string> const& lines)
+{
+ // License text uses CR newlines.
+ for (std::string const& l : lines) {
+ dict.Data.insert(dict.Data.end(), l.begin(), l.end());
+ dict.Data.push_back('\r');
+ }
+ dict.Data.push_back('\r');
+}
- // End of menu
- outputStream << " }\n";
- outputStream << "};\n";
- outputStream << "\n";
+void cmCPackDragNDropGenerator::EncodeMenu(
+ RezDict& dict, std::vector<std::string> const& lines)
+{
+ // Menu resources start with a big-endian uint16_t for number of lines:
+ {
+ uint16_t numLines = static_cast<uint16_t>(lines.size());
+ char* d = reinterpret_cast<char*>(&numLines);
+#if KWIML_ABI_ENDIAN_ID == KWIML_ABI_ENDIAN_ID_LITTLE
+ dict.Data.push_back(d[1]);
+ dict.Data.push_back(d[0]);
+#else
+ dict.Data.push_back(d[0]);
+ dict.Data.push_back(d[1]);
+#endif
}
+ // Each line starts with a uint8_t length, plus the bytes themselves:
+ for (std::string const& l : lines) {
+ dict.Data.push_back(static_cast<unsigned char>(l.length()));
+ dict.Data.insert(dict.Data.end(), l.begin(), l.end());
+ }
+}
+bool cmCPackDragNDropGenerator::ReadFile(std::string const& file,
+ std::vector<std::string>& lines,
+ std::string* error)
+{
+ cmsys::ifstream ifs(file);
+ std::string line;
+ while (std::getline(ifs, line)) {
+ if (!this->BreakLongLine(line, lines, error)) {
+ return false;
+ }
+ }
return true;
}
@@ -898,7 +899,7 @@ bool cmCPackDragNDropGenerator::BreakLongLine(const std::string& line,
std::vector<std::string>& lines,
std::string* error)
{
- const size_t max_line_length = 512;
+ const size_t max_line_length = 255;
size_t line_length = max_line_length;
for (size_t i = 0; i < line.size(); i += line_length) {
line_length = max_line_length;
@@ -913,25 +914,10 @@ bool cmCPackDragNDropGenerator::BreakLongLine(const std::string& line,
if (line_length == 0) {
*error = "Please make sure there are no words "
"(or character sequences not broken up by spaces or newlines) "
- "in your license file which are more than 512 characters long.";
+ "in your license file which are more than 255 characters long.";
return false;
}
lines.push_back(line.substr(i, line_length));
}
return true;
}
-
-void cmCPackDragNDropGenerator::EscapeQuotesAndBackslashes(std::string& line)
-{
- std::string::size_type backslash_pos = line.find('\\');
- while (backslash_pos != std::string::npos) {
- line.replace(backslash_pos, 1, "\\\\");
- backslash_pos = line.find('\\', backslash_pos + 2);
- }
-
- std::string::size_type quote_pos = line.find('\"');
- while (quote_pos != std::string::npos) {
- line.replace(quote_pos, 1, "\\\"");
- quote_pos = line.find('\"', quote_pos + 2);
- }
-}
diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h
index f8c86c06d7..dbd190ced0 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.h
+++ b/Source/CPack/cmCPackDragNDropGenerator.h
@@ -14,6 +14,7 @@
#include "cmCPackGenerator.h"
class cmGeneratedFileStream;
+class cmXMLWriter;
/** \class cmCPackDragNDropGenerator
* \brief A generator for OSX drag-n-drop installs
@@ -45,12 +46,40 @@ private:
std::string slaDirectory;
bool singleLicense;
- bool WriteLicense(cmGeneratedFileStream& outputStream, int licenseNumber,
+ struct RezDict
+ {
+ std::string Name;
+ size_t ID;
+ std::vector<unsigned char> Data;
+ };
+
+ struct RezArray
+ {
+ std::string Key;
+ std::vector<RezDict> Entries;
+ };
+
+ struct RezDoc
+ {
+ RezArray LPic = { "LPic", {} };
+ RezArray Menu = { "STR#", {} };
+ RezArray Text = { "TEXT", {} };
+ RezArray RTF = { "RTF ", {} };
+ };
+
+ void WriteRezXML(std::string const& file, RezDoc const& rez);
+ void WriteRezArray(cmXMLWriter& xml, RezArray const& array);
+ void WriteRezDict(cmXMLWriter& xml, RezDict const& dict);
+
+ bool WriteLicense(RezDoc& rez, size_t licenseNumber,
std::string licenseLanguage,
const std::string& licenseFile, std::string* error);
+ void EncodeLicense(RezDict& dict, std::vector<std::string> const& lines);
+ void EncodeMenu(RezDict& dict, std::vector<std::string> const& lines);
+ bool ReadFile(std::string const& file, std::vector<std::string>& lines,
+ std::string* error);
bool BreakLongLine(const std::string& line, std::vector<std::string>& lines,
std::string* error);
- void EscapeQuotesAndBackslashes(std::string& line);
};
#endif
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 11e1aeccef..0bc8456710 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -61,7 +61,7 @@ int cmCPackExternalGenerator::PackageFiles()
}
const char* packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT");
- if (packageScript && *packageScript) {
+ if (cmNonempty(packageScript)) {
if (!cmSystemTools::FileIsFullPath(packageScript)) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
@@ -75,6 +75,12 @@ int cmCPackExternalGenerator::PackageFiles()
if (cmSystemTools::GetErrorOccuredFlag() || !res) {
return 0;
}
+
+ const char* builtPackagesStr =
+ this->GetOption("CPACK_EXTERNAL_BUILT_PACKAGES");
+ if (builtPackagesStr) {
+ cmExpandList(builtPackagesStr, this->packageFileNames, false);
+ }
}
return 1;
@@ -205,7 +211,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
const char* defaultDirectoryPermissions =
this->Parent->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
- if (defaultDirectoryPermissions && *defaultDirectoryPermissions) {
+ if (cmNonempty(defaultDirectoryPermissions)) {
root["defaultDirectoryPermissions"] = defaultDirectoryPermissions;
}
if (cmIsInternallyOn(this->Parent->GetOption("CPACK_SET_DESTDIR"))) {
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 288dc58a77..3880f6551d 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -216,7 +216,7 @@ int cmCPackGenerator::InstallProject()
mode_t* default_dir_mode = nullptr;
const char* default_dir_install_permissions =
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
- if (default_dir_install_permissions && *default_dir_install_permissions) {
+ if (cmNonempty(default_dir_install_permissions)) {
std::vector<std::string> items =
cmExpandedList(default_dir_install_permissions);
for (const auto& arg : items) {
@@ -264,6 +264,23 @@ int cmCPackGenerator::InstallProject()
return 0;
}
+ // Run pre-build actions
+ const char* preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS");
+ if (preBuildScripts) {
+ const auto scripts = cmExpandedList(preBuildScripts, false);
+ for (const auto& script : scripts) {
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT,
+ "Executing pre-build script: " << script << std::endl);
+
+ if (!this->MakefileMap->ReadListFile(script)) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "The pre-build script not found: " << script
+ << std::endl);
+ return 0;
+ }
+ }
+ }
+
if (setDestDir) {
cmSystemTools::PutEnv("DESTDIR=");
}
@@ -276,7 +293,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
{
(void)setDestDir;
const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
- if (installCommands && *installCommands) {
+ if (cmNonempty(installCommands)) {
std::string tempInstallDirectoryEnv =
cmStrCat("CMAKE_INSTALL_PREFIX=", tempInstallDirectory);
cmSystemTools::PutEnv(tempInstallDirectoryEnv);
@@ -327,13 +344,14 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
}
const char* installDirectories =
this->GetOption("CPACK_INSTALLED_DIRECTORIES");
- if (installDirectories && *installDirectories) {
+ if (cmNonempty(installDirectories)) {
std::vector<std::string> installDirectoriesVector =
cmExpandedList(installDirectories);
if (installDirectoriesVector.size() % 2 != 0) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
- "CPACK_INSTALLED_DIRECTORIES should contain pairs of <directory> and "
+ "CPACK_INSTALLED_DIRECTORIES should contain pairs of <directory> "
+ "and "
"<subdirectory>. The <subdirectory> can be '.' to be installed in "
"the toplevel directory of installation."
<< std::endl);
@@ -475,10 +493,10 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
"- Install script: " << installScript << std::endl);
if (setDestDir) {
- // For DESTDIR based packaging, use the *project* CMAKE_INSTALL_PREFIX
- // underneath the tempInstallDirectory. The value of the project's
- // CMAKE_INSTALL_PREFIX is sent in here as the value of the
- // CPACK_INSTALL_PREFIX variable.
+ // For DESTDIR based packaging, use the *project*
+ // CMAKE_INSTALL_PREFIX underneath the tempInstallDirectory. The
+ // value of the project's CMAKE_INSTALL_PREFIX is sent in here as the
+ // value of the CPACK_INSTALL_PREFIX variable.
std::string dir;
if (this->GetOption("CPACK_INSTALL_PREFIX")) {
@@ -523,7 +541,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
const char* cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
const char* cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR");
std::string absoluteDestFiles;
- if (cmakeProjects && *cmakeProjects) {
+ if (cmNonempty(cmakeProjects)) {
if (!cmakeGenerator) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_INSTALL_CMAKE_PROJECTS is specified, but "
@@ -576,7 +594,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string installTypesVar = "CPACK_" +
cmSystemTools::UpperCase(project.Component) + "_INSTALL_TYPES";
const char* installTypes = this->GetOption(installTypesVar);
- if (installTypes && *installTypes) {
+ if (cmNonempty(installTypes)) {
std::vector<std::string> installTypesVector =
cmExpandedList(installTypes);
for (std::string const& installType : installTypesVector) {
@@ -589,7 +607,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string componentsVar =
"CPACK_COMPONENTS_" + cmSystemTools::UpperCase(project.Component);
const char* components = this->GetOption(componentsVar);
- if (components && *components) {
+ if (cmNonempty(components)) {
cmExpandList(components, componentsVector);
for (std::string const& comp : componentsVector) {
project.Components.push_back(
@@ -753,7 +771,7 @@ int cmCPackGenerator::InstallCMakeProject(
const char* default_dir_inst_permissions =
this->GetOption("CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
- if (default_dir_inst_permissions && *default_dir_inst_permissions) {
+ if (cmNonempty(default_dir_inst_permissions)) {
mf.AddDefinition("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS",
default_dir_inst_permissions);
}
@@ -811,7 +829,7 @@ int cmCPackGenerator::InstallCMakeProject(
* - Because it was already used for component install
* in order to put things in subdirs...
*/
- cmSystemTools::PutEnv(std::string("DESTDIR=") + tempInstallDirectory);
+ cmSystemTools::PutEnv("DESTDIR=" + tempInstallDirectory);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Creating directory: '" << dir << "'" << std::endl);
@@ -965,7 +983,7 @@ void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
const char* value)
{
const char* def = this->MakefileMap->GetDefinition(op);
- if (def && *def) {
+ if (cmNonempty(def)) {
return;
}
this->SetOption(op, value);
@@ -1076,6 +1094,25 @@ int cmCPackGenerator::DoPackage()
return 0;
}
}
+ // Run post-build actions
+ const char* postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS");
+ if (postBuildScripts) {
+ this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES",
+ cmJoin(this->packageFileNames, ";"));
+
+ const auto scripts = cmExpandedList(postBuildScripts, false);
+ for (const auto& script : scripts) {
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT,
+ "Executing post-build script: " << script << std::endl);
+
+ if (!this->MakefileMap->ReadListFile(script)) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "The post-build script not found: " << script
+ << std::endl);
+ return 0;
+ }
+ }
+ }
/* Prepare checksum algorithm*/
const char* algo = this->GetOption("CPACK_PACKAGE_CHECKSUM");
@@ -1178,7 +1215,7 @@ bool cmCPackGenerator::IsOn(const std::string& name) const
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
{
const char* ret = this->MakefileMap->GetDefinition(op);
- if (ret && *ret) {
+ if (cmNonempty(ret)) {
return cmIsOff(ret);
}
return false;
@@ -1289,7 +1326,7 @@ bool cmCPackGenerator::ConfigureFile(const std::string& inName,
bool copyOnly /* = false */)
{
return this->MakefileMap->ConfigureFile(inName, outName, copyOnly, true,
- false) == 1;
+ false, true) == 1;
}
int cmCPackGenerator::CleanTemporaryDirectory()
@@ -1378,7 +1415,8 @@ int cmCPackGenerator::PrepareGroupingKind()
<< std::endl);
}
- // if user specified packaging method, override the default packaging method
+ // if user specified packaging method, override the default packaging
+ // method
if (method != UNKNOWN_COMPONENT_PACKAGE_METHOD) {
componentPackageMethod = method;
}
@@ -1471,7 +1509,7 @@ cmCPackInstallationType* cmCPackGenerator::GetInstallationType(
installType->Name = name;
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
- if (displayName && *displayName) {
+ if (cmNonempty(displayName)) {
installType->DisplayName = displayName;
} else {
installType->DisplayName = installType->Name;
@@ -1493,7 +1531,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
"CPACK_COMPONENT_" + cmsys::SystemTools::UpperCase(name);
component->Name = name;
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
- if (displayName && *displayName) {
+ if (cmNonempty(displayName)) {
component->DisplayName = displayName;
} else {
component->DisplayName = component->Name;
@@ -1505,17 +1543,17 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
const char* archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
- if (archiveFile && *archiveFile) {
+ if (cmNonempty(archiveFile)) {
component->ArchiveFile = archiveFile;
}
const char* plist = this->GetOption(macroPrefix + "_PLIST");
- if (plist && *plist) {
+ if (cmNonempty(plist)) {
component->Plist = plist;
}
const char* groupName = this->GetOption(macroPrefix + "_GROUP");
- if (groupName && *groupName) {
+ if (cmNonempty(groupName)) {
component->Group = GetComponentGroup(projectName, groupName);
component->Group->Components.push_back(component);
} else {
@@ -1523,13 +1561,13 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
}
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION");
- if (description && *description) {
+ if (cmNonempty(description)) {
component->Description = description;
}
// Determine the installation types.
const char* installTypes = this->GetOption(macroPrefix + "_INSTALL_TYPES");
- if (installTypes && *installTypes) {
+ if (cmNonempty(installTypes)) {
std::vector<std::string> installTypesVector =
cmExpandedList(installTypes);
for (std::string const& installType : installTypesVector) {
@@ -1540,7 +1578,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
// Determine the component dependencies.
const char* depends = this->GetOption(macroPrefix + "_DEPENDS");
- if (depends && *depends) {
+ if (cmNonempty(depends)) {
std::vector<std::string> dependsVector = cmExpandedList(depends);
for (std::string const& depend : dependsVector) {
cmCPackComponent* child = GetComponent(projectName, depend);
@@ -1564,21 +1602,21 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
// Define the group
group->Name = name;
const char* displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
- if (displayName && *displayName) {
+ if (cmNonempty(displayName)) {
group->DisplayName = displayName;
} else {
group->DisplayName = group->Name;
}
const char* description = this->GetOption(macroPrefix + "_DESCRIPTION");
- if (description && *description) {
+ if (cmNonempty(description)) {
group->Description = description;
}
group->IsBold = this->IsOn(macroPrefix + "_BOLD_TITLE");
group->IsExpandedByDefault = this->IsOn(macroPrefix + "_EXPANDED");
const char* parentGroupName =
this->GetOption(macroPrefix + "_PARENT_GROUP");
- if (parentGroupName && *parentGroupName) {
+ if (cmNonempty(parentGroupName)) {
group->ParentGroup = GetComponentGroup(projectName, parentGroupName);
group->ParentGroup->Subgroups.push_back(group);
} else {
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 058b090e0c..2109b4e349 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -696,7 +696,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
const char* userUploadDirectory =
this->GetOption("CPACK_UPLOAD_DIRECTORY");
std::string uploadDirectory;
- if (userUploadDirectory && *userUploadDirectory) {
+ if (cmNonempty(userUploadDirectory)) {
uploadDirectory = userUploadDirectory;
} else {
uploadDirectory =
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index db426b2ffd..a18cbb49bc 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -182,10 +182,9 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std::vector<std::string> extraPaths;
std::vector<std::string> failed;
fullPath = cmCTestTestHandler::FindExecutable(
- this->CTest, this->ConfigSample.c_str(), resultingConfig, extraPaths,
- failed);
+ this->CTest, this->ConfigSample, resultingConfig, extraPaths, failed);
if (!fullPath.empty() && !resultingConfig.empty()) {
- this->CTest->SetConfigType(resultingConfig.c_str());
+ this->CTest->SetConfigType(resultingConfig);
}
out << "Using config sample with results: " << fullPath << " and "
<< resultingConfig << std::endl;
@@ -296,9 +295,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
extraPaths.push_back(tempPath);
}
std::vector<std::string> failed;
- fullPath =
- cmCTestTestHandler::FindExecutable(this->CTest, this->TestCommand.c_str(),
- resultingConfig, extraPaths, failed);
+ fullPath = cmCTestTestHandler::FindExecutable(
+ this->CTest, this->TestCommand, resultingConfig, extraPaths, failed);
if (!cmSystemTools::FileExists(fullPath)) {
out << "Could not find path to executable, perhaps it was not built: "
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 44fdc29452..8aab167cf4 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -12,6 +12,7 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -38,10 +39,9 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
this->Handler = handler;
- const char* ctestBuildCommand =
- this->Makefile->GetDefinition("CTEST_BUILD_COMMAND");
- if (ctestBuildCommand && *ctestBuildCommand) {
- this->CTest->SetCTestConfiguration("MakeCommand", ctestBuildCommand,
+ cmProp ctestBuildCommand = this->Makefile->GetDef("CTEST_BUILD_COMMAND");
+ if (cmNonempty(ctestBuildCommand)) {
+ this->CTest->SetCTestConfiguration("MakeCommand", *ctestBuildCommand,
this->Quiet);
} else {
const char* cmakeGeneratorName =
@@ -56,7 +56,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
this->Makefile->GetDefinition("CTEST_BUILD_CONFIGURATION");
const char* cmakeBuildConfiguration = !this->Configuration.empty()
? this->Configuration.c_str()
- : ((ctestBuildConfiguration && *ctestBuildConfiguration)
+ : (cmNonempty(ctestBuildConfiguration)
? ctestBuildConfiguration
: this->CTest->GetConfigType().c_str());
@@ -67,7 +67,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
? this->Target.c_str()
: this->Makefile->GetDefinition("CTEST_BUILD_TARGET");
- if (cmakeGeneratorName && *cmakeGeneratorName) {
+ if (cmNonempty(cmakeGeneratorName)) {
if (!cmakeBuildConfiguration) {
cmakeBuildConfiguration = "Release";
}
@@ -108,7 +108,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:" << buildCommand << "\n",
this->Quiet);
- this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str(),
+ this->CTest->SetCTestConfiguration("MakeCommand", buildCommand,
this->Quiet);
} else {
std::ostringstream ostr;
@@ -123,16 +123,15 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
}
}
- if (const char* useLaunchers =
- this->Makefile->GetDefinition("CTEST_USE_LAUNCHERS")) {
- this->CTest->SetCTestConfiguration("UseLaunchers", useLaunchers,
+ if (cmProp useLaunchers = this->Makefile->GetDef("CTEST_USE_LAUNCHERS")) {
+ this->CTest->SetCTestConfiguration("UseLaunchers", *useLaunchers,
this->Quiet);
}
- if (const char* labelsForSubprojects =
- this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ if (cmProp labelsForSubprojects =
+ this->Makefile->GetDef("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
- labelsForSubprojects, this->Quiet);
+ *labelsForSubprojects, this->Quiet);
}
handler->SetQuiet(this->Quiet);
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index f42c3f18ae..ac57130c5b 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -12,6 +12,7 @@
#include "cmCTestConfigureHandler.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -38,16 +39,16 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
return nullptr;
}
- const char* ctestConfigureCommand =
- this->Makefile->GetDefinition("CTEST_CONFIGURE_COMMAND");
+ cmProp ctestConfigureCommand =
+ this->Makefile->GetDef("CTEST_CONFIGURE_COMMAND");
- if (ctestConfigureCommand && *ctestConfigureCommand) {
+ if (cmNonempty(ctestConfigureCommand)) {
this->CTest->SetCTestConfiguration("ConfigureCommand",
- ctestConfigureCommand, this->Quiet);
+ *ctestConfigureCommand, this->Quiet);
} else {
const char* cmakeGeneratorName =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR");
- if (cmakeGeneratorName && *cmakeGeneratorName) {
+ if (cmNonempty(cmakeGeneratorName)) {
const std::string& source_dir =
this->CTest->GetCTestConfiguration("SourceDirectory");
if (source_dir.empty()) {
@@ -107,7 +108,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
const char* cmakeGeneratorPlatform =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_PLATFORM");
- if (cmakeGeneratorPlatform && *cmakeGeneratorPlatform) {
+ if (cmNonempty(cmakeGeneratorPlatform)) {
cmakeConfigureCommand += " \"-A";
cmakeConfigureCommand += cmakeGeneratorPlatform;
cmakeConfigureCommand += "\"";
@@ -115,7 +116,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
const char* cmakeGeneratorToolset =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_TOOLSET");
- if (cmakeGeneratorToolset && *cmakeGeneratorToolset) {
+ if (cmNonempty(cmakeGeneratorToolset)) {
cmakeConfigureCommand += " \"-T";
cmakeConfigureCommand += cmakeGeneratorToolset;
cmakeConfigureCommand += "\"";
@@ -125,8 +126,8 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
cmakeConfigureCommand += source_dir;
cmakeConfigureCommand += "\"";
- this->CTest->SetCTestConfiguration(
- "ConfigureCommand", cmakeConfigureCommand.c_str(), this->Quiet);
+ this->CTest->SetCTestConfiguration("ConfigureCommand",
+ cmakeConfigureCommand, this->Quiet);
} else {
this->SetError(
"Configure command is not specified. If this is a "
@@ -136,10 +137,10 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
}
}
- if (const char* labelsForSubprojects =
- this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ if (cmProp labelsForSubprojects =
+ this->Makefile->GetDef("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
- labelsForSubprojects, this->Quiet);
+ *labelsForSubprojects, this->Quiet);
}
cmCTestConfigureHandler* handler = this->CTest->GetConfigureHandler();
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index b839c10ad4..093b2d16dd 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -469,8 +469,8 @@ int cmCTestCoverageHandler::ProcessHandler()
}
const std::string fileName = cmSystemTools::GetFilenameName(fullFileName);
- std::string shortFileName =
- this->CTest->GetShortPathToFile(fullFileName.c_str());
+ const std::string shortFileName =
+ this->CTest->GetShortPathToFile(fullFileName);
const cmCTestCoverageHandlerContainer::SingleFileCoverageVector& fcov =
file.second;
covLogXML.StartElement("File");
@@ -538,7 +538,7 @@ int cmCTestCoverageHandler::ProcessHandler()
covSumXML.StartElement("File");
covSumXML.Attribute("Name", fileName);
covSumXML.Attribute("FullPath",
- this->CTest->GetShortPathToFile(fullFileName.c_str()));
+ this->CTest->GetShortPathToFile(fullFileName));
covSumXML.Attribute("Covered", tested + untested > 0 ? "true" : "false");
covSumXML.Element("LOCTested", tested);
covSumXML.Element("LOCUnTested", untested);
@@ -1887,8 +1887,8 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
// start the file output
covLogXML.StartElement("File");
covLogXML.Attribute("Name", i->first);
- covLogXML.Attribute(
- "FullPath", this->CTest->GetShortPathToFile(i->second.c_str()));
+ covLogXML.Attribute("FullPath",
+ this->CTest->GetShortPathToFile(i->second));
covLogXML.StartElement("Report");
// write the bullseye header
line = 0;
@@ -2064,8 +2064,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
total_untested += (totalFunctions - functionsCalled);
std::string fileName = cmSystemTools::GetFilenameName(file);
- std::string shortFileName =
- this->CTest->GetShortPathToFile(file.c_str());
+ std::string shortFileName = this->CTest->GetShortPathToFile(file);
float cper = static_cast<float>(percentBranch + percentFunction);
if (totalBranches > 0) {
@@ -2266,7 +2265,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir)
// is the end of the target-wide labels.
inTarget = false;
- source = this->CTest->GetShortPathToFile(line.c_str());
+ source = this->CTest->GetShortPathToFile(line);
// Label the source with the target labels.
LabelSet& labelSet = this->SourceLabels[source];
@@ -2320,7 +2319,7 @@ bool cmCTestCoverageHandler::IsFilteredOut(std::string const& source)
// The source is filtered out if it does not have any labels in
// common with the filter set.
- std::string shortSrc = this->CTest->GetShortPathToFile(source.c_str());
+ std::string shortSrc = this->CTest->GetShortPathToFile(source);
auto li = this->SourceLabels.find(shortSrc);
if (li != this->SourceLabels.end()) {
return !this->IntersectsFilter(li->second);
@@ -2342,14 +2341,14 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
std::vector<std::string> files = gl.GetFiles();
for (std::string const& f : files) {
if (this->ShouldIDoCoverage(f, cont->SourceDir, cont->BinaryDir)) {
- extraMatches.insert(this->CTest->GetShortPathToFile(f.c_str()));
+ extraMatches.insert(this->CTest->GetShortPathToFile(f));
}
}
}
if (!extraMatches.empty()) {
for (auto const& i : cont->TotalCoverage) {
- std::string shortPath = this->CTest->GetShortPathToFile(i.first.c_str());
+ std::string shortPath = this->CTest->GetShortPathToFile(i.first);
extraMatches.erase(shortPath);
}
}
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index cc0b4ed0cf..a71f550c96 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -100,7 +100,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
<< std::endl);
return false;
}
- this->CTest->AddSubmitFile(part, ostr.str().c_str());
+ this->CTest->AddSubmitFile(part, ostr.str());
return true;
}
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index a755632c5c..03b7173561 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -14,6 +14,7 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
@@ -125,23 +126,21 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
// CTEST_CONFIGURATION_TYPE script variable if it is defined.
// The current script value trumps the -C argument on the command
// line.
- const char* ctestConfigType =
- this->Makefile->GetDefinition("CTEST_CONFIGURATION_TYPE");
+ cmProp ctestConfigType = this->Makefile->GetDef("CTEST_CONFIGURATION_TYPE");
if (ctestConfigType) {
- this->CTest->SetConfigType(ctestConfigType);
+ this->CTest->SetConfigType(*ctestConfigType);
}
if (!this->Build.empty()) {
this->CTest->SetCTestConfiguration(
- "BuildDirectory", cmSystemTools::CollapseFullPath(this->Build).c_str(),
+ "BuildDirectory", cmSystemTools::CollapseFullPath(this->Build),
this->Quiet);
} else {
std::string const& bdir =
this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY");
if (!bdir.empty()) {
this->CTest->SetCTestConfiguration(
- "BuildDirectory", cmSystemTools::CollapseFullPath(bdir).c_str(),
- this->Quiet);
+ "BuildDirectory", cmSystemTools::CollapseFullPath(bdir), this->Quiet);
} else {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"CTEST_BINARY_DIRECTORY not set" << std::endl;);
@@ -151,20 +150,18 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
cmCTestLog(this->CTest, DEBUG,
"Set source directory to: " << this->Source << std::endl);
this->CTest->SetCTestConfiguration(
- "SourceDirectory", cmSystemTools::CollapseFullPath(this->Source).c_str(),
+ "SourceDirectory", cmSystemTools::CollapseFullPath(this->Source),
this->Quiet);
} else {
this->CTest->SetCTestConfiguration(
"SourceDirectory",
cmSystemTools::CollapseFullPath(
- this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY"))
- .c_str(),
+ this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY")),
this->Quiet);
}
- if (const char* changeId =
- this->Makefile->GetDefinition("CTEST_CHANGE_ID")) {
- this->CTest->SetCTestConfiguration("ChangeId", changeId, this->Quiet);
+ if (cmProp changeId = this->Makefile->GetDef("CTEST_CHANGE_ID")) {
+ this->CTest->SetCTestConfiguration("ChangeId", *changeId, this->Quiet);
}
cmCTestLog(this->CTest, DEBUG, "Initialize handler" << std::endl;);
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 85b8ab15f3..822049e2eb 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -326,6 +326,9 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
case cmCTestMemCheckHandler::BOUNDS_CHECKER:
xml.Attribute("Checker", "BoundsChecker");
break;
+ case cmCTestMemCheckHandler::CUDA_MEMCHECK:
+ xml.Attribute("Checker", "CudaMemcheck");
+ break;
case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
xml.Attribute("Checker", "AddressSanitizer");
break;
@@ -351,7 +354,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(cmXMLWriter& xml)
cmCTestMemCheckHandler::TestResultsVector::size_type cc;
for (cmCTestTestResult const& result : this->TestResults) {
std::string testPath = result.Path + "/" + result.Name;
- xml.Element("Test", this->CTest->GetShortPathToFile(testPath.c_str()));
+ xml.Element("Test", this->CTest->GetShortPathToFile(testPath));
}
xml.EndElement(); // TestList
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
@@ -465,6 +468,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
} else if (testerName.find("BC") != std::string::npos) {
this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
+ } else if (testerName.find("cuda-memcheck") != std::string::npos) {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK;
} else {
this->MemoryTesterStyle = cmCTestMemCheckHandler::UNKNOWN;
}
@@ -485,6 +490,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTester =
this->CTest->GetCTestConfiguration("BoundsCheckerCommand");
this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
+ } else if (cmSystemTools::FileExists(
+ this->CTest->GetCTestConfiguration("CudaMemcheckCommand"))) {
+ this->MemoryTester =
+ this->CTest->GetCTestConfiguration("CudaMemcheckCommand");
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK;
}
if (this->CTest->GetCTestConfiguration("MemoryCheckType") ==
"AddressSanitizer") {
@@ -528,6 +538,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
} else if (checkType == "DrMemory") {
this->MemoryTesterStyle = cmCTestMemCheckHandler::DRMEMORY;
+ } else if (checkType == "CudaMemcheck") {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::CUDA_MEMCHECK;
}
}
if (this->MemoryTester.empty()) {
@@ -553,6 +565,10 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
.empty()) {
memoryTesterOptions =
this->CTest->GetCTestConfiguration("DrMemoryCommandOptions");
+ } else if (!this->CTest->GetCTestConfiguration("CudaMemcheckCommandOptions")
+ .empty()) {
+ memoryTesterOptions =
+ this->CTest->GetCTestConfiguration("CudaMemcheckCommandOptions");
}
this->MemoryTesterOptions =
cmSystemTools::ParseArguments(memoryTesterOptions);
@@ -686,6 +702,18 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterOptions.emplace_back("/M");
break;
}
+ case cmCTestMemCheckHandler::CUDA_MEMCHECK: {
+ // cuda-memcheck separates flags from arguments by spaces
+ if (this->MemoryTesterOptions.empty()) {
+ this->MemoryTesterOptions.emplace_back("--tool");
+ this->MemoryTesterOptions.emplace_back("memcheck");
+ this->MemoryTesterOptions.emplace_back("--leak-check");
+ this->MemoryTesterOptions.emplace_back("full");
+ }
+ this->MemoryTesterDynamicOptions.emplace_back("--log-file");
+ this->MemoryTesterDynamicOptions.push_back(this->MemoryTesterOutputFile);
+ break;
+ }
// these are almost the same but the env var used is different
case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
case cmCTestMemCheckHandler::LEAK_SANITIZER:
@@ -771,6 +799,8 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str,
return this->ProcessMemCheckSanitizerOutput(str, log, results);
case cmCTestMemCheckHandler::BOUNDS_CHECKER:
return this->ProcessMemCheckBoundsCheckerOutput(str, log, results);
+ case cmCTestMemCheckHandler::CUDA_MEMCHECK:
+ return this->ProcessMemCheckCudaOutput(str, log, results);
default:
log.append("\nMemory checking style used was: ");
log.append("None that I know");
@@ -1103,6 +1133,118 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
return defects == 0;
}
+bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput(
+ const std::string& str, std::string& log, std::vector<int>& results)
+{
+ std::vector<std::string> lines;
+ cmsys::SystemTools::Split(str, lines);
+ bool unlimitedOutput = false;
+ if (str.find("CTEST_FULL_OUTPUT") != std::string::npos ||
+ this->CustomMaximumFailedTestOutputSize == 0) {
+ unlimitedOutput = true;
+ }
+
+ std::string::size_type cc;
+
+ std::ostringstream ostr;
+ log.clear();
+
+ int defects = 0;
+
+ cmsys::RegularExpression memcheckLine("^========");
+
+ cmsys::RegularExpression leakExpr("== Leaked [0-9,]+ bytes at");
+
+ // list of matchers for output messages that contain variable content
+ // (addresses, sizes, ...) or can be shortened in general. the first match is
+ // used as a error name.
+ std::vector<cmsys::RegularExpression> matchers{
+ // API errors
+ "== Malloc/Free error encountered: (.*)",
+ "== Program hit error ([^ ]*).* on CUDA API call to",
+ "== Program hit ([^ ]*).* on CUDA API call to",
+ // memcheck
+ "== (Invalid .*) of size [0-9,]+",
+ // racecheck
+ "== .* (Potential .* hazard detected)", "== .* (Race reported)",
+ // synccheck
+ "== (Barrier error)",
+ // initcheck
+ "== (Uninitialized .* memory read)", "== (Unused memory)",
+ // generic error: ignore ERROR SUMMARY, CUDA-MEMCHECK and others
+ "== ([A-Z][a-z].*)"
+ };
+
+ std::vector<std::string::size_type> nonMemcheckOutput;
+ auto sttime = std::chrono::steady_clock::now();
+ cmCTestOptionalLog(this->CTest, DEBUG,
+ "Start test: " << lines.size() << std::endl, this->Quiet);
+ std::string::size_type totalOutputSize = 0;
+ for (cc = 0; cc < lines.size(); cc++) {
+ cmCTestOptionalLog(this->CTest, DEBUG,
+ "test line " << lines[cc] << std::endl, this->Quiet);
+
+ if (memcheckLine.find(lines[cc])) {
+ cmCTestOptionalLog(this->CTest, DEBUG,
+ "cuda-memcheck line " << lines[cc] << std::endl,
+ this->Quiet);
+ int failure = -1;
+ auto& line = lines[cc];
+ if (leakExpr.find(line)) {
+ failure = static_cast<int>(this->FindOrAddWarning("Memory leak"));
+ } else {
+ for (auto& matcher : matchers) {
+ if (matcher.find(line)) {
+ failure =
+ static_cast<int>(this->FindOrAddWarning(matcher.match(1)));
+ break;
+ }
+ }
+ }
+
+ if (failure >= 0) {
+ ostr << "<b>" << this->ResultStrings[failure] << "</b> ";
+ if (results.empty() || unsigned(failure) > results.size() - 1) {
+ results.push_back(1);
+ } else {
+ results[failure]++;
+ }
+ defects++;
+ }
+ totalOutputSize += lines[cc].size();
+ ostr << lines[cc] << std::endl;
+ } else {
+ nonMemcheckOutput.push_back(cc);
+ }
+ }
+ // Now put all all the non cuda-memcheck output into the test output
+ // This should be last in case it gets truncated by the output
+ // limiting code
+ for (std::string::size_type i : nonMemcheckOutput) {
+ totalOutputSize += lines[i].size();
+ ostr << lines[i] << std::endl;
+ if (!unlimitedOutput &&
+ totalOutputSize >
+ static_cast<size_t>(this->CustomMaximumFailedTestOutputSize)) {
+ ostr << "....\n";
+ ostr << "Test Output for this test has been truncated see testing"
+ " machine logs for full output,\n";
+ ostr << "or put CTEST_FULL_OUTPUT in the output of "
+ "this test program.\n";
+ break; // stop the copy of output if we are full
+ }
+ }
+ cmCTestOptionalLog(this->CTest, DEBUG,
+ "End test (elapsed: "
+ << cmDurationTo<unsigned int>(
+ std::chrono::steady_clock::now() - sttime)
+ << "s)" << std::endl,
+ this->Quiet);
+ log = ostr.str();
+ this->DefectCount += defects;
+ return defects == 0;
+}
+
// PostProcessTest memcheck results
void cmCTestMemCheckHandler::PostProcessTest(cmCTestTestResult& res, int test)
{
diff --git a/Source/CTest/cmCTestMemCheckHandler.h b/Source/CTest/cmCTestMemCheckHandler.h
index 52667f8cfe..63ab573258 100644
--- a/Source/CTest/cmCTestMemCheckHandler.h
+++ b/Source/CTest/cmCTestMemCheckHandler.h
@@ -46,6 +46,7 @@ private:
DRMEMORY,
BOUNDS_CHECKER,
// checkers after here do not use the standard error list
+ CUDA_MEMCHECK,
ADDRESS_SANITIZER,
LEAK_SANITIZER,
THREAD_SANITIZER,
@@ -137,6 +138,8 @@ private:
std::vector<int>& results);
bool ProcessMemCheckPurifyOutput(const std::string& str, std::string& log,
std::vector<int>& results);
+ bool ProcessMemCheckCudaOutput(const std::string& str, std::string& log,
+ std::vector<int>& results);
bool ProcessMemCheckSanitizerOutput(const std::string& str, std::string& log,
std::vector<int>& results);
bool ProcessMemCheckBoundsCheckerOutput(const std::string& str,
diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.cxx b/Source/CTest/cmCTestReadCustomFilesCommand.cxx
index ed14d06887..a25cca49c8 100644
--- a/Source/CTest/cmCTestReadCustomFilesCommand.cxx
+++ b/Source/CTest/cmCTestReadCustomFilesCommand.cxx
@@ -15,7 +15,7 @@ bool cmCTestReadCustomFilesCommand::InitialPass(
}
for (std::string const& arg : args) {
- this->CTest->ReadCustomConfigurationFileTree(arg.c_str(), this->Makefile);
+ this->CTest->ReadCustomConfigurationFileTree(arg, this->Makefile);
}
return true;
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 2c8e3855ff..4d65c9bda4 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -619,11 +619,11 @@ void cmCTestRunTest::ComputeArguments()
cmCTestMemCheckHandler* handler =
static_cast<cmCTestMemCheckHandler*>(this->TestHandler);
this->ActualCommand = handler->MemoryTester;
- this->TestProperties->Args[1] = this->TestHandler->FindTheExecutable(
- this->TestProperties->Args[1].c_str());
+ this->TestProperties->Args[1] =
+ this->TestHandler->FindTheExecutable(this->TestProperties->Args[1]);
} else {
- this->ActualCommand = this->TestHandler->FindTheExecutable(
- this->TestProperties->Args[1].c_str());
+ this->ActualCommand =
+ this->TestHandler->FindTheExecutable(this->TestProperties->Args[1]);
++j; // skip the executable (it will be actualCommand)
}
std::string testCommand =
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index fe684062d4..6398d66591 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -94,10 +94,9 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
std::string sourceDir = cmSystemTools::CollapseFullPath(src_dir);
std::string binaryDir = cmSystemTools::CollapseFullPath(bld_dir);
- this->CTest->SetCTestConfiguration("SourceDirectory", sourceDir.c_str(),
- this->Quiet);
- this->CTest->SetCTestConfiguration("BuildDirectory", binaryDir.c_str(),
+ this->CTest->SetCTestConfiguration("SourceDirectory", sourceDir,
this->Quiet);
+ this->CTest->SetCTestConfiguration("BuildDirectory", binaryDir, this->Quiet);
if (smodel) {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 279216eeb8..026e98fc51 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -35,12 +35,12 @@ std::unique_ptr<cmCommand> cmCTestSubmitCommand::Clone()
cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
{
- const char* submitURL = !this->SubmitURL.empty()
- ? this->SubmitURL.c_str()
- : this->Makefile->GetDefinition("CTEST_SUBMIT_URL");
+ const std::string* submitURL = !this->SubmitURL.empty()
+ ? &this->SubmitURL
+ : this->Makefile->GetDef("CTEST_SUBMIT_URL");
if (submitURL) {
- this->CTest->SetCTestConfiguration("SubmitURL", submitURL, this->Quiet);
+ this->CTest->SetCTestConfiguration("SubmitURL", *submitURL, this->Quiet);
} else {
this->CTest->SetCTestConfigurationFromCMakeVariable(
this->Makefile, "DropMethod", "CTEST_DROP_METHOD", this->Quiet);
@@ -108,7 +108,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
if (this->PartsMentioned) {
auto parts =
cmMakeRange(this->Parts).transform([this](std::string const& arg) {
- return this->CTest->GetPartFromName(arg.c_str());
+ return this->CTest->GetPartFromName(arg);
});
handler->SelectParts(std::set<cmCTest::Part>(parts.begin(), parts.end()));
}
@@ -177,7 +177,7 @@ void cmCTestSubmitCommand::CheckArguments(
!this->Files.empty() || cm::contains(keywords, "FILES");
cm::erase_if(this->Parts, [this](std::string const& arg) -> bool {
- cmCTest::Part p = this->CTest->GetPartFromName(arg.c_str());
+ cmCTest::Part p = this->CTest->GetPartFromName(arg);
if (p == cmCTest::PartCount) {
std::ostringstream e;
e << "Part name \"" << arg << "\" is invalid.";
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index ea36df54a2..5b54573f34 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -797,7 +797,7 @@ int cmCTestSubmitHandler::ProcessHandler()
gfile = gfile.substr(glen);
cmCTestOptionalLog(this->CTest, DEBUG,
"Glob file: " << gfile << std::endl, this->Quiet);
- this->CTest->AddSubmitFile(cmCTest::PartCoverage, gfile.c_str());
+ this->CTest->AddSubmitFile(cmCTest::PartCoverage, gfile);
}
} else {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem globbing" << std::endl);
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index c71b409ff9..cbc3c0c9f2 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -13,6 +13,7 @@
#include "cmCTestTestHandler.h"
#include "cmDuration.h"
#include "cmMakefile.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
void cmCTestTestCommand::BindArguments()
@@ -116,13 +117,13 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
unsigned long testLoad;
const char* ctestTestLoad = this->Makefile->GetDefinition("CTEST_TEST_LOAD");
if (!this->TestLoad.empty()) {
- if (!cmStrToULong(this->TestLoad.c_str(), &testLoad)) {
+ if (!cmStrToULong(this->TestLoad, &testLoad)) {
testLoad = 0;
cmCTestLog(this->CTest, WARNING,
"Invalid value for 'TEST_LOAD' : " << this->TestLoad
<< std::endl);
}
- } else if (ctestTestLoad && *ctestTestLoad) {
+ } else if (cmNonempty(ctestTestLoad)) {
if (!cmStrToULong(ctestTestLoad, &testLoad)) {
testLoad = 0;
cmCTestLog(this->CTest, WARNING,
@@ -134,10 +135,10 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
}
handler->SetTestLoad(testLoad);
- if (const char* labelsForSubprojects =
- this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ if (cmProp labelsForSubprojects =
+ this->Makefile->GetDef("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
- labelsForSubprojects, this->Quiet);
+ *labelsForSubprojects, this->Quiet);
}
handler->SetQuiet(this->Quiet);
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index d0dbaae81c..70e84eee3c 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1374,7 +1374,7 @@ void cmCTestTestHandler::GenerateDartOutput(cmXMLWriter& xml)
xml.StartElement("TestList");
for (cmCTestTestResult const& result : this->TestResults) {
std::string testPath = result.Path + "/" + result.Name;
- xml.Element("Test", this->CTest->GetShortPathToFile(testPath.c_str()));
+ xml.Element("Test", this->CTest->GetShortPathToFile(testPath));
}
xml.EndElement(); // TestList
for (cmCTestTestResult& result : this->TestResults) {
@@ -1483,8 +1483,8 @@ void cmCTestTestHandler::WriteTestResultHeader(cmXMLWriter& xml,
}
std::string testPath = result.Path + "/" + result.Name;
xml.Element("Name", result.Name);
- xml.Element("Path", this->CTest->GetShortPathToFile(result.Path.c_str()));
- xml.Element("FullName", this->CTest->GetShortPathToFile(testPath.c_str()));
+ xml.Element("Path", this->CTest->GetShortPathToFile(result.Path));
+ xml.Element("FullName", this->CTest->GetShortPathToFile(testPath));
xml.Element("FullCommandLine", result.FullCommandLine);
}
@@ -1546,12 +1546,12 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<std::string>& vec)
}
// Find the appropriate executable to run for a test
-std::string cmCTestTestHandler::FindTheExecutable(const char* exe)
+std::string cmCTestTestHandler::FindTheExecutable(const std::string& exe)
{
std::string resConfig;
std::vector<std::string> extraPaths;
std::vector<std::string> failedPaths;
- if (strcmp(exe, "NOT_AVAILABLE") == 0) {
+ if (exe == "NOT_AVAILABLE") {
return exe;
}
return cmCTestTestHandler::FindExecutable(this->CTest, exe, resConfig,
@@ -1607,7 +1607,7 @@ void cmCTestTestHandler::AddConfigurations(
// Find the appropriate executable to run for a test
std::string cmCTestTestHandler::FindExecutable(
- cmCTest* ctest, const char* testCommand, std::string& resultingConfig,
+ cmCTest* ctest, const std::string& testCommand, std::string& resultingConfig,
std::vector<std::string>& extraPaths, std::vector<std::string>& failed)
{
// now run the compiled test if we can find it
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 0d88c306fb..b26f8a6d25 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -198,7 +198,8 @@ public:
std::string filepath, std::string& filename);
// full signature static method to find an executable
- static std::string FindExecutable(cmCTest* ctest, const char* testCommand,
+ static std::string FindExecutable(cmCTest* ctest,
+ const std::string& testCommand,
std::string& resultingConfig,
std::vector<std::string>& extraPaths,
std::vector<std::string>& failed);
@@ -309,7 +310,7 @@ private:
/**
* Find the executable for a test
*/
- std::string FindTheExecutable(const char* exe);
+ std::string FindTheExecutable(const std::string& exe);
std::string GetTestStatus(cmCTestTestResult const&);
void ExpandTestsToRunInformation(size_t numPossibleTests);
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx
index 673eb9ac11..95cae13742 100644
--- a/Source/CTest/cmCTestUpdateCommand.cxx
+++ b/Source/CTest/cmCTestUpdateCommand.cxx
@@ -11,14 +11,13 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
{
if (!this->Source.empty()) {
this->CTest->SetCTestConfiguration(
- "SourceDirectory", cmSystemTools::CollapseFullPath(this->Source).c_str(),
+ "SourceDirectory", cmSystemTools::CollapseFullPath(this->Source),
this->Quiet);
} else {
this->CTest->SetCTestConfiguration(
"SourceDirectory",
cmSystemTools::CollapseFullPath(
- this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY"))
- .c_str(),
+ this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY")),
this->Quiet);
}
std::string source_dir =
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index a549117ca2..9ee1c170c2 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -545,17 +545,17 @@ std::string cmProcess::GetExitExceptionString()
# endif
# ifdef SIGABRT
case SIGABRT:
- exception_str = "Child aborted";
+ exception_str = "Subprocess aborted";
break;
# endif
# ifdef SIGKILL
case SIGKILL:
- exception_str = "Child killed";
+ exception_str = "Subprocess killed";
break;
# endif
# ifdef SIGTERM
case SIGTERM:
- exception_str = "Child terminated";
+ exception_str = "Subprocess terminated";
break;
# endif
# ifdef SIGHUP
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 50ccc7c869..e726fc72b4 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -63,3 +63,8 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
endif()
cm_check_cxx_feature(unique_ptr)
+if (NOT CMAKE_CXX_STANDARD LESS "17")
+ cm_check_cxx_feature(filesystem)
+else()
+ set(CMake_HAVE_CXX_FILESYSTEM FALSE)
+endif()
diff --git a/Source/Checks/cm_cxx_filesystem.cxx b/Source/Checks/cm_cxx_filesystem.cxx
new file mode 100644
index 0000000000..e508d1c969
--- /dev/null
+++ b/Source/Checks/cm_cxx_filesystem.cxx
@@ -0,0 +1,10 @@
+
+#include <filesystem>
+
+int main()
+{
+ std::filesystem::path p1("/a/b/c");
+ std::filesystem::path p2("/a/b/c");
+
+ return p1 == p2 ? 0 : 1;
+}
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index 9a26db5992..85e256b8bc 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -2,11 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include <csignal>
+#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
+#include <unistd.h>
+
#include "cmsys/Encoding.hxx"
#include "cmCursesColor.h"
@@ -54,7 +58,12 @@ void onsig(int /*unused*/)
{
if (cmCursesForm::CurrentForm) {
endwin();
- initscr(); /* Initialization */
+ if (initscr() == nullptr) {
+ static const char errmsg[] = "Error: ncurses initialization failed\n";
+ auto r = write(STDERR_FILENO, errmsg, sizeof(errmsg) - 1);
+ static_cast<void>(r);
+ exit(1);
+ }
noecho(); /* Echo off */
cbreak(); /* nl- or cr not needed */
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
@@ -124,7 +133,10 @@ int main(int argc, char const* const* argv)
cmCursesForm::DebugStart();
}
- initscr(); /* Initialization */
+ if (initscr() == nullptr) {
+ fprintf(stderr, "Error: ncurses initialization failed\n");
+ exit(1);
+ }
noecho(); /* Echo off */
cbreak(); /* nl- or cr not needed */
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c
index e4e72aa9ce..112ab0898c 100644
--- a/Source/CursesDialog/form/frm_driver.c
+++ b/Source/CursesDialog/form/frm_driver.c
@@ -2983,7 +2983,7 @@ INLINE static FIELD *Right_Neighbour_Field(FIELD * field)
| Function : static FIELD *Upper_Neighbour_Field(FIELD * field)
|
| Description : Because of the row-major nature of sorting the fields,
-| its more difficult to define whats the upper neighbour
+| its more difficult to define what's the upper neighbour
| field really means. We define that it must be on a
| 'previous' line (cyclic order!) and is the rightmost
| field laying on the left side of the given field. If
@@ -3030,7 +3030,7 @@ static FIELD *Upper_Neighbour_Field(FIELD * field)
| Function : static FIELD *Down_Neighbour_Field(FIELD * field)
|
| Description : Because of the row-major nature of sorting the fields,
-| its more difficult to define whats the down neighbour
+| its more difficult to define what's the down neighbour
| field really means. We define that it must be on a
| 'next' line (cyclic order!) and is the leftmost
| field laying on the right side of the given field. If
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 98dd0e212b..e6d6b17bfb 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -3,111 +3,79 @@
project(QtDialog)
CMake_OPTIONAL_COMPONENT(cmake-gui)
-find_package(Qt5Widgets QUIET)
-if (Qt5Widgets_FOUND)
- include_directories(${Qt5Widgets_INCLUDE_DIRS})
- add_definitions(${Qt5Widgets_DEFINITONS})
- macro(qt4_wrap_ui)
- qt5_wrap_ui(${ARGN})
- endmacro()
- macro(qt4_wrap_cpp)
- qt5_wrap_cpp(${ARGN})
- endmacro()
- macro(qt4_add_resources)
- qt5_add_resources(${ARGN})
- endmacro()
+find_package(Qt5Widgets REQUIRED)
- set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
- set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES})
+set(CMake_QT_EXTRA_LIBRARIES)
- # Try to find the package WinExtras for the task bar progress
- if(WIN32)
- find_package(Qt5WinExtras QUIET)
- if (Qt5WinExtras_FOUND)
- include_directories(${Qt5WinExtras_INCLUDE_DIRS})
- add_definitions(-DQT_WINEXTRAS)
- list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES})
- endif()
+# Try to find the package WinExtras for the task bar progress
+if(WIN32)
+ find_package(Qt5WinExtras QUIET)
+ if (Qt5WinExtras_FOUND)
+ add_definitions(-DQT_WINEXTRAS)
+ list(APPEND CMake_QT_EXTRA_LIBRARIES Qt5::WinExtras)
endif()
+endif()
- # Remove this when the minimum version of Qt is 4.6.
- add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
-
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
- if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES)
- list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES})
- set_property(SOURCE CMakeSetup.cxx
- PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin)
- endif()
+if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES)
+ list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES})
+ set_property(SOURCE CMakeSetup.cxx
+ PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin)
+endif()
- if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
- list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES})
- set_property(SOURCE CMakeSetup.cxx
- PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin)
- endif()
+if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
+ list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES})
+ set_property(SOURCE CMakeSetup.cxx
+ PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin)
+endif()
- # We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
- # FIXME: This should be part of Qt5 CMake scripts, but unfortunately
- # Qt5 support is missing there.
- if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
- macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var)
- get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION)
- if(EXISTS "${_qt_plugin_path}")
- get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME)
- get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH)
- get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME)
- if(APPLE)
- set(_qt_plugin_dir "PlugIns")
- elseif(WIN32)
- set(_qt_plugin_dir "plugins")
- endif()
- set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}")
- install(FILES "${_qt_plugin_path}"
- DESTINATION "${_qt_plugin_dest}"
- ${COMPONENT})
- set(${_qt_plugins_var}
- "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}")
- else()
- message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found")
+# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
+# FIXME: This should be part of Qt5 CMake scripts, but unfortunately
+# Qt5 support is missing there.
+if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
+ macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var)
+ get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION)
+ if(EXISTS "${_qt_plugin_path}")
+ get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME)
+ get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH)
+ get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME)
+ if(APPLE)
+ set(_qt_plugin_dir "PlugIns")
+ elseif(WIN32)
+ set(_qt_plugin_dir "plugins")
endif()
- endmacro()
- if(APPLE)
- install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS)
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
- "[Paths]\nPlugins = ${_qt_plugin_dir}\n")
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
- DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources"
+ set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}")
+ install(FILES "${_qt_plugin_path}"
+ DESTINATION "${_qt_plugin_dest}"
${COMPONENT})
- elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
- install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS)
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
- "[Paths]\nPlugins = ../${_qt_plugin_dir}\n")
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
- DESTINATION bin
- ${COMPONENT})
- endif()
- endif()
-
- if(TARGET Qt5::Core)
- get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION)
- get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH)
- if(APPLE)
- get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH)
+ set(${_qt_plugins_var}
+ "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}")
+ else()
+ message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found")
endif()
+ endmacro()
+ if(APPLE)
+ install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
+ "[Paths]\nPlugins = ${_qt_plugin_dir}\n")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources"
+ ${COMPONENT})
+ elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
+ install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
+ "[Paths]\nPlugins = ../${_qt_plugin_dir}\n")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
+ DESTINATION bin
+ ${COMPONENT})
endif()
-else()
- set(QT_MIN_VERSION "4.4.0")
- find_package(Qt4 REQUIRED)
- if(NOT QT4_FOUND)
- message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
- return()
- endif()
-
- include(${QT_USE_FILE})
-
- set(CMake_QT_LIBRARIES ${QT_LIBRARIES})
+endif()
+get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION)
+get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH)
+if(APPLE)
+ get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH)
endif()
set(SRCS
@@ -116,6 +84,7 @@ set(SRCS
CMakeSetup.cxx
CMakeSetupDialog.cxx
CMakeSetupDialog.h
+ Compilers.h
FirstConfigure.cxx
FirstConfigure.h
QCMake.cxx
@@ -129,7 +98,7 @@ set(SRCS
WarningMessagesDialog.cxx
WarningMessagesDialog.h
)
-QT4_WRAP_UI(UI_SRCS
+qt5_wrap_ui(UI_SRCS
CMakeSetupDialog.ui
Compilers.ui
CrossCompiler.ui
@@ -137,7 +106,7 @@ QT4_WRAP_UI(UI_SRCS
RegexExplorer.ui
WarningMessagesDialog.ui
)
-QT4_WRAP_CPP(MOC_SRCS
+qt5_wrap_cpp(MOC_SRCS
AddCacheEntry.h
Compilers.h
CMakeSetupDialog.h
@@ -148,14 +117,24 @@ QT4_WRAP_CPP(MOC_SRCS
RegexExplorer.h
WarningMessagesDialog.h
)
-QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
+qt5_add_resources(RC_SRCS CMakeSetup.qrc)
+
+if (FALSE) # CMake's bootstrap binary does not support automoc
+ set(CMAKE_AUTOMOC 1)
+ set(CMAKE_AUTORCC 1)
+ set(CMAKE_AUTOUIC 1)
+else ()
+ list(APPEND SRCS
+ ${UI_SRCS}
+ ${MOC_SRCS}
+ ${RC_SRCS})
+endif ()
-set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS})
if(WIN32)
- set(SRCS ${SRCS} CMakeSetup.rc)
+ list(APPEND SRCS CMakeSetup.rc)
endif()
if(APPLE)
- set(SRCS ${SRCS} CMakeSetup.icns)
+ list(APPEND SRCS CMakeSetup.icns)
set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
set_source_files_properties(CMakeSetup.icns PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
@@ -172,7 +151,7 @@ endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE})
-target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES})
+target_link_libraries(cmake-gui CMakeLib Qt5::Core Qt5::Widgets ${CMake_QT_EXTRA_LIBRARIES})
if(WIN32)
target_sources(cmake-gui PRIVATE $<TARGET_OBJECTS:CMakeVersion>)
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 9d928b2ff9..7ef5a72995 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -115,14 +115,6 @@ int main(int argc, char** argv)
QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8");
QTextCodec::setCodecForLocale(utf8_codec);
-#if QT_VERSION < 0x050000
- // clean out standard Qt paths for plugins, which we don't use anyway
- // when creating Mac bundles, it potentially causes problems
- foreach (QString p, QApplication::libraryPaths()) {
- QApplication::removeLibraryPath(p);
- }
-#endif
-
// tell the cmake library where cmake is
QDir cmExecDir(QApplication::applicationDirPath());
#if defined(Q_OS_MAC)
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 6dbfe1125a..fcc8408617 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -152,9 +152,6 @@ CMakeSetupDialog::CMakeSetupDialog()
this->WarnUninitializedAction =
OptionsMenu->addAction(tr("&Warn Uninitialized (--warn-uninitialized)"));
this->WarnUninitializedAction->setCheckable(true);
- this->WarnUnusedAction =
- OptionsMenu->addAction(tr("&Warn Unused (--warn-unused-vars)"));
- this->WarnUnusedAction->setCheckable(true);
QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output"));
debugAction->setCheckable(true);
@@ -290,9 +287,6 @@ void CMakeSetupDialog::initialize()
QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)),
this->CMakeThread->cmakeInstance(),
SLOT(setWarnUninitializedMode(bool)));
- QObject::connect(this->WarnUnusedAction, SIGNAL(triggered(bool)),
- this->CMakeThread->cmakeInstance(),
- SLOT(setWarnUnusedMode(bool)));
if (!this->SourceDirectory->text().isEmpty() ||
!this->BinaryDirectory->lineEdit()->text().isEmpty()) {
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index d1e20354b0..914be12a32 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -111,7 +111,6 @@ protected:
QAction* ConfigureAction;
QAction* GenerateAction;
QAction* WarnUninitializedAction;
- QAction* WarnUnusedAction;
QAction* InstallForCommandLineAction;
State CurrentState;
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 776af81ff6..609025658d 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -21,7 +21,6 @@ QCMake::QCMake(QObject* p)
: QObject(p)
{
this->WarnUninitializedMode = false;
- this->WarnUnusedMode = false;
qRegisterMetaType<QCMakeProperty>();
qRegisterMetaType<QCMakePropertyList>();
@@ -170,7 +169,6 @@ void QCMake::configure()
this->CMakeInstance->SetGeneratorToolset(this->Toolset.toLocal8Bit().data());
this->CMakeInstance->LoadCache();
this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode);
- this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode);
this->CMakeInstance->PreLoadCMakeFiles();
InterruptFlag = 0;
@@ -340,10 +338,10 @@ void QCMake::interrupt()
bool QCMake::interruptCallback()
{
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return this->InterruptFlag;
-#else
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
return this->InterruptFlag.load();
+#else
+ return this->InterruptFlag.loadRelaxed();
#endif
}
@@ -478,11 +476,6 @@ void QCMake::setWarnUninitializedMode(bool value)
this->WarnUninitializedMode = value;
}
-void QCMake::setWarnUnusedMode(bool value)
-{
- this->WarnUnusedMode = value;
-}
-
void QCMake::checkOpenPossible()
{
std::string data = this->BinaryDirectory.toLocal8Bit().data();
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index 110a971d0a..39555d6901 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -114,8 +114,6 @@ public slots:
void setDeprecatedWarningsAsErrors(bool value);
/// set whether to run cmake with warnings about uninitialized variables
void setWarnUninitializedMode(bool value);
- /// set whether to run cmake with warnings about unused variables
- void setWarnUnusedMode(bool value);
/// check if project IDE open is possible and emit openPossible signal
void checkOpenPossible();
@@ -175,8 +173,6 @@ protected:
void stderrCallback(std::string const& msg);
bool WarnUninitializedMode;
- bool WarnUnusedMode;
- bool WarnUnusedAllMode;
QString SourceDirectory;
QString BinaryDirectory;
QString Generator;
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 9b24fbdc93..3bf440978d 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -155,11 +155,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
void QCMakeCacheView::setShowAdvanced(bool s)
{
-#if QT_VERSION >= 040300
- // new 4.3 API that needs to be called. what about an older Qt?
this->SearchFilter->invalidate();
-#endif
-
this->AdvancedFilter->setShowAdvanced(s);
}
@@ -209,9 +205,7 @@ void QCMakeCacheModel::clear()
void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
this->beginResetModel();
-#endif
QSet<QCMakeProperty> newProps;
QSet<QCMakeProperty> newProps2;
@@ -335,11 +329,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
}
this->blockSignals(b);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
this->endResetModel();
-#else
- this->reset();
-#endif
}
QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const
@@ -349,9 +339,7 @@ QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const
void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t)
{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
this->beginResetModel();
-#endif
this->View = t;
@@ -368,11 +356,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t)
this->setProperties(oldProps);
this->setProperties(props);
this->blockSignals(b);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
this->endResetModel();
-#else
- this->reset();
-#endif
}
void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
@@ -498,8 +482,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const
// go to the next in the tree
while (!idxs.isEmpty() &&
(
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && \
- QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
+#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
(idxs.last().row() + 1) >= rowCount(idxs.last().parent()) ||
#endif
!idxs.last().sibling(idxs.last().row() + 1, 0).isValid())) {
@@ -659,20 +642,6 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e,
return success;
}
-// Issue 205903 fixed in Qt 4.5.0.
-// Can remove this function and FileDialogFlag when minimum Qt version is 4.5
-bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt)
-{
- // workaround for what looks like a bug in Qt on macOS
- // where it doesn't create a QWidget wrapper for the native file dialog
- // so the Qt library ends up assuming the focus was lost to something else
-
- 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 bea1965868..a25270864a 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -144,7 +144,6 @@ 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/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index 332a770ef8..d16ea58d57 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -4,9 +4,9 @@
#include <utility>
-#include <QDirModel>
#include <QFileDialog>
#include <QFileInfo>
+#include <QFileSystemModel>
#include <QResizeEvent>
#include <QToolButton>
@@ -88,20 +88,20 @@ void QCMakePathEditor::chooseFile()
}
}
-// use same QDirModel for all completers
-static QDirModel* fileDirModel()
+// use same QFileSystemModel for all completers
+static QFileSystemModel* fileDirModel()
{
- static QDirModel* m = nullptr;
+ static QFileSystemModel* m = nullptr;
if (!m) {
- m = new QDirModel();
+ m = new QFileSystemModel();
}
return m;
}
-static QDirModel* pathDirModel()
+static QFileSystemModel* pathDirModel()
{
- static QDirModel* m = nullptr;
+ static QFileSystemModel* m = nullptr;
if (!m) {
- m = new QDirModel();
+ m = new QFileSystemModel();
m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot);
}
return m;
@@ -110,7 +110,7 @@ static QDirModel* pathDirModel()
QCMakeFileCompleter::QCMakeFileCompleter(QObject* o, bool dirs)
: QCompleter(o)
{
- QDirModel* m = dirs ? pathDirModel() : fileDirModel();
+ QFileSystemModel* m = dirs ? pathDirModel() : fileDirModel();
this->setModel(m);
}
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index d6f7500e8f..53d4cb47fc 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -55,7 +55,7 @@ bool cmAuxSourceDirectoryCommand(std::vector<std::string> const& args,
auto ext = cm::string_view(file).substr(dotpos + 1);
// Process only source files
auto cm = mf.GetCMakeInstance();
- if (dotpos > 0 && cm->IsSourceExtension(ext)) {
+ if (dotpos > 0 && cm->IsACLikeSourceExtension(ext)) {
std::string fullname = cmStrCat(templateDirectory, '/', file);
// add the file as a class file so
// depends can be done
diff --git a/Source/cmCMakeLanguageCommand.h b/Source/cmCMakeLanguageCommand.h
index 73065156b0..aeb8f60f84 100644
--- a/Source/cmCMakeLanguageCommand.h
+++ b/Source/cmCMakeLanguageCommand.h
@@ -11,7 +11,7 @@ class cmExecutionStatus;
struct cmListFileArgument;
/**
- * \brief Calls a scripted or build-in command
+ * \brief Calls a scripted or built-in command
*
*/
bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args,
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index bca75406bd..a5fde897c8 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -394,7 +394,7 @@ bool cmCTest::ShouldCompressTestOutput()
return this->Impl->CompressTestOutput;
}
-cmCTest::Part cmCTest::GetPartFromName(const char* name)
+cmCTest::Part cmCTest::GetPartFromName(const std::string& name)
{
// Look up by lower-case to make names case-insensitive.
std::string lower_name = cmSystemTools::LowerCase(name);
@@ -458,8 +458,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator gg(&cm);
cmMakefile mf(&gg, cm.GetCurrentSnapshot());
- if (!this->ReadCustomConfigurationFileTree(this->Impl->BinaryDir.c_str(),
- &mf)) {
+ if (!this->ReadCustomConfigurationFileTree(this->Impl->BinaryDir, &mf)) {
cmCTestOptionalLog(
this, DEBUG, "Cannot find custom configuration file tree" << std::endl,
quiet);
@@ -523,7 +522,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
std::string model;
if (cmSystemTools::GetLineFromStream(tfin, model) &&
!this->Impl->Parts[PartStart] && !command) {
- this->Impl->TestModel = GetTestModelFromString(model.c_str());
+ this->Impl->TestModel = GetTestModelFromString(model);
}
tfin.close();
}
@@ -579,7 +578,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
cmSystemTools::GetLineFromStream(tfin, tag);
cmSystemTools::GetLineFromStream(tfin, group);
if (cmSystemTools::GetLineFromStream(tfin, modelStr)) {
- model = GetTestModelFromString(modelStr.c_str());
+ model = GetTestModelFromString(modelStr);
}
tfin.close();
}
@@ -793,7 +792,7 @@ int cmCTest::GetTestModel() const
return this->Impl->TestModel;
}
-bool cmCTest::SetTest(const char* ttype, bool report)
+bool cmCTest::SetTest(const std::string& ttype, bool report)
{
if (cmSystemTools::LowerCase(ttype) == "all") {
for (Part p = PartStart; p != PartCount; p = Part(p + 1)) {
@@ -841,6 +840,7 @@ bool cmCTest::OpenOutputFile(const std::string& path, const std::string& name,
}
}
std::string filename = testingDir + "/" + name;
+ stream.SetTempExt("tmp");
stream.Open(filename);
if (!stream) {
cmCTestLog(this, ERROR_MESSAGE,
@@ -855,7 +855,7 @@ bool cmCTest::OpenOutputFile(const std::string& path, const std::string& name,
return true;
}
-bool cmCTest::AddIfExists(Part part, const char* file)
+bool cmCTest::AddIfExists(Part part, const std::string& file)
{
if (this->CTestFileExists(file)) {
this->AddSubmitFile(part, file);
@@ -1007,7 +1007,7 @@ int cmCTest::ProcessSteps()
if (this->Impl->Parts[PartNotes]) {
this->UpdateCTestConfiguration();
if (!this->Impl->NotesFiles.empty()) {
- this->GenerateNotesFile(this->Impl->NotesFiles.c_str());
+ this->GenerateNotesFile(this->Impl->NotesFiles);
}
}
if (this->Impl->Parts[PartSubmit]) {
@@ -1036,9 +1036,9 @@ std::string cmCTest::GetTestModelString()
return "Experimental";
}
-int cmCTest::GetTestModelFromString(const char* str)
+int cmCTest::GetTestModelFromString(const std::string& str)
{
- if (!str) {
+ if (str.empty()) {
return cmCTest::EXPERIMENTAL;
}
std::string rstr = cmSystemTools::LowerCase(str);
@@ -1564,9 +1564,9 @@ int cmCTest::GenerateNotesFile(std::vector<std::string> const& files)
return 0;
}
-int cmCTest::GenerateNotesFile(const char* cfiles)
+int cmCTest::GenerateNotesFile(const std::string& cfiles)
{
- if (!cfiles) {
+ if (cfiles.empty()) {
return 1;
}
@@ -1649,14 +1649,14 @@ bool cmCTest::SubmitExtraFiles(std::vector<std::string> const& files)
<< std::endl;);
return false;
}
- this->AddSubmitFile(PartExtraFiles, file.c_str());
+ this->AddSubmitFile(PartExtraFiles, file);
}
return true;
}
-bool cmCTest::SubmitExtraFiles(const char* cfiles)
+bool cmCTest::SubmitExtraFiles(const std::string& cfiles)
{
- if (!cfiles) {
+ if (cfiles.empty()) {
return true;
}
@@ -1940,7 +1940,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
else if (this->CheckArgument(arg, "-C"_s, "--build-config") &&
i < args.size() - 1) {
i++;
- this->SetConfigType(args[i].c_str());
+ this->SetConfigType(args[i]);
}
else if (this->CheckArgument(arg, "--debug"_s)) {
@@ -2015,7 +2015,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
else if (this->CheckArgument(arg, "-O"_s, "--output-log") &&
i < args.size() - 1) {
i++;
- this->SetOutputLogFileName(args[i].c_str());
+ this->SetOutputLogFileName(args[i]);
}
else if (this->CheckArgument(arg, "--tomorrow-tag"_s)) {
@@ -2047,7 +2047,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
this->Impl->ProduceXML = true;
this->SetTest("Notes");
i++;
- this->SetNotesFiles(args[i].c_str());
+ this->SetNotesFiles(args[i]);
return true;
}
@@ -2304,7 +2304,7 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
this->Impl->ProduceXML = true;
this->SetTest("Submit");
i++;
- if (!this->SubmitExtraFiles(args[i].c_str())) {
+ if (!this->SubmitExtraFiles(args[i])) {
return 0;
}
}
@@ -2375,7 +2375,7 @@ bool cmCTest::HandleTestActionArgument(const char* ctestExec, size_t& i,
(i < args.size() - 1)) {
this->Impl->ProduceXML = true;
i++;
- if (!this->SetTest(args[i].c_str(), false)) {
+ if (!this->SetTest(args[i], false)) {
success = false;
cmCTestLog(this, ERROR_MESSAGE,
"CTest -T called with incorrect option: " << args[i]
@@ -2490,11 +2490,8 @@ int cmCTest::RunCMakeAndTest(std::string* output)
return retv;
}
-void cmCTest::SetNotesFiles(const char* notes)
+void cmCTest::SetNotesFiles(const std::string& notes)
{
- if (!notes) {
- return;
- }
this->Impl->NotesFiles = notes;
}
@@ -2560,7 +2557,8 @@ void cmCTest::SetScheduleType(std::string const& type)
this->Impl->ScheduleType = type;
}
-int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
+int cmCTest::ReadCustomConfigurationFileTree(const std::string& dir,
+ cmMakefile* mf)
{
bool found = false;
cmCTestLog(this, DEBUG,
@@ -2647,7 +2645,7 @@ void cmCTest::PopulateCustomInteger(cmMakefile* mf, const std::string& def,
val = atoi(dval);
}
-std::string cmCTest::GetShortPathToFile(const char* cfname)
+std::string cmCTest::GetShortPathToFile(const std::string& cfname)
{
const std::string& sourceDir = cmSystemTools::CollapseFullPath(
this->GetCTestConfiguration("SourceDirectory"));
@@ -2711,18 +2709,17 @@ void cmCTest::EmptyCTestConfiguration()
this->Impl->CTestConfiguration.clear();
}
-void cmCTest::SetCTestConfiguration(const char* name, const char* value,
+void cmCTest::SetCTestConfiguration(const char* name, const std::string& value,
bool suppress)
{
cmCTestOptionalLog(this, HANDLER_VERBOSE_OUTPUT,
- "SetCTestConfiguration:"
- << name << ":" << (value ? value : "(null)") << "\n",
+ "SetCTestConfiguration:" << name << ":" << value << "\n",
suppress);
if (!name) {
return;
}
- if (!value) {
+ if (value.empty()) {
this->Impl->CTestConfiguration.erase(name);
return;
}
@@ -2927,7 +2924,7 @@ std::string cmCTest::GetBuildID() const
return this->Impl->BuildID;
}
-void cmCTest::AddSubmitFile(Part part, const char* name)
+void cmCTest::AddSubmitFile(Part part, const std::string& name)
{
this->Impl->Parts[part].SubmitFiles.emplace_back(name);
}
@@ -2963,9 +2960,9 @@ void cmCTest::AddCTestConfigurationOverwrite(const std::string& overStr)
this->Impl->CTestConfigurationOverwrites[key] = value;
}
-void cmCTest::SetConfigType(const char* ct)
+void cmCTest::SetConfigType(const std::string& ct)
{
- this->Impl->ConfigType = ct ? ct : "";
+ this->Impl->ConfigType = ct;
cmSystemTools::ReplaceString(this->Impl->ConfigType, ".\\", "");
std::string confTypeEnv = "CMAKE_CONFIG_TYPE=" + this->Impl->ConfigType;
cmSystemTools::PutEnv(confTypeEnv);
@@ -2975,8 +2972,7 @@ bool cmCTest::SetCTestConfigurationFromCMakeVariable(
cmMakefile* mf, const char* dconfig, const std::string& cmake_var,
bool suppress)
{
- const char* ctvar;
- ctvar = mf->GetDefinition(cmake_var);
+ cmProp ctvar = mf->GetDef(cmake_var);
if (!ctvar) {
return false;
}
@@ -2984,7 +2980,7 @@ bool cmCTest::SetCTestConfigurationFromCMakeVariable(
"SetCTestConfigurationFromCMakeVariable:"
<< dconfig << ":" << cmake_var << std::endl,
suppress);
- this->SetCTestConfiguration(dconfig, ctvar, suppress);
+ this->SetCTestConfiguration(dconfig, *ctvar, suppress);
return true;
}
@@ -3085,9 +3081,9 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args,
return result;
}
-void cmCTest::SetOutputLogFileName(const char* name)
+void cmCTest::SetOutputLogFileName(const std::string& name)
{
- if (name) {
+ if (!name.empty()) {
this->Impl->OutputLogFile = cm::make_unique<cmGeneratedFileStream>(name);
} else {
this->Impl->OutputLogFile.reset();
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index a39b8fed4a..1e0fb8cef6 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -64,7 +64,7 @@ public:
/** Get a testing part id from its string name. Returns PartCount
if the string does not name a valid part. */
- Part GetPartFromName(const char* name);
+ Part GetPartFromName(const std::string& name);
/** Process Command line arguments */
int Run(std::vector<std::string>&, std::string* output = nullptr);
@@ -127,12 +127,12 @@ public:
* Check if CTest file exists
*/
bool CTestFileExists(const std::string& filename);
- bool AddIfExists(Part part, const char* file);
+ bool AddIfExists(Part part, const std::string& file);
/**
* Set the cmake test
*/
- bool SetTest(const char*, bool report = true);
+ bool SetTest(const std::string&, bool report = true);
/**
* Set the cmake test mode (experimental, nightly, continuous).
@@ -141,11 +141,11 @@ public:
int GetTestModel() const;
std::string GetTestModelString();
- static int GetTestModelFromString(const char* str);
+ static int GetTestModelFromString(const std::string& str);
static std::string CleanString(const std::string& str,
std::string::size_type spos = 0);
std::string GetCTestConfiguration(const std::string& name);
- void SetCTestConfiguration(const char* name, const char* value,
+ void SetCTestConfiguration(const char* name, const std::string& value,
bool suppress = false);
void EmptyCTestConfiguration();
@@ -161,7 +161,7 @@ public:
cmCTest& operator=(const cmCTest&) = delete;
/** Set the notes files to be created. */
- void SetNotesFiles(const char* notes);
+ void SetNotesFiles(const std::string& notes);
void PopulateCustomVector(cmMakefile* mf, const std::string& definition,
std::vector<std::string>& vec);
@@ -272,7 +272,7 @@ public:
* This means if the file is in binary or
* source directory, it will become /.../relative/path/to/file
*/
- std::string GetShortPathToFile(const char* fname);
+ std::string GetShortPathToFile(const std::string& fname);
enum
{
@@ -354,14 +354,14 @@ public:
int GenerateDoneFile();
/** Submit extra files to the server */
- bool SubmitExtraFiles(const char* files);
+ bool SubmitExtraFiles(const std::string& files);
bool SubmitExtraFiles(std::vector<std::string> const& files);
/** Set the output log file name */
- void SetOutputLogFileName(const char* name);
+ void SetOutputLogFileName(const std::string& name);
/** Set the visual studio or Xcode config type */
- void SetConfigType(const char* ct);
+ void SetConfigType(const std::string& ct);
/** Various log types */
enum
@@ -399,14 +399,14 @@ public:
std::string GetBuildID() const;
/** Add file to be submitted */
- void AddSubmitFile(Part part, const char* name);
+ void AddSubmitFile(Part part, const std::string& name);
std::vector<std::string> const& GetSubmitFiles(Part part) const;
void ClearSubmitFiles(Part part);
/**
* Read the custom configuration files and apply them to the current ctest
*/
- int ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf);
+ int ReadCustomConfigurationFileTree(const std::string& dir, cmMakefile* mf);
std::vector<std::string>& GetInitialCommandLineArguments();
@@ -462,7 +462,7 @@ public:
void SetRunCurrentScript(bool value);
private:
- int GenerateNotesFile(const char* files);
+ int GenerateNotesFile(const std::string& files);
void BlockTestErrorDiagnostics();
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 35bd681c95..95686ead8e 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -578,10 +578,7 @@ cmProp cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const
bool cmCacheManager::CacheEntry::GetPropertyAsBool(
const std::string& prop) const
{
- if (cmProp value = this->GetProperty(prop)) {
- return cmIsOn(*value);
- }
- return false;
+ return cmIsOn(this->GetProperty(prop));
}
void cmCacheManager::CacheEntry::SetProperty(const std::string& prop,
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 051eff6f7e..8aee27cbcc 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -41,7 +41,7 @@ std::vector<std::string> const& cmCommonTargetGenerator::GetConfigNames() const
const char* cmCommonTargetGenerator::GetFeature(const std::string& feature,
const std::string& config)
{
- return this->GeneratorTarget->GetFeature(feature, config);
+ return this->GeneratorTarget->GetFeature(feature, config)->c_str();
}
void cmCommonTargetGenerator::AddModuleDefinitionFlag(
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx
index 81cd8785bf..6591fb1d32 100644
--- a/Source/cmComputeComponentGraph.cxx
+++ b/Source/cmComputeComponentGraph.cxx
@@ -8,6 +8,12 @@
cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input)
: InputGraph(input)
{
+}
+
+cmComputeComponentGraph::~cmComputeComponentGraph() = default;
+
+void cmComputeComponentGraph::Compute()
+{
// Identify components.
this->Tarjan();
@@ -17,8 +23,6 @@ cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input)
this->TransferEdges();
}
-cmComputeComponentGraph::~cmComputeComponentGraph() = default;
-
void cmComputeComponentGraph::Tarjan()
{
int n = static_cast<int>(this->InputGraph.size());
diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h
index 202888cf9c..b873131574 100644
--- a/Source/cmComputeComponentGraph.h
+++ b/Source/cmComputeComponentGraph.h
@@ -31,6 +31,9 @@ public:
cmComputeComponentGraph(Graph const& input);
~cmComputeComponentGraph();
+ /** Run the computation. */
+ void Compute();
+
/** Get the adjacency list of the component graph. */
Graph const& GetComponentGraph() const { return this->ComponentGraph; }
EdgeList const& GetComponentGraphEdges(int c) const
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index e9bf5a5cd0..8ca2168b50 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -253,13 +253,13 @@ cmComputeLinkDepends::Compute()
// Compute the final set of link entries.
// Iterate in reverse order so we can keep only the last occurrence
// of a shared library.
- std::set<int> emmitted;
+ std::set<int> emitted;
for (int i : cmReverseRange(this->FinalLinkOrder)) {
LinkEntry const& e = this->EntryList[i];
cmGeneratorTarget const* t = e.Target;
// Entries that we know the linker will re-use do not need to be repeated.
bool uniquify = t && t->GetType() == cmStateEnums::SHARED_LIBRARY;
- if (!uniquify || emmitted.insert(i).second) {
+ if (!uniquify || emitted.insert(i).second) {
this->FinalLinkEntries.push_back(e);
}
}
@@ -626,6 +626,7 @@ void cmComputeLinkDepends::OrderLinkEntires()
// constraints disallow it.
this->CCG =
cm::make_unique<cmComputeComponentGraph>(this->EntryConstraintGraph);
+ this->CCG->Compute();
// The component graph is guaranteed to be acyclic. Start a DFS
// from every entry to compute a topological order for the
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 4c5f57d059..43cceae187 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -515,7 +515,7 @@ bool cmComputeLinkInformation::Compute()
// Restore the target link type so the correct system runtime
// libraries are found.
cmProp lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
- if (lss && cmIsOn(*lss)) {
+ if (cmIsOn(lss)) {
this->SetCurrentLinkType(LinkStatic);
} else {
this->SetCurrentLinkType(this->StartLinkType);
@@ -832,8 +832,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
// We can support link type switching only if all needed flags are
// known.
- if (static_link_type_flag && *static_link_type_flag &&
- shared_link_type_flag && *shared_link_type_flag) {
+ if (cmNonempty(static_link_type_flag) && cmNonempty(shared_link_type_flag)) {
this->LinkTypeEnabled = true;
this->StaticLinkTypeFlag = static_link_type_flag;
this->SharedLinkTypeFlag = shared_link_type_flag;
@@ -841,7 +840,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
// Lookup the starting link type from the target (linked statically?).
cmProp lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
- this->StartLinkType = (lss && cmIsOn(*lss)) ? LinkStatic : LinkShared;
+ this->StartLinkType = cmIsOn(lss) ? LinkStatic : LinkShared;
this->CurrentLinkType = this->StartLinkType;
}
@@ -849,31 +848,31 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
{
// Get possible library name prefixes.
cmMakefile* mf = this->Makefile;
- this->AddLinkPrefix(mf->GetDefinition("CMAKE_STATIC_LIBRARY_PREFIX"));
- this->AddLinkPrefix(mf->GetDefinition("CMAKE_SHARED_LIBRARY_PREFIX"));
+ this->AddLinkPrefix(mf->GetSafeDefinition("CMAKE_STATIC_LIBRARY_PREFIX"));
+ this->AddLinkPrefix(mf->GetSafeDefinition("CMAKE_SHARED_LIBRARY_PREFIX"));
// Import library names should be matched and treated as shared
// libraries for the purposes of linking.
- this->AddLinkExtension(mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"),
+ this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"),
LinkShared);
- this->AddLinkExtension(mf->GetDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"),
+ this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX"),
LinkStatic);
- this->AddLinkExtension(mf->GetDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"),
+ this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"),
LinkShared);
- this->AddLinkExtension(mf->GetDefinition("CMAKE_LINK_LIBRARY_SUFFIX"),
+ this->AddLinkExtension(mf->GetSafeDefinition("CMAKE_LINK_LIBRARY_SUFFIX"),
LinkUnknown);
if (const char* linkSuffixes =
mf->GetDefinition("CMAKE_EXTRA_LINK_EXTENSIONS")) {
std::vector<std::string> linkSuffixVec = cmExpandedList(linkSuffixes);
for (std::string const& i : linkSuffixVec) {
- this->AddLinkExtension(i.c_str(), LinkUnknown);
+ this->AddLinkExtension(i, LinkUnknown);
}
}
if (const char* sharedSuffixes =
mf->GetDefinition("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES")) {
std::vector<std::string> sharedSuffixVec = cmExpandedList(sharedSuffixes);
for (std::string const& i : sharedSuffixVec) {
- this->AddLinkExtension(i.c_str(), LinkShared);
+ this->AddLinkExtension(i, LinkShared);
}
}
@@ -903,7 +902,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
#ifdef CM_COMPUTE_LINK_INFO_DEBUG
fprintf(stderr, "any regex [%s]\n", reg_any.c_str());
#endif
- this->ExtractAnyLibraryName.compile(reg_any.c_str());
+ this->ExtractAnyLibraryName.compile(reg_any);
// Create a regex to match static library names.
if (!this->StaticLinkExtensions.empty()) {
@@ -912,7 +911,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
#ifdef CM_COMPUTE_LINK_INFO_DEBUG
fprintf(stderr, "static regex [%s]\n", reg_static.c_str());
#endif
- this->ExtractStaticLibraryName.compile(reg_static.c_str());
+ this->ExtractStaticLibraryName.compile(reg_static);
}
// Create a regex to match shared library names.
@@ -924,20 +923,21 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
#ifdef CM_COMPUTE_LINK_INFO_DEBUG
fprintf(stderr, "shared regex [%s]\n", reg_shared.c_str());
#endif
- this->ExtractSharedLibraryName.compile(reg_shared.c_str());
+ this->ExtractSharedLibraryName.compile(reg_shared);
}
}
-void cmComputeLinkInformation::AddLinkPrefix(const char* p)
+void cmComputeLinkInformation::AddLinkPrefix(std::string const& p)
{
- if (p && *p) {
+ if (!p.empty()) {
this->LinkPrefixes.insert(p);
}
}
-void cmComputeLinkInformation::AddLinkExtension(const char* e, LinkType type)
+void cmComputeLinkInformation::AddLinkExtension(std::string const& e,
+ LinkType type)
{
- if (e && *e) {
+ if (!e.empty()) {
if (type == LinkStatic) {
this->StaticLinkExtensions.emplace_back(e);
}
@@ -962,7 +962,7 @@ std::string cmComputeLinkInformation::CreateExtensionRegex(
// Store this extension choice with the "." escaped.
libext += "\\";
#if defined(_WIN32) && !defined(__CYGWIN__)
- libext += this->NoCaseExpression(i.c_str());
+ libext += this->NoCaseExpression(i);
#else
libext += i;
#endif
@@ -980,21 +980,19 @@ std::string cmComputeLinkInformation::CreateExtensionRegex(
return libext;
}
-std::string cmComputeLinkInformation::NoCaseExpression(const char* str)
+std::string cmComputeLinkInformation::NoCaseExpression(std::string const& str)
{
std::string ret;
- ret.reserve(strlen(str) * 4);
- const char* s = str;
- while (*s) {
- if (*s == '.') {
- ret += *s;
+ ret.reserve(str.size() * 4);
+ for (char c : str) {
+ if (c == '.') {
+ ret += c;
} else {
ret += '[';
- ret += static_cast<char>(tolower(*s));
- ret += static_cast<char>(toupper(*s));
+ ret += static_cast<char>(tolower(c));
+ ret += static_cast<char>(toupper(c));
ret += ']';
}
- s++;
}
return ret;
}
@@ -1688,7 +1686,7 @@ void cmComputeLinkInformation::AddLibraryRuntimeInfo(
}
}
-static void cmCLI_ExpandListUnique(const char* str,
+static void cmCLI_ExpandListUnique(std::string const& str,
std::vector<std::string>& out,
std::set<std::string>& emitted)
{
@@ -1735,7 +1733,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
if (use_install_rpath) {
std::string install_rpath;
this->Target->GetInstallRPATH(this->Config, install_rpath);
- cmCLI_ExpandListUnique(install_rpath.c_str(), runtimeDirs, emitted);
+ cmCLI_ExpandListUnique(install_rpath, runtimeDirs, emitted);
}
if (use_build_rpath) {
// Add directories explicitly specified by user
@@ -1743,7 +1741,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
if (this->Target->GetBuildRPATH(this->Config, build_rpath)) {
// This will not resolve entries to use $ORIGIN, the user is expected to
// do that if necessary.
- cmCLI_ExpandListUnique(build_rpath.c_str(), runtimeDirs, emitted);
+ cmCLI_ExpandListUnique(build_rpath, runtimeDirs, emitted);
}
}
if (use_build_rpath || use_link_rpath) {
@@ -1769,7 +1767,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
std::string d = ri;
if (!rootPath.empty() && cmHasPrefix(d, rootPath)) {
d.erase(0, rootPath.size());
- } else if (stagePath && *stagePath && cmHasPrefix(d, stagePath)) {
+ } else if (cmNonempty(stagePath) && cmHasPrefix(d, stagePath)) {
d.erase(0, strlen(stagePath));
d = cmStrCat(installPrefix, '/', d);
cmSystemTools::ConvertToUnixSlashes(d);
@@ -1800,7 +1798,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
std::string d = ri;
if (!rootPath.empty() && cmHasPrefix(d, rootPath)) {
d.erase(0, rootPath.size());
- } else if (stagePath && *stagePath && cmHasPrefix(d, stagePath)) {
+ } else if (cmNonempty(stagePath) && cmHasPrefix(d, stagePath)) {
d.erase(0, strlen(stagePath));
d = cmStrCat(installPrefix, '/', d);
cmSystemTools::ConvertToUnixSlashes(d);
@@ -1823,8 +1821,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
"CMAKE_" + li + "_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH";
if (this->Makefile->IsOn(useVar)) {
std::string dirVar = "CMAKE_" + li + "_IMPLICIT_LINK_DIRECTORIES";
- if (const char* dirs = this->Makefile->GetDefinition(dirVar)) {
- cmCLI_ExpandListUnique(dirs, runtimeDirs, emitted);
+ if (cmProp dirs = this->Makefile->GetDef(dirVar)) {
+ cmCLI_ExpandListUnique(*dirs, runtimeDirs, emitted);
}
}
}
@@ -1832,7 +1830,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
// Add runtime paths required by the platform to always be
// present. This is done even when skipping rpath support.
- cmCLI_ExpandListUnique(this->RuntimeAlways.c_str(), runtimeDirs, emitted);
+ cmCLI_ExpandListUnique(this->RuntimeAlways, runtimeDirs, emitted);
}
std::string cmComputeLinkInformation::GetRPathString(bool for_install) const
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index e50d369beb..544ff23f9f 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -144,11 +144,11 @@ private:
cmsys::RegularExpression ExtractSharedLibraryName;
cmsys::RegularExpression ExtractAnyLibraryName;
std::string SharedRegexString;
- void AddLinkPrefix(const char* p);
- void AddLinkExtension(const char* e, LinkType type);
+ void AddLinkPrefix(std::string const& p);
+ void AddLinkExtension(std::string const& e, LinkType type);
std::string CreateExtensionRegex(std::vector<std::string> const& exts,
LinkType type);
- std::string NoCaseExpression(const char* str);
+ std::string NoCaseExpression(std::string const& str);
// Handling of link items.
void AddTargetItem(BT<std::string> const& item,
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 41f5346356..e717f718d4 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -118,6 +118,7 @@ bool cmComputeTargetDepends::Compute()
// Identify components.
cmComputeComponentGraph ccg(this->InitialGraph);
+ ccg.Compute();
if (this->DebugMode) {
this->DisplayComponents(ccg);
}
@@ -184,7 +185,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
{
// Get the depender.
cmGeneratorTarget const* depender = this->Targets[depender_index];
- if (depender->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!depender->IsInBuildSystem()) {
return;
}
@@ -196,18 +197,20 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
std::set<cmLinkItem> emitted;
std::vector<std::string> const& configs =
- depender->Makefile->GetGeneratorConfigs();
+ depender->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
for (std::string const& it : configs) {
- cmLinkImplementation const* impl = depender->GetLinkImplementation(it);
-
// A target should not depend on itself.
emitted.insert(cmLinkItem(depender, false, cmListFileBacktrace()));
emitted.insert(cmLinkItem(depender, true, cmListFileBacktrace()));
- for (cmLinkImplItem const& lib : impl->Libraries) {
- // Don't emit the same library twice for this target.
- if (emitted.insert(lib).second) {
- this->AddTargetDepend(depender_index, lib, true, false);
- this->AddInterfaceDepends(depender_index, lib, it, emitted);
+
+ if (cmLinkImplementation const* impl =
+ depender->GetLinkImplementation(it)) {
+ for (cmLinkImplItem const& lib : impl->Libraries) {
+ // Don't emit the same library twice for this target.
+ if (emitted.insert(lib).second) {
+ this->AddTargetDepend(depender_index, lib, true, false);
+ this->AddInterfaceDepends(depender_index, lib, it, emitted);
+ }
}
}
@@ -356,10 +359,9 @@ void cmComputeTargetDepends::AddTargetDepend(
int depender_index, cmGeneratorTarget const* dependee,
cmListFileBacktrace const& dependee_backtrace, bool linking, bool cross)
{
- if (dependee->IsImported() ||
- dependee->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
- // Skip IMPORTED and INTERFACE targets but follow their utility
- // dependencies.
+ if (!dependee->IsInBuildSystem()) {
+ // Skip targets that are not in the buildsystem but follow their
+ // utility dependencies.
std::set<cmLinkItem> const& utils = dependee->GetUtilityItems();
for (cmLinkItem const& i : utils) {
if (cmGeneratorTarget const* transitive_dependee = i.Target) {
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 4de1c5d6f0..97e7856dd8 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -19,7 +19,6 @@
#cmakedefine HAVE_UNSETENV
#cmakedefine CMAKE_USE_ELF_PARSER
#cmakedefine CMAKE_USE_MACH_PARSER
-#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
#define CMake_DEFAULT_RECURSION_LIMIT @CMake_DEFAULT_RECURSION_LIMIT@
#define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index 5b3045db1a..68322cc0ea 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -60,6 +60,7 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args,
}
bool copyOnly = false;
bool escapeQuotes = false;
+ bool use_source_permissions = true;
static std::set<cm::string_view> noopOptions = {
/* Legacy. */
@@ -87,6 +88,8 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args,
escapeQuotes = true;
} else if (args[i] == "@ONLY") {
atOnly = true;
+ } else if (args[i] == "NO_SOURCE_PERMISSIONS") {
+ use_source_permissions = false;
} else if (noopOptions.find(args[i]) != noopOptions.end()) {
/* Ignore no-op options. */
} else {
@@ -102,7 +105,8 @@ bool cmConfigureFileCommand(std::vector<std::string> const& args,
}
if (!status.GetMakefile().ConfigureFile(
- inputFile, outputFile, copyOnly, atOnly, escapeQuotes, newLineStyle)) {
+ inputFile, outputFile, copyOnly, atOnly, escapeQuotes,
+ use_source_permissions, newLineStyle)) {
status.SetError("Problem configuring file");
return false;
}
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 8550d04da0..63c14842a3 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -18,6 +18,7 @@
#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
+#include "cmProperty.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -25,77 +26,205 @@
#include "cmVersion.h"
#include "cmake.h"
-static std::string const kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN =
- "CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN";
-static std::string const kCMAKE_C_COMPILER_TARGET = "CMAKE_C_COMPILER_TARGET";
-static std::string const kCMAKE_C_LINK_NO_PIE_SUPPORTED =
- "CMAKE_C_LINK_NO_PIE_SUPPORTED";
-static std::string const kCMAKE_C_LINK_PIE_SUPPORTED =
- "CMAKE_C_LINK_PIE_SUPPORTED";
-static std::string const kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN =
- "CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN";
-static std::string const kCMAKE_CXX_COMPILER_TARGET =
- "CMAKE_CXX_COMPILER_TARGET";
-static std::string const kCMAKE_CXX_LINK_NO_PIE_SUPPORTED =
- "CMAKE_CXX_LINK_NO_PIE_SUPPORTED";
-static std::string const kCMAKE_CXX_LINK_PIE_SUPPORTED =
- "CMAKE_CXX_LINK_PIE_SUPPORTED";
-static std::string const kCMAKE_CUDA_ARCHITECTURES =
- "CMAKE_CUDA_ARCHITECTURES";
-static std::string const kCMAKE_CUDA_COMPILER_TARGET =
- "CMAKE_CUDA_COMPILER_TARGET";
-static std::string const kCMAKE_CUDA_RUNTIME_LIBRARY =
- "CMAKE_CUDA_RUNTIME_LIBRARY";
-static std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS";
-static std::string const kCMAKE_LINK_SEARCH_END_STATIC =
+namespace {
+class LanguageStandardState
+{
+public:
+ LanguageStandardState(std::string&& lang)
+ : IsEnabled(false)
+ , DidStandard(false)
+ , DidStandardRequired(false)
+ , DidExtensions(false)
+ , StandardFlag(lang + "_STANDARD")
+ , RequiredFlag(lang + "_STANDARD_REQUIRED")
+ , ExtensionFlag(lang + "_EXTENSIONS")
+ {
+ }
+
+ void Enabled(bool isEnabled) { this->IsEnabled = isEnabled; }
+
+ bool UpdateIfMatches(std::vector<std::string> const& argv, size_t& index)
+ {
+ bool updated = false;
+ if (argv[index] == this->StandardFlag) {
+ this->DidStandard = true;
+ this->StandardValue = argv[++index];
+ updated = true;
+ } else if (argv[index] == this->RequiredFlag) {
+ this->DidStandardRequired = true;
+ this->RequiredValue = argv[++index];
+ updated = true;
+ } else if (argv[index] == this->ExtensionFlag) {
+ this->DidExtensions = true;
+ this->ExtensionValue = argv[++index];
+ updated = true;
+ }
+ return updated;
+ }
+
+ bool Validate(cmMakefile* const makefile) const
+ {
+ if (this->DidStandard) {
+ makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(this->StandardFlag,
+ " allowed only in source file signature."));
+ return false;
+ }
+ if (this->DidStandardRequired) {
+ makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(this->RequiredFlag,
+ " allowed only in source file signature."));
+ return false;
+ }
+ if (this->DidExtensions) {
+ makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(this->ExtensionFlag,
+ " allowed only in source file signature."));
+ return false;
+ }
+
+ return true;
+ }
+
+ bool DidNone() const
+ {
+ return !this->DidStandard && !this->DidStandardRequired &&
+ !this->DidExtensions;
+ }
+
+ void LoadUnsetPropertyValues(cmMakefile* const makefile, bool honorStandard,
+ bool warnCMP0067,
+ std::vector<std::string>& warnCMP0067Variables)
+ {
+ if (!this->IsEnabled) {
+ return;
+ }
+
+ auto lookupStdVar = [&](std::string const& var) -> std::string {
+ std::string value = makefile->GetSafeDefinition(var);
+ if (warnCMP0067 && !value.empty()) {
+ value.clear();
+ warnCMP0067Variables.push_back(var);
+ }
+ return value;
+ };
+
+ if (honorStandard || warnCMP0067) {
+ if (!this->DidStandard) {
+ this->StandardValue =
+ lookupStdVar(cmStrCat("CMAKE_", this->StandardFlag));
+ }
+ if (!this->DidStandardRequired) {
+ this->RequiredValue =
+ lookupStdVar(cmStrCat("CMAKE_", this->RequiredFlag));
+ }
+ if (!this->DidExtensions) {
+ this->ExtensionValue =
+ lookupStdVar(cmStrCat("CMAKE_", this->ExtensionFlag));
+ }
+ }
+ }
+
+ void WriteProperties(FILE* fout, std::string const& targetName) const
+ {
+ if (!this->IsEnabled) {
+ return;
+ }
+
+ auto writeProp = [&](std::string const& prop, std::string const& value) {
+ fprintf(fout, "set_property(TARGET %s PROPERTY %s %s)\n",
+ targetName.c_str(),
+ cmOutputConverter::EscapeForCMake(prop).c_str(),
+ cmOutputConverter::EscapeForCMake(value).c_str());
+ };
+
+ if (!this->StandardValue.empty()) {
+ writeProp(this->StandardFlag, this->StandardValue);
+ }
+ if (!this->RequiredValue.empty()) {
+ writeProp(this->RequiredFlag, this->RequiredValue);
+ }
+ if (!this->ExtensionValue.empty()) {
+ writeProp(this->ExtensionFlag, this->ExtensionValue);
+ }
+ }
+
+private:
+ bool IsEnabled;
+ bool DidStandard;
+ bool DidStandardRequired;
+ bool DidExtensions;
+
+ std::string StandardFlag;
+ std::string RequiredFlag;
+ std::string ExtensionFlag;
+
+ std::string StandardValue;
+ std::string RequiredValue;
+ std::string ExtensionValue;
+};
+
+constexpr size_t lang_property_start = 0;
+constexpr size_t lang_property_size = 4;
+constexpr size_t pie_property_start = 4;
+constexpr size_t pie_property_size = 2;
+#define SETUP_LANGUAGE(name, lang) \
+ static const std::string name[lang_property_size + pie_property_size + 1] = \
+ { "CMAKE_" #lang "_COMPILER_EXTERNAL_TOOLCHAIN", \
+ "CMAKE_" #lang "_COMPILER_TARGET", \
+ "CMAKE_" #lang "_LINK_NO_PIE_SUPPORTED", \
+ "CMAKE_" #lang "_PIE_SUPPORTED", "" }
+
+// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
+SETUP_LANGUAGE(c_properties, C);
+// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
+SETUP_LANGUAGE(cxx_properties, CXX);
+
+// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
+SETUP_LANGUAGE(cuda_properties, CUDA);
+// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
+SETUP_LANGUAGE(fortran_properties, Fortran);
+// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
+SETUP_LANGUAGE(objc_properties, OBJC);
+// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
+SETUP_LANGUAGE(objcxx_properties, OBJCXX);
+// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
+SETUP_LANGUAGE(swift_properties, Swift);
+#undef SETUP_LANGUAGE
+
+std::string const kCMAKE_CUDA_ARCHITECTURES = "CMAKE_CUDA_ARCHITECTURES";
+std::string const kCMAKE_CUDA_RUNTIME_LIBRARY = "CMAKE_CUDA_RUNTIME_LIBRARY";
+std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS";
+std::string const kCMAKE_LINK_SEARCH_END_STATIC =
"CMAKE_LINK_SEARCH_END_STATIC";
-static std::string const kCMAKE_LINK_SEARCH_START_STATIC =
+std::string const kCMAKE_LINK_SEARCH_START_STATIC =
"CMAKE_LINK_SEARCH_START_STATIC";
-static std::string const kCMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT =
+std::string const kCMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT =
"CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT";
-static std::string const kCMAKE_OSX_ARCHITECTURES = "CMAKE_OSX_ARCHITECTURES";
-static std::string const kCMAKE_OSX_DEPLOYMENT_TARGET =
- "CMAKE_OSX_DEPLOYMENT_TARGET";
-static std::string const kCMAKE_OSX_SYSROOT = "CMAKE_OSX_SYSROOT";
-static std::string const kCMAKE_APPLE_ARCH_SYSROOTS =
- "CMAKE_APPLE_ARCH_SYSROOTS";
-static std::string const kCMAKE_POSITION_INDEPENDENT_CODE =
+std::string const kCMAKE_OSX_ARCHITECTURES = "CMAKE_OSX_ARCHITECTURES";
+std::string const kCMAKE_OSX_DEPLOYMENT_TARGET = "CMAKE_OSX_DEPLOYMENT_TARGET";
+std::string const kCMAKE_OSX_SYSROOT = "CMAKE_OSX_SYSROOT";
+std::string const kCMAKE_APPLE_ARCH_SYSROOTS = "CMAKE_APPLE_ARCH_SYSROOTS";
+std::string const kCMAKE_POSITION_INDEPENDENT_CODE =
"CMAKE_POSITION_INDEPENDENT_CODE";
-static std::string const kCMAKE_SYSROOT = "CMAKE_SYSROOT";
-static std::string const kCMAKE_SYSROOT_COMPILE = "CMAKE_SYSROOT_COMPILE";
-static std::string const kCMAKE_SYSROOT_LINK = "CMAKE_SYSROOT_LINK";
-static std::string const kCMAKE_Swift_COMPILER_TARGET =
- "CMAKE_Swift_COMPILER_TARGET";
-static std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES =
+std::string const kCMAKE_SYSROOT = "CMAKE_SYSROOT";
+std::string const kCMAKE_SYSROOT_COMPILE = "CMAKE_SYSROOT_COMPILE";
+std::string const kCMAKE_SYSROOT_LINK = "CMAKE_SYSROOT_LINK";
+std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES =
"CMAKE_TRY_COMPILE_OSX_ARCHITECTURES";
-static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES =
+std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES =
"CMAKE_TRY_COMPILE_PLATFORM_VARIABLES";
-static std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED";
+std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED";
/* GHS Multi platform variables */
-static std::set<std::string> ghs_platform_vars{
+std::set<std::string> const ghs_platform_vars{
"GHS_TARGET_PLATFORM", "GHS_PRIMARY_TARGET", "GHS_TOOLSET_ROOT",
"GHS_OS_ROOT", "GHS_OS_DIR", "GHS_BSP_NAME",
"GHS_OS_DIR_OPTION"
};
-
-static void writeProperty(FILE* fout, std::string const& targetName,
- std::string const& prop, std::string const& value)
-{
- fprintf(fout, "set_property(TARGET %s PROPERTY %s %s)\n", targetName.c_str(),
- cmOutputConverter::EscapeForCMake(prop).c_str(),
- cmOutputConverter::EscapeForCMake(value).c_str());
-}
-
-std::string cmCoreTryCompile::LookupStdVar(std::string const& var,
- bool warnCMP0067)
-{
- std::string value = this->Makefile->GetSafeDefinition(var);
- if (warnCMP0067 && !value.empty()) {
- value.clear();
- this->WarnCMP0067.push_back(var);
- }
- return value;
}
int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
@@ -107,9 +236,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
this->SrcFileSignature = true;
cmStateEnums::TargetType targetType = cmStateEnums::EXECUTABLE;
- const std::string* tt =
- this->Makefile->GetDef("CMAKE_TRY_COMPILE_TARGET_TYPE");
- if (!isTryRun && tt && !tt->empty()) {
+ cmProp tt = this->Makefile->GetDef("CMAKE_TRY_COMPILE_TARGET_TYPE");
+ if (!isTryRun && cmNonempty(tt)) {
if (*tt == cmState::GetTargetTypeName(cmStateEnums::EXECUTABLE)) {
targetType = cmStateEnums::EXECUTABLE;
} else if (*tt ==
@@ -137,21 +265,11 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
std::string outputVariable;
std::string copyFile;
std::string copyFileError;
- std::string cStandard;
- std::string objcStandard;
- std::string cxxStandard;
- std::string objcxxStandard;
- std::string cudaStandard;
- std::string cStandardRequired;
- std::string cxxStandardRequired;
- std::string objcStandardRequired;
- std::string objcxxStandardRequired;
- std::string cudaStandardRequired;
- std::string cExtensions;
- std::string cxxExtensions;
- std::string objcExtensions;
- std::string objcxxExtensions;
- std::string cudaExtensions;
+ LanguageStandardState cState("C");
+ LanguageStandardState cudaState("CUDA");
+ LanguageStandardState cxxState("CXX");
+ LanguageStandardState objcState("OBJC");
+ LanguageStandardState objcxxState("OBJCXX");
std::vector<std::string> targets;
std::vector<std::string> linkOptions;
std::string libsToLink = " ";
@@ -160,21 +278,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
bool didOutputVariable = false;
bool didCopyFile = false;
bool didCopyFileError = false;
- bool didCStandard = false;
- bool didCxxStandard = false;
- bool didObjCStandard = false;
- bool didObjCxxStandard = false;
- bool didCudaStandard = false;
- bool didCStandardRequired = false;
- bool didCxxStandardRequired = false;
- bool didObjCStandardRequired = false;
- bool didObjCxxStandardRequired = false;
- bool didCudaStandardRequired = false;
- bool didCExtensions = false;
- bool didCxxExtensions = false;
- bool didObjCExtensions = false;
- bool didObjCxxExtensions = false;
- bool didCudaExtensions = false;
bool useSources = argv[2] == "SOURCES";
std::vector<std::string> sources;
@@ -188,21 +291,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
DoingOutputVariable,
DoingCopyFile,
DoingCopyFileError,
- DoingCStandard,
- DoingCxxStandard,
- DoingObjCStandard,
- DoingObjCxxStandard,
- DoingCudaStandard,
- DoingCStandardRequired,
- DoingCxxStandardRequired,
- DoingObjCStandardRequired,
- DoingObjCxxStandardRequired,
- DoingCudaStandardRequired,
- DoingCExtensions,
- DoingCxxExtensions,
- DoingObjCExtensions,
- DoingObjCxxExtensions,
- DoingCudaExtensions,
DoingSources,
DoingCMakeInternal
};
@@ -226,51 +314,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
} else if (argv[i] == "COPY_FILE_ERROR") {
doing = DoingCopyFileError;
didCopyFileError = true;
- } else if (argv[i] == "C_STANDARD") {
- doing = DoingCStandard;
- didCStandard = true;
- } else if (argv[i] == "CXX_STANDARD") {
- doing = DoingCxxStandard;
- didCxxStandard = true;
- } else if (argv[i] == "OBJC_STANDARD") {
- doing = DoingObjCStandard;
- didObjCStandard = true;
- } else if (argv[i] == "OBJCXX_STANDARD") {
- doing = DoingObjCxxStandard;
- didObjCxxStandard = true;
- } else if (argv[i] == "CUDA_STANDARD") {
- doing = DoingCudaStandard;
- didCudaStandard = true;
- } else if (argv[i] == "C_STANDARD_REQUIRED") {
- doing = DoingCStandardRequired;
- didCStandardRequired = true;
- } else if (argv[i] == "CXX_STANDARD_REQUIRED") {
- doing = DoingCxxStandardRequired;
- didCxxStandardRequired = true;
- } else if (argv[i] == "OBJC_STANDARD_REQUIRED") {
- doing = DoingObjCStandardRequired;
- didObjCStandardRequired = true;
- } else if (argv[i] == "OBJCXX_STANDARD_REQUIRED") {
- doing = DoingObjCxxStandardRequired;
- didObjCxxStandardRequired = true;
- } else if (argv[i] == "CUDA_STANDARD_REQUIRED") {
- doing = DoingCudaStandardRequired;
- didCudaStandardRequired = true;
- } else if (argv[i] == "C_EXTENSIONS") {
- doing = DoingCExtensions;
- didCExtensions = true;
- } else if (argv[i] == "CXX_EXTENSIONS") {
- doing = DoingCxxExtensions;
- didCxxExtensions = true;
- } else if (argv[i] == "OBJC_EXTENSIONS") {
- doing = DoingObjCExtensions;
- didObjCExtensions = true;
- } else if (argv[i] == "OBJCXX_EXTENSIONS") {
- doing = DoingObjCxxExtensions;
- didObjCxxExtensions = true;
- } else if (argv[i] == "CUDA_EXTENSIONS") {
- doing = DoingCudaExtensions;
- didCudaExtensions = true;
+ } else if (cState.UpdateIfMatches(argv, i) ||
+ cxxState.UpdateIfMatches(argv, i) ||
+ cudaState.UpdateIfMatches(argv, i) ||
+ objcState.UpdateIfMatches(argv, i) ||
+ objcxxState.UpdateIfMatches(argv, i)) {
+ continue;
} else if (argv[i] == "__CMAKE_INTERNAL") {
doing = DoingCMakeInternal;
} else if (doing == DoingCMakeFlags) {
@@ -315,51 +364,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
} else if (doing == DoingCopyFileError) {
copyFileError = argv[i];
doing = DoingNone;
- } else if (doing == DoingCStandard) {
- cStandard = argv[i];
- doing = DoingNone;
- } else if (doing == DoingCxxStandard) {
- cxxStandard = argv[i];
- doing = DoingNone;
- } else if (doing == DoingObjCStandard) {
- objcStandard = argv[i];
- doing = DoingNone;
- } else if (doing == DoingObjCxxStandard) {
- objcxxStandard = argv[i];
- doing = DoingNone;
- } else if (doing == DoingCudaStandard) {
- cudaStandard = argv[i];
- doing = DoingNone;
- } else if (doing == DoingCStandardRequired) {
- cStandardRequired = argv[i];
- doing = DoingNone;
- } else if (doing == DoingCxxStandardRequired) {
- cxxStandardRequired = argv[i];
- doing = DoingNone;
- } else if (doing == DoingObjCStandardRequired) {
- objcStandardRequired = argv[i];
- doing = DoingNone;
- } else if (doing == DoingObjCxxStandardRequired) {
- objcxxStandardRequired = argv[i];
- doing = DoingNone;
- } else if (doing == DoingCudaStandardRequired) {
- cudaStandardRequired = argv[i];
- doing = DoingNone;
- } else if (doing == DoingCExtensions) {
- cExtensions = argv[i];
- doing = DoingNone;
- } else if (doing == DoingCxxExtensions) {
- cxxExtensions = argv[i];
- doing = DoingNone;
- } else if (doing == DoingObjCExtensions) {
- objcExtensions = argv[i];
- doing = DoingNone;
- } else if (doing == DoingObjCxxExtensions) {
- objcxxExtensions = argv[i];
- doing = DoingNone;
- } else if (doing == DoingCudaExtensions) {
- cudaExtensions = argv[i];
- doing = DoingNone;
} else if (doing == DoingSources) {
sources.push_back(argv[i]);
} else if (doing == DoingCMakeInternal) {
@@ -411,59 +415,22 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
return -1;
}
- if (didCStandard && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "C_STANDARD allowed only in source file signature.");
- return -1;
- }
- if (didCxxStandard && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "CXX_STANDARD allowed only in source file signature.");
- return -1;
- }
- if (didCudaStandard && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "CUDA_STANDARD allowed only in source file signature.");
- return -1;
- }
- if (didCStandardRequired && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "C_STANDARD_REQUIRED allowed only in source file signature.");
- return -1;
- }
- if (didCxxStandardRequired && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "CXX_STANDARD_REQUIRED allowed only in source file signature.");
- return -1;
- }
- if (didCudaStandardRequired && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "CUDA_STANDARD_REQUIRED allowed only in source file signature.");
- return -1;
- }
- if (didCExtensions && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "C_EXTENSIONS allowed only in source file signature.");
- return -1;
- }
- if (didCxxExtensions && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "CXX_EXTENSIONS allowed only in source file signature.");
- return -1;
- }
- if (didCudaExtensions && !this->SrcFileSignature) {
- this->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "CUDA_EXTENSIONS allowed only in source file signature.");
- return -1;
+ if (!this->SrcFileSignature) {
+ if (!cState.Validate(this->Makefile)) {
+ return -1;
+ }
+ if (!cudaState.Validate(this->Makefile)) {
+ return -1;
+ }
+ if (!cxxState.Validate(this->Makefile)) {
+ return -1;
+ }
+ if (!objcState.Validate(this->Makefile)) {
+ return -1;
+ }
+ if (!objcxxState.Validate(this->Makefile)) {
+ return -1;
+ }
}
// compute the binary dir when TRY_COMPILE is called with a src file
@@ -721,12 +688,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
// Forward a set of variables to the inner project cache.
{
std::set<std::string> vars;
- vars.insert(kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN);
- vars.insert(kCMAKE_C_COMPILER_TARGET);
- vars.insert(kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN);
- vars.insert(kCMAKE_CXX_COMPILER_TARGET);
+ vars.insert(&c_properties[lang_property_start],
+ &c_properties[lang_property_start + lang_property_size]);
+ vars.insert(&cxx_properties[lang_property_start],
+ &cxx_properties[lang_property_start + lang_property_size]);
+ vars.insert(&cuda_properties[lang_property_start],
+ &cuda_properties[lang_property_start + lang_property_size]);
+ vars.insert(
+ &fortran_properties[lang_property_start],
+ &fortran_properties[lang_property_start + lang_property_size]);
+ vars.insert(&objc_properties[lang_property_start],
+ &objc_properties[lang_property_start + lang_property_size]);
+ vars.insert(
+ &objcxx_properties[lang_property_start],
+ &objcxx_properties[lang_property_start + lang_property_size]);
+ vars.insert(&swift_properties[lang_property_start],
+ &swift_properties[lang_property_start + lang_property_size]);
vars.insert(kCMAKE_CUDA_ARCHITECTURES);
- vars.insert(kCMAKE_CUDA_COMPILER_TARGET);
vars.insert(kCMAKE_CUDA_RUNTIME_LIBRARY);
vars.insert(kCMAKE_ENABLE_EXPORTS);
vars.insert(kCMAKE_LINK_SEARCH_END_STATIC);
@@ -739,7 +717,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
vars.insert(kCMAKE_SYSROOT);
vars.insert(kCMAKE_SYSROOT_COMPILE);
vars.insert(kCMAKE_SYSROOT_LINK);
- vars.insert(kCMAKE_Swift_COMPILER_TARGET);
vars.insert(kCMAKE_WARN_DEPRECATED);
vars.emplace("CMAKE_MSVC_RUNTIME_LIBRARY"_s);
@@ -753,10 +730,22 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
cmPolicies::NEW) {
// To ensure full support of PIE, propagate cache variables
// driving the link options
- vars.insert(kCMAKE_C_LINK_PIE_SUPPORTED);
- vars.insert(kCMAKE_C_LINK_NO_PIE_SUPPORTED);
- vars.insert(kCMAKE_CXX_LINK_PIE_SUPPORTED);
- vars.insert(kCMAKE_CXX_LINK_NO_PIE_SUPPORTED);
+ vars.insert(&c_properties[pie_property_start],
+ &c_properties[pie_property_start + pie_property_size]);
+ vars.insert(&cxx_properties[pie_property_start],
+ &cxx_properties[pie_property_start + pie_property_size]);
+ vars.insert(&cuda_properties[pie_property_start],
+ &cuda_properties[pie_property_start + pie_property_size]);
+ vars.insert(
+ &fortran_properties[pie_property_start],
+ &fortran_properties[pie_property_start + pie_property_size]);
+ vars.insert(&objc_properties[pie_property_start],
+ &objc_properties[pie_property_start + pie_property_size]);
+ vars.insert(
+ &objcxx_properties[pie_property_start],
+ &objcxx_properties[pie_property_start + pie_property_size]);
+ vars.insert(&swift_properties[pie_property_start],
+ &swift_properties[pie_property_start + pie_property_size]);
}
/* for the TRY_COMPILEs we want to be able to specify the architecture.
@@ -819,21 +808,17 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
fprintf(fout, ")\n");
- bool const testC = testLangs.find("C") != testLangs.end();
- bool const testObjC = testLangs.find("OBJC") != testLangs.end();
- bool const testCxx = testLangs.find("CXX") != testLangs.end();
- bool const testObjCxx = testLangs.find("OBJCXX") != testLangs.end();
- bool const testCuda = testLangs.find("CUDA") != testLangs.end();
+ cState.Enabled(testLangs.find("C") != testLangs.end());
+ cxxState.Enabled(testLangs.find("CXX") != testLangs.end());
+ cudaState.Enabled(testLangs.find("CUDA") != testLangs.end());
+ objcState.Enabled(testLangs.find("OBJC") != testLangs.end());
+ objcxxState.Enabled(testLangs.find("OBJCXX") != testLangs.end());
bool warnCMP0067 = false;
bool honorStandard = true;
- if (!didCStandard && !didCxxStandard && !didObjCStandard &&
- !didObjCxxStandard && !didCudaStandard && !didCStandardRequired &&
- !didCxxStandardRequired && !didObjCStandardRequired &&
- !didObjCxxStandardRequired && !didCudaStandardRequired &&
- !didCExtensions && !didCxxExtensions && !didObjCExtensions &&
- !didObjCxxExtensions && !didCudaExtensions) {
+ if (cState.DidNone() && cxxState.DidNone() && objcState.DidNone() &&
+ objcxxState.DidNone() && cudaState.DidNone()) {
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0067)) {
case cmPolicies::WARN:
warnCMP0067 = this->Makefile->PolicyOptionalWarningEnabled(
@@ -855,46 +840,20 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
}
- if (honorStandard || warnCMP0067) {
+ std::vector<std::string> warnCMP0067Variables;
- auto testLanguage =
- [&](bool testLang, bool didLangStandard, bool didLangStandardRequired,
- bool didLangExtensions, std::string& langStandard,
- std::string& langStandardRequired, std::string& langExtensions,
- const std::string& lang) {
- if (testLang) {
- if (!didLangStandard) {
- langStandard = this->LookupStdVar(
- cmStrCat("CMAKE_", lang, "_STANDARD"), warnCMP0067);
- }
- if (!didLangStandardRequired) {
- langStandardRequired = this->LookupStdVar(
- cmStrCat("CMAKE_", lang, "_STANDARD_REQUIRED"), warnCMP0067);
- }
- if (!didLangExtensions) {
- langExtensions = this->LookupStdVar(
- cmStrCat("CMAKE_", lang, "_EXTENSIONS"), warnCMP0067);
- }
- }
- };
-
- testLanguage(testC, didCStandard, didCStandardRequired, didCExtensions,
- cStandard, cStandardRequired, cExtensions, "C");
- testLanguage(testObjC, didObjCStandard, didObjCStandardRequired,
- didObjCExtensions, objcStandard, objcStandardRequired,
- objcExtensions, "OBJC");
- testLanguage(testCxx, didCxxStandard, didCxxStandardRequired,
- didCxxExtensions, cxxStandard, cxxStandardRequired,
- cxxExtensions, "CXX");
- testLanguage(testObjCxx, didObjCxxStandard, didObjCxxStandardRequired,
- didObjCxxExtensions, objcxxStandard, objcxxStandardRequired,
- objcxxExtensions, "OBJCXX");
- testLanguage(testCuda, didCudaStandard, didCudaStandardRequired,
- didCudaExtensions, cudaStandard, cudaStandardRequired,
- cudaExtensions, "CUDA");
- }
+ cState.LoadUnsetPropertyValues(this->Makefile, honorStandard, warnCMP0067,
+ warnCMP0067Variables);
+ cxxState.LoadUnsetPropertyValues(this->Makefile, honorStandard,
+ warnCMP0067, warnCMP0067Variables);
+ cudaState.LoadUnsetPropertyValues(this->Makefile, honorStandard,
+ warnCMP0067, warnCMP0067Variables);
+ objcState.LoadUnsetPropertyValues(this->Makefile, honorStandard,
+ warnCMP0067, warnCMP0067Variables);
+ objcxxState.LoadUnsetPropertyValues(this->Makefile, honorStandard,
+ warnCMP0067, warnCMP0067Variables);
- if (!this->WarnCMP0067.empty()) {
+ if (!warnCMP0067Variables.empty()) {
std::ostringstream w;
/* clang-format off */
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0067) << "\n"
@@ -902,43 +861,17 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
"is not honoring language standard variables in the test project:\n"
;
/* clang-format on */
- for (std::string const& vi : this->WarnCMP0067) {
+ for (std::string const& vi : warnCMP0067Variables) {
w << " " << vi << "\n";
}
this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
- auto writeLanguageProperties = [&](bool testLang,
- const std::string& langStandard,
- const std::string& langStandardRequired,
- const std::string& langExtensions,
- const std::string& lang) {
- if (testLang) {
- if (!langStandard.empty()) {
- writeProperty(fout, targetName, cmStrCat(lang, "_STANDARD"),
- langStandard);
- }
- if (!langStandardRequired.empty()) {
- writeProperty(fout, targetName, cmStrCat(lang, "_STANDARD_REQUIRED"),
- langStandardRequired);
- }
- if (!langExtensions.empty()) {
- writeProperty(fout, targetName, cmStrCat(lang, "_EXTENSIONS"),
- langExtensions);
- }
- }
- };
-
- writeLanguageProperties(testC, cStandard, cStandardRequired, cExtensions,
- "C");
- writeLanguageProperties(testObjC, objcStandard, objcStandardRequired,
- objcExtensions, "OBJC");
- writeLanguageProperties(testCxx, cxxStandard, cxxStandardRequired,
- cxxExtensions, "CXX");
- writeLanguageProperties(testObjCxx, objcxxStandard, objcxxStandardRequired,
- objcxxExtensions, "OBJCXX");
- writeLanguageProperties(testCuda, cudaStandard, cudaStandardRequired,
- cudaExtensions, "CUDA");
+ cState.WriteProperties(fout, targetName);
+ cxxState.WriteProperties(fout, targetName);
+ cudaState.WriteProperties(fout, targetName);
+ objcState.WriteProperties(fout, targetName);
+ objcxxState.WriteProperties(fout, targetName);
if (!linkOptions.empty()) {
std::vector<std::string> options;
@@ -1112,14 +1045,14 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName,
const char* config =
this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
// if a config was specified try that first
- if (config && config[0]) {
+ if (cmNonempty(config)) {
std::string tmp = cmStrCat('/', config);
searchDirs.push_back(std::move(tmp));
}
searchDirs.emplace_back("/Debug");
#if defined(__APPLE__)
std::string app = "/" + targetName + ".app";
- if (config && config[0]) {
+ if (cmNonempty(config)) {
std::string tmp = cmStrCat('/', config, app);
searchDirs.push_back(std::move(tmp));
}
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h
index ae714a63a3..916572aa26 100644
--- a/Source/cmCoreTryCompile.h
+++ b/Source/cmCoreTryCompile.h
@@ -47,10 +47,6 @@ protected:
std::string OutputFile;
std::string FindErrorMessage;
bool SrcFileSignature = false;
-
-private:
- std::vector<std::string> WarnCMP0067;
- std::string LookupStdVar(std::string const& var, bool warnCMP0067);
};
#endif
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index 9d492ba845..9c4deea1e2 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)) {
+ if (!mf.ConfigureFile(configFile, driver, false, true, false, true)) {
res = false;
}
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 69a64276bc..4a4f87d8b2 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -19,7 +19,6 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(const std::string& key,
{
auto it = begin->Map.find(cm::String::borrow(key));
if (it != begin->Map.end()) {
- it->second.Used = true;
return it->second;
}
}
@@ -108,16 +107,3 @@ void cmDefinitions::Unset(const std::string& key)
{
this->Map[key] = Def();
}
-
-std::vector<std::string> cmDefinitions::UnusedKeys() const
-{
- std::vector<std::string> keys;
- keys.reserve(this->Map.size());
- // Consider local definitions.
- for (auto const& mi : this->Map) {
- if (!mi.second.Used) {
- keys.push_back(*mi.first.str_if_stable());
- }
- }
- return keys;
-}
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 0e38fb1af2..d57750a072 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -48,9 +48,6 @@ public:
/** Unset a definition. */
void Unset(const std::string& key);
- /** List of unused keys. */
- std::vector<std::string> UnusedKeys() const;
-
private:
/** String with existence boolean. */
struct Def
@@ -62,7 +59,6 @@ private:
{
}
cm::String Value;
- bool Used = false;
};
static Def NoDef;
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 8f02d95515..54418df2f9 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -395,7 +395,7 @@ bool cmDependsFortran::WriteDependenciesReal(std::string const& obj,
<< ' ' << stampFileForShell;
cmMakefile* mf = this->LocalGenerator->GetMakefile();
const char* cid = mf->GetDefinition("CMAKE_Fortran_COMPILER_ID");
- if (cid && *cid) {
+ if (cmNonempty(cid)) {
makeDepends << ' ' << cid;
}
makeDepends << '\n';
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 9f8a821e6f..352eaf2911 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -223,11 +223,9 @@ bool cmExportCommand(std::vector<std::string> const& args,
ebfg->SetExportOld(arguments.ExportOld);
// Compute the set of configurations exported.
- std::vector<std::string> configurationTypes;
- mf.GetConfigurations(configurationTypes);
- if (configurationTypes.empty()) {
- configurationTypes.emplace_back();
- }
+ std::vector<std::string> configurationTypes =
+ mf.GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
+
for (std::string const& ct : configurationTypes) {
ebfg->AddConfiguration(ct);
}
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 4d0e0996af..58aa391092 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -567,8 +567,9 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
if (gtarget->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
getCompatibleInterfaceProperties(gtarget, ifaceProperties, "");
- std::vector<std::string> configNames;
- gtarget->Target->GetMakefile()->GetConfigurations(configNames);
+ std::vector<std::string> configNames =
+ gtarget->Target->GetMakefile()->GetGeneratorConfigs(
+ cmMakefile::ExcludeEmptyConfig);
for (std::string const& cn : configNames) {
getCompatibleInterfaceProperties(gtarget, ifaceProperties, cn);
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 32b0ca93bf..511168bacf 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -95,7 +95,7 @@ struct Tree
std::string path; // only one component of the path
std::vector<Tree> folders;
std::set<std::string> files;
- void InsertPath(const std::vector<std::string>& splitted,
+ void InsertPath(const std::vector<std::string>& split,
std::vector<std::string>::size_type start,
const std::string& fileName);
void BuildVirtualFolder(cmXMLWriter& xml) const;
@@ -106,34 +106,34 @@ struct Tree
const std::string& fsPath) const;
};
-void Tree::InsertPath(const std::vector<std::string>& splitted,
+void Tree::InsertPath(const std::vector<std::string>& split,
std::vector<std::string>::size_type start,
const std::string& fileName)
{
- if (start == splitted.size()) {
+ if (start == split.size()) {
files.insert(fileName);
return;
}
for (Tree& folder : folders) {
- if (folder.path == splitted[start]) {
- if (start + 1 < splitted.size()) {
- folder.InsertPath(splitted, start + 1, fileName);
+ if (folder.path == split[start]) {
+ if (start + 1 < split.size()) {
+ folder.InsertPath(split, start + 1, fileName);
return;
}
- // last part of splitted
+ // last part of split
folder.files.insert(fileName);
return;
}
}
// Not found in folders, thus insert
Tree newFolder;
- newFolder.path = splitted[start];
- if (start + 1 < splitted.size()) {
- newFolder.InsertPath(splitted, start + 1, fileName);
+ newFolder.path = split[start];
+ if (start + 1 < split.size()) {
+ newFolder.InsertPath(split, start + 1, fileName);
folders.push_back(newFolder);
return;
}
- // last part of splitted
+ // last part of split
newFolder.files.insert(fileName);
folders.push_back(newFolder);
}
@@ -224,11 +224,11 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
const std::string& relative = cmSystemTools::RelativePath(
it.second[0]->GetSourceDirectory(), listFile);
- std::vector<std::string> splitted;
- cmSystemTools::SplitPath(relative, splitted, false);
+ std::vector<std::string> split;
+ cmSystemTools::SplitPath(relative, split, false);
// Split filename from path
- std::string fileName = *(splitted.end() - 1);
- splitted.erase(splitted.end() - 1, splitted.end());
+ std::string fileName = *(split.end() - 1);
+ split.erase(split.end() - 1, split.end());
// We don't want paths with CMakeFiles in them
// or do we?
@@ -236,13 +236,12 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
//
// Also we can disable external (outside the project) files by setting ON
// CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES variable.
- const bool excludeExternal =
- cmIsOn(it.second[0]->GetMakefile()->GetSafeDefinition(
- "CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES"));
- if (!splitted.empty() &&
+ const bool excludeExternal = it.second[0]->GetMakefile()->IsOn(
+ "CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES");
+ if (!split.empty() &&
(!excludeExternal || (relative.find("..") == std::string::npos)) &&
relative.find("CMakeFiles") == std::string::npos) {
- tree.InsertPath(splitted, 1, fileName);
+ tree.InsertPath(split, 1, fileName);
}
}
}
@@ -370,7 +369,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
std::string lang = s->GetOrDetermineLanguage();
if (lang == "C" || lang == "CXX" || lang == "CUDA") {
std::string const& srcext = s->GetExtension();
- isCFile = cm->IsSourceExtension(srcext);
+ isCFile = cm->IsACLikeSourceExtension(srcext);
}
std::string const& fullPath = s->ResolveFullPath();
@@ -380,9 +379,8 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
cmSystemTools::RelativePath(lg->GetSourceDirectory(), fullPath);
// Do not add this file if it has ".." in relative path and
// if CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES variable is on.
- const bool excludeExternal =
- cmIsOn(lg->GetMakefile()->GetSafeDefinition(
- "CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES"));
+ const bool excludeExternal = lg->GetMakefile()->IsOn(
+ "CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES");
if (excludeExternal &&
(relative.find("..") != std::string::npos)) {
continue;
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index bf7555d98a..95cfb0a451 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -227,8 +227,7 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
cmSystemTools::LowerCase(s->GetExtension());
// check whether it is a source or a include file
// then put it accordingly into one of the two containers
- if (cm->IsSourceExtension(extLower) || cm->IsCudaExtension(extLower) ||
- cm->IsFortranExtension(extLower)) {
+ if (cm->IsAKnownSourceExtension(extLower)) {
cFiles[fullPath] = s;
} else {
otherFiles.insert(fullPath);
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 7bc45360d1..b6c0a7a875 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -604,7 +604,7 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{
- std::set<std::string> emmited;
+ std::set<std::string> emitted;
const auto& lg = this->GlobalGenerator->GetLocalGenerators()[0];
const cmMakefile* mf = lg->GetMakefile();
@@ -751,7 +751,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
xml.EndElement();
// add pre-processor definitions to allow eclipse to gray out sections
- emmited.clear();
+ emitted.clear();
for (const auto& lgen : this->GlobalGenerator->GetLocalGenerators()) {
if (cmProp cdefs =
@@ -780,8 +780,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
// insert the definition if not already added.
- if (emmited.find(def) == emmited.end()) {
- emmited.insert(def);
+ if (emitted.find(def) == emitted.end()) {
+ emitted.insert(def);
xml.StartElement("pathentry");
xml.Attribute("kind", "mac");
xml.Attribute("name", def);
@@ -812,8 +812,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
// insert the definition if not already added.
- if (emmited.find(def) == emmited.end()) {
- emmited.insert(def);
+ if (emitted.find(def) == emitted.end()) {
+ emitted.insert(def);
xml.StartElement("pathentry");
xml.Attribute("kind", "mac");
xml.Attribute("name", def);
@@ -844,8 +844,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
// insert the definition if not already added.
- if (emmited.find(def) == emmited.end()) {
- emmited.insert(def);
+ if (emitted.find(def) == emitted.end()) {
+ emitted.insert(def);
xml.StartElement("pathentry");
xml.Attribute("kind", "mac");
xml.Attribute("name", def);
@@ -858,7 +858,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
}
// include dirs
- emmited.clear();
+ emitted.clear();
for (const auto& lgen : this->GlobalGenerator->GetLocalGenerators()) {
const auto& targets = lgen->GetGeneratorTargets();
for (const auto& target : targets) {
@@ -868,7 +868,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
std::vector<std::string> includeDirs;
std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE");
lgen->GetIncludeDirectories(includeDirs, target.get(), "C", config);
- this->AppendIncludeDirectories(xml, includeDirs, emmited);
+ this->AppendIncludeDirectories(xml, includeDirs, emitted);
}
}
// now also the system include directories, in case we found them in
@@ -879,14 +879,14 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
std::string systemIncludeDirs =
mf->GetSafeDefinition("CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs = cmExpandedList(systemIncludeDirs);
- this->AppendIncludeDirectories(xml, dirs, emmited);
+ this->AppendIncludeDirectories(xml, dirs, emitted);
}
compiler = mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
if (this->CXXEnabled && !compiler.empty()) {
std::string systemIncludeDirs =
mf->GetSafeDefinition("CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs = cmExpandedList(systemIncludeDirs);
- this->AppendIncludeDirectories(xml, dirs, emmited);
+ this->AppendIncludeDirectories(xml, dirs, emitted);
}
xml.EndElement(); // storageModule
@@ -895,7 +895,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
xml.StartElement("storageModule");
xml.Attribute("moduleId", "org.eclipse.cdt.make.core.buildtargets");
xml.StartElement("buildTargets");
- emmited.clear();
+ emitted.clear();
const std::string& make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
const std::string& makeArgs =
mf->GetSafeDefinition("CMAKE_ECLIPSE_MAKE_ARGUMENTS");
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 613a943747..3e265a0df7 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -349,6 +349,13 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(
if (language.empty()) {
language = "C";
}
+
+ // explicitly add the explicit language flag before any other flag
+ // this way backwards compatibility with user flags is maintained
+ if (source->GetProperty("LANGUAGE")) {
+ lg->AppendFeatureOptions(flags, language, "EXPLICIT_LANGUAGE");
+ }
+
std::string const& config =
lg->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx
index 594969b1b1..c2ab2f10b0 100644
--- a/Source/cmFileAPI.cxx
+++ b/Source/cmFileAPI.cxx
@@ -665,7 +665,7 @@ std::string cmFileAPI::NoSupportedVersion(
// The "codemodel" object kind.
-static unsigned int const CodeModelV2Minor = 1;
+static unsigned int const CodeModelV2Minor = 2;
void cmFileAPI::BuildClientRequestCodeModel(
ClientRequest& r, std::vector<RequestVersion> const& versions)
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index fe331ec8d4..e9af208a69 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -175,6 +175,38 @@ public:
}
};
+template <typename T>
+class JBTs
+{
+public:
+ JBTs(T v = T(), std::vector<JBTIndex> ids = std::vector<JBTIndex>())
+ : Value(std::move(v))
+ , Backtraces(std::move(ids))
+ {
+ }
+ T Value;
+ std::vector<JBTIndex> Backtraces;
+ friend bool operator==(JBTs<T> const& l, JBTs<T> const& r)
+ {
+ if ((l.Value == r.Value) && (l.Backtraces.size() == r.Backtraces.size())) {
+ for (size_t i = 0; i < l.Backtraces.size(); i++) {
+ if (l.Backtraces[i].Index != r.Backtraces[i].Index) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ static bool ValueEq(JBTs<T> const& l, JBTs<T> const& r)
+ {
+ return l.Value == r.Value;
+ }
+ static bool ValueLess(JBTs<T> const& l, JBTs<T> const& r)
+ {
+ return l.Value < r.Value;
+ }
+};
+
class BacktraceData
{
std::string TopSource;
@@ -277,6 +309,7 @@ struct CompileData
std::string Language;
std::string Sysroot;
+ JBTs<std::string> LanguageStandard;
std::vector<JBT<std::string>> Flags;
std::vector<JBT<std::string>> Defines;
std::vector<JBT<std::string>> PrecompileHeaders;
@@ -287,6 +320,7 @@ struct CompileData
return (l.Language == r.Language && l.Sysroot == r.Sysroot &&
l.Flags == r.Flags && l.Defines == r.Defines &&
l.PrecompileHeaders == r.PrecompileHeaders &&
+ l.LanguageStandard == r.LanguageStandard &&
l.Includes == r.Includes);
}
};
@@ -320,6 +354,12 @@ struct hash<CompileData>
result = result ^ hash<std::string>()(i.Value) ^
hash<Json::ArrayIndex>()(i.Backtrace.Index);
}
+ if (!in.LanguageStandard.Value.empty()) {
+ result = result ^ hash<std::string>()(in.LanguageStandard.Value);
+ for (JBTIndex backtrace : in.LanguageStandard.Backtraces) {
+ result = result ^ hash<Json::ArrayIndex>()(backtrace.Index);
+ }
+ }
return result;
}
};
@@ -363,6 +403,16 @@ class Target
return JBT<T>(bt.Value, this->Backtraces.Add(bt.Backtrace));
}
+ template <typename T>
+ JBTs<T> ToJBTs(BTs<T> const& bts)
+ {
+ std::vector<JBTIndex> ids;
+ for (cmListFileBacktrace const& backtrace : bts.Backtraces) {
+ ids.emplace_back(this->Backtraces.Add(backtrace));
+ }
+ return JBTs<T>(bts.Value, ids);
+ }
+
void ProcessLanguages();
void ProcessLanguage(std::string const& lang);
@@ -377,6 +427,7 @@ class Target
Json::Value DumpCompileData(CompileData const& cd);
Json::Value DumpInclude(CompileData::IncludeEntry const& inc);
Json::Value DumpPrecompileHeader(JBT<std::string> const& header);
+ Json::Value DumpLanguageStandard(JBTs<std::string> const& standard);
Json::Value DumpDefine(JBT<std::string> const& def);
Json::Value DumpSources();
Json::Value DumpSource(cmGeneratorTarget::SourceAndKind const& sk,
@@ -438,7 +489,7 @@ Json::Value Codemodel::DumpConfigurations()
const auto& makefiles = gg->GetMakefiles();
if (!makefiles.empty()) {
std::vector<std::string> const& configs =
- makefiles[0]->GetGeneratorConfigs();
+ makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
for (std::string const& config : configs) {
configurations.append(this->DumpConfiguration(config));
}
@@ -838,6 +889,11 @@ void Target::ProcessLanguage(std::string const& lang)
for (BT<std::string> const& pch : precompileHeaders) {
cd.PrecompileHeaders.emplace_back(this->ToJBT(pch));
}
+ BTs<std::string> const* languageStandard =
+ this->GT->GetLanguageStandardProperty(lang, this->Config);
+ if (languageStandard) {
+ cd.LanguageStandard = this->ToJBTs(*languageStandard);
+ }
}
Json::ArrayIndex Target::AddSourceGroup(cmSourceGroup* sg, Json::ArrayIndex si)
@@ -996,6 +1052,9 @@ CompileData Target::MergeCompileData(CompileData const& fd)
// All compile groups share the precompile headers of the target.
cd.PrecompileHeaders = td.PrecompileHeaders;
+ // All compile groups share the language standard of the target.
+ cd.LanguageStandard = td.LanguageStandard;
+
// Use target-wide flags followed by source-specific flags.
cd.Flags.reserve(td.Flags.size() + fd.Flags.size());
cd.Flags.insert(cd.Flags.end(), td.Flags.begin(), td.Flags.end());
@@ -1153,6 +1212,10 @@ Json::Value Target::DumpCompileData(CompileData const& cd)
}
result["precompileHeaders"] = std::move(precompileHeaders);
}
+ if (!cd.LanguageStandard.Value.empty()) {
+ result["languageStandard"] =
+ this->DumpLanguageStandard(cd.LanguageStandard);
+ }
return result;
}
@@ -1176,6 +1239,20 @@ Json::Value Target::DumpPrecompileHeader(JBT<std::string> const& header)
return precompileHeader;
}
+Json::Value Target::DumpLanguageStandard(JBTs<std::string> const& standard)
+{
+ Json::Value languageStandard = Json::objectValue;
+ languageStandard["standard"] = standard.Value;
+ if (!standard.Backtraces.empty()) {
+ Json::Value backtraces = Json::arrayValue;
+ for (JBTIndex backtrace : standard.Backtraces) {
+ backtraces.append(backtrace.Index);
+ }
+ languageStandard["backtraces"] = backtraces;
+ }
+ return languageStandard;
+}
+
Json::Value Target::DumpDefine(JBT<std::string> const& def)
{
Json::Value define = Json::objectValue;
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 7101e229fa..9db8b85d96 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1394,8 +1394,10 @@ size_t cmWriteToFileCallback(void* ptr, size_t size, size_t nmemb, void* data)
{
int realsize = static_cast<int>(size * nmemb);
cmsys::ofstream* fout = static_cast<cmsys::ofstream*>(data);
- const char* chPtr = static_cast<char*>(ptr);
- fout->write(chPtr, realsize);
+ if (fout) {
+ const char* chPtr = static_cast<char*>(ptr);
+ fout->write(chPtr, realsize);
+ }
return realsize;
}
@@ -1551,15 +1553,14 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
{
#if !defined(CMAKE_BOOTSTRAP)
auto i = args.begin();
- if (args.size() < 3) {
- status.SetError("DOWNLOAD must be called with at least three arguments.");
+ if (args.size() < 2) {
+ status.SetError("DOWNLOAD must be called with at least two arguments.");
return false;
}
++i; // Get rid of subcommand
std::string url = *i;
++i;
- std::string file = *i;
- ++i;
+ std::string file;
long timeout = 0;
long inactivity_timeout = 0;
@@ -1690,6 +1691,8 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
return false;
}
curl_headers.push_back(*i);
+ } else if (file.empty()) {
+ file = *i;
} else {
// Do not return error for compatibility reason.
std::string err = cmStrCat("Unexpected argument: ", *i);
@@ -1697,11 +1700,18 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
}
++i;
}
+ // Can't calculate hash if we don't save the file.
+ // TODO Incrementally calculate hash in the write callback as the file is
+ // being downloaded so this check can be relaxed.
+ if (file.empty() && hash) {
+ status.SetError("DOWNLOAD cannot calculate hash if file is not saved.");
+ return false;
+ }
// If file exists already, and caller specified an expected md5 or sha,
// and the existing file already has the expected hash, then simply
// return.
//
- if (cmSystemTools::FileExists(file) && hash.get()) {
+ if (!file.empty() && cmSystemTools::FileExists(file) && hash.get()) {
std::string msg;
std::string actualHash = hash->HashFile(file);
if (actualHash == expectedHash) {
@@ -1716,20 +1726,26 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
// Make sure parent directory exists so we can write to the file
// as we receive downloaded bits from curl...
//
- std::string dir = cmSystemTools::GetFilenamePath(file);
- if (!dir.empty() && !cmSystemTools::FileExists(dir) &&
- !cmSystemTools::MakeDirectory(dir)) {
- std::string errstring = "DOWNLOAD error: cannot create directory '" + dir +
- "' - Specify file by full path name and verify that you "
- "have directory creation and file write privileges.";
- status.SetError(errstring);
- return false;
+ if (!file.empty()) {
+ std::string dir = cmSystemTools::GetFilenamePath(file);
+ if (!dir.empty() && !cmSystemTools::FileExists(dir) &&
+ !cmSystemTools::MakeDirectory(dir)) {
+ std::string errstring = "DOWNLOAD error: cannot create directory '" +
+ dir +
+ "' - Specify file by full path name and verify that you "
+ "have directory creation and file write privileges.";
+ status.SetError(errstring);
+ return false;
+ }
}
- cmsys::ofstream fout(file.c_str(), std::ios::binary);
- if (!fout) {
- status.SetError("DOWNLOAD cannot open file for write.");
- return false;
+ cmsys::ofstream fout;
+ if (!file.empty()) {
+ fout.open(file.c_str(), std::ios::binary);
+ if (!fout) {
+ status.SetError("DOWNLOAD cannot open file for write.");
+ return false;
+ }
}
# if defined(_WIN32)
@@ -1791,7 +1807,8 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
cmFileCommandVectorOfChar chunkDebug;
- res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA, &fout);
+ res = ::curl_easy_setopt(curl, CURLOPT_WRITEDATA,
+ file.empty() ? nullptr : &fout);
check_curl_result(res, "DOWNLOAD cannot set write data: ");
res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
@@ -1865,8 +1882,10 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
// Explicitly flush/close so we can measure the md5 accurately.
//
- fout.flush();
- fout.close();
+ if (!file.empty()) {
+ fout.flush();
+ fout.close();
+ }
// Verify MD5 sum if requested:
//
diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx
index 627e05b587..5d44a06816 100644
--- a/Source/cmFileCopier.cxx
+++ b/Source/cmFileCopier.cxx
@@ -173,7 +173,7 @@ bool cmFileCopier::GetDefaultDirectoryPermissions(mode_t** mode)
// check if default dir creation permissions were set
const char* default_dir_install_permissions = this->Makefile->GetDefinition(
"CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS");
- if (default_dir_install_permissions && *default_dir_install_permissions) {
+ if (cmNonempty(default_dir_install_permissions)) {
std::vector<std::string> items =
cmExpandedList(default_dir_install_permissions);
for (const auto& arg : items) {
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 3e97150e79..3401effa7c 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -208,10 +208,10 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
const char* sysrootLink =
this->Makefile->GetDefinition("CMAKE_SYSROOT_LINK");
const char* rootPath = this->Makefile->GetDefinition("CMAKE_FIND_ROOT_PATH");
- const bool noSysroot = !sysroot || !*sysroot;
- const bool noCompileSysroot = !sysrootCompile || !*sysrootCompile;
- const bool noLinkSysroot = !sysrootLink || !*sysrootLink;
- const bool noRootPath = !rootPath || !*rootPath;
+ const bool noSysroot = !cmNonempty(sysroot);
+ const bool noCompileSysroot = !cmNonempty(sysrootCompile);
+ const bool noLinkSysroot = !cmNonempty(sysrootLink);
+ const bool noRootPath = !cmNonempty(rootPath);
if (noSysroot && noCompileSysroot && noLinkSysroot && noRootPath) {
return;
}
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 8d5b177f2b..ae06047048 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1121,7 +1121,7 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
std::vector<std::string> foundContents;
cmProp foundProp =
this->Makefile->GetState()->GetGlobalProperty("PACKAGES_FOUND");
- if (foundProp && !foundProp->empty()) {
+ if (cmNonempty(foundProp)) {
cmExpandList(*foundProp, foundContents, false);
auto nameIt =
std::find(foundContents.begin(), foundContents.end(), this->Name);
@@ -1133,7 +1133,7 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
std::vector<std::string> notFoundContents;
cmProp notFoundProp =
this->Makefile->GetState()->GetGlobalProperty("PACKAGES_NOT_FOUND");
- if (notFoundProp && !notFoundProp->empty()) {
+ if (cmNonempty(notFoundProp)) {
cmExpandList(*notFoundProp, notFoundContents, false);
auto nameIt =
std::find(notFoundContents.begin(), notFoundContents.end(), this->Name);
@@ -1166,9 +1166,9 @@ void cmFindPackageCommand::AppendSuccessInformation()
std::string found = cmStrCat(this->Name, "_FOUND");
std::string upperFound = cmSystemTools::UpperCase(found);
- const char* upperResult = this->Makefile->GetDefinition(upperFound);
- const char* result = this->Makefile->GetDefinition(found);
- bool packageFound = ((cmIsOn(result)) || (cmIsOn(upperResult)));
+ bool upperResult = this->Makefile->IsOn(upperFound);
+ bool result = this->Makefile->IsOn(found);
+ bool packageFound = (result || upperResult);
this->AppendToFoundProperty(packageFound);
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 4b88bea4d3..77728ec8a6 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -4,6 +4,7 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -19,6 +20,7 @@ struct cmFindProgramHelper
cmFindProgramHelper(cmMakefile* makefile, cmFindBase const* base)
: DebugSearches("find_program", base)
, Makefile(makefile)
+ , PolicyCMP0109(makefile->GetPolicyStatus(cmPolicies::CMP0109))
{
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
// Consider platform-specific extensions.
@@ -48,6 +50,8 @@ struct cmFindProgramHelper
cmFindBaseDebugState DebugSearches;
cmMakefile* Makefile;
+ cmPolicies::PolicyStatus PolicyCMP0109;
+
void AddName(std::string const& name) { this->Names.push_back(name); }
void SetName(std::string const& name)
{
@@ -85,7 +89,7 @@ struct cmFindProgramHelper
this->TestNameExt = cmStrCat(name, ext);
this->TestPath =
cmSystemTools::CollapseFullPath(this->TestNameExt, path);
- bool exists = cmSystemTools::FileExists(this->TestPath, true);
+ bool exists = this->FileIsExecutable(this->TestPath);
exists ? this->DebugSearches.FoundAt(this->TestPath)
: this->DebugSearches.FailedAt(this->TestPath);
if (exists) {
@@ -95,6 +99,48 @@ struct cmFindProgramHelper
}
return false;
}
+ bool FileIsExecutable(std::string const& file) const
+ {
+ switch (this->PolicyCMP0109) {
+ case cmPolicies::OLD:
+ return cmSystemTools::FileExists(file, true);
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::REQUIRED_IF_USED:
+ return cmSystemTools::FileIsExecutable(file);
+ default:
+ break;
+ }
+ bool const isExeOld = cmSystemTools::FileExists(file, true);
+ bool const isExeNew = cmSystemTools::FileIsExecutable(file);
+ if (isExeNew == isExeOld) {
+ return isExeNew;
+ }
+ if (isExeNew) {
+ this->Makefile->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0109),
+ "\n"
+ "The file\n"
+ " ",
+ file,
+ "\n"
+ "is executable but not readable. "
+ "CMake is ignoring it for compatibility."));
+ } else {
+ this->Makefile->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0109),
+ "\n"
+ "The file\n"
+ " ",
+ file,
+ "\n"
+ "is readable but not executable. "
+ "CMake is using it for compatibility."));
+ }
+ return isExeOld;
+ }
};
cmFindProgramCommand::cmFindProgramCommand(cmExecutionStatus& status)
@@ -266,14 +312,13 @@ std::string cmFindProgramCommand::GetBundleExecutable(
if (executableURL != nullptr) {
const int MAX_OSX_PATH_SIZE = 1024;
- char buffer[MAX_OSX_PATH_SIZE];
+ UInt8 buffer[MAX_OSX_PATH_SIZE];
- // Convert the CFString to a C string
- CFStringGetCString(CFURLGetString(executableURL), buffer,
- MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8);
-
- // And finally to a c++ string
- executable = bundlePath + "/Contents/MacOS/" + std::string(buffer);
+ if (CFURLGetFileSystemRepresentation(executableURL, false, buffer,
+ MAX_OSX_PATH_SIZE)) {
+ executable = bundlePath + "/Contents/MacOS/" +
+ std::string(reinterpret_cast<char*>(buffer));
+ }
// Only release CFURLRef if it's not null
CFRelease(executableURL);
}
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 9cee0e6e96..345f0ba4d9 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -122,10 +122,17 @@ void cmGeneratedFileStreamBase::Open(std::string const& name)
// Create the name of the temporary file.
this->TempName = name;
#if defined(__VMS)
- this->TempName += "_tmp";
+ this->TempName += "_";
#else
- this->TempName += ".tmp";
+ this->TempName += ".";
#endif
+ if (!this->TempExt.empty()) {
+ this->TempName += this->TempExt;
+ } else {
+ char buf[64];
+ sprintf(buf, "tmp%05x", cmSystemTools::RandomSeed() & 0xFFFFF);
+ this->TempName += buf;
+ }
// Make sure the temporary file that will be used is not present.
cmSystemTools::RemoveFile(this->TempName);
@@ -216,3 +223,8 @@ void cmGeneratedFileStream::SetName(const std::string& fname)
{
this->Name = fname;
}
+
+void cmGeneratedFileStream::SetTempExt(std::string const& ext)
+{
+ this->TempExt = ext;
+}
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index a9088ac8af..3dee1429e7 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -43,6 +43,9 @@ protected:
// The name of the final destination file for the output.
std::string Name;
+ // The extension of the temporary file.
+ std::string TempExt;
+
// The name of the temporary file.
std::string TempName;
@@ -138,6 +141,12 @@ public:
* the output file to be changed during the use of cmGeneratedFileStream.
*/
void SetName(const std::string& fname);
+
+ /**
+ * Set set a custom temporary file extension used with 'Open'.
+ * This does not work if the file was opened by the constructor.
+ */
+ void SetTempExt(std::string const& ext);
};
#endif
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 6e293d51a8..840f5112d6 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -406,9 +406,3 @@ const std::string& cmGeneratorExpressionInterpreter::Evaluate(
this->LocalGenerator, this->Config, this->HeadTarget, &dagChecker, nullptr,
this->Language);
}
-
-const std::string& cmGeneratorExpressionInterpreter::Evaluate(
- const char* expression, const std::string& property)
-{
- return this->Evaluate(std::string(expression ? expression : ""), property);
-}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 75bba02d2e..09d8b8863b 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -199,8 +199,6 @@ public:
const std::string& Evaluate(std::string expression,
const std::string& property);
- const std::string& Evaluate(const char* expression,
- const std::string& property);
protected:
cmGeneratorExpression GeneratorExpression;
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 4f379cd7bd..e223f15453 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -154,6 +154,14 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingPICExpression() const
return this->Top()->Property == "INTERFACE_POSITION_INDEPENDENT_CODE";
}
+bool cmGeneratorExpressionDAGChecker::EvaluatingCompileExpression() const
+{
+ cm::string_view property(this->Top()->Property);
+
+ return property == "INCLUDE_DIRECTORIES"_s ||
+ property == "COMPILE_DEFINITIONS"_s || property == "COMPILE_OPTIONS"_s;
+}
+
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkExpression() const
{
cm::string_view property(this->Top()->Property);
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index c2c5b6b6bd..ac2314c670 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -68,6 +68,7 @@ struct cmGeneratorExpressionDAGChecker
bool EvaluatingGenexExpression() const;
bool EvaluatingPICExpression() const;
+ bool EvaluatingCompileExpression() const;
bool EvaluatingLinkExpression() const;
bool EvaluatingLinkOptionsExpression() const;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 9e8707d9d9..1107adbdae 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -157,12 +157,8 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
std::map<std::string, std::string> outputFiles;
- std::vector<std::string> allConfigs;
- lg->GetMakefile()->GetConfigurations(allConfigs);
-
- if (allConfigs.empty()) {
- allConfigs.emplace_back();
- }
+ std::vector<std::string> allConfigs =
+ lg->GetMakefile()->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
std::vector<std::string> enabledLanguages;
cmGlobalGenerator* gg = lg->GetGlobalGenerator();
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index e4fb67e699..fdc8f298dd 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -37,6 +37,7 @@
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmRange.h"
+#include "cmStandardLevelResolver.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
@@ -881,7 +882,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
{
ConfigurationTestNode() {} // NOLINT(modernize-use-equals-default)
- int NumExpectedParameters() const override { return OneOrZeroParameters; }
+ int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -899,13 +900,15 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
return std::string();
}
context->HadContextSensitiveCondition = true;
- if (context->Config.empty()) {
- return parameters.front().empty() ? "1" : "0";
- }
-
- if (cmsysString_strcasecmp(parameters.front().c_str(),
- context->Config.c_str()) == 0) {
- return "1";
+ for (auto& param : parameters) {
+ if (context->Config.empty()) {
+ if (param.empty()) {
+ return "1";
+ }
+ } else if (cmsysString_strcasecmp(param.c_str(),
+ context->Config.c_str()) == 0) {
+ return "1";
+ }
}
if (context->CurrentTarget && context->CurrentTarget->IsImported()) {
@@ -922,10 +925,12 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
"MAP_IMPORTED_CONFIG_", cmSystemTools::UpperCase(context->Config));
if (cmProp mapValue = context->CurrentTarget->GetProperty(mapProp)) {
cmExpandList(cmSystemTools::UpperCase(*mapValue), mappedConfigs);
- return cm::contains(mappedConfigs,
- cmSystemTools::UpperCase(parameters.front()))
- ? "1"
- : "0";
+
+ for (auto& param : parameters) {
+ if (cm::contains(mappedConfigs, cmSystemTools::UpperCase(param))) {
+ return "1";
+ }
+ }
}
}
}
@@ -962,9 +967,10 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
const std::vector<std::string>& parameters,
cmGeneratorExpressionContext* context,
const GeneratorExpressionContent* content,
- cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
+ cmGeneratorExpressionDAGChecker* dagChecker) const override
{
- if (context->Language.empty()) {
+ if (context->Language.empty() &&
+ (!dagChecker || !dagChecker->EvaluatingCompileExpression())) {
reportError(
context, content->GetOriginalExpression(),
"$<COMPILE_LANGUAGE:...> may only be used to specify include "
@@ -1009,7 +1015,9 @@ static const struct CompileLanguageAndIdNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* dagChecker) const override
{
- if (!context->HeadTarget || context->Language.empty()) {
+ if (!context->HeadTarget ||
+ (context->Language.empty() &&
+ (!dagChecker || !dagChecker->EvaluatingCompileExpression()))) {
// reportError(context, content->GetOriginalExpression(), "");
reportError(
context, content->GetOriginalExpression(),
@@ -1468,8 +1476,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
if (isInterfaceProperty) {
- return target->EvaluateInterfaceProperty(propertyName, context,
- dagCheckerParent);
+ return cmGeneratorExpression::StripEmptyListElements(
+ target->EvaluateInterfaceProperty(propertyName, context,
+ dagCheckerParent));
}
cmGeneratorExpressionDAGChecker dagChecker(
@@ -1555,8 +1564,9 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
if (!interfacePropertyName.empty()) {
- result = this->EvaluateDependentExpression(result, context->LG, context,
- target, &dagChecker, target);
+ result = cmGeneratorExpression::StripEmptyListElements(
+ this->EvaluateDependentExpression(result, context->LG, context, target,
+ &dagChecker, target));
std::string linkedTargetsContent = getLinkedTargetsContent(
target, interfacePropertyName, context, &dagChecker);
if (!linkedTargetsContent.empty()) {
@@ -1703,12 +1713,12 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
static LangMap availableFeatures;
LangMap testedFeatures;
-
+ cmStandardLevelResolver standardResolver(context->LG->GetMakefile());
for (std::string const& p : parameters) {
std::string error;
std::string lang;
- if (!context->LG->GetMakefile()->CompileFeatureKnown(
- context->HeadTarget->Target, p, lang, &error)) {
+ if (!standardResolver.CompileFeatureKnown(
+ context->HeadTarget->Target->GetName(), p, lang, &error)) {
reportError(context, content->GetOriginalExpression(), error);
return std::string();
}
@@ -1716,7 +1726,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
if (availableFeatures.find(lang) == availableFeatures.end()) {
const char* featuresKnown =
- context->LG->GetMakefile()->CompileFeaturesAvailable(lang, &error);
+ standardResolver.CompileFeaturesAvailable(lang, &error);
if (!featuresKnown) {
reportError(context, content->GetOriginalExpression(), error);
return std::string();
@@ -1741,10 +1751,10 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
// All features known for the language are always available.
continue;
}
- if (!context->LG->GetMakefile()->HaveStandardAvailable(
- target->Target, lit.first, it)) {
+ if (!standardResolver.HaveStandardAvailable(target, lit.first,
+ context->Config, it)) {
if (evalLL) {
- cmProp l = target->GetProperty(lit.first + "_STANDARD");
+ cmProp l = target->GetLanguageStandard(lit.first, context->Config);
if (!l) {
l = standardDefault;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c7baf2b713..41cff01368 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -43,6 +43,7 @@
#include "cmSourceFile.h"
#include "cmSourceFileLocation.h"
#include "cmSourceFileLocationKind.h"
+#include "cmStandardLevelResolver.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -364,7 +365,7 @@ std::string cmGeneratorTarget::GetExportName() const
{
cmProp exportName = this->GetProperty("EXPORT_NAME");
- if (exportName && !exportName->empty()) {
+ if (cmNonempty(exportName)) {
if (!cmGeneratorExpression::IsValidTargetName(*exportName)) {
std::ostringstream e;
e << "EXPORT_NAME property \"" << *exportName << "\" for \""
@@ -801,7 +802,8 @@ void cmGeneratorTarget::GetObjectSources(
void cmGeneratorTarget::ComputeObjectMapping()
{
- auto const& configs = this->Makefile->GetGeneratorConfigs();
+ auto const& configs =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
std::set<std::string> configSet(configs.begin(), configs.end());
if (configSet == this->VisitedConfigsForObjects) {
return;
@@ -813,18 +815,18 @@ void cmGeneratorTarget::ComputeObjectMapping()
}
}
-const char* cmGeneratorTarget::GetFeature(const std::string& feature,
- const std::string& config) const
+cmProp cmGeneratorTarget::GetFeature(const std::string& feature,
+ const std::string& config) const
{
if (!config.empty()) {
std::string featureConfig =
cmStrCat(feature, '_', cmSystemTools::UpperCase(config));
if (cmProp value = this->GetProperty(featureConfig)) {
- return value->c_str();
+ return value;
}
}
if (cmProp value = this->GetProperty(feature)) {
- return value->c_str();
+ return value;
}
return this->LocalGenerator->GetFeature(feature, config);
}
@@ -851,10 +853,9 @@ const char* cmGeneratorTarget::GetLinkPIEProperty(
bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
std::string const& config) const
{
- const char* feature = "INTERPROCEDURAL_OPTIMIZATION";
- const bool result = cmIsOn(this->GetFeature(feature, config));
+ cmProp feature = this->GetFeature("INTERPROCEDURAL_OPTIMIZATION", config);
- if (!result) {
+ if (!cmIsOn(feature)) {
// 'INTERPROCEDURAL_OPTIMIZATION' is off, no need to check policies
return false;
}
@@ -947,6 +948,61 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const
return it != this->ExplicitObjectName.end();
}
+BTs<std::string> const* cmGeneratorTarget::GetLanguageStandardProperty(
+ std::string const& lang, std::string const& config) const
+{
+ std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang);
+ auto langStandardIter = this->LanguageStandardMap.find(key);
+ if (langStandardIter != this->LanguageStandardMap.end()) {
+ return &langStandardIter->second;
+ }
+
+ return this->Target->GetLanguageStandardProperty(
+ cmStrCat(lang, "_STANDARD"));
+}
+
+cmProp cmGeneratorTarget::GetLanguageStandard(std::string const& lang,
+ std::string const& config) const
+{
+ BTs<std::string> const* languageStandard =
+ this->GetLanguageStandardProperty(lang, config);
+
+ if (languageStandard) {
+ return &(languageStandard->Value);
+ }
+
+ return nullptr;
+}
+
+cmProp cmGeneratorTarget::GetPropertyWithPairedLanguageSupport(
+ std::string const& lang, const char* suffix) const
+{
+ cmProp propertyValue = this->Target->GetProperty(cmStrCat(lang, suffix));
+ if (propertyValue == nullptr) {
+ // Check if we should use the value set by another language.
+ if (lang == "OBJC") {
+ propertyValue = this->GetPropertyWithPairedLanguageSupport("C", suffix);
+ } else if (lang == "OBJCXX" || lang == "CUDA") {
+ propertyValue =
+ this->GetPropertyWithPairedLanguageSupport("CXX", suffix);
+ }
+ }
+ return propertyValue;
+}
+
+cmProp cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const
+{
+ return this->GetPropertyWithPairedLanguageSupport(lang, "_EXTENSIONS");
+}
+
+bool cmGeneratorTarget::GetLanguageStandardRequired(
+ std::string const& lang) const
+{
+ cmProp p =
+ this->GetPropertyWithPairedLanguageSupport(lang, "_STANDARD_REQUIRED");
+ return cmIsOn(p);
+}
+
void cmGeneratorTarget::GetModuleDefinitionSources(
std::vector<cmSourceFile const*>& data, const std::string& config) const
{
@@ -1033,6 +1089,27 @@ std::vector<cmCustomCommand> const& cmGeneratorTarget::GetPostBuildCommands()
return this->Target->GetPostBuildCommands();
}
+bool cmGeneratorTarget::IsInBuildSystem() const
+{
+ if (this->IsImported()) {
+ return false;
+ }
+ switch (this->Target->GetType()) {
+ case cmStateEnums::EXECUTABLE:
+ case cmStateEnums::STATIC_LIBRARY:
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::OBJECT_LIBRARY:
+ case cmStateEnums::UTILITY:
+ case cmStateEnums::GLOBAL_TARGET:
+ return true;
+ case cmStateEnums::INTERFACE_LIBRARY:
+ case cmStateEnums::UNKNOWN_LIBRARY:
+ break;
+ }
+ return false;
+}
+
bool cmGeneratorTarget::IsImported() const
{
return this->Target->IsImported();
@@ -1043,6 +1120,11 @@ bool cmGeneratorTarget::IsImportedGloballyVisible() const
return this->Target->IsImportedGloballyVisible();
}
+bool cmGeneratorTarget::CanCompileSources() const
+{
+ return this->Target->CanCompileSources();
+}
+
const std::string& cmGeneratorTarget::GetLocationForBuild() const
{
static std::string location;
@@ -1137,7 +1219,7 @@ bool cmGeneratorTarget::MaybeHaveInterfaceProperty(
// If this target itself has a non-empty property value, we are done.
cmProp p = this->GetProperty(prop);
- maybeInterfaceProp = p && !p->empty();
+ maybeInterfaceProp = cmNonempty(p);
// Otherwise, recurse to interface dependencies.
if (!maybeInterfaceProp) {
@@ -1309,7 +1391,7 @@ void AddSwiftImplicitIncludeDirectories(
for (const cmLinkImplItem& library : libraries->Libraries) {
if (const cmGeneratorTarget* dependency = library.Target) {
- if (dependency->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!dependency->IsInBuildSystem()) {
continue;
}
if (cm::contains(dependency->GetAllConfigCompileLanguages(),
@@ -1726,8 +1808,8 @@ cmGeneratorTarget::GetAllConfigSources() const
void cmGeneratorTarget::ComputeAllConfigSources() const
{
- std::vector<std::string> configs;
- this->Makefile->GetConfigurations(configs);
+ std::vector<std::string> configs =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
std::map<cmSourceFile const*, size_t> index;
@@ -1787,12 +1869,12 @@ std::string cmGeneratorTarget::GetCompilePDBName(
std::string configUpper = cmSystemTools::UpperCase(config);
std::string configProp = cmStrCat("COMPILE_PDB_NAME_", configUpper);
cmProp config_name = this->GetProperty(configProp);
- if (config_name && !config_name->empty()) {
+ if (cmNonempty(config_name)) {
return prefix + *config_name + ".pdb";
}
cmProp name = this->GetProperty("COMPILE_PDB_NAME");
- if (name && !name->empty()) {
+ if (cmNonempty(name)) {
return prefix + *name + ".pdb";
}
@@ -1939,7 +2021,7 @@ bool cmGeneratorTarget::IsChrpathUsed(const std::string& config) const
std::string sepVar =
cmStrCat("CMAKE_SHARED_LIBRARY_RUNTIME_", ll, "_FLAG_SEP");
const char* sep = this->Makefile->GetDefinition(sepVar);
- if (sep && *sep) {
+ if (cmNonempty(sep)) {
// TODO: Add ELF check to ABI detection and get rid of
// CMAKE_EXECUTABLE_FORMAT.
if (const char* fmt =
@@ -2239,7 +2321,7 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree(
cmProp install_name_dir = this->GetProperty("INSTALL_NAME_DIR");
if (this->CanGenerateInstallNameDir(INSTALL_NAME_FOR_INSTALL)) {
- if (install_name_dir && !install_name_dir->empty()) {
+ if (cmNonempty(install_name_dir)) {
dir = *install_name_dir;
cmGeneratorExpression::ReplaceInstallPrefix(dir, installPrefix);
dir =
@@ -2385,6 +2467,12 @@ private:
cmGeneratorTarget::LinkClosure const* cmGeneratorTarget::GetLinkClosure(
const std::string& config) const
{
+ // There is no link implementation for targets that cannot compile sources.
+ if (!this->CanCompileSources()) {
+ static LinkClosure const empty = { {}, {} };
+ return &empty;
+ }
+
std::string key(cmSystemTools::UpperCase(config));
auto i = this->LinkClosureMap.find(key);
if (i == this->LinkClosureMap.end()) {
@@ -2701,6 +2789,12 @@ const std::vector<const cmGeneratorTarget*>&
cmGeneratorTarget::GetLinkImplementationClosure(
const std::string& config) const
{
+ // There is no link implementation for targets that cannot compile sources.
+ if (!this->CanCompileSources()) {
+ static std::vector<const cmGeneratorTarget*> const empty;
+ return empty;
+ }
+
LinkImplClosure& tgts = this->LinkImplClosureMap[config];
if (!tgts.Done) {
tgts.Done = true;
@@ -2708,6 +2802,7 @@ cmGeneratorTarget::GetLinkImplementationClosure(
cmLinkImplementationLibraries const* impl =
this->GetLinkImplementationLibraries(config);
+ assert(impl);
for (cmLinkImplItem const& lib : impl->Libraries) {
processILibs(config, this, lib,
@@ -2757,29 +2852,26 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target)
this->CurrentEntry = nullptr;
// Queue all the source files already specified for the target.
- if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
- std::set<cmSourceFile*> emitted;
- std::vector<std::string> const& configs =
- this->Makefile->GetGeneratorConfigs();
- for (std::string const& c : configs) {
- std::vector<cmSourceFile*> sources;
- this->GeneratorTarget->GetSourceFiles(sources, c);
- for (cmSourceFile* sf : sources) {
- const std::set<cmGeneratorTarget const*> tgts =
- this->GlobalGenerator->GetFilenameTargetDepends(sf);
- if (cm::contains(tgts, this->GeneratorTarget)) {
- std::ostringstream e;
- e << "Evaluation output file\n \"" << sf->ResolveFullPath()
- << "\"\ndepends on the sources of a target it is used in. This "
- "is a dependency loop and is not allowed.";
- this->GeneratorTarget->LocalGenerator->IssueMessage(
- MessageType::FATAL_ERROR, e.str());
- return;
- }
- if (emitted.insert(sf).second &&
- this->SourcesQueued.insert(sf).second) {
- this->SourceQueue.push(sf);
- }
+ std::set<cmSourceFile*> emitted;
+ std::vector<std::string> const& configs =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
+ for (std::string const& c : configs) {
+ std::vector<cmSourceFile*> sources;
+ this->GeneratorTarget->GetSourceFiles(sources, c);
+ for (cmSourceFile* sf : sources) {
+ const std::set<cmGeneratorTarget const*> tgts =
+ this->GlobalGenerator->GetFilenameTargetDepends(sf);
+ if (cm::contains(tgts, this->GeneratorTarget)) {
+ std::ostringstream e;
+ e << "Evaluation output file\n \"" << sf->ResolveFullPath()
+ << "\"\ndepends on the sources of a target it is used in. This "
+ "is a dependency loop and is not allowed.";
+ this->GeneratorTarget->LocalGenerator->IssueMessage(
+ MessageType::FATAL_ERROR, e.str());
+ return;
+ }
+ if (emitted.insert(sf).second && this->SourcesQueued.insert(sf).second) {
+ this->SourceQueue.push(sf);
}
}
}
@@ -2971,7 +3063,7 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc)
// Queue the custom command dependencies.
std::set<std::string> emitted;
std::vector<std::string> const& configs =
- this->Makefile->GetGeneratorConfigs();
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
for (std::string const& conf : configs) {
this->FollowCommandDepends(cc, conf, emitted);
}
@@ -3108,7 +3200,7 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(std::string& flags) const
} else {
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
- "Uknown CUDA architecture specifier \"" + std::string(specifier) +
+ "Unknown CUDA architecture specifier \"" + std::string(specifier) +
"\".");
}
}
@@ -3357,23 +3449,24 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
&dagChecker, entries);
if (this->Makefile->IsOn("APPLE")) {
- cmLinkImplementationLibraries const* impl =
- this->GetLinkImplementationLibraries(config);
- for (cmLinkImplItem const& lib : impl->Libraries) {
- std::string libDir = cmSystemTools::CollapseFullPath(
- lib.AsStr(), this->Makefile->GetHomeOutputDirectory());
-
- static cmsys::RegularExpression frameworkCheck(
- "(.*\\.framework)(/Versions/[^/]+)?/[^/]+$");
- if (!frameworkCheck.find(libDir)) {
- continue;
- }
+ if (cmLinkImplementationLibraries const* impl =
+ this->GetLinkImplementationLibraries(config)) {
+ for (cmLinkImplItem const& lib : impl->Libraries) {
+ std::string libDir = cmSystemTools::CollapseFullPath(
+ lib.AsStr(), this->Makefile->GetHomeOutputDirectory());
+
+ static cmsys::RegularExpression frameworkCheck(
+ "(.*\\.framework)(/Versions/[^/]+)?/[^/]+$");
+ if (!frameworkCheck.find(libDir)) {
+ continue;
+ }
- libDir = frameworkCheck.match(1);
+ libDir = frameworkCheck.match(1);
- EvaluatedTargetPropertyEntry ee(lib, cmListFileBacktrace());
- ee.Values.emplace_back(std::move(libDir));
- entries.Entries.emplace_back(std::move(ee));
+ EvaluatedTargetPropertyEntry ee(lib, cmListFileBacktrace());
+ ee.Values.emplace_back(std::move(libDir));
+ entries.Entries.emplace_back(std::move(ee));
+ }
}
}
@@ -3824,7 +3917,7 @@ std::string cmGeneratorTarget::GetPchSource(const std::string& config,
cmStrCat(generatorTarget->LocalGenerator->GetCurrentBinaryDirectory(),
"/CMakeFiles/", generatorTarget->GetName(), ".dir/cmake_pch");
- // For GCC the source extension will be tranformed into .h[xx].gch
+ // For GCC the source extension will be transformed into .h[xx].gch
if (!this->Makefile->IsOn("CMAKE_LINK_PCH")) {
const std::map<std::string, std::string> languageToExtension = {
{ "C", ".h.c" },
@@ -4411,12 +4504,75 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const
bool cmGeneratorTarget::ComputeCompileFeatures(std::string const& config) const
{
+ // Compute the language standard based on the compile features.
+ cmStandardLevelResolver standardResolver(this->Makefile);
std::vector<BT<std::string>> features = this->GetCompileFeatures(config);
for (BT<std::string> const& f : features) {
- if (!this->Makefile->AddRequiredTargetFeature(this->Target, f.Value)) {
+ std::string lang;
+ if (!standardResolver.CompileFeatureKnown(this->Target->GetName(), f.Value,
+ lang, nullptr)) {
return false;
}
+
+ std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang);
+ cmProp currentLanguageStandard = this->GetLanguageStandard(lang, config);
+
+ std::string newRequiredStandard;
+ if (!standardResolver.GetNewRequiredStandard(
+ this->Target->GetName(), f.Value, currentLanguageStandard,
+ newRequiredStandard)) {
+ return false;
+ }
+
+ if (!newRequiredStandard.empty()) {
+ BTs<std::string>& languageStandardProperty =
+ this->LanguageStandardMap[key];
+ if (languageStandardProperty.Value != newRequiredStandard) {
+ languageStandardProperty.Value = newRequiredStandard;
+ languageStandardProperty.Backtraces.clear();
+ }
+ languageStandardProperty.Backtraces.emplace_back(f.Backtrace);
+ }
+ }
+
+ return true;
+}
+
+bool cmGeneratorTarget::ComputeCompileFeatures(
+ std::string const& config, std::set<LanguagePair> const& languagePairs) const
+{
+ for (const auto& language : languagePairs) {
+ BTs<std::string> const* generatorTargetLanguageStandard =
+ this->GetLanguageStandardProperty(language.first, config);
+ if (!generatorTargetLanguageStandard) {
+ // If the standard isn't explicitly set we copy it over from the
+ // specified paired language.
+ std::string key =
+ cmStrCat(cmSystemTools::UpperCase(config), '-', language.first);
+ BTs<std::string> const* standardToCopy =
+ this->GetLanguageStandardProperty(language.second, config);
+ if (standardToCopy != nullptr) {
+ this->LanguageStandardMap[key] = *standardToCopy;
+ generatorTargetLanguageStandard = &this->LanguageStandardMap[key];
+ } else {
+ cmProp defaultStandard = this->Makefile->GetDef(
+ cmStrCat("CMAKE_", language.second, "_STANDARD_DEFAULT"));
+ if (defaultStandard != nullptr) {
+ this->LanguageStandardMap[key] = BTs<std::string>(*defaultStandard);
+ generatorTargetLanguageStandard = &this->LanguageStandardMap[key];
+ }
+ }
+
+ // Custom updates for the CUDA standard.
+ if (generatorTargetLanguageStandard != nullptr &&
+ language.first == "CUDA") {
+ if (generatorTargetLanguageStandard->Value == "98") {
+ this->LanguageStandardMap[key].Value = "03";
+ }
+ }
+ }
}
+
return true;
}
@@ -5294,8 +5450,7 @@ bool getTypedProperty<bool>(cmGeneratorTarget const* tgt,
}
cmProp value = tgt->GetProperty(prop);
- return cmIsOn(
- genexInterpreter->Evaluate(value ? value->c_str() : nullptr, prop));
+ return cmIsOn(genexInterpreter->Evaluate(value ? *value : "", prop));
}
template <>
@@ -5309,8 +5464,7 @@ const char* getTypedProperty<const char*>(
return value ? value->c_str() : nullptr;
}
- return genexInterpreter->Evaluate(value ? value->c_str() : nullptr, prop)
- .c_str();
+ return genexInterpreter->Evaluate(value ? *value : "", prop).c_str();
}
template <>
@@ -5324,7 +5478,7 @@ std::string getTypedProperty<std::string>(
return valueAsString(value ? value->c_str() : nullptr);
}
- return genexInterpreter->Evaluate(value ? value->c_str() : nullptr, prop);
+ return genexInterpreter->Evaluate(value ? *value : "", prop);
}
template <typename PropertyType>
@@ -5725,7 +5879,7 @@ std::string cmGeneratorTarget::GetRuntimeLinkLibrary(
// not it is overridden by a property.
cmProp runtimeLibraryDefault = this->Makefile->GetDef(
cmStrCat("CMAKE_", lang, "_RUNTIME_LIBRARY_DEFAULT"));
- if (!runtimeLibraryDefault || runtimeLibraryDefault->empty()) {
+ if (!cmNonempty(runtimeLibraryDefault)) {
return std::string();
}
cmProp runtimeLibraryValue =
@@ -6407,15 +6561,20 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
iface.HadHeadSensitiveCondition,
iface.HadContextSensitiveCondition,
iface.HadLinkLanguageSensitiveCondition);
- } else if (!cmp0022NEW)
+ return;
+ }
+
// If CMP0022 is NEW then the plain tll signature sets the
// INTERFACE_LINK_LIBRARIES, so if we get here then the project
// cleared the property explicitly and we should not fall back
// to the link implementation.
- {
- // The link implementation is the default link interface.
- cmLinkImplementationLibraries const* impl =
- this->GetLinkImplementationLibrariesInternal(config, headTarget);
+ if (cmp0022NEW) {
+ return;
+ }
+
+ // The link implementation is the default link interface.
+ if (cmLinkImplementationLibraries const* impl =
+ this->GetLinkImplementationLibrariesInternal(config, headTarget)) {
iface.Libraries.insert(iface.Libraries.end(), impl->Libraries.begin(),
impl->Libraries.end());
if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN &&
@@ -6709,8 +6868,8 @@ const cmLinkImplementation* cmGeneratorTarget::GetLinkImplementation(
const cmLinkImplementation* cmGeneratorTarget::GetLinkImplementation(
const std::string& config, bool secondPass) const
{
- // There is no link implementation for imported targets.
- if (this->IsImported()) {
+ // There is no link implementation for targets that cannot compile sources.
+ if (!this->CanCompileSources()) {
return nullptr;
}
@@ -6734,7 +6893,7 @@ bool cmGeneratorTarget::GetConfigCommonSourceFiles(
std::vector<cmSourceFile*>& files) const
{
std::vector<std::string> const& configs =
- this->Makefile->GetGeneratorConfigs();
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
auto it = configs.begin();
const std::string& firstConfig = *it;
@@ -6858,7 +7017,7 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
bool cmGeneratorTarget::IsDeprecated() const
{
cmProp deprecation = this->GetProperty("DEPRECATION");
- return deprecation && !deprecation->empty();
+ return cmNonempty(deprecation);
}
std::string cmGeneratorTarget::GetDeprecation() const
@@ -6873,6 +7032,11 @@ std::string cmGeneratorTarget::GetDeprecation() const
void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
const std::string& config) const
{
+ // Targets that do not compile anything have no languages.
+ if (!this->CanCompileSources()) {
+ return;
+ }
+
std::vector<cmSourceFile*> sourceFiles;
this->GetSourceFiles(sourceFiles, config);
for (cmSourceFile* src : sourceFiles) {
@@ -6923,7 +7087,7 @@ bool cmGeneratorTarget::IsCSharpOnly() const
// Consider an explicit linker language property, but *not* the
// computed linker language that may depend on linked targets.
cmProp linkLang = this->GetProperty("LINKER_LANGUAGE");
- if (linkLang && !linkLang->empty()) {
+ if (cmNonempty(linkLang)) {
languages.insert(*linkLang);
}
return languages.size() == 1 && languages.count("CSharp") > 0;
@@ -6968,8 +7132,8 @@ cmLinkImplementationLibraries const*
cmGeneratorTarget::GetLinkImplementationLibrariesInternal(
const std::string& config, cmGeneratorTarget const* head) const
{
- // There is no link implementation for imported targets.
- if (this->IsImported()) {
+ // There is no link implementation for targets that cannot compile sources.
+ if (!this->CanCompileSources()) {
return nullptr;
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 3aedbf53e6..4a03f650bc 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -45,8 +45,10 @@ public:
cmGlobalGenerator* GetGlobalGenerator() const;
+ bool IsInBuildSystem() const;
bool IsImported() const;
bool IsImportedGloballyVisible() const;
+ bool CanCompileSources() const;
const std::string& GetLocation(const std::string& config) const;
std::vector<cmCustomCommand> const& GetPreBuildCommands() const;
@@ -148,6 +150,16 @@ public:
bool HasExplicitObjectName(cmSourceFile const* file) const;
void AddExplicitObjectName(cmSourceFile const* sf);
+ BTs<std::string> const* GetLanguageStandardProperty(
+ std::string const& lang, std::string const& config) const;
+
+ cmProp GetLanguageStandard(std::string const& lang,
+ std::string const& config) const;
+
+ cmProp GetLanguageExtensions(std::string const& lang) const;
+
+ bool GetLanguageStandardRequired(std::string const& lang) const;
+
void GetModuleDefinitionSources(std::vector<cmSourceFile const*>&,
const std::string& config) const;
void GetExternalObjects(std::vector<cmSourceFile const*>&,
@@ -165,8 +177,8 @@ public:
void ComputeObjectMapping();
- const char* GetFeature(const std::string& feature,
- const std::string& config) const;
+ cmProp GetFeature(const std::string& feature,
+ const std::string& config) const;
const char* GetLinkPIEProperty(const std::string& config) const;
@@ -515,6 +527,11 @@ public:
bool ComputeCompileFeatures(std::string const& config) const;
+ using LanguagePair = std::pair<std::string, std::string>;
+ bool ComputeCompileFeatures(
+ std::string const& config,
+ std::set<LanguagePair> const& languagePairs) const;
+
/**
* Trace through the source files in this target and add al source files
* that they depend on, used by all generators
@@ -1038,6 +1055,11 @@ private:
bool GetRPATH(const std::string& config, const std::string& prop,
std::string& rpath) const;
+ mutable std::map<std::string, BTs<std::string>> LanguageStandardMap;
+
+ cmProp GetPropertyWithPairedLanguageSupport(std::string const& lang,
+ const char* suffix) const;
+
public:
const std::vector<const cmGeneratorTarget*>& GetLinkImplementationClosure(
const std::string& config) const;
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index 811421a6dd..38bffbf262 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -14,6 +14,7 @@ bool cmGetFilenameComponentCommand(std::vector<std::string> const& args,
{
if (args.size() < 3) {
status.SetError("called with incorrect number of arguments");
+ cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -114,6 +115,7 @@ bool cmGetFilenameComponentCommand(std::vector<std::string> const& args,
} else {
std::string err = "unknown component " + args[2];
status.SetError(err);
+ cmSystemTools::SetFatalErrorOccured();
return false;
}
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 97580d6ec1..1589c47eaa 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -550,10 +550,9 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
*/
for (auto& sg : groupFilesList) {
std::ostream* fout;
- cmProp noSourceGroupFile =
- this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE");
- bool useProjectFile = (noSourceGroupFile && cmIsOn(*noSourceGroupFile)) ||
- cmIsOn(this->Makefile->GetDefinition("CMAKE_GHS_NO_SOURCE_GROUP_FILE"));
+ bool useProjectFile =
+ cmIsOn(this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE")) ||
+ this->Makefile->IsOn("CMAKE_GHS_NO_SOURCE_GROUP_FILE");
if (useProjectFile || sg.empty()) {
fout = &fout_proj;
} else {
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index f03ca44a20..5f2638758c 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -43,7 +43,7 @@ private:
void SetCompilerFlags(std::string const& config,
const std::string& language);
- std::string GetDefines(const std::string& langugae,
+ std::string GetDefines(const std::string& language,
std::string const& config);
void WriteIncludes(std::ostream& fout, const std::string& config,
diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx
index 9dc86f4e42..9e5bbca003 100644
--- a/Source/cmGlobalCommonGenerator.cxx
+++ b/Source/cmGlobalCommonGenerator.cxx
@@ -5,8 +5,12 @@
#include <memory>
#include <utility>
+#include <cmext/algorithm>
+
+#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
#include "cmProperty.h"
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
@@ -31,26 +35,30 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const
lg->GetStateSnapshot().GetDirectory().GetCurrentBinary());
DirectoryTarget& dirTarget = dirTargets[currentBinaryDir];
dirTarget.LG = lg.get();
+ const std::vector<std::string>& configs =
+ lg->GetMakefile()->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
// The directory-level rule should depend on the target-level rules
// for all targets in the directory.
for (const auto& gt : lg->GetGeneratorTargets()) {
cmStateEnums::TargetType const type = gt->GetType();
- if (type != cmStateEnums::EXECUTABLE &&
- type != cmStateEnums::STATIC_LIBRARY &&
- type != cmStateEnums::SHARED_LIBRARY &&
- type != cmStateEnums::MODULE_LIBRARY &&
- type != cmStateEnums::OBJECT_LIBRARY &&
- type != cmStateEnums::UTILITY) {
+ if (type == cmStateEnums::GLOBAL_TARGET || !gt->IsInBuildSystem()) {
continue;
}
DirectoryTarget::Target t;
t.GT = gt.get();
- if (cmProp exclude = gt->GetProperty("EXCLUDE_FROM_ALL")) {
- if (cmIsOn(*exclude)) {
- // This target has been explicitly excluded.
- t.ExcludeFromAll = true;
- } else {
+ const std::string EXCLUDE_FROM_ALL("EXCLUDE_FROM_ALL");
+ if (cmProp exclude = gt->GetProperty(EXCLUDE_FROM_ALL)) {
+ for (const std::string& config : configs) {
+ cmGeneratorExpressionInterpreter genexInterpreter(lg.get(), config,
+ gt.get());
+ if (cmIsOn(genexInterpreter.Evaluate(*exclude, EXCLUDE_FROM_ALL))) {
+ // This target has been explicitly excluded.
+ t.ExcludedFromAllInConfigs.push_back(config);
+ }
+ }
+
+ if (t.ExcludedFromAllInConfigs.empty()) {
// This target has been explicitly un-excluded. The directory-level
// rule for every directory between this and the root should depend
// on the target-level rule for this target.
@@ -78,3 +86,12 @@ cmGlobalCommonGenerator::ComputeDirectoryTargets() const
return dirTargets;
}
+
+bool cmGlobalCommonGenerator::IsExcludedFromAllInConfig(
+ const DirectoryTarget::Target& t, const std::string& config)
+{
+ if (this->IsMultiConfig()) {
+ return cm::contains(t.ExcludedFromAllInConfigs, config);
+ }
+ return !t.ExcludedFromAllInConfigs.empty();
+}
diff --git a/Source/cmGlobalCommonGenerator.h b/Source/cmGlobalCommonGenerator.h
index 7d16daca2a..f97b5f49b1 100644
--- a/Source/cmGlobalCommonGenerator.h
+++ b/Source/cmGlobalCommonGenerator.h
@@ -30,7 +30,7 @@ public:
struct Target
{
cmGeneratorTarget const* GT = nullptr;
- bool ExcludeFromAll = false;
+ std::vector<std::string> ExcludedFromAllInConfigs;
};
std::vector<Target> Targets;
struct Dir
@@ -41,6 +41,8 @@ public:
std::vector<Dir> Children;
};
std::map<std::string, DirectoryTarget> ComputeDirectoryTargets() const;
+ bool IsExcludedFromAllInConfig(const DirectoryTarget::Target& t,
+ const std::string& config);
};
#endif
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4dc409221c..530bb595fa 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -302,31 +302,12 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
bool failed = false;
for (const auto& localGen : this->LocalGenerators) {
for (const auto& target : localGen->GetGeneratorTargets()) {
- if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET ||
- target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY ||
- target->GetType() == cmStateEnums::TargetType::UTILITY) {
+ if (!target->CanCompileSources() ||
+ cmIsOn(target->GetProperty("ghs_integrity_app"))) {
continue;
}
- if (cmProp p = target->GetProperty("ghs_integrity_app")) {
- if (cmIsOn(*p)) {
- continue;
- }
- }
- std::vector<std::string> configs;
- target->Makefile->GetConfigurations(configs);
- std::vector<cmSourceFile*> srcs;
- if (configs.empty()) {
- target->GetSourceFiles(srcs, "");
- } else {
- for (std::string const& config : configs) {
- target->GetSourceFiles(srcs, config);
- if (!srcs.empty()) {
- break;
- }
- }
- }
- if (srcs.empty()) {
+ if (target->GetAllConfigSources().empty()) {
std::ostringstream e;
e << "No SOURCES given to target: " << target->GetName();
this->GetCMakeInstance()->IssueMessage(
@@ -349,7 +330,8 @@ bool cmGlobalGenerator::CheckTargetsForType() const
if (target->GetType() == cmStateEnums::EXECUTABLE &&
target->GetPropertyAsBool("WIN32_EXECUTABLE")) {
std::vector<std::string> const& configs =
- target->Makefile->GetGeneratorConfigs();
+ target->Makefile->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig);
for (std::string const& config : configs) {
if (target->GetLinkerLanguage(config) == "Swift") {
this->GetCMakeInstance()->IssueMessage(
@@ -374,16 +356,10 @@ bool cmGlobalGenerator::CheckTargetsForPchCompilePdb() const
bool failed = false;
for (const auto& generator : this->LocalGenerators) {
for (const auto& target : generator->GetGeneratorTargets()) {
- if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET ||
- target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY ||
- target->GetType() == cmStateEnums::TargetType::UTILITY) {
+ if (!target->CanCompileSources() ||
+ cmIsOn(target->GetProperty("ghs_integrity_app"))) {
continue;
}
- if (cmProp p = target->GetProperty("ghs_integrity_app")) {
- if (cmIsOn(*p)) {
- continue;
- }
- }
std::string const& reuseFrom =
target->GetSafeProperty("PRECOMPILE_HEADERS_REUSE_FROM");
@@ -425,15 +401,13 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
"all generators must specify this->FindMakeProgramFile");
return false;
}
- if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") ||
- cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile);
if (!setMakeProgram.empty()) {
mf->ReadListFile(setMakeProgram);
}
}
- if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") ||
- cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
std::ostringstream err;
err << "CMake was unable to find a build program corresponding to \""
<< this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You "
@@ -596,6 +570,16 @@ void cmGlobalGenerator::EnableLanguage(
mf->ReadListFile(fpath);
}
}
+
+ if (readCMakeSystem) {
+ // Find the native build tool for this generator.
+ // This has to be done early so that MSBuild can be used to examine the
+ // cross-compilation environment.
+ if (!this->FindMakeProgram(mf)) {
+ return;
+ }
+ }
+
// Load the CMakeDetermineSystem.cmake file and find out
// what platform we are running on
if (!mf->GetDefinition("CMAKE_SYSTEM")) {
@@ -667,11 +651,6 @@ void cmGlobalGenerator::EnableLanguage(
cmSystemTools::SetFatalErrorOccured();
return;
}
-
- // Find the native build tool for this generator.
- if (!this->FindMakeProgram(mf)) {
- return;
- }
}
// Check that the languages are supported by the generator and its
@@ -794,7 +773,7 @@ void cmGlobalGenerator::EnableLanguage(
std::string compilerEnv = cmStrCat("CMAKE_", lang, "_COMPILER_ENV_VAR");
std::ostringstream noCompiler;
const char* compilerFile = mf->GetDefinition(compilerName);
- if (!compilerFile || !*compilerFile || cmIsNOTFOUND(compilerFile)) {
+ if (!cmNonempty(compilerFile) || cmIsNOTFOUND(compilerFile)) {
/* clang-format off */
noCompiler <<
"No " << compilerName << " could be found.\n"
@@ -1442,12 +1421,10 @@ bool cmGlobalGenerator::Compute()
localGen->AddHelperCommands();
}
- // Finalize the set of compile features for each target.
- // FIXME: This turns into calls to cmMakefile::AddRequiredTargetFeature
- // which actually modifies the <lang>_STANDARD target property
- // on the original cmTarget instance. It accumulates features
- // across all configurations. Some refactoring is needed to
- // compute a per-config resulta purely during generation.
+ // Perform up-front computation in order to handle errors (such as unknown
+ // features) at this point. While processing the compile features we also
+ // calculate and cache the language standard required by the compile
+ // features.
for (const auto& localGen : this->LocalGenerators) {
if (!localGen->ComputeTargetCompileFeatures()) {
return false;
@@ -1612,9 +1589,7 @@ bool cmGlobalGenerator::AddAutomaticSources()
for (const auto& lg : this->LocalGenerators) {
lg->CreateEvaluationFileOutputs();
for (const auto& gt : lg->GetGeneratorTargets()) {
- if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
- gt->GetType() == cmStateEnums::UTILITY ||
- gt->GetType() == cmStateEnums::GLOBAL_TARGET) {
+ if (!gt->CanCompileSources()) {
continue;
}
lg->AddUnityBuild(gt.get());
@@ -1626,9 +1601,7 @@ bool cmGlobalGenerator::AddAutomaticSources()
}
for (const auto& lg : this->LocalGenerators) {
for (const auto& gt : lg->GetGeneratorTargets()) {
- if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
- gt->GetType() == cmStateEnums::UTILITY ||
- gt->GetType() == cmStateEnums::GLOBAL_TARGET) {
+ if (!gt->CanCompileSources()) {
continue;
}
// Handle targets that re-use a PCH from an above-handled target.
@@ -1698,8 +1671,8 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
cmPolicies::PolicyStatus polSt =
mf->GetPolicyStatus(cmPolicies::CMP0043);
if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) {
- std::vector<std::string> configs;
- mf->GetConfigurations(configs);
+ std::vector<std::string> configs =
+ mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
for (std::string const& c : configs) {
std::string defPropName =
@@ -1988,8 +1961,9 @@ int cmGlobalGenerator::Build(
std::string makeCommandStr;
output += "\nRun Build Command(s):";
- for (auto command = makeCommand.begin(); command != makeCommand.end();
- ++command) {
+ retVal = 0;
+ for (auto command = makeCommand.begin();
+ command != makeCommand.end() && retVal == 0; ++command) {
makeCommandStr = command->Printable();
if (command != makeCommand.end()) {
makeCommandStr += " && ";
@@ -2179,13 +2153,38 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
}
bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
- cmGeneratorTarget* target) const
+ const cmGeneratorTarget* target) const
{
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
return true;
}
- if (cmProp exclude = target->GetProperty("EXCLUDE_FROM_ALL")) {
- return cmIsOn(*exclude);
+ cmMakefile* mf = root->GetMakefile();
+ const std::string EXCLUDE_FROM_ALL = "EXCLUDE_FROM_ALL";
+ if (cmProp exclude = target->GetProperty(EXCLUDE_FROM_ALL)) {
+ // Expand the property value per configuration.
+ unsigned int trueCount = 0;
+ unsigned int falseCount = 0;
+ const std::vector<std::string>& configs =
+ mf->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
+ for (const std::string& config : configs) {
+ cmGeneratorExpressionInterpreter genexInterpreter(root, config, target);
+ if (cmIsOn(genexInterpreter.Evaluate(*exclude, EXCLUDE_FROM_ALL))) {
+ ++trueCount;
+ } else {
+ ++falseCount;
+ }
+ }
+
+ // Check whether the genex expansion of the property agrees in all
+ // configurations.
+ if (trueCount && falseCount) {
+ std::ostringstream e;
+ e << "The EXCLUDE_FROM_ALL property of target \"" << target->GetName()
+ << "\" varies by configuration. This is not supported by the \""
+ << root->GetGlobalGenerator()->GetName() << "\" generator.";
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ }
+ return trueCount;
}
// This target is included in its directory. Check whether the
// directory is excluded.
@@ -2445,7 +2444,7 @@ void cmGlobalGenerator::AddGlobalTarget_Package(
gti.WorkingDir = mf->GetCurrentBinaryDirectory();
cmCustomCommandLine singleLine;
singleLine.push_back(cmSystemTools::GetCPackCommand());
- if (cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.') {
+ if (cmNonempty(cmakeCfgIntDir) && cmakeCfgIntDir[0] != '.') {
singleLine.push_back("-C");
singleLine.push_back(cmakeCfgIntDir);
}
@@ -2530,7 +2529,7 @@ void cmGlobalGenerator::AddGlobalTarget_Test(
singleLine.push_back(arg);
}
}
- if (cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.') {
+ if (cmNonempty(cmakeCfgIntDir) && cmakeCfgIntDir[0] != '.') {
singleLine.push_back("-C");
singleLine.push_back(cmakeCfgIntDir);
} else // TODO: This is a hack. Should be something to do with the
@@ -2611,7 +2610,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
"installation rules have been specified",
mf->GetBacktrace());
} else if (this->InstallTargetEnabled && !skipInstallRules) {
- if (!cmakeCfgIntDir || !*cmakeCfgIntDir || cmakeCfgIntDir[0] == '.') {
+ if (!(cmNonempty(cmakeCfgIntDir) && cmakeCfgIntDir[0] != '.')) {
std::set<std::string>* componentsSet = &this->InstallComponents;
std::ostringstream ostr;
if (!componentsSet->empty()) {
@@ -2650,7 +2649,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
cmd = "cmake";
}
singleLine.push_back(cmd);
- if (cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.') {
+ if (cmNonempty(cmakeCfgIntDir) && cmakeCfgIntDir[0] != '.') {
std::string cfgArg = "-DBUILD_TYPE=";
bool useEPN = this->UseEffectivePlatformName(mf.get());
if (useEPN) {
@@ -3045,7 +3044,7 @@ void cmGlobalGenerator::WriteSummary()
for (const auto& lg : this->LocalGenerators) {
for (const auto& tgt : lg->GetGeneratorTargets()) {
- if (tgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!tgt->IsInBuildSystem()) {
continue;
}
this->WriteSummary(tgt.get());
@@ -3123,7 +3122,8 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
fout << "# Source files and their labels\n";
std::vector<cmSourceFile*> sources;
std::vector<std::string> const& configs =
- target->Target->GetMakefile()->GetGeneratorConfigs();
+ target->Target->GetMakefile()->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig);
for (std::string const& c : configs) {
target->GetSourceFiles(sources, c);
}
@@ -3222,8 +3222,9 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile()
const auto& lg = this->LocalGenerators[0];
cmMakefile* mf = lg->GetMakefile();
- std::vector<std::string> configs;
- std::string config = mf->GetConfigurations(configs, false);
+ std::vector<std::string> configs =
+ mf->GetGeneratorConfigs(cmMakefile::OnlyMultiConfig);
+ std::string config = mf->GetDefaultConfiguration();
std::string path = cmStrCat(this->CMakeInstance->GetHomeOutputDirectory(),
"/CPackProperties.cmake");
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 57c780807d..c2c80c21b5 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -542,7 +542,8 @@ protected:
bool IsExcluded(cmStateSnapshot const& root,
cmStateSnapshot const& snp) const;
bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
- bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
+ bool IsExcluded(cmLocalGenerator* root,
+ const cmGeneratorTarget* target) const;
virtual void InitializeProgressMarks() {}
struct GlobalTargetInfo
diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h
index 3709365970..13cfe4d489 100644
--- a/Source/cmGlobalGeneratorFactory.h
+++ b/Source/cmGlobalGeneratorFactory.h
@@ -44,7 +44,7 @@ public:
/** Get the list of supported platforms name for this generator */
virtual std::vector<std::string> GetKnownPlatforms() const = 0;
- /** If the generator suports platforms, get its default. */
+ /** If the generator supports platforms, get its default. */
virtual std::string GetDefaultPlatformName() const = 0;
};
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index d36adfb746..7c8713141d 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -218,10 +218,11 @@ void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
{
const char* ghsRoot = mf->GetDefinition("GHS_TOOLSET_ROOT");
- if (!ghsRoot || ghsRoot[0] == '\0') {
- ghsRoot = DEFAULT_TOOLSET_ROOT;
+ if (cmNonempty(ghsRoot)) {
+ tsd = ghsRoot;
+ } else {
+ tsd = DEFAULT_TOOLSET_ROOT;
}
- tsd = ghsRoot;
if (ts.empty()) {
std::vector<std::string> output;
@@ -467,11 +468,10 @@ void cmGlobalGhsMultiGenerator::WriteAllTarget(
this->ProjectTargets.push_back(t);
}
for (cmGeneratorTarget const* t : sortedProjectTargets) {
- if (t->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!t->IsInBuildSystem()) {
continue;
}
- cmProp p = t->GetProperty("EXCLUDE_FROM_ALL");
- if (!(p && cmIsOn(*p))) {
+ if (!IsExcluded(t->GetLocalGenerator(), t)) {
defaultTargets.push_back(t);
}
}
@@ -635,7 +635,7 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives(
std::string tgt;
const char* t =
this->GetCMakeInstance()->GetCacheDefinition("GHS_PRIMARY_TARGET");
- if (t && *t != '\0') {
+ if (cmNonempty(t)) {
tgt = t;
this->GetCMakeInstance()->MarkCliAsUsed("GHS_PRIMARY_TARGET");
} else {
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 843b0f44d7..2ef202d5bf 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -5,9 +5,9 @@
#include <algorithm>
#include <cctype>
#include <cstdio>
-#include <iterator>
#include <sstream>
+#include <cm/iterator>
#include <cm/memory>
#include <cmext/algorithm>
#include <cmext/memory>
@@ -518,7 +518,8 @@ void cmGlobalNinjaGenerator::Generate()
if (cmSystemTools::GetErrorOccuredFlag()) {
this->RulesFileStream->setstate(std::ios::failbit);
- for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) {
+ for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig)) {
this->GetImplFileStream(config)->setstate(std::ios::failbit);
this->GetConfigFileStream(config)->setstate(std::ios::failbit);
}
@@ -1104,8 +1105,9 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs(
break;
}
- default:
- return;
+ case cmStateEnums::INTERFACE_LIBRARY:
+ case cmStateEnums::UNKNOWN_LIBRARY:
+ break;
}
}
@@ -1127,7 +1129,7 @@ void cmGlobalNinjaGenerator::AppendTargetDepends(
cmNinjaDeps outs;
for (cmTargetDepend const& targetDep :
this->GetTargetDirectDepends(target)) {
- if (targetDep->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!targetDep->IsInBuildSystem()) {
continue;
}
if (targetDep.IsCross()) {
@@ -1169,7 +1171,7 @@ void cmGlobalNinjaGenerator::AppendTargetDependsClosure(
cmNinjaOuts this_outs; // this will be the new cache entry
for (auto const& dep_target : this->GetTargetDirectDepends(target)) {
- if (dep_target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
+ if (!dep_target->IsInBuildSystem() ||
(this->EnableCrossConfigBuild() && !dep_target.IsCross())) {
continue;
}
@@ -1188,7 +1190,7 @@ void cmGlobalNinjaGenerator::AppendTargetDependsClosure(
// finally generate the outputs of the target itself, if applicable
cmNinjaDeps outs;
if (!omit_self) {
- this->AppendTargetOutputs(target, outs, config);
+ this->AppendTargetOutputs(target, outs, config, DependOnTargetArtifact);
}
outputs.insert(outs.begin(), outs.end());
}
@@ -1200,14 +1202,15 @@ 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);
+ 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) {
this->TargetAliases[output].GeneratorTarget = nullptr;
this->DefaultTargetAliases[output].GeneratorTarget = nullptr;
for (const std::string& config2 :
- this->Makefiles.front()->GetGeneratorConfigs()) {
+ this->Makefiles.front()->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig)) {
this->Configs[config2].TargetAliases[output].GeneratorTarget = nullptr;
}
}
@@ -1265,11 +1268,12 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
if (ta.second.Config == "all") {
for (auto const& config : this->CrossConfigs) {
this->AppendTargetOutputs(ta.second.GeneratorTarget,
- build.ExplicitDeps, config);
+ build.ExplicitDeps, config,
+ DependOnTargetArtifact);
}
} else {
this->AppendTargetOutputs(ta.second.GeneratorTarget, build.ExplicitDeps,
- ta.second.Config);
+ ta.second.Config, DependOnTargetArtifact);
}
this->WriteBuild(this->EnableCrossConfigBuild() &&
(ta.second.Config == "all" ||
@@ -1280,7 +1284,8 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
}
if (this->IsMultiConfig()) {
- for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs()) {
+ for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig)) {
for (auto const& ta : this->Configs[config].TargetAliases) {
// Don't write ambiguous aliases.
if (!ta.second.GeneratorTarget) {
@@ -1296,7 +1301,8 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
build.Outputs.front() = ta.first;
build.ExplicitDeps.clear();
this->AppendTargetOutputs(ta.second.GeneratorTarget,
- build.ExplicitDeps, config);
+ build.ExplicitDeps, config,
+ DependOnTargetArtifact);
this->WriteBuild(*this->GetConfigFileStream(config), build);
}
}
@@ -1318,7 +1324,8 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
build.ExplicitDeps.clear();
for (auto const& config : this->DefaultConfigs) {
this->AppendTargetOutputs(ta.second.GeneratorTarget,
- build.ExplicitDeps, config);
+ build.ExplicitDeps, config,
+ DependOnTargetArtifact);
}
this->WriteBuild(*this->GetDefaultFileStream(), build);
}
@@ -1339,11 +1346,9 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
cmGlobalNinjaGenerator::WriteDivider(os);
std::string const& currentBinaryDir = it.first;
DirectoryTarget const& dt = it.second;
- std::vector<std::string> configs;
- dt.LG->GetMakefile()->GetConfigurations(configs, true);
- if (configs.empty()) {
- configs.emplace_back();
- }
+ std::vector<std::string> configs =
+ dt.LG->GetMakefile()->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig);
// Setup target
cmNinjaDeps configDeps;
@@ -1356,8 +1361,9 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
build.Outputs.front() = this->BuildAlias(buildDirAllTarget, config);
configDeps.emplace_back(build.Outputs.front());
for (DirectoryTarget::Target const& t : dt.Targets) {
- if (!t.ExcludeFromAll) {
- this->AppendTargetOutputs(t.GT, build.ExplicitDeps, config);
+ if (!IsExcludedFromAllInConfig(t, config)) {
+ this->AppendTargetOutputs(t.GT, build.ExplicitDeps, config,
+ DependOnTargetArtifact);
}
}
for (DirectoryTarget::Dir const& d : dt.Children) {
@@ -1538,7 +1544,8 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)
this->WriteTargetClean(os);
this->WriteTargetHelp(os);
- for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) {
+ for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig)) {
this->WriteTargetDefault(*this->GetConfigFileStream(config));
}
@@ -1712,11 +1719,8 @@ bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os)
std::string cleanScriptRel = "CMakeFiles/clean_additional.cmake";
std::string cleanScriptAbs =
cmStrCat(lgr->GetBinaryDirectory(), '/', cleanScriptRel);
- std::vector<std::string> configs;
- this->Makefiles[0]->GetConfigurations(configs, true);
- if (configs.empty()) {
- configs.emplace_back();
- }
+ std::vector<std::string> configs =
+ this->Makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
// Check if there are additional files to clean
bool empty = true;
@@ -1810,7 +1814,8 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
WriteRule(*this->RulesFileStream, rule);
}
- auto const configs = this->Makefiles.front()->GetGeneratorConfigs();
+ auto const configs = this->Makefiles.front()->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig);
// Write build
{
@@ -2489,7 +2494,8 @@ bool cmGlobalNinjaMultiGenerator::OpenBuildFileStreams()
<< "# This file contains build statements common to all "
"configurations.\n\n";
- for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) {
+ for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig)) {
// Open impl file.
if (!this->OpenFileStream(this->ImplFileStreams[config],
GetNinjaImplFilename(config))) {
@@ -2529,7 +2535,8 @@ void cmGlobalNinjaMultiGenerator::CloseBuildFileStreams()
this->DefaultFileStream.reset();
} // No error if it wasn't open
- for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs()) {
+ for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig)) {
if (this->ImplFileStreams[config]) {
this->ImplFileStreams[config].reset();
} else {
@@ -2571,7 +2578,8 @@ std::string cmGlobalNinjaMultiGenerator::GetNinjaConfigFilename(
void cmGlobalNinjaMultiGenerator::AddRebuildManifestOutputs(
cmNinjaDeps& outputs) const
{
- for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs()) {
+ for (auto const& config : this->Makefiles.front()->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig)) {
outputs.push_back(this->NinjaOutputPath(GetNinjaImplFilename(config)));
outputs.push_back(this->NinjaOutputPath(GetNinjaConfigFilename(config)));
}
@@ -2583,11 +2591,9 @@ void cmGlobalNinjaMultiGenerator::AddRebuildManifestOutputs(
void cmGlobalNinjaMultiGenerator::GetQtAutoGenConfigs(
std::vector<std::string>& configs) const
{
- auto const oldSize = configs.size();
- this->Makefiles.front()->GetConfigurations(configs);
- if (configs.size() == oldSize) {
- configs.emplace_back();
- }
+ auto allConfigs =
+ this->Makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
+ configs.insert(configs.end(), cm::cbegin(allConfigs), cm::cend(allConfigs));
}
bool cmGlobalNinjaMultiGenerator::InspectConfigTypeVariables()
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 44e632fe58..10f5cf61a1 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -318,14 +318,13 @@ public:
virtual std::string OrderDependsTargetForTarget(
cmGeneratorTarget const* target, const std::string& config) const;
- void AppendTargetOutputs(
- cmGeneratorTarget const* target, cmNinjaDeps& outputs,
- const std::string& config,
- cmNinjaTargetDepends depends = DependOnTargetArtifact);
- void AppendTargetDepends(
- cmGeneratorTarget const* target, cmNinjaDeps& outputs,
- const std::string& config, const std::string& fileConfig,
- cmNinjaTargetDepends depends = DependOnTargetArtifact);
+ void AppendTargetOutputs(cmGeneratorTarget const* target,
+ cmNinjaDeps& outputs, const std::string& config,
+ cmNinjaTargetDepends depends);
+ void AppendTargetDepends(cmGeneratorTarget const* target,
+ cmNinjaDeps& outputs, const std::string& config,
+ const std::string& fileConfig,
+ cmNinjaTargetDepends depends);
void AppendTargetDependsClosure(cmGeneratorTarget const* target,
cmNinjaDeps& outputs,
const std::string& config);
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index c31983ba5c..ebc90b61e1 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -143,7 +143,7 @@ void cmGlobalUnixMakefileGenerator3::Generate()
total += pmi.second.NumberOfActions;
}
- // write each target's progress.make this loop is done twice. Bascially the
+ // write each target's progress.make this loop is done twice. Basically the
// Generate pass counts all the actions, the first loop below determines
// how many actions have progress updates for each target and writes to
// corrrect variable values for everything except the all targets. The
@@ -416,7 +416,7 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRule2(
std::vector<std::string> depends;
for (DirectoryTarget::Target const& t : dt.Targets) {
// Add this to the list of depends rules in this directory.
- if ((!check_all || !t.ExcludeFromAll) &&
+ if ((!check_all || t.ExcludedFromAllInConfigs.empty()) &&
(!check_relink ||
t.GT->NeedRelinkBeforeInstall(lg->GetConfigName()))) {
// The target may be from a different directory; use its local gen.
@@ -845,8 +845,7 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks()
for (const auto& gt : lg->GetGeneratorTargets()) {
cmLocalGenerator* tlg = gt->GetLocalGenerator();
- if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
- gt->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
+ if (!gt->IsInBuildSystem() || IsExcluded(lg.get(), gt.get())) {
continue;
}
@@ -881,7 +880,7 @@ size_t cmGlobalUnixMakefileGenerator3::CountProgressMarksInTarget(
if (emitted.insert(target).second) {
count = this->ProgressMap[target].Marks.size();
for (cmTargetDepend const& depend : this->GetTargetDirectDepends(target)) {
- if (depend->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!depend->IsInBuildSystem()) {
continue;
}
count += this->CountProgressMarksInTarget(depend, emitted);
@@ -938,7 +937,7 @@ void cmGlobalUnixMakefileGenerator3::AppendGlobalTargetDepends(
for (cmTargetDepend const& i : this->GetTargetDirectDepends(target)) {
// Create the target-level dependency.
cmGeneratorTarget const* dep = i;
- if (dep->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!dep->IsInBuildSystem()) {
continue;
}
cmLocalUnixMakefileGenerator3* lg3 =
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 5dac072c2f..3805546497 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -138,9 +138,6 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
"ProductDir",
vc10Express, cmSystemTools::KeyWOW64_32);
this->CudaEnabled = false;
- this->SystemIsWindowsCE = false;
- this->SystemIsWindowsPhone = false;
- this->SystemIsWindowsStore = false;
this->MSBuildCommandInitialized = false;
{
std::string envPlatformToolset;
@@ -511,18 +508,16 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
- std::string v = this->GetInstalledNsightTegraVersion();
- if (v.empty()) {
- mf->IssueMessage(MessageType::FATAL_ERROR,
- "CMAKE_SYSTEM_NAME is 'Android' but "
- "'NVIDIA Nsight Tegra Visual Studio Edition' "
- "is not installed.");
- return false;
+ if (mf->GetSafeDefinition("CMAKE_GENERATOR_PLATFORM") == "Tegra-Android") {
+ if (!this->InitializeTegraAndroid(mf)) {
+ return false;
+ }
+ } else {
+ this->SystemIsAndroid = true;
+ if (!this->InitializeAndroid(mf)) {
+ return false;
+ }
}
- this->DefaultPlatformName = "Tegra-Android";
- this->DefaultPlatformToolset = "Default";
- this->NsightTegraVersion = v;
- mf->AddDefinition("CMAKE_VS_NsightTegra_VERSION", v);
}
return true;
@@ -564,6 +559,31 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf)
return false;
}
+bool cmGlobalVisualStudio10Generator::InitializeTegraAndroid(cmMakefile* mf)
+{
+ std::string v = this->GetInstalledNsightTegraVersion();
+ if (v.empty()) {
+ mf->IssueMessage(MessageType::FATAL_ERROR,
+ "CMAKE_SYSTEM_NAME is 'Android' but "
+ "'NVIDIA Nsight Tegra Visual Studio Edition' "
+ "is not installed.");
+ return false;
+ }
+ this->DefaultPlatformName = "Tegra-Android";
+ this->DefaultPlatformToolset = "Default";
+ this->NsightTegraVersion = v;
+ mf->AddDefinition("CMAKE_VS_NsightTegra_VERSION", v);
+ return true;
+}
+
+bool cmGlobalVisualStudio10Generator::InitializeAndroid(cmMakefile* mf)
+{
+ std::ostringstream e;
+ e << this->GetName() << " does not support Android.";
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ return false;
+}
+
bool cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(
std::string& toolset) const
{
@@ -598,6 +618,28 @@ void cmGlobalVisualStudio10Generator::Generate()
{
this->LongestSource = LongestSourcePath();
this->cmGlobalVisualStudio8Generator::Generate();
+ if (!this->AndroidExecutableWarnings.empty() &&
+ !this->CMakeInstance->GetIsInTryCompile()) {
+ std::ostringstream e;
+ /* clang-format off */
+ e <<
+ "You are using Visual Studio tools for Android, which does not support "
+ "standalone executables. However, the following executable targets do "
+ "not have the ANDROID_GUI property set, and thus will not be built as "
+ "expected. They will be built as shared libraries with executable "
+ "filenames:\n"
+ " ";
+ /* clang-format on */
+ bool first = true;
+ for (auto const& name : this->AndroidExecutableWarnings) {
+ if (!first) {
+ e << ", ";
+ }
+ first = false;
+ e << name;
+ }
+ this->CMakeInstance->IssueMessage(MessageType::WARNING, e.str());
+ }
if (this->LongestSource.Length > 0) {
cmLocalGenerator* lg = this->LongestSource.Target->GetLocalGenerator();
std::ostringstream e;
@@ -664,8 +706,14 @@ std::string const& cmGlobalVisualStudio10Generator::GetPlatformToolsetString()
if (!this->GeneratorToolset.empty()) {
return this->GeneratorToolset;
}
- if (!this->DefaultPlatformToolset.empty()) {
- return this->DefaultPlatformToolset;
+ if (this->SystemIsAndroid) {
+ if (!this->DefaultAndroidToolset.empty()) {
+ return this->DefaultAndroidToolset;
+ }
+ } else {
+ if (!this->DefaultPlatformToolset.empty()) {
+ return this->DefaultPlatformToolset;
+ }
}
static std::string const empty;
return empty;
@@ -879,7 +927,10 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
epg.Attribute("Label", "Globals");
cmXMLElement(epg, "ProjectGuid")
.Content("{F3FC6D86-508D-3FB1-96D2-995F08B142EC}");
- cmXMLElement(epg, "Keyword").Content("Win32Proj");
+ cmXMLElement(epg, "Keyword")
+ .Content(mf->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "Android"
+ ? "Android"
+ : "Win32Proj");
cmXMLElement(epg, "Platform").Content(this->GetPlatformName());
if (this->GetSystemName() == "WindowsPhone") {
cmXMLElement(epg, "ApplicationType").Content("Windows Phone");
@@ -889,15 +940,21 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
cmXMLElement(epg, "ApplicationType").Content("Windows Store");
cmXMLElement(epg, "ApplicationTypeRevision")
.Content(this->GetApplicationTypeRevision());
+ } else if (this->GetSystemName() == "Android") {
+ cmXMLElement(epg, "ApplicationType").Content("Android");
+ cmXMLElement(epg, "ApplicationTypeRevision")
+ .Content(this->GetApplicationTypeRevision());
}
if (!this->WindowsTargetPlatformVersion.empty()) {
cmXMLElement(epg, "WindowsTargetPlatformVersion")
.Content(this->WindowsTargetPlatformVersion);
}
- if (this->GetPlatformName() == "ARM64") {
- cmXMLElement(epg, "WindowsSDKDesktopARM64Support").Content("true");
- } else if (this->GetPlatformName() == "ARM") {
- cmXMLElement(epg, "WindowsSDKDesktopARMSupport").Content("true");
+ if (this->GetSystemName() != "Android") {
+ if (this->GetPlatformName() == "ARM64") {
+ cmXMLElement(epg, "WindowsSDKDesktopARM64Support").Content("true");
+ } else if (this->GetPlatformName() == "ARM") {
+ cmXMLElement(epg, "WindowsSDKDesktopARMSupport").Content("true");
+ }
}
}
cmXMLElement(eprj, "Import")
@@ -1209,6 +1266,10 @@ std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion()
std::string cmGlobalVisualStudio10Generator::GetApplicationTypeRevision() const
{
+ if (this->GetSystemName() == "Android") {
+ return this->GetAndroidApplicationTypeRevision();
+ }
+
// Return the first two '.'-separated components of the Windows version.
std::string::size_type end1 = this->SystemVersion.find('.');
std::string::size_type end2 =
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index b8c18b4ac4..0c53537ef5 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -4,6 +4,7 @@
#define cmGlobalVisualStudio10Generator_h
#include <memory>
+#include <set>
#include "cmGlobalVisualStudio8Generator.h"
#include "cmVisualStudio10ToolsetOptions.h"
@@ -43,6 +44,11 @@ public:
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
bool optional) override;
+ void AddAndroidExecutableWarning(const std::string& name)
+ {
+ this->AndroidExecutableWarnings.insert(name);
+ }
+
bool IsCudaEnabled() const { return this->CudaEnabled; }
/** Generating for Nsight Tegra VS plugin? */
@@ -100,6 +106,9 @@ public:
/** Return true if building for WindowsStore */
bool TargetsWindowsStore() const { return this->SystemIsWindowsStore; }
+ /** Return true if building for Android */
+ bool TargetsAndroid() const { return this->SystemIsAndroid; }
+
const char* GetCMakeCFGIntDir() const override { return "$(Configuration)"; }
bool Find64BitTools(cmMakefile* mf);
@@ -128,6 +137,8 @@ public:
/** Return the first two components of CMAKE_SYSTEM_VERSION. */
std::string GetApplicationTypeRevision() const;
+ virtual const char* GetAndroidApplicationTypeRevision() const { return ""; }
+
cmIDEFlagTable const* GetClFlagTable() const;
cmIDEFlagTable const* GetCSharpFlagTable() const;
cmIDEFlagTable const* GetRcFlagTable() const;
@@ -148,6 +159,8 @@ protected:
virtual bool InitializeWindowsCE(cmMakefile* mf);
virtual bool InitializeWindowsPhone(cmMakefile* mf);
virtual bool InitializeWindowsStore(cmMakefile* mf);
+ virtual bool InitializeTegraAndroid(cmMakefile* mf);
+ virtual bool InitializeAndroid(cmMakefile* mf);
virtual bool ProcessGeneratorToolsetField(std::string const& key,
std::string const& value);
@@ -171,6 +184,7 @@ protected:
std::string GeneratorToolsetCudaCustomDir;
std::string DefaultPlatformToolset;
std::string DefaultPlatformToolsetHostArchitecture;
+ std::string DefaultAndroidToolset;
std::string WindowsTargetPlatformVersion;
std::string SystemName;
std::string SystemVersion;
@@ -185,9 +199,10 @@ protected:
std::string DefaultNasmFlagTableName;
std::string DefaultRCFlagTableName;
bool SupportsUnityBuilds = false;
- bool SystemIsWindowsCE;
- bool SystemIsWindowsPhone;
- bool SystemIsWindowsStore;
+ bool SystemIsWindowsCE = false;
+ bool SystemIsWindowsPhone = false;
+ bool SystemIsWindowsStore = false;
+ bool SystemIsAndroid = false;
private:
class Factory;
@@ -211,6 +226,7 @@ private:
std::string MSBuildCommand;
bool MSBuildCommandInitialized;
cmVisualStudio10ToolsetOptions ToolsetOptions;
+ std::set<std::string> AndroidExecutableWarnings;
virtual std::string FindMSBuildCommand();
std::string FindDevEnvCommand() override;
std::string GetVSMakeProgram() override { return this->GetMSBuildCommand(); }
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index f549b6aae6..451d448081 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -109,6 +109,7 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator(
"ProductDir",
vc14Express, cmSystemTools::KeyWOW64_32);
this->DefaultPlatformToolset = "v140";
+ this->DefaultAndroidToolset = "Clang_3_8";
this->DefaultCLFlagTableName = "v140";
this->DefaultCSharpFlagTableName = "v140";
this->DefaultLibFlagTableName = "v14";
@@ -159,6 +160,11 @@ bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf)
return true;
}
+bool cmGlobalVisualStudio14Generator::InitializeAndroid(cmMakefile*)
+{
+ return true;
+}
+
bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
bool required)
{
diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h
index ccc29177ef..39353f2278 100644
--- a/Source/cmGlobalVisualStudio14Generator.h
+++ b/Source/cmGlobalVisualStudio14Generator.h
@@ -23,12 +23,18 @@ public:
bool MatchesGeneratorName(const std::string& name) const override;
+ const char* GetAndroidApplicationTypeRevision() const override
+ {
+ return "2.0";
+ }
+
protected:
cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name,
std::string const& platformInGeneratorName);
bool InitializeWindows(cmMakefile* mf) override;
bool InitializeWindowsStore(cmMakefile* mf) override;
+ bool InitializeAndroid(cmMakefile* mf) override;
bool SelectWindowsStoreToolset(std::string& toolset) const override;
// These aren't virtual because we need to check if the selected version
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 7ada325118..0083c407d5 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -19,8 +19,8 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(
std::ostream& fout, cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators)
{
- std::vector<std::string> configs;
- root->GetMakefile()->GetConfigurations(configs);
+ std::vector<std::string> configs =
+ root->GetMakefile()->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
// Write out the header for a SLN file
this->WriteSLNHeader(fout);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 428c748633..f8b438a63e 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -339,7 +339,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
// loop over again and write out configurations for each target
// in the solution
for (cmGeneratorTarget const* target : projectTargets) {
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
continue;
}
cmProp expath = target->GetProperty("EXTERNAL_MSPROJECT");
@@ -369,7 +369,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
std::string rootBinaryDir = root->GetCurrentBinaryDirectory();
for (cmGeneratorTarget const* target : projectTargets) {
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
continue;
}
bool written = false;
@@ -436,7 +436,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
std::ostream& fout, OrderedTargetDependSet const& projectTargets)
{
for (cmGeneratorTarget const* target : projectTargets) {
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
continue;
}
cmProp vcprojName = target->GetProperty("GENERATOR_FILE_NAME");
@@ -568,8 +568,9 @@ void cmGlobalVisualStudio7Generator::WriteSLNFooter(std::ostream& fout)
std::string cmGlobalVisualStudio7Generator::WriteUtilityDepend(
cmGeneratorTarget const* target)
{
- std::vector<std::string> configs;
- target->Target->GetMakefile()->GetConfigurations(configs);
+ std::vector<std::string> configs =
+ target->Target->GetMakefile()->GetGeneratorConfigs(
+ cmMakefile::ExcludeEmptyConfig);
std::string pname = cmStrCat(target->GetName(), "_UTILITY");
std::string fname =
cmStrCat(target->GetLocalGenerator()->GetCurrentBinaryDirectory(), '/',
@@ -693,9 +694,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
}
// inspect EXCLUDE_FROM_DEFAULT_BUILD[_<CONFIG>] properties
for (std::string const& i : configs) {
- const char* propertyValue =
- target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i);
- if (cmIsOff(propertyValue)) {
+ if (cmIsOff(target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i))) {
activeConfigs.insert(i);
}
}
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 29ca1549c5..fcdfc5064e 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -325,7 +325,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectDepends(
TargetDependSet const& unordered = this->GetTargetDirectDepends(gt);
OrderedTargetDependSet depends(unordered, std::string());
for (cmTargetDepend const& i : depends) {
- if (i->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!i->IsInBuildSystem()) {
continue;
}
std::string guid = this->GetGUID(i->GetName());
@@ -341,7 +341,7 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
if (cmGeneratorTarget* depTarget =
target->GetLocalGenerator()->FindGeneratorTargetToUse(
ui.Value.first)) {
- if (depTarget->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
+ if (depTarget->IsInBuildSystem() &&
depTarget->GetProperty("EXTERNAL_MSPROJECT")) {
// This utility dependency names an external .vcproj target.
// We use LinkLibraryDependencies="true" to link to it without
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index c688da2a39..001d876650 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -368,7 +368,7 @@ cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmGeneratorTarget* target)
void cmGlobalVisualStudioGenerator::FollowLinkDepends(
const cmGeneratorTarget* target, std::set<const cmGeneratorTarget*>& linked)
{
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
return;
}
if (linked.insert(target).second &&
@@ -509,7 +509,7 @@ std::string cmGlobalVisualStudioGenerator::GetStartupProjectName(
cmLocalGenerator const* root) const
{
cmProp n = root->GetMakefile()->GetProperty("VS_STARTUP_PROJECT");
- if (n && !n->empty()) {
+ if (cmNonempty(n)) {
std::string startup = *n;
if (this->FindTarget(startup)) {
return startup;
@@ -810,7 +810,7 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
// a target with none of its own sources, e.g. when also using
// object libraries.
cmProp linkLang = gt->GetProperty("LINKER_LANGUAGE");
- if (linkLang && !linkLang->empty()) {
+ if (cmNonempty(linkLang)) {
languages.insert(*linkLang);
}
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 605dc8b2a6..e2e045c0d6 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -100,6 +100,24 @@ static const char* VSVersionToToolset(
return "";
}
+static const char* VSVersionToAndroidToolset(
+ cmGlobalVisualStudioGenerator::VSVersion v)
+{
+ switch (v) {
+ case cmGlobalVisualStudioGenerator::VS9:
+ case cmGlobalVisualStudioGenerator::VS10:
+ case cmGlobalVisualStudioGenerator::VS11:
+ case cmGlobalVisualStudioGenerator::VS12:
+ return "";
+ case cmGlobalVisualStudioGenerator::VS14:
+ return "Clang_3_8";
+ case cmGlobalVisualStudioGenerator::VS15:
+ case cmGlobalVisualStudioGenerator::VS16:
+ return "Clang_5_0";
+ }
+ return "";
+}
+
static const char vs15generatorName[] = "Visual Studio 15 2017";
// Map generator name without year to name with year.
@@ -284,6 +302,7 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
this->Version = version;
this->ExpressEdition = false;
this->DefaultPlatformToolset = VSVersionToToolset(this->Version);
+ this->DefaultAndroidToolset = VSVersionToAndroidToolset(this->Version);
this->DefaultCLFlagTableName = VSVersionToToolset(this->Version);
this->DefaultCSharpFlagTableName = VSVersionToToolset(this->Version);
this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
@@ -408,6 +427,25 @@ bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
vsInstanceVersion > vsInstanceVersion16_7_P2);
}
+const char*
+cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision()
+ const
+{
+ switch (this->Version) {
+ case cmGlobalVisualStudioGenerator::VS9:
+ case cmGlobalVisualStudioGenerator::VS10:
+ case cmGlobalVisualStudioGenerator::VS11:
+ case cmGlobalVisualStudioGenerator::VS12:
+ return "";
+ case cmGlobalVisualStudioGenerator::VS14:
+ return "2.0";
+ case cmGlobalVisualStudioGenerator::VS15:
+ case cmGlobalVisualStudioGenerator::VS16:
+ return "3.0";
+ }
+ return "";
+}
+
std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
{
const char* version = this->GetPlatformToolsetVersion();
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h
index cbd3ba77cb..d5b833759c 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.h
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.h
@@ -36,6 +36,8 @@ public:
bool IsStdOutEncodingSupported() const override;
+ const char* GetAndroidApplicationTypeRevision() const override;
+
protected:
cmGlobalVisualStudioVersionedGenerator(
VSVersion version, cmake* cm, const std::string& name,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f0737e80fb..574e0f5856 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -173,6 +173,7 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(
this->RootObject = nullptr;
this->MainGroupChildren = nullptr;
+ this->FrameworkGroup = nullptr;
this->CurrentMakefile = nullptr;
this->CurrentLocalGenerator = nullptr;
this->XcodeBuildCommandInitialized = false;
@@ -476,6 +477,9 @@ void cmGlobalXCodeGenerator::Generate()
}
}
+ // cache the enabled languages for source file type queries
+ this->GetEnabledLanguages(this->EnabledLangs);
+
this->SetGenerationRoot(root);
// now create the project
this->OutputXCodeProject(root, keyVal.second);
@@ -673,6 +677,7 @@ void cmGlobalXCodeGenerator::ClearXCodeObjects()
this->GroupNameMap.clear();
this->TargetGroup.clear();
this->FileRefs.clear();
+ this->ExternalLibRefs.clear();
}
void cmGlobalXCodeGenerator::addObject(std::unique_ptr<cmXCodeObject> obj)
@@ -741,7 +746,7 @@ std::string GetGroupMapKeyFromPath(cmGeneratorTarget* target,
return key;
}
-cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFileFromPath(
+cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeBuildFileFromPath(
const std::string& fullpath, cmGeneratorTarget* target,
const std::string& lang, cmSourceFile* sf)
{
@@ -827,6 +832,14 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
default:
break;
}
+
+ // explicitly add the explicit language flag before any other flag
+ // this way backwards compatibility with user flags is maintained
+ if (sf->GetProperty("LANGUAGE")) {
+ this->CurrentLocalGenerator->AppendFeatureOptions(flags, lang,
+ "EXPLICIT_LANGUAGE");
+ }
+
const std::string COMPILE_FLAGS("COMPILE_FLAGS");
if (cmProp cflags = sf->GetProperty(COMPILE_FLAGS)) {
lg->AppendFlags(flags, genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS));
@@ -869,7 +882,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
lg->AppendFlags(flags, lg->GetIncludeFlags(includes, gtgt, lang, true));
cmXCodeObject* buildFile =
- this->CreateXCodeSourceFileFromPath(sf->ResolveFullPath(), gtgt, lang, sf);
+ this->CreateXCodeBuildFileFromPath(sf->ResolveFullPath(), gtgt, lang, sf);
cmXCodeObject* settings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
settings->AddAttributeIfNotEmpty("COMPILER_FLAGS",
@@ -922,14 +935,40 @@ void cmGlobalXCodeGenerator::AddXCodeProjBuildRule(
}
}
-std::string GetSourcecodeValueFromFileExtension(const std::string& _ext,
- const std::string& lang,
- bool& keepLastKnownFileType)
+bool IsLibraryExtension(const std::string& fileExt)
+{
+ return (fileExt == ".framework" || fileExt == ".a" || fileExt == ".o" ||
+ fileExt == ".dylib" || fileExt == ".tbd");
+}
+bool IsLibraryType(const std::string& fileType)
+{
+ return (fileType == "wrapper.framework" || fileType == "archive.ar" ||
+ fileType == "compiled.mach-o.objfile" ||
+ fileType == "compiled.mach-o.dylib" ||
+ fileType == "sourcecode.text-based-dylib-definition");
+}
+
+std::string GetDirectoryValueFromFileExtension(const std::string& dirExt)
+{
+ std::string ext = cmSystemTools::LowerCase(dirExt);
+ if (ext == "framework") {
+ return "wrapper.framework";
+ }
+ if (ext == "xcassets") {
+ return "folder.assetcatalog";
+ }
+ return "folder";
+}
+
+std::string GetSourcecodeValueFromFileExtension(
+ const std::string& _ext, const std::string& lang,
+ bool& keepLastKnownFileType, const std::vector<std::string>& enabled_langs)
{
std::string ext = cmSystemTools::LowerCase(_ext);
std::string sourcecode = "sourcecode";
if (ext == "o") {
+ keepLastKnownFileType = true;
sourcecode = "compiled.mach-o.objfile";
} else if (ext == "xctest") {
sourcecode = "wrapper.cfbundle";
@@ -939,9 +978,9 @@ std::string GetSourcecodeValueFromFileExtension(const std::string& _ext,
} else if (ext == "storyboard") {
keepLastKnownFileType = true;
sourcecode = "file.storyboard";
- } else if (ext == "mm") {
+ } else if (ext == "mm" && !cm::contains(enabled_langs, "OBJCXX")) {
sourcecode += ".cpp.objcpp";
- } else if (ext == "m") {
+ } else if (ext == "m" && !cm::contains(enabled_langs, "OBJC")) {
sourcecode += ".c.objc";
} else if (ext == "swift") {
sourcecode += ".swift";
@@ -973,6 +1012,14 @@ std::string GetSourcecodeValueFromFileExtension(const std::string& _ext,
sourcecode += ".metal";
} else if (ext == "mig") {
sourcecode += ".mig";
+ } else if (ext == "tbd") {
+ sourcecode += ".text-based-dylib-definition";
+ } else if (ext == "a") {
+ keepLastKnownFileType = true;
+ sourcecode = "archive.ar";
+ } else if (ext == "dylib") {
+ keepLastKnownFileType = true;
+ sourcecode = "compiled.mach-o.dylib";
}
// else
// {
@@ -989,20 +1036,6 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
const std::string& fullpath, cmGeneratorTarget* target,
const std::string& lang, cmSourceFile* sf)
{
- std::string key = GetGroupMapKeyFromPath(target, fullpath);
- cmXCodeObject* fileRef = this->FileRefs[key];
- if (!fileRef) {
- fileRef = this->CreateObject(cmXCodeObject::PBXFileReference);
- fileRef->SetComment(fullpath);
- this->FileRefs[key] = fileRef;
- }
- cmXCodeObject* group = this->GroupMap[key];
- cmXCodeObject* children = group->GetObject("children");
- if (!children->HasObject(fileRef)) {
- children->AddObject(fileRef);
- }
- fileRef->AddAttribute("fileEncoding", this->CreateString("4"));
-
bool useLastKnownFileType = false;
std::string fileType;
if (sf) {
@@ -1013,38 +1046,70 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
fileType = *l;
}
}
+ // Make a copy so that we can override it later
+ std::string path = fullpath;
+ // Compute the extension without leading '.'.
+ std::string ext = cmSystemTools::GetFilenameLastExtension(path);
+ if (!ext.empty()) {
+ ext = ext.substr(1);
+ }
if (fileType.empty()) {
- // Compute the extension without leading '.'.
- std::string ext = cmSystemTools::GetFilenameLastExtension(fullpath);
- if (!ext.empty()) {
- ext = ext.substr(1);
+ // If file has no extension it's either a raw executable or might
+ // be a direct reference to binary within a framework (bad practice!)
+ // so this is where we change the path to the point to framework
+ // directory.
+ if (ext.empty()) {
+ auto parentDir = cmSystemTools::GetParentDirectory(path);
+ auto parentExt = cmSystemTools::GetFilenameLastExtension(parentDir);
+ if (parentExt == ".framework") {
+ path = parentDir;
+ ext = parentExt.substr(1);
+ }
}
-
// If fullpath references a directory, then we need to specify
// lastKnownFileType as folder in order for Xcode to be able to
// open the contents of the folder.
// (Xcode 4.6 does not like explicitFileType=folder).
- if (cmSystemTools::FileIsDirectory(fullpath)) {
- fileType = (ext == "xcassets" ? "folder.assetcatalog" : "folder");
+ if (cmSystemTools::FileIsDirectory(path)) {
+ fileType = GetDirectoryValueFromFileExtension(ext);
useLastKnownFileType = true;
} else {
- fileType =
- GetSourcecodeValueFromFileExtension(ext, lang, useLastKnownFileType);
+ fileType = GetSourcecodeValueFromFileExtension(
+ ext, lang, useLastKnownFileType, this->EnabledLangs);
}
}
+ std::string key = GetGroupMapKeyFromPath(target, path);
+ cmXCodeObject* fileRef = this->FileRefs[key];
+ if (!fileRef) {
+ fileRef = this->CreateObject(cmXCodeObject::PBXFileReference);
+ fileRef->SetComment(path);
+ this->FileRefs[key] = fileRef;
+ }
+ fileRef->AddAttribute("fileEncoding", this->CreateString("4"));
fileRef->AddAttribute(useLastKnownFileType ? "lastKnownFileType"
: "explicitFileType",
this->CreateString(fileType));
-
// Store the file path relative to the top of the source tree.
- std::string path = this->RelativeToSource(fullpath);
+ if (!IsLibraryType(fileType)) {
+ path = this->RelativeToSource(path);
+ }
std::string name = cmSystemTools::GetFilenameName(path);
const char* sourceTree =
cmSystemTools::FileIsFullPath(path) ? "<absolute>" : "SOURCE_ROOT";
fileRef->AddAttribute("name", this->CreateString(name));
fileRef->AddAttribute("path", this->CreateString(path));
fileRef->AddAttribute("sourceTree", this->CreateString(sourceTree));
+
+ cmXCodeObject* group = this->GroupMap[key];
+ if (!group && IsLibraryType(fileType)) {
+ group = this->FrameworkGroup;
+ this->GroupMap[key] = group;
+ }
+ cmXCodeObject* children = group->GetObject("children");
+ if (!children->HasObject(fileRef)) {
+ children->AddObject(fileRef);
+ }
return fileRef;
}
@@ -1077,11 +1142,8 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
this->CurrentMakefile = gen->GetMakefile();
// Select the current set of configuration types.
- this->CurrentConfigurationTypes.clear();
- this->CurrentMakefile->GetConfigurations(this->CurrentConfigurationTypes);
- if (this->CurrentConfigurationTypes.empty()) {
- this->CurrentConfigurationTypes.emplace_back();
- }
+ this->CurrentConfigurationTypes =
+ this->CurrentMakefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
}
struct cmSourceFilePathCompare
@@ -1137,7 +1199,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
return true;
}
- if (gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!gtgt->IsInBuildSystem()) {
return true;
}
@@ -1152,23 +1214,24 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
}
// organize the sources
- std::vector<cmSourceFile*> classes;
- if (!gtgt->GetConfigCommonSourceFiles(classes)) {
+ std::vector<cmSourceFile*> commonSourceFiles;
+ if (!gtgt->GetConfigCommonSourceFiles(commonSourceFiles)) {
return false;
}
// Add CMakeLists.txt file for user convenience.
- this->AddXCodeProjBuildRule(gtgt, classes);
+ this->AddXCodeProjBuildRule(gtgt, commonSourceFiles);
// Add the Info.plist we are about to generate for an App Bundle.
if (gtgt->GetPropertyAsBool("MACOSX_BUNDLE")) {
std::string plist = this->ComputeInfoPListLocation(gtgt);
cmSourceFile* sf = gtgt->Makefile->GetOrCreateSource(
plist, true, cmSourceFileLocationKind::Known);
- classes.push_back(sf);
+ commonSourceFiles.push_back(sf);
}
- std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare());
+ std::sort(commonSourceFiles.begin(), commonSourceFiles.end(),
+ cmSourceFilePathCompare());
gtgt->ComputeObjectMapping();
@@ -1176,16 +1239,19 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
std::vector<cmXCodeObject*> headerFiles;
std::vector<cmXCodeObject*> resourceFiles;
std::vector<cmXCodeObject*> sourceFiles;
- for (auto sourceFile : classes) {
+ for (auto sourceFile : commonSourceFiles) {
cmXCodeObject* xsf = this->CreateXCodeSourceFile(
this->CurrentLocalGenerator, sourceFile, gtgt);
cmXCodeObject* fr = xsf->GetObject("fileRef");
cmXCodeObject* filetype = fr->GetObject()->GetObject("explicitFileType");
+ if (!filetype) {
+ filetype = fr->GetObject()->GetObject("lastKnownFileType");
+ }
cmGeneratorTarget::SourceFileFlags tsFlags =
gtgt->GetTargetSourceFileFlags(sourceFile);
- if (filetype && filetype->GetString() == "compiled.mach-o.objfile") {
+ if (filetype && IsLibraryType(filetype->GetString())) {
if (sourceFile->GetObjectLibrary().empty()) {
externalObjFiles.push_back(xsf);
}
@@ -1275,7 +1341,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
using mapOfVectorOfSourceFiles =
std::map<std::string, std::vector<cmSourceFile*>>;
mapOfVectorOfSourceFiles bundleFiles;
- for (auto sourceFile : classes) {
+ for (auto sourceFile : commonSourceFiles) {
cmGeneratorTarget::SourceFileFlags tsFlags =
gtgt->GetTargetSourceFileFlags(sourceFile);
if (tsFlags.Type == cmGeneratorTarget::SourceFileTypeMacContent) {
@@ -1323,7 +1389,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
using mapOfVectorOfSourceFiles =
std::map<std::string, std::vector<cmSourceFile*>>;
mapOfVectorOfSourceFiles bundleFiles;
- for (auto sourceFile : classes) {
+ for (auto sourceFile : commonSourceFiles) {
cmGeneratorTarget::SourceFileFlags tsFlags =
gtgt->GetTargetSourceFileFlags(sourceFile);
if (tsFlags.Type == cmGeneratorTarget::SourceFileTypeDeepResource) {
@@ -1353,22 +1419,20 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget(
}
}
- // create framework build phase
+ // always create framework build phase
cmXCodeObject* frameworkBuildPhase = nullptr;
- if (!externalObjFiles.empty()) {
- frameworkBuildPhase =
- this->CreateObject(cmXCodeObject::PBXFrameworksBuildPhase);
- frameworkBuildPhase->SetComment("Frameworks");
- frameworkBuildPhase->AddAttribute("buildActionMask",
- this->CreateString("2147483647"));
- buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
- frameworkBuildPhase->AddAttribute("files", buildFiles);
- for (auto& externalObjFile : externalObjFiles) {
- buildFiles->AddObject(externalObjFile);
- }
- frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
- this->CreateString("0"));
- }
+ frameworkBuildPhase =
+ this->CreateObject(cmXCodeObject::PBXFrameworksBuildPhase);
+ frameworkBuildPhase->SetComment("Frameworks");
+ frameworkBuildPhase->AddAttribute("buildActionMask",
+ this->CreateString("2147483647"));
+ buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
+ frameworkBuildPhase->AddAttribute("files", buildFiles);
+ for (auto& externalObjFile : externalObjFiles) {
+ buildFiles->AddObject(externalObjFile);
+ }
+ frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
+ this->CreateString("0"));
// create list of build phases and create the Xcode target
cmXCodeObject* buildPhases = this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -1781,7 +1845,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
cmXCodeObject* buildSettings,
const std::string& configName)
{
- if (gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!gtgt->IsInBuildSystem()) {
return;
}
@@ -2614,7 +2678,7 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(
cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget(
cmGeneratorTarget* gtgt, cmXCodeObject* buildPhases)
{
- if (gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!gtgt->IsInBuildSystem()) {
return nullptr;
}
cmXCodeObject* target = this->CreateObject(cmXCodeObject::PBXNativeTarget);
@@ -2757,7 +2821,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
cmSystemTools::Error("Error no target on xobject\n");
return;
}
- if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!gt->IsInBuildSystem()) {
return;
}
@@ -2768,6 +2832,190 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
}
}
+ // Separate libraries into ones that can be linked using "Link Binary With
+ // Libraries" build phase and the ones that can't. Only targets that build
+ // Apple bundles (.app, .framework, .bundle) can use this feature and only
+ // targets that represent actual libraries (static or dynamic, local or
+ // imported) not objects and not executables will be used. These are
+ // limitations imposed by CMake use-cases - otherwise a lot of things break.
+ // The rest will be linked using linker flags (OTHER_LDFLAGS setting in Xcode
+ // project).
+ std::map<std::string, std::vector<cmComputeLinkInformation::Item const*>>
+ configItemMap;
+ auto addToLinkerArguments =
+ [&configItemMap](const std::string& configName,
+ cmComputeLinkInformation::Item const* libItemPtr) {
+ auto& linkVector = configItemMap[configName];
+ if (std::find_if(linkVector.begin(), linkVector.end(),
+ [libItemPtr](cmComputeLinkInformation::Item const* p) {
+ return p == libItemPtr;
+ }) == linkVector.end()) {
+ linkVector.push_back(libItemPtr);
+ }
+ };
+ std::vector<cmComputeLinkInformation::Item const*> linkPhaseTargetVector;
+ std::map<std::string, std::vector<std::string>> targetConfigMap;
+ using ConfigItemPair =
+ std::pair<std::string, cmComputeLinkInformation::Item const*>;
+ std::map<std::string, std::vector<ConfigItemPair>> targetItemMap;
+ std::map<std::string, std::vector<std::string>> targetProductNameMap;
+ for (auto const& configName : this->CurrentConfigurationTypes) {
+ cmComputeLinkInformation* cli = gt->GetLinkInformation(configName);
+ if (!cli) {
+ continue;
+ }
+ for (auto const& libItem : cli->GetItems()) {
+ if (gt->IsBundleOnApple() &&
+ (gt->GetType() == cmStateEnums::EXECUTABLE ||
+ gt->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ gt->GetType() == cmStateEnums::MODULE_LIBRARY ||
+ gt->GetType() == cmStateEnums::UNKNOWN_LIBRARY) &&
+ ((libItem.Target &&
+ (libItem.Target->GetType() == cmStateEnums::STATIC_LIBRARY ||
+ libItem.Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ libItem.Target->GetType() == cmStateEnums::MODULE_LIBRARY)) ||
+ (!libItem.Target && libItem.IsPath))) {
+ // Add unique configuration name to target-config map for later
+ // checks
+ std::string libName;
+ if (libItem.Target) {
+ libName = libItem.Target->GetName();
+ } else {
+ libName = cmSystemTools::GetFilenameName(libItem.Value.Value);
+ const auto libExt = cmSystemTools::GetFilenameExtension(libName);
+ if (!IsLibraryExtension(libExt)) {
+ // Add this library item to a regular linker flag list
+ addToLinkerArguments(configName, &libItem);
+ continue;
+ }
+ }
+ auto& configVector = targetConfigMap[libName];
+ if (std::find(configVector.begin(), configVector.end(), configName) ==
+ configVector.end()) {
+ configVector.push_back(configName);
+ }
+ // Add a pair of config and item to target-item map
+ auto& itemVector = targetItemMap[libName];
+ itemVector.emplace_back(ConfigItemPair(configName, &libItem));
+ // Add product file-name to a lib-product map
+ auto productName = cmSystemTools::GetFilenameName(libItem.Value.Value);
+ auto& productVector = targetProductNameMap[libName];
+ if (std::find(productVector.begin(), productVector.end(),
+ productName) == productVector.end()) {
+ productVector.push_back(productName);
+ }
+ } else {
+ // Add this library item to a regular linker flag list
+ addToLinkerArguments(configName, &libItem);
+ }
+ }
+ }
+
+ // Go through target library map and separate libraries that are linked
+ // in all configurations and produce only single product, from the rest.
+ // Only these will be linked through "Link Binary With Libraries" build
+ // phase.
+ for (auto const& targetLibConfigs : targetConfigMap) {
+ // Add this library to "Link Binary With Libraries" build phase if it's
+ // linked in all configurations and it has only one product name
+ auto& itemVector = targetItemMap[targetLibConfigs.first];
+ auto& productVector = targetProductNameMap[targetLibConfigs.first];
+ if (targetLibConfigs.second == this->CurrentConfigurationTypes &&
+ productVector.size() == 1) {
+ // Add this library to "Link Binary With Libraries" list
+ linkPhaseTargetVector.push_back(itemVector[0].second);
+ } else {
+ for (auto const& libItem : targetItemMap[targetLibConfigs.first]) {
+ // Add this library item to a regular linker flag list
+ addToLinkerArguments(libItem.first, libItem.second);
+ }
+ }
+ }
+
+ // Add libraries to "Link Binary With Libraries" build phase and collect
+ // their search paths. Xcode does not support per-configuration linking
+ // in this build phase so we don't have to do this for each configuration
+ // separately.
+ std::vector<std::string> linkSearchPaths;
+ for (auto const& libItem : linkPhaseTargetVector) {
+ // Add target output directory as a library search path
+ std::string linkDir;
+ if (libItem->Target) {
+ linkDir = cmSystemTools::GetParentDirectory(
+ libItem->Target->GetLocationForBuild());
+ } else {
+ linkDir = cmSystemTools::GetParentDirectory(libItem->Value.Value);
+ }
+ if (std::find(linkSearchPaths.begin(), linkSearchPaths.end(), linkDir) ==
+ linkSearchPaths.end()) {
+ linkSearchPaths.push_back(linkDir);
+ }
+ // Add target dependency
+ if (libItem->Target && !libItem->Target->IsImported()) {
+ for (auto const& configName : this->CurrentConfigurationTypes) {
+ target->AddDependTarget(configName, libItem->Target->GetName());
+ }
+ }
+ // Get the library target
+ auto* libTarget = FindXCodeTarget(libItem->Target);
+ cmXCodeObject* buildFile;
+ if (!libTarget) {
+ if (libItem->IsPath) {
+ // Get or create a direct file ref in the root project
+ auto it = this->ExternalLibRefs.find(libItem->Value.Value);
+ if (it == this->ExternalLibRefs.end()) {
+ buildFile = CreateXCodeBuildFileFromPath(libItem->Value.Value, gt,
+ "", nullptr);
+ this->ExternalLibRefs.emplace(libItem->Value.Value, buildFile);
+ } else {
+ buildFile = it->second;
+ }
+ } else {
+ // Add this library item back to a regular linker flag list
+ for (const auto& conf : configItemMap) {
+ addToLinkerArguments(conf.first, libItem);
+ }
+ continue;
+ }
+ } else {
+ // Add the target output file as a build reference for other targets
+ // to link against
+ auto* fileRefObject = libTarget->GetObject("productReference");
+ if (!fileRefObject) {
+ // Add this library item back to a regular linker flag list
+ for (const auto& conf : configItemMap) {
+ addToLinkerArguments(conf.first, libItem);
+ }
+ continue;
+ }
+ auto it = FileRefToBuildFileMap.find(fileRefObject);
+ if (it == FileRefToBuildFileMap.end()) {
+ buildFile = this->CreateObject(cmXCodeObject::PBXBuildFile);
+ buildFile->AddAttribute("fileRef", fileRefObject);
+ FileRefToBuildFileMap[fileRefObject] = buildFile;
+ } else {
+ buildFile = it->second;
+ }
+ }
+ // Add this reference to current target
+ auto* buildPhases = target->GetObject("buildPhases");
+ if (!buildPhases) {
+ continue;
+ }
+ auto* frameworkBuildPhase =
+ buildPhases->GetObject(cmXCodeObject::PBXFrameworksBuildPhase);
+ if (!frameworkBuildPhase) {
+ continue;
+ }
+ auto* buildFiles = frameworkBuildPhase->GetObject("files");
+ if (!buildFiles) {
+ continue;
+ }
+ if (!buildFiles->HasObject(buildFile)) {
+ buildFiles->AddObject(buildFile);
+ }
+ }
+
// Loop over configuration types and set per-configuration info.
for (auto const& configName : this->CurrentConfigurationTypes) {
{
@@ -2795,21 +3043,20 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
}
// Compute the link library and directory information.
- cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
- if (!pcli) {
+ cmComputeLinkInformation* cli = gt->GetLinkInformation(configName);
+ if (!cli) {
continue;
}
- cmComputeLinkInformation& cli = *pcli;
// Add dependencies directly on library files.
- for (auto const& libDep : cli.GetDepends()) {
+ for (auto const& libDep : cli->GetDepends()) {
target->AddDependLibrary(configName, libDep);
}
// add the library search paths
{
std::string linkDirs;
- for (auto const& libDir : cli.GetDirectories()) {
+ for (auto const& libDir : cli->GetDirectories()) {
if (!libDir.empty() && libDir != "/usr/lib") {
// Now add the same one but append
// $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) to it:
@@ -2820,15 +3067,22 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
linkDirs += this->XCodeEscapePath(libDir);
}
}
+ // Add previously collected paths where to look for libraries
+ // that were added to "Link Binary With Libraries"
+ for (auto& linkDir : linkSearchPaths) {
+ linkDirs += " ";
+ linkDirs += this->XCodeEscapePath(linkDir);
+ }
this->AppendBuildSettingAttribute(target, "LIBRARY_SEARCH_PATHS",
linkDirs.c_str(), configName);
}
- // now add the link libraries
+ // now add the left-over link libraries
{
std::string linkLibs;
const char* sep = "";
- for (auto const& libName : cli.GetItems()) {
+ for (auto const& libItem : configItemMap[configName]) {
+ auto const& libName = *libItem;
linkLibs += sep;
sep = " ";
if (libName.IsPath) {
@@ -2859,13 +3113,9 @@ bool cmGlobalXCodeGenerator::CreateGroups(
// end up with (empty anyhow) ZERO_CHECK, install, or test source
// groups:
//
- if (gtgt->GetType() == cmStateEnums::GLOBAL_TARGET) {
- continue;
- }
- if (gtgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
- continue;
- }
- if (gtgt->GetName() == CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
+ if (!gtgt->IsInBuildSystem() ||
+ gtgt->GetType() == cmStateEnums::GLOBAL_TARGET ||
+ gtgt->GetName() == CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
continue;
}
@@ -3009,6 +3259,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
this->ClearXCodeObjects();
this->RootObject = nullptr;
this->MainGroupChildren = nullptr;
+ this->FrameworkGroup = nullptr;
cmXCodeObject* group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
group->AddAttribute("COPY_PHASE_STRIP", this->CreateString("NO"));
cmXCodeObject* listObjs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -3043,6 +3294,15 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
productGroup->AddAttribute("children", productGroupChildren);
this->MainGroupChildren->AddObject(productGroup);
+ this->FrameworkGroup = this->CreateObject(cmXCodeObject::PBXGroup);
+ this->FrameworkGroup->AddAttribute("name", this->CreateString("Frameworks"));
+ this->FrameworkGroup->AddAttribute("sourceTree",
+ this->CreateString("<group>"));
+ cmXCodeObject* frameworkGroupChildren =
+ this->CreateObject(cmXCodeObject::OBJECT_LIST);
+ this->FrameworkGroup->AddAttribute("children", frameworkGroupChildren);
+ this->MainGroupChildren->AddObject(this->FrameworkGroup);
+
this->RootObject = this->CreateObject(cmXCodeObject::PBXProject);
this->RootObject->SetComment("Project object");
@@ -3121,7 +3381,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
buildSettings->AddAttribute("ONLY_ACTIVE_ARCH", this->CreateString("YES"));
// When targeting macOS, use only the host architecture.
if (this->SystemName == "Darwin"_s &&
- (!sysroot || !*sysroot ||
+ (!cmNonempty(sysroot) ||
cmSystemTools::LowerCase(sysroot).find("macos") !=
std::string::npos)) {
buildSettings->AddAttribute("ARCHS",
@@ -3131,7 +3391,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
// Tell Xcode to use ARCHS (ONLY_ACTIVE_ARCH defaults to NO).
buildSettings->AddAttribute("ARCHS", this->CreateString(archs));
}
- if (deploymentTarget && *deploymentTarget) {
+ if (cmNonempty(deploymentTarget)) {
buildSettings->AddAttribute(GetDeploymentPlatform(root->GetMakefile()),
this->CreateString(deploymentTarget));
}
@@ -3158,6 +3418,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
std::string symroot = cmStrCat(root->GetCurrentBinaryDirectory(), "/build");
buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot));
+ // Inside a try_compile project, do not require signing on any platform.
+ if (this->CMakeInstance->GetIsInTryCompile()) {
+ buildSettings->AddAttribute("CODE_SIGNING_ALLOWED",
+ this->CreateString("NO"));
+ }
+
for (auto& config : configs) {
cmXCodeObject* buildSettingsForCfg = this->CreateFlatClone(buildSettings);
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index e2d1b3a82a..7018de7908 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -28,7 +28,7 @@ struct cmDocumentationEntry;
/** \class cmGlobalXCodeGenerator
* \brief Write a Unix makefiles.
*
- * cmGlobalXCodeGenerator manages UNIX build process for a tree
+ * cmGlobalXCodeGenerator manages Xcode build process for a tree
*/
class cmGlobalXCodeGenerator : public cmGlobalGenerator
{
@@ -204,10 +204,10 @@ private:
cmGeneratorTarget* target,
const std::string& lang,
cmSourceFile* sf);
- cmXCodeObject* CreateXCodeSourceFileFromPath(const std::string& fullpath,
- cmGeneratorTarget* target,
- const std::string& lang,
- cmSourceFile* sf);
+ cmXCodeObject* CreateXCodeBuildFileFromPath(const std::string& fullpath,
+ cmGeneratorTarget* target,
+ const std::string& lang,
+ cmSourceFile* sf);
cmXCodeObject* CreateXCodeFileReference(cmSourceFile* sf,
cmGeneratorTarget* target);
cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen, cmSourceFile* sf,
@@ -282,6 +282,7 @@ private:
std::string PostBuildMakeTarget(std::string const& tName,
std::string const& configName);
cmXCodeObject* MainGroupChildren;
+ cmXCodeObject* FrameworkGroup;
cmMakefile* CurrentMakefile;
cmLocalGenerator* CurrentLocalGenerator;
std::vector<std::string> CurrentConfigurationTypes;
@@ -295,13 +296,16 @@ private:
std::map<std::string, cmXCodeObject*> GroupNameMap;
std::map<std::string, cmXCodeObject*> TargetGroup;
std::map<std::string, cmXCodeObject*> FileRefs;
+ std::map<std::string, cmXCodeObject*> ExternalLibRefs;
std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap;
+ std::map<cmXCodeObject*, cmXCodeObject*> FileRefToBuildFileMap;
std::vector<std::string> Architectures;
std::string ObjectDirArchDefault;
std::string ObjectDirArch;
std::string SystemName;
std::string GeneratorToolset;
std::map<cmGeneratorTarget const*, size_t> TargetOrderIndex;
+ std::vector<std::string> EnabledLangs;
};
#endif
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index c23156d667..8e9abf878b 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -260,7 +260,7 @@ void cmGraphVizWriter::ReadSettings(
do { \
const char* value = mf.GetDefinition(cmakeDefinition); \
if (value) { \
- (var) = mf.IsOn(cmakeDefinition); \
+ (var) = cmIsOn(value); \
} \
} while (false)
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 178af738a5..ddd6c2200a 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -680,7 +680,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
if (createInstallGeneratorsForTargetFileSets && !namelinkOnly) {
cmProp files = target.GetProperty("PRIVATE_HEADER");
- if (files && !files->empty()) {
+ if (cmNonempty(files)) {
std::vector<std::string> relFiles = cmExpandedList(*files);
std::vector<std::string> absFiles;
if (!helper.MakeFilesFullPath("PRIVATE_HEADER", relFiles, absFiles)) {
@@ -702,7 +702,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
}
files = target.GetProperty("PUBLIC_HEADER");
- if (files && !files->empty()) {
+ if (cmNonempty(files)) {
std::vector<std::string> relFiles = cmExpandedList(*files);
std::vector<std::string> absFiles;
if (!helper.MakeFilesFullPath("PUBLIC_HEADER", relFiles, absFiles)) {
@@ -724,7 +724,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
}
files = target.GetProperty("RESOURCE");
- if (files && !files->empty()) {
+ if (cmNonempty(files)) {
std::vector<std::string> relFiles = cmExpandedList(*files);
std::vector<std::string> absFiles;
if (!helper.MakeFilesFullPath("RESOURCE", relFiles, absFiles)) {
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx
index 9f17f15577..3a2e3be32c 100644
--- a/Source/cmJsonObjects.cxx
+++ b/Source/cmJsonObjects.cxx
@@ -51,11 +51,7 @@ std::vector<std::string> getConfigurations(const cmake* cm)
return configurations;
}
- makefiles[0]->GetConfigurations(configurations);
- if (configurations.empty()) {
- configurations.emplace_back();
- }
- return configurations;
+ return makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
}
bool hasString(const Json::Value& v, const std::string& s)
diff --git a/Source/cmLinkItemGraphVisitor.cxx b/Source/cmLinkItemGraphVisitor.cxx
index acc23c8db3..dfdd3ff65c 100644
--- a/Source/cmLinkItemGraphVisitor.cxx
+++ b/Source/cmLinkItemGraphVisitor.cxx
@@ -24,15 +24,12 @@ void cmLinkItemGraphVisitor::VisitItem(cmLinkItem const& item)
void cmLinkItemGraphVisitor::VisitLinks(cmLinkItem const& item,
cmLinkItem const& rootItem)
{
- if (this->LinkVisited(item, rootItem)) {
- return;
- }
-
if (item.Target == nullptr) {
return;
}
- for (auto const& config : item.Target->Makefile->GetGeneratorConfigs()) {
+ for (auto const& config : item.Target->Makefile->GetGeneratorConfigs(
+ cmMakefile::IncludeEmptyConfig)) {
this->VisitLinks(item, rootItem, config);
}
}
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index c50a786843..5739feca1f 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -191,21 +191,18 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
target.GetLinkClosure(config);
if (cm::contains(closure->Languages, "CUDA")) {
- if (cmProp separableCompilation =
- target.GetProperty("CUDA_SEPARABLE_COMPILATION")) {
- if (cmIsOn(*separableCompilation)) {
- bool doDeviceLinking = false;
- switch (target.GetType()) {
- case cmStateEnums::SHARED_LIBRARY:
- case cmStateEnums::MODULE_LIBRARY:
- case cmStateEnums::EXECUTABLE:
- doDeviceLinking = true;
- break;
- default:
- break;
- }
- return doDeviceLinking;
+ if (cmIsOn(target.GetProperty("CUDA_SEPARABLE_COMPILATION"))) {
+ bool doDeviceLinking = false;
+ switch (target.GetType()) {
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::EXECUTABLE:
+ doDeviceLinking = true;
+ break;
+ default:
+ break;
}
+ return doDeviceLinking;
}
cmComputeLinkInformation* pcli = target.GetLinkInformation(config);
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 89902ff30b..0b4414de69 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -175,6 +175,32 @@ public:
std::ostream& operator<<(std::ostream& os, BT<std::string> const& s);
+// Wrap type T as a value with potentially multiple backtraces. For purposes
+// of ordering and equality comparison, only the original value is used. The
+// backtrace is considered incidental.
+template <typename T>
+class BTs
+{
+public:
+ BTs(T v = T(), cmListFileBacktrace bt = cmListFileBacktrace())
+ : Value(std::move(v))
+ {
+ Backtraces.emplace_back(std::move(bt));
+ }
+ T Value;
+ std::vector<cmListFileBacktrace> Backtraces;
+ friend bool operator==(BTs<T> const& l, BTs<T> const& r)
+ {
+ return l.Value == r.Value;
+ }
+ friend bool operator<(BTs<T> const& l, BTs<T> const& r)
+ {
+ return l.Value < r.Value;
+ }
+ friend bool operator==(BTs<T> const& l, T const& r) { return l.Value == r; }
+ friend bool operator==(T const& l, BTs<T> const& r) { return l == r.Value; }
+};
+
std::vector<BT<std::string>> ExpandListWithBacktrace(
std::string const& list,
cmListFileBacktrace const& bt = cmListFileBacktrace());
diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx
index 278ec8b147..44db842a54 100644
--- a/Source/cmLocalCommonGenerator.cxx
+++ b/Source/cmLocalCommonGenerator.cxx
@@ -17,10 +17,8 @@ cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
: cmLocalGenerator(gg, mf)
, WorkingDirectory(std::move(wd))
{
- this->Makefile->GetConfigurations(this->ConfigNames);
- if (this->ConfigNames.empty()) {
- this->ConfigNames.emplace_back();
- }
+ this->ConfigNames =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
}
cmLocalCommonGenerator::~cmLocalCommonGenerator() = default;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index e26dc94e67..4d39312c0c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -39,6 +39,7 @@
#include "cmSourceFile.h"
#include "cmSourceFileLocation.h"
#include "cmSourceFileLocationKind.h"
+#include "cmStandardLevelResolver.h"
#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmStateTypes.h"
@@ -129,7 +130,7 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile)
this->LinkerSysroot = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
}
- if (std::string const* appleArchSysroots =
+ if (cmProp appleArchSysroots =
this->Makefile->GetDef("CMAKE_APPLE_ARCH_SYSROOTS")) {
std::string const& appleArchs =
this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES");
@@ -220,7 +221,7 @@ void cmLocalGenerator::ComputeObjectMaxPath()
this->ObjectPathMax = 1000;
#endif
const char* plen = this->Makefile->GetDefinition("CMAKE_OBJECT_PATH_MAX");
- if (plen && *plen) {
+ if (cmNonempty(plen)) {
unsigned int pmax;
if (sscanf(plen, "%u", &pmax) == 1) {
if (pmax >= 128) {
@@ -283,7 +284,7 @@ void cmLocalGenerator::TraceDependencies()
// Generate the rule files for each target.
const auto& targets = this->GetGeneratorTargets();
for (const auto& target : targets) {
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
continue;
}
target->TraceDependencies();
@@ -297,9 +298,9 @@ void cmLocalGenerator::GenerateTestFiles()
}
// Compute the set of configurations.
- std::vector<std::string> configurationTypes;
- const std::string& config =
- this->Makefile->GetConfigurations(configurationTypes, false);
+ std::vector<std::string> configurationTypes =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::OnlyMultiConfig);
+ std::string config = this->Makefile->GetDefaultConfiguration();
std::string file =
cmStrCat(this->StateSnapshot.GetDirectory().GetCurrentBinary(),
@@ -379,7 +380,7 @@ void cmLocalGenerator::GenerateTestFiles()
void cmLocalGenerator::CreateEvaluationFileOutputs()
{
std::vector<std::string> const& configs =
- this->Makefile->GetGeneratorConfigs();
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
for (std::string const& c : configs) {
this->CreateEvaluationFileOutputs(c);
}
@@ -433,7 +434,7 @@ void cmLocalGenerator::GenerateInstallRules()
prefix_win32 = "C:";
}
const char* project_name = this->Makefile->GetDefinition("PROJECT_NAME");
- if (project_name && project_name[0]) {
+ if (cmNonempty(project_name)) {
prefix_win32 += "/Program Files/";
prefix_win32 += project_name;
} else {
@@ -462,9 +463,9 @@ void cmLocalGenerator::GenerateInstallRules()
}
// Compute the set of configurations.
- std::vector<std::string> configurationTypes;
- const std::string& config =
- this->Makefile->GetConfigurations(configurationTypes, false);
+ std::vector<std::string> configurationTypes =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::OnlyMultiConfig);
+ std::string config = this->Makefile->GetDefaultConfiguration();
// Choose a default install configuration.
std::string default_config = config;
@@ -753,16 +754,13 @@ cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget(
void cmLocalGenerator::ComputeTargetManifest()
{
// Collect the set of configuration types.
- std::vector<std::string> configNames;
- this->Makefile->GetConfigurations(configNames);
- if (configNames.empty()) {
- configNames.emplace_back();
- }
+ std::vector<std::string> configNames =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
// Add our targets to the manifest for each configuration.
const auto& targets = this->GetGeneratorTargets();
for (const auto& target : targets) {
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
continue;
}
for (std::string const& c : configNames) {
@@ -774,11 +772,8 @@ void cmLocalGenerator::ComputeTargetManifest()
bool cmLocalGenerator::ComputeTargetCompileFeatures()
{
// Collect the set of configuration types.
- std::vector<std::string> configNames;
- this->Makefile->GetConfigurations(configNames);
- if (configNames.empty()) {
- configNames.emplace_back();
- }
+ std::vector<std::string> configNames =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
using LanguagePair = std::pair<std::string, std::string>;
std::vector<LanguagePair> pairedLanguages{ { "OBJC", "C" },
@@ -802,40 +797,9 @@ bool cmLocalGenerator::ComputeTargetCompileFeatures()
// Now that C/C++ _STANDARD values have been computed
// set the values to ObjC/ObjCXX _STANDARD variables
- if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
- auto copyStandardToObjLang = [&](LanguagePair const& lang) -> bool {
- if (!target->GetProperty(cmStrCat(lang.first, "_STANDARD"))) {
- cmProp standard =
- target->GetProperty(cmStrCat(lang.second, "_STANDARD"));
- if (!standard) {
- standard = this->Makefile->GetDef(
- cmStrCat("CMAKE_", lang.second, "_STANDARD_DEFAULT"));
- }
- target->Target->SetProperty(cmStrCat(lang.first, "_STANDARD"),
- standard ? standard->c_str() : nullptr);
- return true;
- }
- return false;
- };
- auto copyPropertyToObjLang = [&](LanguagePair const& lang,
- const char* property) {
- if (!target->GetProperty(cmStrCat(lang.first, property)) &&
- target->GetProperty(cmStrCat(lang.second, property))) {
- cmProp p = target->GetProperty(cmStrCat(lang.second, property));
- target->Target->SetProperty(cmStrCat(lang.first, property),
- p ? p->c_str() : nullptr);
- }
- };
- for (auto const& lang : pairedLanguages) {
- if (copyStandardToObjLang(lang)) {
- copyPropertyToObjLang(lang, "_STANDARD_REQUIRED");
- copyPropertyToObjLang(lang, "_EXTENSIONS");
- }
- }
- if (cmProp standard = target->GetProperty("CUDA_STANDARD")) {
- if (*standard == "98") {
- target->Target->SetProperty("CUDA_STANDARD", "03");
- }
+ if (target->CanCompileSources()) {
+ for (std::string const& c : configNames) {
+ target->ComputeCompileFeatures(c, inferredEnabledLanguages);
}
}
}
@@ -929,7 +893,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
emitted.insert("/System/Library/Frameworks");
#endif
for (std::string const& i : includes) {
- if (fwSearchFlag && *fwSearchFlag && this->Makefile->IsOn("APPLE") &&
+ if (cmNonempty(fwSearchFlag) && this->Makefile->IsOn("APPLE") &&
cmSystemTools::IsPathToFramework(i)) {
std::string const frameworkDir =
cmSystemTools::CollapseFullPath(cmStrCat(i, "/../"));
@@ -1025,12 +989,13 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags,
this->AppendCompileOptions(flags, targetCompileOpts);
}
+ cmStandardLevelResolver standardResolver(this->Makefile);
for (auto const& it : target->GetMaxLanguageStandards()) {
- cmProp standard = target->GetProperty(it.first + "_STANDARD");
+ cmProp standard = target->GetLanguageStandard(it.first, config);
if (!standard) {
continue;
}
- if (this->Makefile->IsLaterStandard(it.first, *standard, it.second)) {
+ if (standardResolver.IsLaterStandard(it.first, *standard, it.second)) {
std::ostringstream e;
e << "The COMPILE_FEATURES property of target \"" << target->GetName()
<< "\" was evaluated when computing the link "
@@ -1050,7 +1015,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags,
}
std::string compReqFlag;
- this->AddCompilerRequirementFlag(compReqFlag, target, lang);
+ this->AddCompilerRequirementFlag(compReqFlag, target, lang, config);
if (!compReqFlag.empty()) {
flags.emplace_back(std::move(compReqFlag));
}
@@ -1308,7 +1273,7 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit(
}
}
- // Emit remaining non implicit user direcories.
+ // Emit remaining non implicit user directories.
for (BT<std::string> const& udr : userDirs) {
if (notExcluded(udr.Value)) {
emitBT(udr);
@@ -1578,9 +1543,8 @@ void cmLocalGenerator::GetTargetFlags(
frameworkPath, linkPath);
}
- if (cmIsOn(this->Makefile->GetDefinition("BUILD_SHARED_LIBS"))) {
- std::string sFlagVar = std::string("CMAKE_SHARED_BUILD_") +
- linkLanguage + std::string("_FLAGS");
+ if (this->Makefile->IsOn("BUILD_SHARED_LIBS")) {
+ std::string sFlagVar = "CMAKE_SHARED_BUILD_" + linkLanguage + "_FLAGS";
exeFlags += this->Makefile->GetSafeDefinition(sFlagVar);
exeFlags += " ";
}
@@ -1689,7 +1653,7 @@ static std::string GetFrameworkFlags(const std::string& lang,
std::string fwSearchFlagVar = "CMAKE_" + lang + "_FRAMEWORK_SEARCH_FLAG";
const char* fwSearchFlag = mf->GetDefinition(fwSearchFlagVar);
- if (!(fwSearchFlag && *fwSearchFlag)) {
+ if (!cmNonempty(fwSearchFlag)) {
return std::string();
}
@@ -1928,7 +1892,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
std::string sysrootFlagVar =
std::string("CMAKE_") + lang + "_SYSROOT_FLAG";
const char* sysrootFlag = this->Makefile->GetDefinition(sysrootFlagVar);
- if (sysrootFlag && *sysrootFlag) {
+ if (cmNonempty(sysrootFlag)) {
if (!this->AppleArchSysroots.empty() &&
!this->AllAppleArchSysrootsAreTheSame(archs, sysroot)) {
for (std::string const& arch : archs) {
@@ -1957,8 +1921,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
std::string("CMAKE_") + lang + "_OSX_DEPLOYMENT_TARGET_FLAG";
const char* deploymentTargetFlag =
this->Makefile->GetDefinition(deploymentTargetFlagVar);
- if (deploymentTargetFlag && *deploymentTargetFlag && deploymentTarget &&
- *deploymentTarget) {
+ if (cmNonempty(deploymentTargetFlag) && cmNonempty(deploymentTarget)) {
flags += " ";
flags += deploymentTargetFlag;
flags += deploymentTarget;
@@ -2007,7 +1970,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
// of a default selection whether or not it is overridden by a property.
cmProp msvcRuntimeLibraryDefault =
this->Makefile->GetDef("CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT");
- if (msvcRuntimeLibraryDefault && !msvcRuntimeLibraryDefault->empty()) {
+ if (cmNonempty(msvcRuntimeLibraryDefault)) {
cmProp msvcRuntimeLibraryValue =
target->GetProperty("MSVC_RUNTIME_LIBRARY");
if (!msvcRuntimeLibraryValue) {
@@ -2046,7 +2009,7 @@ void cmLocalGenerator::AddLanguageFlagsForLinking(
// when linking in order to use the matching standard library.
// FIXME: If CMake gains an abstraction for standard library
// selection, this will have to be reconciled with it.
- this->AddCompilerRequirementFlag(flags, target, lang);
+ this->AddCompilerRequirementFlag(flags, target, lang, config);
}
this->AddLanguageFlags(flags, target, lang, config);
@@ -2189,156 +2152,20 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags,
}
void cmLocalGenerator::AddCompilerRequirementFlag(
- std::string& flags, cmGeneratorTarget const* target, const std::string& lang)
+ std::string& flags, cmGeneratorTarget const* target, const std::string& lang,
+ const std::string& config)
{
- if (lang.empty()) {
- return;
- }
- const char* defaultStd =
- this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT");
- if (!defaultStd || !*defaultStd) {
- // This compiler has no notion of language standard levels.
- return;
- }
- std::string extProp = lang + "_EXTENSIONS";
- bool ext = true;
- if (cmProp extPropValue = target->GetProperty(extProp)) {
- if (cmIsOff(*extPropValue)) {
- ext = false;
- }
- }
- std::string stdProp = lang + "_STANDARD";
- cmProp standardProp = target->GetProperty(stdProp);
- if (!standardProp) {
- if (ext) {
- // No language standard is specified and extensions are not disabled.
- // Check if this compiler needs a flag to enable extensions.
- std::string const option_flag =
- "CMAKE_" + lang + "_EXTENSION_COMPILE_OPTION";
- if (const char* opt =
- target->Target->GetMakefile()->GetDefinition(option_flag)) {
- std::vector<std::string> optVec = cmExpandedList(opt);
- for (std::string const& i : optVec) {
- this->AppendFlagEscape(flags, i);
- }
- }
- }
- return;
- }
-
- std::string const type = ext ? "EXTENSION" : "STANDARD";
-
- if (target->GetPropertyAsBool(lang + "_STANDARD_REQUIRED")) {
- std::string option_flag =
- "CMAKE_" + lang + *standardProp + "_" + type + "_COMPILE_OPTION";
-
- const char* opt =
- target->Target->GetMakefile()->GetDefinition(option_flag);
- if (!opt) {
- std::ostringstream e;
- e << "Target \"" << target->GetName()
- << "\" requires the language "
- "dialect \""
- << lang << *standardProp << "\" "
- << (ext ? "(with compiler extensions)" : "")
- << ", but CMake "
- "does not know the compile flags to use to enable it.";
- this->IssueMessage(MessageType::FATAL_ERROR, e.str());
- } else {
- std::vector<std::string> optVec = cmExpandedList(opt);
- for (std::string const& i : optVec) {
- this->AppendFlagEscape(flags, i);
- }
- }
- return;
- }
-
- static std::map<std::string, std::vector<std::string>> langStdMap;
- if (langStdMap.empty()) {
- // Maintain sorted order, most recent first.
- langStdMap["CXX"].emplace_back("20");
- langStdMap["CXX"].emplace_back("17");
- langStdMap["CXX"].emplace_back("14");
- langStdMap["CXX"].emplace_back("11");
- langStdMap["CXX"].emplace_back("98");
-
- langStdMap["OBJCXX"].emplace_back("20");
- langStdMap["OBJCXX"].emplace_back("17");
- langStdMap["OBJCXX"].emplace_back("14");
- langStdMap["OBJCXX"].emplace_back("11");
- langStdMap["OBJCXX"].emplace_back("98");
-
- langStdMap["C"].emplace_back("11");
- langStdMap["C"].emplace_back("99");
- langStdMap["C"].emplace_back("90");
-
- langStdMap["OBJC"].emplace_back("11");
- langStdMap["OBJC"].emplace_back("99");
- langStdMap["OBJC"].emplace_back("90");
-
- langStdMap["CUDA"].emplace_back("20");
- langStdMap["CUDA"].emplace_back("17");
- langStdMap["CUDA"].emplace_back("14");
- langStdMap["CUDA"].emplace_back("11");
- langStdMap["CUDA"].emplace_back("03");
- }
-
- std::string standard(*standardProp);
- if (lang == "CUDA" && standard == "98") {
- standard = "03";
- }
- std::vector<std::string>& stds = langStdMap[lang];
-
- auto stdIt = std::find(stds.begin(), stds.end(), standard);
- if (stdIt == stds.end()) {
+ cmStandardLevelResolver standardResolver(this->Makefile);
- std::string e =
- lang + "_STANDARD is set to invalid value '" + standard + "'";
- this->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage(
- MessageType::FATAL_ERROR, e, target->GetBacktrace());
- return;
- }
-
- auto defaultStdIt = std::find(stds.begin(), stds.end(), defaultStd);
- if (defaultStdIt == stds.end()) {
- std::string e = "CMAKE_" + lang +
- "_STANDARD_DEFAULT is set to invalid value '" + std::string(defaultStd) +
- "'";
- this->IssueMessage(MessageType::INTERNAL_ERROR, e);
- return;
- }
-
- // If the standard requested is older than the compiler's default
- // then we need to use a flag to change it. The comparison is
- // greater-or-equal because the standards are stored in backward
- // chronological order.
- if (stdIt >= defaultStdIt) {
- std::string option_flag =
- "CMAKE_" + lang + *stdIt + "_" + type + "_COMPILE_OPTION";
-
- std::string const& opt =
- target->Target->GetMakefile()->GetRequiredDefinition(option_flag);
- std::vector<std::string> optVec = cmExpandedList(opt);
- for (std::string const& i : optVec) {
- this->AppendFlagEscape(flags, i);
- }
- return;
- }
-
- // The standard requested is at least as new as the compiler's default,
- // and the standard request is not required. Decay to the newest standard
- // for which a flag is defined.
- for (; stdIt < defaultStdIt; ++stdIt) {
- std::string option_flag =
- cmStrCat("CMAKE_", lang, *stdIt, "_", type, "_COMPILE_OPTION");
-
- if (const char* opt =
- target->Target->GetMakefile()->GetDefinition(option_flag)) {
+ std::string const& optionFlagDef =
+ standardResolver.GetCompileOptionDef(target, lang, config);
+ if (!optionFlagDef.empty()) {
+ auto opt = target->Target->GetMakefile()->GetDefinition(optionFlagDef);
+ if (opt) {
std::vector<std::string> optVec = cmExpandedList(opt);
for (std::string const& i : optVec) {
this->AppendFlagEscape(flags, i);
}
- return;
}
}
}
@@ -2583,11 +2410,8 @@ void cmLocalGenerator::AppendFlagEscape(std::string& flags,
void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
{
- std::vector<std::string> configsList;
- std::string configDefault = this->Makefile->GetConfigurations(configsList);
- if (configsList.empty()) {
- configsList.push_back(configDefault);
- }
+ std::vector<std::string> configsList =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
for (std::string const& config : configsList) {
// FIXME: Refactor collection of sources to not evaluate object
@@ -3236,7 +3060,7 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines,
if (!lang.empty()) {
const char* df =
this->Makefile->GetDefinition(cmStrCat("CMAKE_", lang, "_DEFINE_FLAG"));
- if (df && *df) {
+ if (cmNonempty(df)) {
dflag = df;
}
}
@@ -3291,8 +3115,8 @@ void cmLocalGenerator::AppendFeatureOptions(std::string& flags,
}
}
-const char* cmLocalGenerator::GetFeature(const std::string& feature,
- const std::string& config)
+cmProp cmLocalGenerator::GetFeature(const std::string& feature,
+ const std::string& config)
{
std::string featureName = feature;
// TODO: Define accumulation policy for features (prepend, append,
@@ -3304,7 +3128,7 @@ const char* cmLocalGenerator::GetFeature(const std::string& feature,
cmStateSnapshot snp = this->StateSnapshot;
while (snp.IsValid()) {
if (cmProp value = snp.GetDirectory().GetProperty(featureName)) {
- return value->c_str();
+ return value;
}
snp = snp.GetBuildsystemDirectoryParent();
}
@@ -3845,8 +3669,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target,
{
// Find the Info.plist template.
cmProp in = target->GetProperty("MACOSX_BUNDLE_INFO_PLIST");
- std::string inFile =
- (in && !in->empty()) ? *in : "MacOSXBundleInfo.plist.in";
+ std::string inFile = cmNonempty(in) ? *in : "MacOSXBundleInfo.plist.in";
if (!cmSystemTools::FileIsFullPath(inFile)) {
std::string inMod = this->Makefile->GetModulesFile(inFile);
if (!inMod.empty()) {
@@ -3876,7 +3699,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);
+ mf->ConfigureFile(inFile, fname, false, false, false, true);
}
void cmLocalGenerator::GenerateFrameworkInfoPList(
@@ -3885,8 +3708,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(
{
// Find the Info.plist template.
cmProp in = target->GetProperty("MACOSX_FRAMEWORK_INFO_PLIST");
- std::string inFile =
- (in && !in->empty()) ? *in : "MacOSXFrameworkInfo.plist.in";
+ std::string inFile = cmNonempty(in) ? *in : "MacOSXFrameworkInfo.plist.in";
if (!cmSystemTools::FileIsFullPath(inFile)) {
std::string inMod = this->Makefile->GetModulesFile(inFile);
if (!inMod.empty()) {
@@ -3912,7 +3734,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);
+ mf->ConfigureFile(inFile, fname, false, false, false, true);
}
namespace {
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index f2d914519b..0c51a6530d 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -20,6 +20,7 @@
#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
+#include "cmProperty.h"
#include "cmStateSnapshot.h"
class cmComputeLinkInformation;
@@ -123,7 +124,8 @@ public:
const std::string& config);
void AddCompilerRequirementFlag(std::string& flags,
cmGeneratorTarget const* target,
- const std::string& lang);
+ const std::string& lang,
+ const std::string& config);
//! Append flags to a string.
virtual void AppendFlags(std::string& flags,
const std::string& newFlags) const;
@@ -208,8 +210,7 @@ public:
void AppendFeatureOptions(std::string& flags, const std::string& lang,
const char* feature);
- const char* GetFeature(const std::string& feature,
- const std::string& config);
+ cmProp GetFeature(const std::string& feature, const std::string& config);
/** \brief Get absolute path to dependency \a name
*
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 098fa5a577..a23ad574dc 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -11,7 +11,6 @@
#include "cmGhsMultiTargetGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmSourceFile.h"
-#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -33,7 +32,7 @@ std::string cmLocalGhsMultiGenerator::GetTargetDirectory(
void cmLocalGhsMultiGenerator::GenerateTargetsDepthFirst(
cmGeneratorTarget* target, std::vector<cmGeneratorTarget*>& remaining)
{
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
return;
}
// Find this target in the list of remaining targets.
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 87e8aa4459..ef34953788 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -90,7 +90,7 @@ void cmLocalNinjaGenerator::Generate()
}
for (const auto& target : this->GetGeneratorTargets()) {
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
continue;
}
auto tg = cmNinjaTargetGenerator::New(target.get());
@@ -102,9 +102,10 @@ void cmLocalNinjaGenerator::Generate()
this->GetGlobalGenerator()->IsMultiConfig()) {
cmNinjaBuild phonyAlias("phony");
this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
- target.get(), phonyAlias.Outputs, "");
+ target.get(), phonyAlias.Outputs, "", DependOnTargetArtifact);
this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
- target.get(), phonyAlias.ExplicitDeps, config);
+ target.get(), phonyAlias.ExplicitDeps, config,
+ DependOnTargetArtifact);
this->GetGlobalNinjaGenerator()->WriteBuild(
*this->GetGlobalNinjaGenerator()->GetConfigFileStream(config),
phonyAlias);
@@ -115,11 +116,12 @@ void cmLocalNinjaGenerator::Generate()
if (!this->GetGlobalNinjaGenerator()->GetDefaultConfigs().empty()) {
cmNinjaBuild phonyAlias("phony");
this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
- target.get(), phonyAlias.Outputs, "");
+ target.get(), phonyAlias.Outputs, "", DependOnTargetArtifact);
for (auto const& config :
this->GetGlobalNinjaGenerator()->GetDefaultConfigs()) {
this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
- target.get(), phonyAlias.ExplicitDeps, config);
+ target.get(), phonyAlias.ExplicitDeps, config,
+ DependOnTargetArtifact);
}
this->GetGlobalNinjaGenerator()->WriteBuild(
*this->GetGlobalNinjaGenerator()->GetDefaultFileStream(),
@@ -127,10 +129,11 @@ void cmLocalNinjaGenerator::Generate()
}
cmNinjaBuild phonyAlias("phony");
this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
- target.get(), phonyAlias.Outputs, "all");
+ target.get(), phonyAlias.Outputs, "all", DependOnTargetArtifact);
for (auto const& config : this->GetConfigNames()) {
this->GetGlobalNinjaGenerator()->AppendTargetOutputs(
- target.get(), phonyAlias.ExplicitDeps, config);
+ target.get(), phonyAlias.ExplicitDeps, config,
+ DependOnTargetArtifact);
}
this->GetGlobalNinjaGenerator()->WriteBuild(
*this->GetGlobalNinjaGenerator()->GetDefaultFileStream(),
@@ -355,8 +358,8 @@ void cmLocalNinjaGenerator::AppendTargetOutputs(cmGeneratorTarget* target,
cmNinjaDeps& outputs,
const std::string& config)
{
- this->GetGlobalNinjaGenerator()->AppendTargetOutputs(target, outputs,
- config);
+ this->GetGlobalNinjaGenerator()->AppendTargetOutputs(target, outputs, config,
+ DependOnTargetArtifact);
}
void cmLocalNinjaGenerator::AppendTargetDepends(cmGeneratorTarget* target,
@@ -668,7 +671,7 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
{
cmProp property_value = this->Makefile->GetProperty("RULE_LAUNCH_CUSTOM");
- if (!property_value || property_value->empty()) {
+ if (!cmNonempty(property_value)) {
return std::string();
}
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index ef160e70f8..73c0cdeaca 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -66,10 +66,10 @@ public:
void AppendTargetOutputs(cmGeneratorTarget* target, cmNinjaDeps& outputs,
const std::string& config);
- void AppendTargetDepends(
- cmGeneratorTarget* target, cmNinjaDeps& outputs, const std::string& config,
- const std::string& fileConfig,
- cmNinjaTargetDepends depends = DependOnTargetArtifact);
+ void AppendTargetDepends(cmGeneratorTarget* target, cmNinjaDeps& outputs,
+ const std::string& config,
+ const std::string& fileConfig,
+ cmNinjaTargetDepends depends);
void AddCustomCommandTarget(cmCustomCommand const* cc,
cmGeneratorTarget* target);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index de1461a79b..8acd1e30a9 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -101,7 +101,7 @@ void cmLocalUnixMakefileGenerator3::Generate()
cmGlobalUnixMakefileGenerator3* gg =
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
for (const auto& target : this->GetGeneratorTargets()) {
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
continue;
}
std::unique_ptr<cmMakefileTargetGenerator> tg(
@@ -137,7 +137,7 @@ void cmLocalUnixMakefileGenerator3::GetLocalObjectFiles(
std::map<std::string, LocalObjectInfo>& localObjectFiles)
{
for (const auto& gt : this->GetGeneratorTargets()) {
- if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!gt->CanCompileSources()) {
continue;
}
std::vector<cmSourceFile const*> objectSources;
@@ -950,7 +950,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
std::string launcher;
// Short-circuit if there is no launcher.
const char* val = this->GetRuleLauncher(target, "RULE_LAUNCH_CUSTOM");
- if (val && *val) {
+ if (cmNonempty(val)) {
// Expand rule variables referenced in the given launcher command.
cmRulePlaceholderExpander::RuleVariables vars;
vars.CMTargetName = target->GetName().c_str();
@@ -1744,7 +1744,7 @@ public:
return false;
}
// If it's an absolute path, check if it starts with the source
- // direcotory:
+ // directory:
return (
!(IsInDirectory(SourceDir, path) || IsInDirectory(BinaryDir, path)));
}
@@ -1807,7 +1807,7 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
std::string cidVar =
cmStrCat("CMAKE_", implicitLang.first, "_COMPILER_ID");
const char* cid = this->Makefile->GetDefinition(cidVar);
- if (cid && *cid) {
+ if (cmNonempty(cid)) {
cmakefileStream << "set(CMAKE_" << implicitLang.first
<< "_COMPILER_ID \"" << cid << "\")\n";
}
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 9076e26d12..6c7d6c6c45 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -69,7 +69,7 @@ cmLocalVisualStudio10Generator::~cmLocalVisualStudio10Generator()
void cmLocalVisualStudio10Generator::GenerateTargetsDepthFirst(
cmGeneratorTarget* target, std::vector<cmGeneratorTarget*>& remaining)
{
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!target->IsInBuildSystem()) {
return;
}
// Find this target in the list of remaining targets.
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 5d50e2d2b3..fec6a9d500 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -66,7 +66,7 @@ void cmLocalVisualStudio7Generator::AddHelperCommands()
// Now create GUIDs for targets
const auto& tgts = this->GetGeneratorTargets();
for (const auto& l : tgts) {
- if (l->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!l->IsInBuildSystem()) {
continue;
}
cmProp path = l->GetProperty("EXTERNAL_MSPROJECT");
@@ -129,7 +129,7 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
// Create the project file for each target.
for (const auto& l : tgts) {
- if (l->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!l->IsInBuildSystem()) {
continue;
}
// INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
@@ -1331,8 +1331,8 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
const std::string& libName,
cmGeneratorTarget* target)
{
- std::vector<std::string> configs;
- this->Makefile->GetConfigurations(configs);
+ std::vector<std::string> configs =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
// We may be modifying the source groups temporarily, so make a copy.
std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups();
@@ -1580,8 +1580,9 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
std::string cmLocalVisualStudio7Generator::ComputeLongestObjectDirectory(
cmGeneratorTarget const* target) const
{
- std::vector<std::string> configs;
- target->Target->GetMakefile()->GetConfigurations(configs);
+ std::vector<std::string> configs =
+ target->Target->GetMakefile()->GetGeneratorConfigs(
+ cmMakefile::ExcludeEmptyConfig);
// Compute the maximum length configuration name.
std::string config_max;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index db5cee9bda..5e1f0702bb 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -34,6 +34,7 @@
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h" // IWYU pragma: keep
#include "cmExportBuildFileGenerator.h"
+#include "cmFSPermissions.h"
#include "cmFileLockPool.h"
#include "cmFunctionBlocker.h"
#include "cmGeneratedFileStream.h"
@@ -68,6 +69,8 @@
class cmMessenger;
+using namespace cmFSPermissions;
+
cmDirectoryId::cmDirectoryId(std::string s)
: String(std::move(s))
{
@@ -82,7 +85,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
{
this->IsSourceFileTryCompile = false;
- this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
this->SuppressSideEffects = false;
@@ -194,7 +196,7 @@ void cmMakefile::MaybeWarnCMP0074(std::string const& pkg)
std::string env;
cmSystemTools::GetEnv(varName, env);
- bool const haveVar = var && *var;
+ bool const haveVar = cmNonempty(var);
bool const haveEnv = !env.empty();
if ((haveVar || haveEnv) && this->WarnedCMP0074.insert(varName).second) {
std::ostringstream w;
@@ -750,7 +752,6 @@ void cmMakefile::ReadListFile(cmListFile const& listFile,
break;
}
}
- this->CheckForUnusedVariables();
this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile);
this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile);
@@ -1434,8 +1435,8 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent)
if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) {
cmProp p = parent->GetProperty("COMPILE_DEFINITIONS");
this->SetProperty("COMPILE_DEFINITIONS", p ? p->c_str() : nullptr);
- std::vector<std::string> configs;
- this->GetConfigurations(configs);
+ std::vector<std::string> configs =
+ this->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
for (std::string const& config : configs) {
std::string defPropName =
cmStrCat("COMPILE_DEFINITIONS_", cmSystemTools::UpperCase(config));
@@ -1513,8 +1514,6 @@ void cmMakefile::PopFunctionScope(bool reportError)
#endif
this->PopLoopBlockBarrier();
-
- this->CheckForUnusedVariables();
}
void cmMakefile::PushMacroScope(std::string const& fileName,
@@ -1661,7 +1660,8 @@ void cmMakefile::Configure()
this->SetCheckCMP0000(true);
// Implicitly set the version for the user.
- this->SetPolicyVersion("2.4", std::string());
+ cmPolicies::ApplyPolicyVersion(this, 2, 4, 0,
+ cmPolicies::WarnCompat::Off);
}
}
bool hasProject = false;
@@ -1860,9 +1860,6 @@ void cmMakefile::AddSystemIncludeDirectories(const std::set<std::string>& incs)
void cmMakefile::AddDefinition(const std::string& name, cm::string_view value)
{
- if (this->VariableInitialized(name)) {
- this->LogUnused("changing definition", name);
- }
this->StateSnapshot.SetDefinition(name, value);
#ifndef CMAKE_BOOTSTRAP
@@ -1923,16 +1920,6 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
this->StateSnapshot.RemoveDefinition(name);
}
-void cmMakefile::CheckForUnusedVariables() const
-{
- if (!this->WarnUnused) {
- return;
- }
- for (const std::string& key : this->StateSnapshot.UnusedKeys()) {
- this->LogUnused("out of scope", key);
- }
-}
-
void cmMakefile::MarkVariableAsUsed(const std::string& var)
{
this->StateSnapshot.GetDefinition(var);
@@ -1960,29 +1947,8 @@ void cmMakefile::MaybeWarnUninitialized(std::string const& variable,
}
}
-void cmMakefile::LogUnused(const char* reason, const std::string& name) const
-{
- if (this->WarnUnused) {
- std::string path;
- if (!this->ExecutionStatusStack.empty()) {
- path = this->GetExecutionContext().FilePath;
- } else {
- path = cmStrCat(this->GetCurrentSourceDirectory(), "/CMakeLists.txt");
- }
-
- if (this->CheckSystemVars || this->IsProjectFile(path.c_str())) {
- std::ostringstream msg;
- msg << "unused variable (" << reason << ") \'" << name << "\'";
- this->IssueMessage(MessageType::AUTHOR_WARNING, msg.str());
- }
- }
-}
-
void cmMakefile::RemoveDefinition(const std::string& name)
{
- if (this->VariableInitialized(name)) {
- this->LogUnused("unsetting", name);
- }
this->StateSnapshot.RemoveDefinition(name);
#ifndef CMAKE_BOOTSTRAP
cmVariableWatch* vv = this->GetVariableWatch();
@@ -2555,8 +2521,7 @@ void cmMakefile::ExpandVariablesCMP0019()
bool cmMakefile::IsOn(const std::string& name) const
{
- const char* value = this->GetDefinition(name);
- return cmIsOn(value);
+ return cmIsOn(this->GetDef(name));
}
bool cmMakefile::IsSet(const std::string& name) const
@@ -3287,25 +3252,28 @@ void cmMakefile::RemoveVariablesInString(std::string& source,
}
}
-std::string cmMakefile::GetConfigurations(std::vector<std::string>& configs,
- bool singleConfig) const
+std::string cmMakefile::GetDefaultConfiguration() const
{
if (this->GetGlobalGenerator()->IsMultiConfig()) {
- this->GetDefExpandList("CMAKE_CONFIGURATION_TYPES", configs);
- return "";
- }
- const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
- if (singleConfig && !buildType.empty()) {
- configs.push_back(buildType);
+ return std::string{};
}
- return buildType;
+ return this->GetSafeDefinition("CMAKE_BUILD_TYPE");
}
-std::vector<std::string> cmMakefile::GetGeneratorConfigs() const
+std::vector<std::string> cmMakefile::GetGeneratorConfigs(
+ GeneratorConfigQuery mode) const
{
std::vector<std::string> configs;
- GetConfigurations(configs);
- if (configs.empty()) {
+ if (this->GetGlobalGenerator()->IsMultiConfig() ||
+ mode == cmMakefile::OnlyMultiConfig) {
+ this->GetDefExpandList("CMAKE_CONFIGURATION_TYPES", configs);
+ } else {
+ const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ if (!buildType.empty()) {
+ configs.emplace_back(buildType);
+ }
+ }
+ if (mode == cmMakefile::IncludeEmptyConfig && configs.empty()) {
configs.emplace_back();
}
return configs;
@@ -3725,7 +3693,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
if (cmakeArgs) {
// FIXME: Workaround to ignore unused CLI variables in try-compile.
//
- // Ideally we should use SetArgs to honor options like --warn-unused-vars.
+ // Ideally we should use SetArgs for options like --no-warn-unused-cli.
// However, there is a subtle problem when certain arguments are passed to
// a macro wrapping around try_compile or try_run that does not escape
// semicolons in its parameters but just passes ${ARGV} or ${ARGN}. In
@@ -3744,7 +3712,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
// the value VAR=a is sufficient for the try_compile or try_run to get the
// correct result. Calling SetArgs here would break such projects that
// previously built. Instead we work around the issue by never reporting
- // unused arguments and ignoring options such as --warn-unused-vars.
+ // unused arguments and ignoring options such as --no-warn-unused-cli.
cm.SetWarnUnusedCli(false);
// cm.SetArgs(*cmakeArgs, true);
@@ -3998,6 +3966,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)
{
int res = 1;
@@ -4021,7 +3990,13 @@ int cmMakefile::ConfigureFile(const std::string& infile,
this->AddCMakeOutputFile(soutfile);
mode_t perm = 0;
- cmSystemTools::GetPermissions(sinfile, perm);
+ if (!use_source_permissions) {
+ perm = perm | mode_owner_read | mode_owner_write | mode_group_read |
+ mode_world_read;
+ } else {
+ cmSystemTools::GetPermissions(sinfile, perm);
+ }
+
std::string::size_type pos = soutfile.rfind('/');
if (pos != std::string::npos) {
std::string path = soutfile.substr(0, pos);
@@ -4030,6 +4005,13 @@ int cmMakefile::ConfigureFile(const std::string& infile,
if (copyonly) {
if (!cmSystemTools::CopyFileIfDifferent(sinfile, soutfile)) {
+ this->IssueMessage(MessageType::FATAL_ERROR,
+ cmSystemTools::GetLastSystemError());
+ return 0;
+ }
+ if (!cmSystemTools::SetPermissions(soutfile, perm)) {
+ this->IssueMessage(MessageType::FATAL_ERROR,
+ cmSystemTools::GetLastSystemError());
return 0;
}
} else {
@@ -4080,9 +4062,15 @@ int cmMakefile::ConfigureFile(const std::string& infile,
fin.close();
fout.close();
if (!cmSystemTools::CopyFileIfDifferent(tempOutputFile, soutfile)) {
+ this->IssueMessage(MessageType::FATAL_ERROR,
+ cmSystemTools::GetLastSystemError());
res = 0;
} else {
- cmSystemTools::SetPermissions(soutfile, perm);
+ if (!cmSystemTools::SetPermissions(soutfile, perm)) {
+ this->IssueMessage(MessageType::FATAL_ERROR,
+ cmSystemTools::GetLastSystemError());
+ res = 0;
+ }
}
cmSystemTools::RemoveFile(tempOutputFile);
}
@@ -4127,8 +4115,7 @@ cmProp cmMakefile::GetProperty(const std::string& prop, bool chain) const
bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
{
- cmProp p = this->GetProperty(prop);
- return p && cmIsOn(*p);
+ return cmIsOn(this->GetProperty(prop));
}
std::vector<std::string> cmMakefile::GetPropertyKeys() const
@@ -4240,8 +4227,6 @@ void cmMakefile::PopScope()
this->PopLoopBlockBarrier();
- this->CheckForUnusedVariables();
-
this->PopSnapshot();
}
@@ -4557,7 +4542,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
// Deprecate old policies, especially those that require a lot
// of code to maintain the old behavior.
- if (status == cmPolicies::OLD && id <= cmPolicies::CMP0071 &&
+ if (status == cmPolicies::OLD && id <= cmPolicies::CMP0072 &&
!(this->GetCMakeInstance()->GetIsInTryCompile() &&
(
// Policies set by cmCoreTryCompile::TryCompileCode.
@@ -4599,7 +4584,7 @@ void cmMakefile::PopSnapshot(bool reportError)
// cmStateSnapshot manages nested policy scopes within it.
// Since the scope corresponding to the snapshot is closing,
// reject any still-open nested policy scopes with an error.
- while (!this->StateSnapshot.CanPopPolicyScope()) {
+ while (this->StateSnapshot.CanPopPolicyScope()) {
if (reportError) {
this->IssueMessage(MessageType::FATAL_ERROR,
"cmake_policy PUSH without matching POP");
@@ -4615,7 +4600,8 @@ void cmMakefile::PopSnapshot(bool reportError)
bool cmMakefile::SetPolicyVersion(std::string const& version_min,
std::string const& version_max)
{
- return cmPolicies::ApplyPolicyVersion(this, version_min, version_max);
+ return cmPolicies::ApplyPolicyVersion(this, version_min, version_max,
+ cmPolicies::WarnCompat::On);
}
bool cmMakefile::HasCMP0054AlreadyBeenReported(
@@ -4651,674 +4637,6 @@ bool cmMakefile::IgnoreErrorsCMP0061() const
return ignoreErrors;
}
-#define FEATURE_STRING(F) , #F
-static const char* const C_FEATURES[] = { nullptr FOR_EACH_C_FEATURE(
- FEATURE_STRING) };
-
-static const char* const CXX_FEATURES[] = { nullptr FOR_EACH_CXX_FEATURE(
- FEATURE_STRING) };
-
-static const char* const CUDA_FEATURES[] = { nullptr FOR_EACH_CUDA_FEATURE(
- FEATURE_STRING) };
-#undef FEATURE_STRING
-
-static const char* const C_STANDARDS[] = { "90", "99", "11" };
-static const char* const CXX_STANDARDS[] = { "98", "11", "14", "17", "20" };
-static const char* const CUDA_STANDARDS[] = { "03", "11", "14", "17", "20" };
-
-bool cmMakefile::AddRequiredTargetFeature(cmTarget* target,
- const std::string& feature,
- std::string* error) const
-{
- if (cmGeneratorExpression::Find(feature) != std::string::npos) {
- target->AppendProperty("COMPILE_FEATURES", feature);
- return true;
- }
-
- std::string lang;
- if (!this->CompileFeatureKnown(target, feature, lang, error)) {
- return false;
- }
-
- const char* features = this->CompileFeaturesAvailable(lang, error);
- if (!features) {
- return false;
- }
-
- std::vector<std::string> availableFeatures = cmExpandedList(features);
- if (!cm::contains(availableFeatures, feature)) {
- std::ostringstream e;
- e << "The compiler feature \"" << feature << "\" is not known to " << lang
- << " compiler\n\""
- << this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID")
- << "\"\nversion "
- << this->GetDefinition("CMAKE_" + lang + "_COMPILER_VERSION") << ".";
- if (error) {
- *error = e.str();
- } else {
- this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
- this->Backtrace);
- }
- return false;
- }
-
- target->AppendProperty("COMPILE_FEATURES", feature);
-
- if (lang == "C" || lang == "OBJC") {
- return this->AddRequiredTargetCFeature(target, feature, lang, error);
- }
- if (lang == "CUDA") {
- return this->AddRequiredTargetCudaFeature(target, feature, lang, error);
- }
- return this->AddRequiredTargetCxxFeature(target, feature, lang, error);
-}
-
-bool cmMakefile::CompileFeatureKnown(cmTarget const* target,
- const std::string& feature,
- std::string& lang,
- std::string* error) const
-{
- assert(cmGeneratorExpression::Find(feature) == std::string::npos);
-
- bool isCFeature =
- std::find_if(cm::cbegin(C_FEATURES) + 1, cm::cend(C_FEATURES),
- cmStrCmp(feature)) != cm::cend(C_FEATURES);
- if (isCFeature) {
- lang = "C";
- return true;
- }
- bool isCxxFeature =
- std::find_if(cm::cbegin(CXX_FEATURES) + 1, cm::cend(CXX_FEATURES),
- cmStrCmp(feature)) != cm::cend(CXX_FEATURES);
- if (isCxxFeature) {
- lang = "CXX";
- return true;
- }
- bool isCudaFeature =
- std::find_if(cm::cbegin(CUDA_FEATURES) + 1, cm::cend(CUDA_FEATURES),
- cmStrCmp(feature)) != cm::cend(CUDA_FEATURES);
- if (isCudaFeature) {
- lang = "CUDA";
- return true;
- }
- std::ostringstream e;
- if (error) {
- e << "specified";
- } else {
- e << "Specified";
- }
- e << " unknown feature \"" << feature
- << "\" for "
- "target \""
- << target->GetName() << "\".";
- if (error) {
- *error = e.str();
- } else {
- this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
- this->Backtrace);
- }
- return false;
-}
-
-const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang,
- std::string* error) const
-{
- if (!this->GlobalGenerator->GetLanguageEnabled(lang)) {
- std::ostringstream e;
- if (error) {
- e << "cannot";
- } else {
- e << "Cannot";
- }
- e << " use features from non-enabled language " << lang;
- if (error) {
- *error = e.str();
- } else {
- this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
- this->Backtrace);
- }
- return nullptr;
- }
-
- const char* featuresKnown =
- this->GetDefinition("CMAKE_" + lang + "_COMPILE_FEATURES");
-
- if (!featuresKnown || !*featuresKnown) {
- std::ostringstream e;
- if (error) {
- e << "no";
- } else {
- e << "No";
- }
- e << " known features for " << lang << " compiler\n\""
- << this->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID")
- << "\"\nversion "
- << this->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_VERSION") << ".";
- if (error) {
- *error = e.str();
- } else {
- this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
- this->Backtrace);
- }
- return nullptr;
- }
- return featuresKnown;
-}
-
-bool cmMakefile::HaveStandardAvailable(cmTarget const* target,
- std::string const& lang,
- const std::string& feature) const
-{
- if (lang == "C" || lang == "OBJC") {
- return this->HaveCStandardAvailable(target, feature, lang);
- }
- if (lang == "CUDA") {
- return this->HaveCudaStandardAvailable(target, feature, lang);
- }
- return this->HaveCxxStandardAvailable(target, feature, lang);
-}
-
-bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
- const std::string& feature,
- std::string const& lang) const
-{
- cmProp defaultCStandard =
- this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT"));
- if (!defaultCStandard) {
- this->IssueMessage(
- MessageType::INTERNAL_ERROR,
- cmStrCat("CMAKE_", lang,
- "_STANDARD_DEFAULT is not set. COMPILE_FEATURES support "
- "not fully configured for this compiler."));
- // Return true so the caller does not try to lookup the default standard.
- return true;
- }
- if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
- cmStrCmp(*defaultCStandard)) == cm::cend(C_STANDARDS)) {
- const std::string e = cmStrCat("The CMAKE_", lang,
- "_STANDARD_DEFAULT variable contains an "
- "invalid value: \"",
- *defaultCStandard, "\".");
- this->IssueMessage(MessageType::INTERNAL_ERROR, e);
- return false;
- }
-
- bool needC90 = false;
- bool needC99 = false;
- bool needC11 = false;
-
- this->CheckNeededCLanguage(feature, lang, needC90, needC99, needC11);
-
- cmProp existingCStandard = target->GetProperty(cmStrCat(lang, "_STANDARD"));
- if (!existingCStandard) {
- existingCStandard = defaultCStandard;
- }
-
- if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
- cmStrCmp(*existingCStandard)) == cm::cend(C_STANDARDS)) {
- const std::string e = cmStrCat(
- "The ", lang, "_STANDARD property on target \"", target->GetName(),
- "\" contained an invalid value: \"", *existingCStandard, "\".");
- this->IssueMessage(MessageType::FATAL_ERROR, e);
- return false;
- }
-
- const char* const* existingCIt = existingCStandard
- ? std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
- cmStrCmp(*existingCStandard))
- : cm::cend(C_STANDARDS);
-
- if (needC11 && existingCStandard &&
- existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
- cm::cend(C_STANDARDS), cmStrCmp("11"))) {
- return false;
- }
- if (needC99 && existingCStandard &&
- existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
- cm::cend(C_STANDARDS), cmStrCmp("99"))) {
- return false;
- }
- if (needC90 && existingCStandard &&
- existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
- cm::cend(C_STANDARDS), cmStrCmp("90"))) {
- return false;
- }
- return true;
-}
-
-bool cmMakefile::IsLaterStandard(std::string const& lang,
- std::string const& lhs,
- std::string const& rhs)
-{
- if (lang == "C" || lang == "OBJC") {
- const char* const* rhsIt = std::find_if(
- cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), cmStrCmp(rhs));
-
- return std::find_if(rhsIt, cm::cend(C_STANDARDS), cmStrCmp(lhs)) !=
- cm::cend(C_STANDARDS);
- }
- if (lang == "CUDA") {
- const char* const* rhsIt = std::find_if(
- cm::cbegin(CUDA_STANDARDS), cm::cend(CUDA_STANDARDS), cmStrCmp(rhs));
-
- return std::find_if(rhsIt, cm::cend(CUDA_STANDARDS), cmStrCmp(lhs)) !=
- cm::cend(CUDA_STANDARDS);
- }
-
- const char* const* rhsIt = std::find_if(
- cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS), cmStrCmp(rhs));
-
- return std::find_if(rhsIt, cm::cend(CXX_STANDARDS), cmStrCmp(lhs)) !=
- cm::cend(CXX_STANDARDS);
-}
-
-bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
- const std::string& feature,
- std::string const& lang) const
-{
- cmProp defaultCxxStandard =
- this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT"));
- if (!defaultCxxStandard) {
- this->IssueMessage(
- MessageType::INTERNAL_ERROR,
- cmStrCat("CMAKE_", lang,
- "_STANDARD_DEFAULT is not set. COMPILE_FEATURES support "
- "not fully configured for this compiler."));
- // Return true so the caller does not try to lookup the default standard.
- return true;
- }
- if (std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS),
- cmStrCmp(*defaultCxxStandard)) == cm::cend(CXX_STANDARDS)) {
- const std::string e =
- cmStrCat("The CMAKE_", lang, "_STANDARD_DEFAULT variable contains an ",
- "invalid value: \"", *defaultCxxStandard, "\".");
- this->IssueMessage(MessageType::INTERNAL_ERROR, e);
- return false;
- }
-
- bool needCxx98 = false;
- bool needCxx11 = false;
- bool needCxx14 = false;
- bool needCxx17 = false;
- bool needCxx20 = false;
- this->CheckNeededCxxLanguage(feature, lang, needCxx98, needCxx11, needCxx14,
- needCxx17, needCxx20);
-
- cmProp existingCxxStandard =
- target->GetProperty(cmStrCat(lang, "_STANDARD"));
- if (!existingCxxStandard) {
- existingCxxStandard = defaultCxxStandard;
- }
-
- const char* const* existingCxxLevel =
- std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS),
- cmStrCmp(*existingCxxStandard));
- if (existingCxxLevel == cm::cend(CXX_STANDARDS)) {
- const std::string e = cmStrCat(
- "The ", lang, "_STANDARD property on target \"", target->GetName(),
- "\" contained an invalid value: \"", *existingCxxStandard, "\".");
- this->IssueMessage(MessageType::FATAL_ERROR, e);
- return false;
- }
-
- /* clang-format off */
- const char* const* needCxxLevel =
- needCxx20 ? &CXX_STANDARDS[4]
- : needCxx17 ? &CXX_STANDARDS[3]
- : needCxx14 ? &CXX_STANDARDS[2]
- : needCxx11 ? &CXX_STANDARDS[1]
- : needCxx98 ? &CXX_STANDARDS[0]
- : nullptr;
- /* clang-format on */
-
- return !needCxxLevel || needCxxLevel <= existingCxxLevel;
-}
-
-void cmMakefile::CheckNeededCxxLanguage(const std::string& feature,
- std::string const& lang,
- bool& needCxx98, bool& needCxx11,
- bool& needCxx14, bool& needCxx17,
- bool& needCxx20) const
-{
- if (const char* propCxx98 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "98_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCxx98);
- needCxx98 = cm::contains(props, feature);
- }
- if (const char* propCxx11 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "11_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCxx11);
- needCxx11 = cm::contains(props, feature);
- }
- if (const char* propCxx14 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "14_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCxx14);
- needCxx14 = cm::contains(props, feature);
- }
- if (const char* propCxx17 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "17_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCxx17);
- needCxx17 = cm::contains(props, feature);
- }
- if (const char* propCxx20 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "20_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCxx20);
- needCxx20 = cm::contains(props, feature);
- }
-}
-
-bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
- const std::string& feature,
- std::string const& lang,
- std::string* error) const
-{
- bool needCxx98 = false;
- bool needCxx11 = false;
- bool needCxx14 = false;
- bool needCxx17 = false;
- bool needCxx20 = false;
-
- this->CheckNeededCxxLanguage(feature, lang, needCxx98, needCxx11, needCxx14,
- needCxx17, needCxx20);
-
- cmProp existingCxxStandard =
- target->GetProperty(cmStrCat(lang, "_STANDARD"));
- if (existingCxxStandard == nullptr) {
- cmProp defaultCxxStandard =
- this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT"));
- if (defaultCxxStandard && !defaultCxxStandard->empty()) {
- existingCxxStandard = defaultCxxStandard;
- }
- }
- const char* const* existingCxxLevel = nullptr;
- if (existingCxxStandard) {
- existingCxxLevel =
- std::find_if(cm::cbegin(CXX_STANDARDS), cm::cend(CXX_STANDARDS),
- cmStrCmp(*existingCxxStandard));
- if (existingCxxLevel == cm::cend(CXX_STANDARDS)) {
- const std::string e = cmStrCat(
- "The ", lang, "_STANDARD property on target \"", target->GetName(),
- "\" contained an invalid value: \"", *existingCxxStandard, "\".");
- if (error) {
- *error = e;
- } else {
- this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
- this->Backtrace);
- }
- return false;
- }
- }
-
- /* clang-format off */
- const char* const* needCxxLevel =
- needCxx20 ? &CXX_STANDARDS[4]
- : needCxx17 ? &CXX_STANDARDS[3]
- : needCxx14 ? &CXX_STANDARDS[2]
- : needCxx11 ? &CXX_STANDARDS[1]
- : needCxx98 ? &CXX_STANDARDS[0]
- : nullptr;
- /* clang-format on */
-
- if (needCxxLevel) {
- // Ensure the C++ language level is high enough to support
- // the needed C++ features.
- if (!existingCxxLevel || existingCxxLevel < needCxxLevel) {
- target->SetProperty(cmStrCat(lang, "_STANDARD"), *needCxxLevel);
- }
- }
-
- return true;
-}
-
-bool cmMakefile::HaveCudaStandardAvailable(cmTarget const* target,
- const std::string& feature,
- std::string const& lang) const
-{
- cmProp defaultCudaStandard =
- this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT"));
- if (!defaultCudaStandard) {
- this->IssueMessage(
- MessageType::INTERNAL_ERROR,
- cmStrCat("CMAKE_", lang,
- "_STANDARD_DEFAULT is not set. COMPILE_FEATURES support "
- "not fully configured for this compiler."));
- // Return true so the caller does not try to lookup the default standard.
- return true;
- }
- if (std::find_if(cm::cbegin(CUDA_STANDARDS), cm::cend(CUDA_STANDARDS),
- cmStrCmp(*defaultCudaStandard)) ==
- cm::cend(CUDA_STANDARDS)) {
- const std::string e =
- cmStrCat("The CMAKE_", lang, "_STANDARD_DEFAULT variable contains an ",
- "invalid value: \"", *defaultCudaStandard, "\".");
- this->IssueMessage(MessageType::INTERNAL_ERROR, e);
- return false;
- }
-
- bool needCuda03 = false;
- bool needCuda11 = false;
- bool needCuda14 = false;
- bool needCuda17 = false;
- bool needCuda20 = false;
- this->CheckNeededCudaLanguage(feature, lang, needCuda03, needCuda11,
- needCuda14, needCuda17, needCuda20);
-
- cmProp existingCudaStandard =
- target->GetProperty(cmStrCat(lang, "_STANDARD"));
- if (!existingCudaStandard) {
- existingCudaStandard = defaultCudaStandard;
- }
-
- const char* const* existingCudaLevel =
- std::find_if(cm::cbegin(CUDA_STANDARDS), cm::cend(CUDA_STANDARDS),
- cmStrCmp(*existingCudaStandard));
- if (existingCudaLevel == cm::cend(CUDA_STANDARDS)) {
- const std::string e = cmStrCat(
- "The ", lang, "_STANDARD property on target \"", target->GetName(),
- "\" contained an invalid value: \"", *existingCudaStandard, "\".");
- this->IssueMessage(MessageType::FATAL_ERROR, e);
- return false;
- }
-
- /* clang-format off */
- const char* const* needCudaLevel =
- needCuda20 ? &CUDA_STANDARDS[4]
- : needCuda17 ? &CUDA_STANDARDS[3]
- : needCuda14 ? &CUDA_STANDARDS[2]
- : needCuda11 ? &CUDA_STANDARDS[1]
- : needCuda03 ? &CUDA_STANDARDS[0]
- : nullptr;
- /* clang-format on */
-
- return !needCudaLevel || needCudaLevel <= existingCudaLevel;
-}
-
-void cmMakefile::CheckNeededCudaLanguage(const std::string& feature,
- std::string const& lang,
- bool& needCuda03, bool& needCuda11,
- bool& needCuda14, bool& needCuda17,
- bool& needCuda20) const
-{
- if (const char* propCuda03 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "03_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCuda03);
- needCuda03 = cm::contains(props, feature);
- }
- if (const char* propCuda11 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "11_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCuda11);
- needCuda11 = cm::contains(props, feature);
- }
- if (const char* propCuda14 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "14_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCuda14);
- needCuda14 = cm::contains(props, feature);
- }
- if (const char* propCuda17 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "17_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCuda17);
- needCuda17 = cm::contains(props, feature);
- }
- if (const char* propCuda20 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "20_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propCuda20);
- needCuda20 = cm::contains(props, feature);
- }
-}
-
-bool cmMakefile::AddRequiredTargetCudaFeature(cmTarget* target,
- const std::string& feature,
- std::string const& lang,
- std::string* error) const
-{
- bool needCuda03 = false;
- bool needCuda11 = false;
- bool needCuda14 = false;
- bool needCuda17 = false;
- bool needCuda20 = false;
-
- this->CheckNeededCudaLanguage(feature, lang, needCuda03, needCuda11,
- needCuda14, needCuda17, needCuda20);
-
- cmProp existingCudaStandard =
- target->GetProperty(cmStrCat(lang, "_STANDARD"));
- if (existingCudaStandard == nullptr) {
- cmProp defaultCudaStandard =
- this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT"));
- if (defaultCudaStandard && !defaultCudaStandard->empty()) {
- existingCudaStandard = defaultCudaStandard;
- }
- }
- const char* const* existingCudaLevel = nullptr;
- if (existingCudaStandard) {
- existingCudaLevel =
- std::find_if(cm::cbegin(CUDA_STANDARDS), cm::cend(CUDA_STANDARDS),
- cmStrCmp(*existingCudaStandard));
- if (existingCudaLevel == cm::cend(CUDA_STANDARDS)) {
- const std::string e = cmStrCat(
- "The ", lang, "_STANDARD property on target \"", target->GetName(),
- "\" contained an invalid value: \"", *existingCudaStandard, "\".");
- if (error) {
- *error = e;
- } else {
- this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
- this->Backtrace);
- }
- return false;
- }
- }
-
- /* clang-format off */
- const char* const* needCudaLevel =
- needCuda20 ? &CUDA_STANDARDS[4]
- : needCuda17 ? &CUDA_STANDARDS[3]
- : needCuda14 ? &CUDA_STANDARDS[2]
- : needCuda11 ? &CUDA_STANDARDS[1]
- : needCuda03 ? &CUDA_STANDARDS[0]
- : nullptr;
- /* clang-format on */
-
- if (needCudaLevel) {
- // Ensure the CUDA language level is high enough to support
- // the needed CUDA features.
- if (!existingCudaLevel || existingCudaLevel < needCudaLevel) {
- target->SetProperty("CUDA_STANDARD", *needCudaLevel);
- }
- }
-
- return true;
-}
-
-void cmMakefile::CheckNeededCLanguage(const std::string& feature,
- std::string const& lang, bool& needC90,
- bool& needC99, bool& needC11) const
-{
- if (const char* propC90 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "90_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propC90);
- needC90 = cm::contains(props, feature);
- }
- if (const char* propC99 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "99_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propC99);
- needC99 = cm::contains(props, feature);
- }
- if (const char* propC11 =
- this->GetDefinition(cmStrCat("CMAKE_", lang, "11_COMPILE_FEATURES"))) {
- std::vector<std::string> props = cmExpandedList(propC11);
- needC11 = cm::contains(props, feature);
- }
-}
-
-bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target,
- const std::string& feature,
- std::string const& lang,
- std::string* error) const
-{
- bool needC90 = false;
- bool needC99 = false;
- bool needC11 = false;
-
- this->CheckNeededCLanguage(feature, lang, needC90, needC99, needC11);
-
- cmProp existingCStandard = target->GetProperty(cmStrCat(lang, "_STANDARD"));
- if (existingCStandard == nullptr) {
- cmProp defaultCStandard =
- this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT"));
- if (defaultCStandard && !defaultCStandard->empty()) {
- existingCStandard = defaultCStandard;
- }
- }
- if (existingCStandard) {
- if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
- cmStrCmp(*existingCStandard)) == cm::cend(C_STANDARDS)) {
- const std::string e = cmStrCat(
- "The ", lang, "_STANDARD property on target \"", target->GetName(),
- "\" contained an invalid value: \"", *existingCStandard, "\".");
- if (error) {
- *error = e;
- } else {
- this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
- this->Backtrace);
- }
- return false;
- }
- }
- const char* const* existingCIt = existingCStandard
- ? std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
- cmStrCmp(*existingCStandard))
- : cm::cend(C_STANDARDS);
-
- bool setC90 = needC90 && !existingCStandard;
- bool setC99 = needC99 && !existingCStandard;
- bool setC11 = needC11 && !existingCStandard;
-
- if (needC11 && existingCStandard &&
- existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
- cm::cend(C_STANDARDS), cmStrCmp("11"))) {
- setC11 = true;
- } else if (needC99 && existingCStandard &&
- existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
- cm::cend(C_STANDARDS),
- cmStrCmp("99"))) {
- setC99 = true;
- } else if (needC90 && existingCStandard &&
- existingCIt < std::find_if(cm::cbegin(C_STANDARDS),
- cm::cend(C_STANDARDS),
- cmStrCmp("90"))) {
- setC90 = true;
- }
-
- if (setC11) {
- target->SetProperty(cmStrCat(lang, "_STANDARD"), "11");
- } else if (setC99) {
- target->SetProperty(cmStrCat(lang, "_STANDARD"), "99");
- } else if (setC90) {
- target->SetProperty(cmStrCat(lang, "_STANDARD"), "90");
- }
- return true;
-}
-
cmMakefile::FunctionPushPop::FunctionPushPop(cmMakefile* mf,
const std::string& fileName,
cmPolicies::PolicyMap const& pm)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 45d7109e10..80d80d37b9 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -342,12 +342,19 @@ public:
*/
void SetProjectName(std::string const& name);
- /** Get the configurations to be generated. */
- std::string GetConfigurations(std::vector<std::string>& configs,
- bool single = true) const;
+ /* Get the default configuration */
+ std::string GetDefaultConfiguration() const;
+
+ enum GeneratorConfigQuery
+ {
+ IncludeEmptyConfig, // Include "" aka noconfig
+ ExcludeEmptyConfig, // Exclude "" aka noconfig
+ OnlyMultiConfig,
+ };
/** Get the configurations for dependency checking. */
- std::vector<std::string> GetGeneratorConfigs() const;
+ std::vector<std::string> GetGeneratorConfigs(
+ GeneratorConfigQuery mode) const;
/**
* Set the name of the library.
@@ -686,6 +693,7 @@ public:
*/
int ConfigureFile(const std::string& infile, const std::string& outfile,
bool copyonly, bool atOnly, bool escapeQuotes,
+ bool use_source_permissions,
cmNewLineStyle = cmNewLineStyle());
/**
@@ -925,21 +933,6 @@ public:
bool PolicyOptionalWarningEnabled(std::string const& var);
- bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature,
- std::string* error = nullptr) const;
-
- bool CompileFeatureKnown(cmTarget const* target, const std::string& feature,
- std::string& lang, std::string* error) const;
-
- const char* CompileFeaturesAvailable(const std::string& lang,
- std::string* error) const;
-
- bool HaveStandardAvailable(cmTarget const* target, std::string const& lang,
- const std::string& feature) const;
-
- bool IsLaterStandard(std::string const& lang, std::string const& lhs,
- std::string const& rhs);
-
void PushLoopBlock();
void PopLoopBlock();
bool IsLoopBlock() const;
@@ -985,9 +978,6 @@ protected:
// add link libraries and directories to the target
void AddGlobalLinkInformation(cmTarget& target);
- // Check for a an unused variable
- void LogUnused(const char* reason, const std::string& name) const;
-
mutable std::set<cmListFileContext> CMP0054ReportedIds;
// libraries, classes, and executables
@@ -1162,44 +1152,6 @@ private:
*/
bool MightHaveCustomCommand(const std::string& name) const;
- bool AddRequiredTargetCFeature(cmTarget* target, const std::string& feature,
- std::string const& lang,
- std::string* error = nullptr) const;
- bool AddRequiredTargetCxxFeature(cmTarget* target,
- const std::string& feature,
- std::string const& lang,
- std::string* error = nullptr) const;
- bool AddRequiredTargetCudaFeature(cmTarget* target,
- const std::string& feature,
- std::string const& lang,
- std::string* error = nullptr) const;
-
- void CheckNeededCLanguage(const std::string& feature,
- std::string const& lang, bool& needC90,
- bool& needC99, bool& needC11) const;
- void CheckNeededCxxLanguage(const std::string& feature,
- std::string const& lang, bool& needCxx98,
- bool& needCxx11, bool& needCxx14,
- bool& needCxx17, bool& needCxx20) const;
- void CheckNeededCudaLanguage(const std::string& feature,
- std::string const& lang, bool& needCuda03,
- bool& needCuda11, bool& needCuda14,
- bool& needCuda17, bool& needCuda20) const;
-
- bool HaveCStandardAvailable(cmTarget const* target,
- const std::string& feature,
- std::string const& lang) const;
- bool HaveCxxStandardAvailable(cmTarget const* target,
- const std::string& feature,
- std::string const& lang) const;
- bool HaveCudaStandardAvailable(cmTarget const* target,
- const std::string& feature,
- std::string const& lang) const;
-
- void CheckForUnusedVariables() const;
-
- // Unused variable flags
- bool WarnUnused;
bool CheckSystemVars;
bool CheckCMP0000;
std::set<std::string> WarnedCMP0074;
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 446f225bda..bc288ace9d 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -218,7 +218,7 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
const char* val = this->LocalGenerator->GetRuleLauncher(
this->GeneratorTarget, "RULE_LAUNCH_LINK");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
@@ -583,7 +583,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
const char* val = this->LocalGenerator->GetRuleLauncher(
this->GeneratorTarget, "RULE_LAUNCH_LINK");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 5809b4a5cc..1c25fc434a 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -356,7 +356,7 @@ void cmMakefileLibraryTargetGenerator::WriteDeviceLibraryRules(
std::string launcher;
const char* val = this->LocalGenerator->GetRuleLauncher(
this->GeneratorTarget, "RULE_LAUNCH_LINK");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
@@ -809,7 +809,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
std::string launcher;
const char* val = this->LocalGenerator->GetRuleLauncher(
this->GeneratorTarget, "RULE_LAUNCH_LINK");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 8396fa326c..13c2fe9299 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -197,8 +197,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
}
// add custom commands to the clean rules?
- cmProp clean_no_custom = this->Makefile->GetProperty("CLEAN_NO_CUSTOM");
- bool clean = clean_no_custom ? cmIsOff(*clean_no_custom) : true;
+ bool clean = cmIsOff(this->Makefile->GetProperty("CLEAN_NO_CUSTOM"));
// First generate the object rule files. Save a list of all object
// files for this target.
@@ -532,6 +531,13 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
// Build the set of compiler flags.
std::string flags;
+ // explicitly add the explicit language flag before any other flag
+ // this way backwards compatibility with user flags is maintained
+ if (source.GetProperty("LANGUAGE")) {
+ this->LocalGenerator->AppendFeatureOptions(flags, lang,
+ "EXPLICIT_LANGUAGE");
+ }
+
// Add language-specific flags.
std::string langFlags = cmStrCat("$(", lang, "_FLAGS", filterArch, ")");
this->LocalGenerator->AppendFlags(flags, langFlags);
@@ -800,7 +806,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
lang == "OBJC" || lang == "OBJCXX")) {
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
cmProp clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
- if (clauncher && !clauncher->empty()) {
+ if (cmNonempty(clauncher)) {
compilerLauncher = *clauncher;
}
}
@@ -815,8 +821,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
cmProp cpplint = this->GeneratorTarget->GetProperty(cpplint_prop);
std::string const cppcheck_prop = lang + "_CPPCHECK";
cmProp cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop);
- if ((iwyu && !iwyu->empty()) || (tidy && !tidy->empty()) ||
- (cpplint && !cpplint->empty()) || (cppcheck && !cppcheck->empty())) {
+ if (cmNonempty(iwyu) || cmNonempty(tidy) || cmNonempty(cpplint) ||
+ cmNonempty(cppcheck)) {
std::string run_iwyu = "$(CMAKE_COMMAND) -E __run_co_compile";
if (!compilerLauncher.empty()) {
// In __run_co_compile case the launcher command is supplied
@@ -825,30 +831,30 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
run_iwyu += this->LocalGenerator->EscapeForShell(compilerLauncher);
compilerLauncher.clear();
}
- if (iwyu && !iwyu->empty()) {
+ if (cmNonempty(iwyu)) {
run_iwyu += " --iwyu=";
run_iwyu += this->LocalGenerator->EscapeForShell(*iwyu);
}
- if (tidy && !tidy->empty()) {
+ if (cmNonempty(tidy)) {
run_iwyu += " --tidy=";
const char* driverMode = this->Makefile->GetDefinition(
"CMAKE_" + lang + "_CLANG_TIDY_DRIVER_MODE");
- if (!(driverMode && *driverMode)) {
+ if (!cmNonempty(driverMode)) {
driverMode = lang == "C" ? "gcc" : "g++";
}
run_iwyu += this->LocalGenerator->EscapeForShell(
cmStrCat(*tidy, ";--extra-arg-before=--driver-mode=", driverMode));
}
- if (cpplint && !cpplint->empty()) {
+ if (cmNonempty(cpplint)) {
run_iwyu += " --cpplint=";
run_iwyu += this->LocalGenerator->EscapeForShell(*cpplint);
}
- if (cppcheck && !cppcheck->empty()) {
+ if (cmNonempty(cppcheck)) {
run_iwyu += " --cppcheck=";
run_iwyu += this->LocalGenerator->EscapeForShell(*cppcheck);
}
- if ((tidy && !tidy->empty()) || (cpplint && !cpplint->empty()) ||
- (cppcheck && !cppcheck->empty())) {
+ if (cmNonempty(tidy) || (cmNonempty(cpplint)) ||
+ (cmNonempty(cppcheck))) {
run_iwyu += " --source=";
run_iwyu += sourceFile;
}
@@ -875,7 +881,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
{
const char* val = this->LocalGenerator->GetRuleLauncher(
this->GeneratorTarget, "RULE_LAUNCH_COMPILE");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
}
@@ -1851,7 +1857,7 @@ void cmMakefileTargetGenerator::GenDefFile(
this->LocalGenerator->GetCurrentBinaryDirectory(), objlist_file),
cmOutputConverter::SHELL);
const char* nm_executable = this->Makefile->GetDefinition("CMAKE_NM");
- if (nm_executable && *nm_executable) {
+ if (cmNonempty(nm_executable)) {
cmd += " --nm=";
cmd += this->LocalCommonGenerator->ConvertToOutputFormat(
nm_executable, cmOutputConverter::SHELL);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 32ab9f80ec..bde5ee7443 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -239,7 +239,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(
std::string launcher;
const char* val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
@@ -376,7 +376,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
std::string launcher;
const char* val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_LINK");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
@@ -739,7 +739,8 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement(
// Gather order-only dependencies.
this->GetLocalGenerator()->AppendTargetDepends(
- this->GetGeneratorTarget(), build.OrderOnlyDeps, config, config);
+ this->GetGeneratorTarget(), build.OrderOnlyDeps, config, config,
+ DependOnTargetArtifact);
// Write the build statement for this target.
bool usedResponseFile = false;
@@ -1091,7 +1092,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
obj_list_file, cmOutputConverter::SHELL);
const char* nm_executable = GetMakefile()->GetDefinition("CMAKE_NM");
- if (nm_executable && *nm_executable) {
+ if (cmNonempty(nm_executable)) {
cmd += " --nm=";
cmd += this->LocalCommonGenerator->ConvertToOutputFormat(
nm_executable, cmOutputConverter::SHELL);
@@ -1160,8 +1161,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
globalGen->IsMultiConfig() ? cmStrCat('.', config) : "", ".rsp"));
// Gather order-only dependencies.
- this->GetLocalGenerator()->AppendTargetDepends(gt, linkBuild.OrderOnlyDeps,
- config, fileConfig);
+ this->GetLocalGenerator()->AppendTargetDepends(
+ gt, linkBuild.OrderOnlyDeps, config, fileConfig, DependOnTargetArtifact);
// Add order-only dependencies on versioning symlinks of shared libs we link.
if (!this->GeneratorTarget->IsDLLPlatform()) {
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index d406c9951a..048dbb678e 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -65,7 +65,8 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
, LocalGenerator(
static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator()))
{
- for (auto const& fileConfig : target->Makefile->GetGeneratorConfigs()) {
+ for (auto const& fileConfig :
+ target->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig)) {
this->Configs[fileConfig].MacOSXContentGenerator =
cm::make_unique<MacOSXContentGeneratorType>(this, fileConfig);
}
@@ -188,7 +189,16 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject(
}
}
- std::string flags = this->GetFlags(language, config, filterArch);
+ std::string flags;
+ // explicitly add the explicit language flag before any other flag
+ // this way backwards compatibility with user flags is maintained
+ if (source->GetProperty("LANGUAGE")) {
+ this->LocalGenerator->AppendFeatureOptions(flags, language,
+ "EXPLICIT_LANGUAGE");
+ flags += " ";
+ }
+
+ flags += this->GetFlags(language, config, filterArch);
// Add Fortran format flags.
if (language == "Fortran") {
@@ -652,7 +662,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
std::string launcher;
const char* val = this->GetLocalGenerator()->GetRuleLauncher(
this->GetGeneratorTarget(), "RULE_LAUNCH_COMPILE");
- if (val && *val) {
+ if (cmNonempty(val)) {
launcher = cmStrCat(val, ' ');
}
@@ -803,7 +813,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
lang == "OBJC" || lang == "OBJCXX")) {
std::string const clauncher_prop = cmStrCat(lang, "_COMPILER_LAUNCHER");
cmProp clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
- if (clauncher && !clauncher->empty()) {
+ if (cmNonempty(clauncher)) {
compilerLauncher = *clauncher;
}
}
@@ -818,8 +828,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
cmProp cpplint = this->GeneratorTarget->GetProperty(cpplint_prop);
std::string const cppcheck_prop = cmStrCat(lang, "_CPPCHECK");
cmProp cppcheck = this->GeneratorTarget->GetProperty(cppcheck_prop);
- if ((iwyu && !iwyu->empty()) || (tidy && !tidy->empty()) ||
- (cpplint && !cpplint->empty()) || (cppcheck && !cppcheck->empty())) {
+ if (cmNonempty(iwyu) || cmNonempty(tidy) || cmNonempty(cpplint) ||
+ cmNonempty(cppcheck)) {
std::string run_iwyu = cmStrCat(cmakeCmd, " -E __run_co_compile");
if (!compilerLauncher.empty()) {
// In __run_co_compile case the launcher command is supplied
@@ -829,31 +839,30 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
this->LocalGenerator->EscapeForShell(compilerLauncher));
compilerLauncher.clear();
}
- if (iwyu && !iwyu->empty()) {
+ if (cmNonempty(iwyu)) {
run_iwyu += cmStrCat(" --iwyu=",
this->GetLocalGenerator()->EscapeForShell(*iwyu));
}
- if (tidy && !tidy->empty()) {
+ if (cmNonempty(tidy)) {
run_iwyu += " --tidy=";
const char* driverMode = this->Makefile->GetDefinition(
cmStrCat("CMAKE_", lang, "_CLANG_TIDY_DRIVER_MODE"));
- if (!(driverMode && *driverMode)) {
+ if (!cmNonempty(driverMode)) {
driverMode = lang == "C" ? "gcc" : "g++";
}
run_iwyu += this->GetLocalGenerator()->EscapeForShell(
cmStrCat(*tidy, ";--extra-arg-before=--driver-mode=", driverMode));
}
- if (cpplint && !cpplint->empty()) {
+ if (cmNonempty(cpplint)) {
run_iwyu += cmStrCat(
" --cpplint=", this->GetLocalGenerator()->EscapeForShell(*cpplint));
}
- if (cppcheck && !cppcheck->empty()) {
+ if (cmNonempty(cppcheck)) {
run_iwyu +=
cmStrCat(" --cppcheck=",
this->GetLocalGenerator()->EscapeForShell(*cppcheck));
}
- if ((tidy && !tidy->empty()) || (cpplint && !cpplint->empty()) ||
- (cppcheck && !cppcheck->empty())) {
+ if (cmNonempty(tidy) || cmNonempty(cpplint) || cmNonempty(cppcheck)) {
run_iwyu += " --source=$in";
}
run_iwyu += " -- ";
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 8d863c34d1..9508bb903c 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -101,7 +101,8 @@ void cmNinjaUtilityTargetGenerator::Generate(const std::string& config)
lg->AppendTargetOutputs(genTarget, gg->GetByproductsForCleanTarget(),
config);
}
- lg->AppendTargetDepends(genTarget, deps, config, config);
+ lg->AppendTargetDepends(genTarget, deps, config, config,
+ DependOnTargetArtifact);
if (commands.empty()) {
phonyBuild.Comment = "Utility command for " + this->GetTargetName();
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index dea3f8a356..01e8c047a0 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -7,9 +7,11 @@
#include <sstream>
#include <vector>
+#include "cmListFileCache.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmState.h"
+#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -157,7 +159,8 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy,
bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf,
std::string const& version_min,
- std::string const& version_max)
+ std::string const& version_max,
+ WarnCompat warnCompat)
{
// Parse components of the minimum version.
unsigned int minMajor = 2;
@@ -244,13 +247,34 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf,
polPatch = maxPatch;
}
- return cmPolicies::ApplyPolicyVersion(mf, polMajor, polMinor, polPatch);
+ return cmPolicies::ApplyPolicyVersion(mf, polMajor, polMinor, polPatch,
+ warnCompat);
}
bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer,
unsigned int minorVer,
- unsigned int patchVer)
+ unsigned int patchVer,
+ WarnCompat warnCompat)
{
+ // Warn about policy versions for which support will be removed.
+ if (warnCompat == WarnCompat::On &&
+ (majorVer < 2 || (majorVer == 2 && minorVer < 8) ||
+ (majorVer == 2 && minorVer == 8 && patchVer < 12)) &&
+ // Avoid warning on calls generated by install(EXPORT)
+ // in CMake versions prior to 3.18.
+ !(majorVer == 2 && minorVer == 6 && patchVer == 0 &&
+ mf->GetStateSnapshot().CanPopPolicyScope() &&
+ cmSystemTools::Strucmp(mf->GetBacktrace().Top().Name.c_str(),
+ "cmake_policy") == 0)) {
+ mf->IssueMessage(
+ MessageType::DEPRECATION_WARNING,
+ "Compatibility with CMake < 2.8.12 will be removed from "
+ "a future version of CMake.\n"
+ "Update the VERSION argument <min> value or use a ...<max> suffix "
+ "to tell CMake that the project does not need compatibility with "
+ "older versions.");
+ }
+
// now loop over all the policies and set them as appropriate
std::vector<cmPolicies::PolicyID> ancientPolicies;
for (PolicyID pid = cmPolicies::CMP0000; pid != cmPolicies::CMPCOUNT;
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index a82f4211e2..bba8b037a6 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -320,7 +320,10 @@ class cmMakefile;
SELECT(POLICY, CMP0107, "An ALIAS target cannot overwrite another target.", \
3, 18, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0108, "A target cannot link to itself through an alias.", \
- 3, 18, 0, cmPolicies::WARN)
+ 3, 18, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0109, \
+ "find_program() requires permission to execute but not to read.", 3, \
+ 19, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \
@@ -396,12 +399,20 @@ public:
//! Get the default status for a policy
static cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id);
+ enum class WarnCompat
+ {
+ Off,
+ On
+ };
+
//! Set a policy level for this listfile
static bool ApplyPolicyVersion(cmMakefile* mf,
std::string const& version_min,
- std::string const& version_max);
+ std::string const& version_max,
+ WarnCompat warnCompat);
static bool ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer,
- unsigned int minorVer, unsigned int patchVer);
+ unsigned int minorVer, unsigned int patchVer,
+ WarnCompat warnCompat);
//! return a warning string for a given policy
static std::string GetPolicyWarning(cmPolicies::PolicyID id);
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 2ec66d9f14..bb6db92c95 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -303,7 +303,7 @@ bool cmProjectCommand(std::vector<std::string> const& args,
std::string vw;
for (std::string const& i : vv) {
const char* const v = mf.GetDefinition(i);
- if (v && *v) {
+ if (cmNonempty(v)) {
if (cmp0048 == cmPolicies::WARN) {
if (!injectedProjectCommand) {
vw += "\n ";
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index 3d4f5d7227..fac2bbf2dc 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -50,7 +50,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
{
cmMakefile* makefile = localGen->GetMakefile();
// Detect global autogen target name
- if (cmIsOn(makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET"))) {
+ if (makefile->IsOn("CMAKE_GLOBAL_AUTOGEN_TARGET")) {
std::string targetName =
makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET_NAME");
if (targetName.empty()) {
@@ -61,7 +61,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
}
// Detect global autorcc target name
- if (cmIsOn(makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET"))) {
+ if (makefile->IsOn("CMAKE_GLOBAL_AUTORCC_TARGET")) {
std::string targetName =
makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET_NAME");
if (targetName.empty()) {
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 1132852bc5..06957b08f1 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -315,10 +315,9 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
{
// Configurations
this->MultiConfig = this->GlobalGen->IsMultiConfig();
- this->ConfigDefault = this->Makefile->GetConfigurations(this->ConfigsList);
- if (this->ConfigsList.empty()) {
- this->ConfigsList.push_back(this->ConfigDefault);
- }
+ this->ConfigDefault = this->Makefile->GetDefaultConfiguration();
+ this->ConfigsList =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
// Verbosity
{
@@ -490,7 +489,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
if (this->Moc.Enabled) {
// Path prefix
- if (cmIsOn(this->GenTarget->GetSafeProperty("AUTOMOC_PATH_PREFIX"))) {
+ if (cmIsOn(this->GenTarget->GetProperty("AUTOMOC_PATH_PREFIX"))) {
this->Moc.PathPrefix = true;
}
@@ -789,9 +788,9 @@ bool cmQtAutoGenInitializer::InitScanFiles()
// Register files that will be scanned by moc or uic
if (this->MocOrUicEnabled()) {
- if (cm->IsHeaderExtension(extLower)) {
+ if (cm->IsAHeaderExtension(extLower)) {
addMUHeader(makeMUFile(sf, fullPath, true), extLower);
- } else if (cm->IsSourceExtension(extLower)) {
+ } else if (cm->IsACLikeSourceExtension(extLower)) {
addMUSource(makeMUFile(sf, fullPath, true));
}
}
@@ -863,7 +862,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
if (sf != nullptr) {
auto eMuf = makeMUFile(sf, fullPath, true);
- // Ony process moc/uic when the parent is processed as well
+ // Only process moc/uic when the parent is processed as well
if (!muf.MocIt) {
eMuf->MocIt = false;
}
@@ -895,14 +894,14 @@ bool cmQtAutoGenInitializer::InitScanFiles()
std::string const& extLower =
cmSystemTools::LowerCase(sf->GetExtension());
- if (cm->IsHeaderExtension(extLower)) {
+ if (cm->IsAHeaderExtension(extLower)) {
if (!cm::contains(this->AutogenTarget.Headers, sf.get())) {
auto muf = makeMUFile(sf.get(), fullPath, false);
if (muf->SkipMoc || muf->SkipUic) {
addMUHeader(std::move(muf), extLower);
}
}
- } else if (cm->IsSourceExtension(extLower)) {
+ } else if (cm->IsACLikeSourceExtension(extLower)) {
if (!cm::contains(this->AutogenTarget.Sources, sf.get())) {
auto muf = makeMUFile(sf.get(), fullPath, false);
if (muf->SkipMoc || muf->SkipUic) {
@@ -1654,7 +1653,7 @@ void cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
};
for (std::string const& prop : props) {
cmProp propName = this->Makefile->GetState()->GetGlobalProperty(prop);
- if (propName && !propName->empty()) {
+ if (cmNonempty(propName)) {
groupName = *propName;
property = prop;
break;
diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx
index 766d3478b3..eb8fcaf3f5 100644
--- a/Source/cmSearchPath.cxx
+++ b/Source/cmSearchPath.cxx
@@ -180,7 +180,7 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths,
if (subdir == "include" || subdir == "lib") {
const char* arch =
this->FC->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE");
- if (arch && *arch) {
+ if (cmNonempty(arch)) {
if (this->FC->Makefile->IsDefinitionSet("CMAKE_SYSROOT") &&
this->FC->Makefile->IsDefinitionSet(
"CMAKE_PREFIX_LIBRARY_ARCHITECTURE")) {
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 4f7131fc62..e586fd9d8f 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -136,6 +136,7 @@ bool cmServerProtocol::Activate(cmServer* server,
this->m_Server = server;
this->m_CMakeInstance =
cm::make_unique<cmake>(cmake::RoleProject, cmState::Project);
+ this->m_WarnUnused = false;
const bool result = this->DoActivate(request, errorMessage);
if (!result) {
this->m_CMakeInstance = nullptr;
@@ -636,7 +637,7 @@ cmServerResponse cmServerProtocol1::ProcessGlobalSettings(
obj[kTRACE_KEY] = cm->GetTrace();
obj[kTRACE_EXPAND_KEY] = cm->GetTraceExpand();
obj[kWARN_UNINITIALIZED_KEY] = cm->GetWarnUninitialized();
- obj[kWARN_UNUSED_KEY] = cm->GetWarnUnused();
+ obj[kWARN_UNUSED_KEY] = m_WarnUnused;
obj[kWARN_UNUSED_CLI_KEY] = cm->GetWarnUnusedCli();
obj[kCHECK_SYSTEM_VARS_KEY] = cm->GetCheckSystemVars();
@@ -682,7 +683,7 @@ cmServerResponse cmServerProtocol1::ProcessSetGlobalSettings(
setBool(request, kTRACE_EXPAND_KEY, [cm](bool e) { cm->SetTraceExpand(e); });
setBool(request, kWARN_UNINITIALIZED_KEY,
[cm](bool e) { cm->SetWarnUninitialized(e); });
- setBool(request, kWARN_UNUSED_KEY, [cm](bool e) { cm->SetWarnUnused(e); });
+ setBool(request, kWARN_UNUSED_KEY, [this](bool e) { m_WarnUnused = e; });
setBool(request, kWARN_UNUSED_CLI_KEY,
[cm](bool e) { cm->SetWarnUnusedCli(e); });
setBool(request, kCHECK_SYSTEM_VARS_KEY,
diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h
index c71b7bf606..6009e23bf8 100644
--- a/Source/cmServerProtocol.h
+++ b/Source/cmServerProtocol.h
@@ -94,6 +94,7 @@ protected:
// Implement protocol specific activation tasks here. Called from Activate().
virtual bool DoActivate(const cmServerRequest& request,
std::string* errorMessage);
+ bool m_WarnUnused = false; // storage for legacy option
private:
std::unique_ptr<cmake> m_CMakeInstance;
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index f5254392db..ef44a578db 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSourceFile.h"
-#include <array>
#include <utility>
#include "cmGlobalGenerator.h"
@@ -130,13 +129,11 @@ bool cmSourceFile::FindFullPath(std::string* error)
// Location path
std::string const& lPath = this->Location.GetFullPath();
// List of extension lists
- std::array<std::vector<std::string> const*, 2> const extsLists = {
- { &makefile->GetCMakeInstance()->GetSourceExtensions(),
- &makefile->GetCMakeInstance()->GetHeaderExtensions() }
- };
+ std::vector<std::string> exts =
+ makefile->GetCMakeInstance()->GetAllExtensions();
// Tries to find the file in a given directory
- auto findInDir = [this, &extsLists, &lPath](std::string const& dir) -> bool {
+ auto findInDir = [this, &exts, &lPath](std::string const& dir) -> bool {
// Compute full path
std::string const fullPath = cmSystemTools::CollapseFullPath(lPath, dir);
// Try full path
@@ -145,14 +142,12 @@ bool cmSourceFile::FindFullPath(std::string* error)
return true;
}
// Try full path with extension
- for (auto& exts : extsLists) {
- for (std::string const& ext : *exts) {
- if (!ext.empty()) {
- std::string extPath = cmStrCat(fullPath, '.', ext);
- if (cmSystemTools::FileExists(extPath)) {
- this->FullPath = extPath;
- return true;
- }
+ for (std::string const& ext : exts) {
+ if (!ext.empty()) {
+ std::string extPath = cmStrCat(fullPath, '.', ext);
+ if (cmSystemTools::FileExists(extPath)) {
+ this->FullPath = extPath;
+ return true;
}
}
}
@@ -175,11 +170,9 @@ bool cmSourceFile::FindFullPath(std::string* error)
// Compose error
std::string err =
cmStrCat("Cannot find source file:\n ", lPath, "\nTried extensions");
- for (auto exts : extsLists) {
- for (std::string const& ext : *exts) {
- err += " .";
- err += ext;
- }
+ for (std::string const& ext : exts) {
+ err += " .";
+ err += ext;
}
if (error != nullptr) {
*error = std::move(err);
@@ -387,8 +380,7 @@ const char* cmSourceFile::GetSafeProperty(const std::string& prop) const
bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
{
- cmProp p = this->GetProperty(prop);
- return p && cmIsOn(*p);
+ return cmIsOn(this->GetProperty(prop));
}
void cmSourceFile::SetProperties(cmPropertyMap properties)
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index e852c05bab..222bafac88 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -101,7 +101,7 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name)
cmMakefile const* mf = this->Makefile;
auto cm = mf->GetCMakeInstance();
if (!gg->GetLanguageFromExtension(ext.c_str()).empty() ||
- cm->IsSourceExtension(ext) || cm->IsHeaderExtension(ext)) {
+ cm->IsAKnownExtension(ext)) {
// This is a known extension. Use the given filename with extension.
this->Name = cmSystemTools::GetFilenameName(name);
this->AmbiguousExtension = false;
@@ -157,7 +157,7 @@ bool cmSourceFileLocation::MatchesAmbiguousExtension(
auto ext = cm::string_view(this->Name).substr(loc.Name.size() + 1);
cmMakefile const* mf = this->Makefile;
auto cm = mf->GetCMakeInstance();
- return cm->IsSourceExtension(ext) || cm->IsHeaderExtension(ext);
+ return cm->IsAKnownExtension(ext);
}
bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc)
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
new file mode 100644
index 0000000000..6dbab98e8e
--- /dev/null
+++ b/Source/cmStandardLevelResolver.cxx
@@ -0,0 +1,538 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include "cmStandardLevelResolver.h"
+
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <sstream>
+#include <stdexcept>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include <cm/iterator>
+#include <cmext/algorithm>
+
+#include "cmGeneratorExpression.h"
+#include "cmGeneratorTarget.h"
+#include "cmGlobalGenerator.h"
+#include "cmMakefile.h"
+#include "cmMessageType.h"
+#include "cmProperty.h"
+#include "cmStringAlgorithms.h"
+#include "cmTarget.h"
+#include "cmake.h"
+
+namespace {
+
+#define FEATURE_STRING(F) , #F
+const char* const C_FEATURES[] = { nullptr FOR_EACH_C_FEATURE(
+ FEATURE_STRING) };
+
+const char* const CXX_FEATURES[] = { nullptr FOR_EACH_CXX_FEATURE(
+ FEATURE_STRING) };
+
+const char* const CUDA_FEATURES[] = { nullptr FOR_EACH_CUDA_FEATURE(
+ FEATURE_STRING) };
+#undef FEATURE_STRING
+
+struct StandardNeeded
+{
+ int index;
+ int value;
+};
+
+struct StanardLevelComputer
+{
+ explicit StanardLevelComputer(std::string lang, std::vector<int> levels,
+ std::vector<std::string> levelsStr)
+ : Language(std::move(lang))
+ , Levels(std::move(levels))
+ , LevelsAsStrings(std::move(levelsStr))
+ {
+ assert(levels.size() == levelsStr.size());
+ }
+
+ std::string GetCompileOptionDef(cmMakefile* makefile,
+ cmGeneratorTarget const* target,
+ std::string const& config) const
+ {
+
+ const auto& stds = this->Levels;
+ const auto& stdsStrings = this->LevelsAsStrings;
+
+ const char* defaultStd = makefile->GetDefinition(
+ cmStrCat("CMAKE_", this->Language, "_STANDARD_DEFAULT"));
+ if (!cmNonempty(defaultStd)) {
+ // this compiler has no notion of language standard levels
+ return std::string{};
+ }
+
+ bool ext = true;
+ if (cmProp extPropValue = target->GetLanguageExtensions(this->Language)) {
+ if (cmIsOff(*extPropValue)) {
+ ext = false;
+ }
+ }
+
+ cmProp standardProp = target->GetLanguageStandard(this->Language, config);
+ if (!standardProp) {
+ if (ext) {
+ // No language standard is specified and extensions are not disabled.
+ // Check if this compiler needs a flag to enable extensions.
+ return cmStrCat("CMAKE_", this->Language, "_EXTENSION_COMPILE_OPTION");
+ }
+ return std::string{};
+ }
+
+ std::string const type = ext ? "EXTENSION" : "STANDARD";
+
+ if (target->GetLanguageStandardRequired(this->Language)) {
+ std::string option_flag = cmStrCat(
+ "CMAKE_", this->Language, *standardProp, "_", type, "_COMPILE_OPTION");
+
+ const char* opt =
+ target->Target->GetMakefile()->GetDefinition(option_flag);
+ if (!opt) {
+ std::ostringstream e;
+ e << "Target \"" << target->GetName()
+ << "\" requires the language "
+ "dialect \""
+ << this->Language << *standardProp << "\" "
+ << (ext ? "(with compiler extensions)" : "")
+ << ", but CMake "
+ "does not know the compile flags to use to enable it.";
+ makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ }
+ return option_flag;
+ }
+
+ std::string standardStr(*standardProp);
+ if (this->Language == "CUDA" && standardStr == "98") {
+ standardStr = "03";
+ }
+
+ int standardValue = -1;
+ int defaultValue = -1;
+ try {
+ standardValue = std::stoi(standardStr);
+ defaultValue = std::stoi(defaultStd);
+ } catch (std::invalid_argument&) {
+ // fall through as we want an error
+ // when we can't find the bad value in the `stds` vector
+ }
+
+ auto stdIt = std::find(cm::cbegin(stds), cm::cend(stds), standardValue);
+ if (stdIt == cm::cend(stds)) {
+ std::string e =
+ cmStrCat(this->Language, "_STANDARD is set to invalid value '",
+ standardStr, "'");
+ makefile->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
+ target->GetBacktrace());
+ return std::string{};
+ }
+
+ auto defaultStdIt =
+ std::find(cm::cbegin(stds), cm::cend(stds), defaultValue);
+ if (defaultStdIt == cm::cend(stds)) {
+ std::string e = cmStrCat("CMAKE_", this->Language,
+ "_STANDARD_DEFAULT is set to invalid value '",
+ defaultStd, "'");
+ makefile->IssueMessage(MessageType::INTERNAL_ERROR, e);
+ return std::string{};
+ }
+
+ // If the standard requested is older than the compiler's default
+ // then we need to use a flag to change it.
+ if (stdIt <= defaultStdIt) {
+ auto offset = std::distance(cm::cbegin(stds), stdIt);
+ return cmStrCat("CMAKE_", this->Language, stdsStrings[offset], "_", type,
+ "_COMPILE_OPTION");
+ }
+
+ // The standard requested is at least as new as the compiler's default,
+ // and the standard request is not required. Decay to the newest standard
+ // for which a flag is defined.
+ for (; defaultStdIt < stdIt; --stdIt) {
+ auto offset = std::distance(cm::cbegin(stds), stdIt);
+ std::string option_flag =
+ cmStrCat("CMAKE_", this->Language, stdsStrings[offset], "_", type,
+ "_COMPILE_OPTION");
+ if (target->Target->GetMakefile()->GetDefinition(option_flag)) {
+ return option_flag;
+ }
+ }
+
+ return std::string{};
+ }
+
+ bool GetNewRequiredStandard(cmMakefile* makefile,
+ std::string const& targetName,
+ const std::string& feature,
+ cmProp currentLangStandardValue,
+ std::string& newRequiredStandard,
+ std::string* error) const
+ {
+ if (currentLangStandardValue) {
+ newRequiredStandard = *currentLangStandardValue;
+ } else {
+ newRequiredStandard.clear();
+ }
+
+ auto needed = this->HighestStandardNeeded(makefile, feature);
+
+ cmProp existingStandard = currentLangStandardValue;
+ if (existingStandard == nullptr) {
+ cmProp defaultStandard = makefile->GetDef(
+ cmStrCat("CMAKE_", this->Language, "_STANDARD_DEFAULT"));
+ if (cmNonempty(defaultStandard)) {
+ existingStandard = defaultStandard;
+ }
+ }
+
+ auto existingLevelIter = cm::cend(this->Levels);
+ if (existingStandard) {
+ existingLevelIter =
+ std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
+ std::stoi(*existingStandard));
+ if (existingLevelIter == cm::cend(this->Levels)) {
+ const std::string e =
+ cmStrCat("The ", this->Language, "_STANDARD property on target \"",
+ targetName, "\" contained an invalid value: \"",
+ *existingStandard, "\".");
+ if (error) {
+ *error = e;
+ } else {
+ makefile->IssueMessage(MessageType::FATAL_ERROR, e);
+ }
+ return false;
+ }
+ }
+
+ if (needed.index != -1) {
+ // Ensure the C++ language level is high enough to support
+ // the needed C++ features.
+ if (existingLevelIter == cm::cend(this->Levels) ||
+ existingLevelIter < this->Levels.begin() + needed.index) {
+ newRequiredStandard = this->LevelsAsStrings[needed.index];
+ }
+ }
+
+ return true;
+ }
+
+ bool HaveStandardAvailable(cmMakefile* makefile,
+ cmGeneratorTarget const* target,
+ std::string const& config,
+ std::string const& feature) const
+ {
+ cmProp defaultStandard = makefile->GetDef(
+ cmStrCat("CMAKE_", this->Language, "_STANDARD_DEFAULT"));
+ if (!defaultStandard) {
+ makefile->IssueMessage(
+ MessageType::INTERNAL_ERROR,
+ cmStrCat("CMAKE_", this->Language,
+ "_STANDARD_DEFAULT is not set. COMPILE_FEATURES support "
+ "not fully configured for this compiler."));
+ // Return true so the caller does not try to lookup the default standard.
+ return true;
+ }
+ // convert defaultStandard to an integer
+ if (std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
+ std::stoi(*defaultStandard)) == cm::cend(this->Levels)) {
+ const std::string e = cmStrCat("The CMAKE_", this->Language,
+ "_STANDARD_DEFAULT variable contains an "
+ "invalid value: \"",
+ *defaultStandard, "\".");
+ makefile->IssueMessage(MessageType::INTERNAL_ERROR, e);
+ return false;
+ }
+
+ cmProp existingStandard =
+ target->GetLanguageStandard(this->Language, config);
+ if (!existingStandard) {
+ existingStandard = defaultStandard;
+ }
+
+ auto existingLevelIter =
+ std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
+ std::stoi(*existingStandard));
+ if (existingLevelIter == cm::cend(this->Levels)) {
+ const std::string e =
+ cmStrCat("The ", this->Language, "_STANDARD property on target \"",
+ target->GetName(), "\" contained an invalid value: \"",
+ *existingStandard, "\".");
+ makefile->IssueMessage(MessageType::FATAL_ERROR, e);
+ return false;
+ }
+
+ auto needed = this->HighestStandardNeeded(makefile, feature);
+
+ return (needed.index == -1) ||
+ (this->Levels.begin() + needed.index) <= existingLevelIter;
+ }
+
+ StandardNeeded HighestStandardNeeded(cmMakefile* makefile,
+ std::string const& feature) const
+ {
+ std::string prefix = cmStrCat("CMAKE_", this->Language);
+ StandardNeeded maxLevel = { -1, -1 };
+ for (size_t i = 0; i < this->Levels.size(); ++i) {
+ if (const char* prop = makefile->GetDefinition(
+ cmStrCat(prefix, this->LevelsAsStrings[i], "_COMPILE_FEATURES"))) {
+ std::vector<std::string> props = cmExpandedList(prop);
+ if (cm::contains(props, feature)) {
+ maxLevel = { static_cast<int>(i), this->Levels[i] };
+ }
+ }
+ }
+ return maxLevel;
+ }
+
+ bool IsLaterStandard(int lhs, int rhs) const
+ {
+ auto rhsIt =
+ std::find(cm::cbegin(this->Levels), cm::cend(this->Levels), rhs);
+
+ return std::find(rhsIt, cm::cend(this->Levels), lhs) !=
+ cm::cend(this->Levels);
+ }
+
+ std::string Language;
+ std::vector<int> Levels;
+ std::vector<std::string> LevelsAsStrings;
+};
+
+std::unordered_map<std::string, StanardLevelComputer> StandardComputerMapping =
+ {
+ { "C",
+ StanardLevelComputer{ "C", std::vector<int>{ 90, 99, 11 },
+ std::vector<std::string>{ "90", "99", "11" } } },
+ { "CXX",
+ StanardLevelComputer{
+ "CXX", std::vector<int>{ 98, 11, 14, 17, 20 },
+ std::vector<std::string>{ "98", "11", "14", "17", "20" } } },
+ { "CUDA",
+ StanardLevelComputer{
+ "CUDA", std::vector<int>{ 03, 11, 14, 17, 20 },
+ std::vector<std::string>{ "03", "11", "14", "17", "20" } } },
+ { "OBJC",
+ StanardLevelComputer{ "OBJC", std::vector<int>{ 90, 99, 11 },
+ std::vector<std::string>{ "90", "99", "11" } } },
+ { "OBJCXX",
+ StanardLevelComputer{
+ "OBJCXX", std::vector<int>{ 98, 11, 14, 17, 20 },
+ std::vector<std::string>{ "98", "11", "14", "17", "20" } } },
+ };
+}
+
+std::string cmStandardLevelResolver::GetCompileOptionDef(
+ cmGeneratorTarget const* target, std::string const& lang,
+ std::string const& config) const
+{
+ const auto& mapping = StandardComputerMapping.find(lang);
+ if (mapping == cm::cend(StandardComputerMapping)) {
+ return std::string{};
+ }
+
+ return mapping->second.GetCompileOptionDef(this->Makefile, target, config);
+}
+
+bool cmStandardLevelResolver::AddRequiredTargetFeature(
+ cmTarget* target, const std::string& feature, std::string* error) const
+{
+ if (cmGeneratorExpression::Find(feature) != std::string::npos) {
+ target->AppendProperty("COMPILE_FEATURES", feature);
+ return true;
+ }
+
+ std::string lang;
+ if (!this->CheckCompileFeaturesAvailable(target->GetName(), feature, lang,
+ error)) {
+ return false;
+ }
+
+ target->AppendProperty("COMPILE_FEATURES", feature);
+
+ // FIXME: Add a policy to avoid updating the <LANG>_STANDARD target
+ // property due to COMPILE_FEATURES. The language standard selection
+ // should be done purely at generate time based on whatever the project
+ // code put in these properties explicitly. That is mostly true now,
+ // but for compatibility we need to continue updating the property here.
+ std::string newRequiredStandard;
+ bool newRequired = this->GetNewRequiredStandard(
+ target->GetName(), feature,
+ target->GetProperty(cmStrCat(lang, "_STANDARD")), newRequiredStandard,
+ error);
+ if (!newRequiredStandard.empty()) {
+ target->SetProperty(cmStrCat(lang, "_STANDARD"), newRequiredStandard);
+ }
+ return newRequired;
+}
+
+bool cmStandardLevelResolver::CheckCompileFeaturesAvailable(
+ const std::string& targetName, const std::string& feature, std::string& lang,
+ std::string* error) const
+{
+ if (!this->CompileFeatureKnown(targetName, feature, lang, error)) {
+ return false;
+ }
+
+ const char* features = this->CompileFeaturesAvailable(lang, error);
+ if (!features) {
+ return false;
+ }
+
+ std::vector<std::string> availableFeatures = cmExpandedList(features);
+ if (!cm::contains(availableFeatures, feature)) {
+ std::ostringstream e;
+ e << "The compiler feature \"" << feature << "\" is not known to " << lang
+ << " compiler\n\""
+ << this->Makefile->GetDefinition("CMAKE_" + lang + "_COMPILER_ID")
+ << "\"\nversion "
+ << this->Makefile->GetDefinition("CMAKE_" + lang + "_COMPILER_VERSION")
+ << ".";
+ if (error) {
+ *error = e.str();
+ } else {
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ }
+ return false;
+ }
+
+ return true;
+}
+
+bool cmStandardLevelResolver::CompileFeatureKnown(
+ const std::string& targetName, const std::string& feature, std::string& lang,
+ std::string* error) const
+{
+ assert(cmGeneratorExpression::Find(feature) == std::string::npos);
+
+ bool isCFeature =
+ std::find_if(cm::cbegin(C_FEATURES) + 1, cm::cend(C_FEATURES),
+ cmStrCmp(feature)) != cm::cend(C_FEATURES);
+ if (isCFeature) {
+ lang = "C";
+ return true;
+ }
+ bool isCxxFeature =
+ std::find_if(cm::cbegin(CXX_FEATURES) + 1, cm::cend(CXX_FEATURES),
+ cmStrCmp(feature)) != cm::cend(CXX_FEATURES);
+ if (isCxxFeature) {
+ lang = "CXX";
+ return true;
+ }
+ bool isCudaFeature =
+ std::find_if(cm::cbegin(CUDA_FEATURES) + 1, cm::cend(CUDA_FEATURES),
+ cmStrCmp(feature)) != cm::cend(CUDA_FEATURES);
+ if (isCudaFeature) {
+ lang = "CUDA";
+ return true;
+ }
+ std::ostringstream e;
+ if (error) {
+ e << "specified";
+ } else {
+ e << "Specified";
+ }
+ e << " unknown feature \"" << feature
+ << "\" for "
+ "target \""
+ << targetName << "\".";
+ if (error) {
+ *error = e.str();
+ } else {
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ }
+ return false;
+}
+
+const char* cmStandardLevelResolver::CompileFeaturesAvailable(
+ const std::string& lang, std::string* error) const
+{
+ if (!this->Makefile->GetGlobalGenerator()->GetLanguageEnabled(lang)) {
+ std::ostringstream e;
+ if (error) {
+ e << "cannot";
+ } else {
+ e << "Cannot";
+ }
+ e << " use features from non-enabled language " << lang;
+ if (error) {
+ *error = e.str();
+ } else {
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ }
+ return nullptr;
+ }
+
+ const char* featuresKnown =
+ this->Makefile->GetDefinition("CMAKE_" + lang + "_COMPILE_FEATURES");
+
+ if (!cmNonempty(featuresKnown)) {
+ std::ostringstream e;
+ if (error) {
+ e << "no";
+ } else {
+ e << "No";
+ }
+ e << " known features for " << lang << " compiler\n\""
+ << this->Makefile->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID")
+ << "\"\nversion "
+ << this->Makefile->GetSafeDefinition("CMAKE_" + lang +
+ "_COMPILER_VERSION")
+ << ".";
+ if (error) {
+ *error = e.str();
+ } else {
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ }
+ return nullptr;
+ }
+ return featuresKnown;
+}
+
+bool cmStandardLevelResolver::GetNewRequiredStandard(
+ const std::string& targetName, const std::string& feature,
+ cmProp currentLangStandardValue, std::string& newRequiredStandard,
+ std::string* error) const
+{
+ std::string lang;
+ if (!this->CheckCompileFeaturesAvailable(targetName, feature, lang, error)) {
+ return false;
+ }
+
+ auto mapping = StandardComputerMapping.find(lang);
+ if (mapping != cm::cend(StandardComputerMapping)) {
+ return mapping->second.GetNewRequiredStandard(
+ this->Makefile, targetName, feature, currentLangStandardValue,
+ newRequiredStandard, error);
+ }
+ return false;
+}
+
+bool cmStandardLevelResolver::HaveStandardAvailable(
+ cmGeneratorTarget const* target, std::string const& lang,
+ std::string const& config, const std::string& feature) const
+{
+ auto mapping = StandardComputerMapping.find(lang);
+ if (mapping != cm::cend(StandardComputerMapping)) {
+ return mapping->second.HaveStandardAvailable(this->Makefile, target,
+ config, feature);
+ }
+ return false;
+}
+
+bool cmStandardLevelResolver::IsLaterStandard(std::string const& lang,
+ std::string const& lhs,
+ std::string const& rhs) const
+{
+ auto mapping = StandardComputerMapping.find(lang);
+ if (mapping != cm::cend(StandardComputerMapping)) {
+ return mapping->second.IsLaterStandard(std::stoi(lhs), std::stoi(rhs));
+ }
+ return false;
+}
diff --git a/Source/cmStandardLevelResolver.h b/Source/cmStandardLevelResolver.h
new file mode 100644
index 0000000000..959a5f9c87
--- /dev/null
+++ b/Source/cmStandardLevelResolver.h
@@ -0,0 +1,59 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmStandardLevelResolver_h
+#define cmStandardLevelResolver_h
+
+#include <string>
+
+#include "cmProperty.h"
+
+class cmMakefile;
+class cmGeneratorTarget;
+class cmTarget;
+
+class cmStandardLevelResolver
+{
+
+public:
+ explicit cmStandardLevelResolver(cmMakefile* makefile)
+ : Makefile(makefile)
+ {
+ }
+
+ std::string GetCompileOptionDef(cmGeneratorTarget const* target,
+ std::string const& lang,
+ std::string const& config) const;
+
+ bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature,
+ std::string* error = nullptr) const;
+
+ bool CompileFeatureKnown(const std::string& targetName,
+ const std::string& feature, std::string& lang,
+ std::string* error) const;
+
+ const char* CompileFeaturesAvailable(const std::string& lang,
+ std::string* error) const;
+
+ bool GetNewRequiredStandard(const std::string& targetName,
+ const std::string& feature,
+ cmProp currentLangStandardValue,
+ std::string& newRequiredStandard,
+ std::string* error = nullptr) const;
+
+ bool HaveStandardAvailable(cmGeneratorTarget const* target,
+ std::string const& lang,
+ std::string const& config,
+ const std::string& feature) const;
+
+ bool IsLaterStandard(std::string const& lang, std::string const& lhs,
+ std::string const& rhs) const;
+
+private:
+ bool CheckCompileFeaturesAvailable(const std::string& targetName,
+ const std::string& feature,
+ std::string& lang,
+ std::string* error) const;
+
+ cmMakefile* Makefile;
+};
+#endif
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 0b6b40f4d5..73f166c58b 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -623,8 +623,7 @@ cmProp cmState::GetGlobalProperty(const std::string& prop)
bool cmState::GetGlobalPropertyAsBool(const std::string& prop)
{
- cmProp p = this->GetGlobalProperty(prop);
- return p && cmIsOn(*p);
+ return cmIsOn(this->GetGlobalProperty(prop));
}
void cmState::SetSourceDirectory(std::string const& sourceDirectory)
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index a4fe663044..796bb1f754 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -648,8 +648,7 @@ cmProp cmStateDirectory::GetProperty(const std::string& prop, bool chain) const
bool cmStateDirectory::GetPropertyAsBool(const std::string& prop) const
{
- cmProp p = this->GetProperty(prop);
- return p && cmIsOn(*p);
+ return cmIsOn(this->GetProperty(prop));
}
std::vector<std::string> cmStateDirectory::GetPropertyKeys() const
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index c223431854..bf8e331b7c 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -148,7 +148,7 @@ bool cmStateSnapshot::PopPolicy()
bool cmStateSnapshot::CanPopPolicyScope()
{
- return this->Position->Policies == this->Position->PolicyScope;
+ return this->Position->Policies != this->Position->PolicyScope;
}
void cmStateSnapshot::SetPolicy(cmPolicies::PolicyID id,
@@ -232,11 +232,6 @@ void cmStateSnapshot::RemoveDefinition(std::string const& name)
this->Position->Vars->Unset(name);
}
-std::vector<std::string> cmStateSnapshot::UnusedKeys() const
-{
- return this->Position->Vars->UnusedKeys();
-}
-
std::vector<std::string> cmStateSnapshot::ClosureKeys() const
{
return cmDefinitions::ClosureKeys(this->Position->Vars,
@@ -328,7 +323,7 @@ void cmStateSnapshot::SetDefaultDefinitions()
#if defined(__CYGWIN__)
std::string legacy;
if (cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32", legacy) &&
- cmIsOn(legacy.c_str())) {
+ cmIsOn(legacy)) {
this->SetDefinition("WIN32", "1");
this->SetDefinition("CMAKE_HOST_WIN32", "1");
}
diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h
index 021fd53c13..c19f174859 100644
--- a/Source/cmStateSnapshot.h
+++ b/Source/cmStateSnapshot.h
@@ -28,7 +28,6 @@ public:
bool IsInitialized(std::string const& name) const;
void SetDefinition(std::string const& name, cm::string_view value);
void RemoveDefinition(std::string const& name);
- std::vector<std::string> UnusedKeys() const;
std::vector<std::string> ClosureKeys() const;
bool RaiseScope(std::string const& var, const char* varDef);
diff --git a/Source/cmString.cxx b/Source/cmString.cxx
index 2a0c125e63..898b8286e5 100644
--- a/Source/cmString.cxx
+++ b/Source/cmString.cxx
@@ -17,7 +17,7 @@ static std::string const empty_string_;
void String::internally_mutate_to_stable_string()
{
// We assume that only one thread mutates this instance at
- // a time even if we point to a shared string buffer refernced
+ // a time even if we point to a shared string buffer referenced
// by other threads.
*this = String(data(), size());
}
diff --git a/Source/cmString.hxx b/Source/cmString.hxx
index 87bfdffcfd..40fe20dd5a 100644
--- a/Source/cmString.hxx
+++ b/Source/cmString.hxx
@@ -383,7 +383,7 @@ public:
instance is mutated or destroyed. */
std::string const* str_if_stable() const;
- /** Get a refernce to a normal std::string. The reference
+ /** Get a reference to a normal std::string. The reference
is valid until this instance is mutated or destroyed. */
std::string const& str();
diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h
index a5ecca758d..4b0090b97d 100644
--- a/Source/cmStringAlgorithms.h
+++ b/Source/cmStringAlgorithms.h
@@ -20,6 +20,20 @@
/** String range type. */
using cmStringRange = cmRange<std::vector<std::string>::const_iterator>;
+/** Check for non-empty string. */
+inline bool cmNonempty(const char* str)
+{
+ return str && *str;
+}
+inline bool cmNonempty(cm::string_view str)
+{
+ return !str.empty();
+}
+inline bool cmNonempty(std::string const* str)
+{
+ return str && !str->empty();
+}
+
/** Callable string comparison struct. */
struct cmStrCmp
{
@@ -205,10 +219,11 @@ bool cmIsNOTFOUND(cm::string_view val);
bool cmIsOn(cm::string_view val);
inline bool cmIsOn(const char* val)
{
- if (!val) {
- return false;
- }
- return cmIsOn(cm::string_view(val));
+ return val && cmIsOn(cm::string_view(val));
+}
+inline bool cmIsOn(std::string const* val)
+{
+ return val && cmIsOn(*val);
}
/**
@@ -221,10 +236,11 @@ inline bool cmIsOn(const char* val)
bool cmIsOff(cm::string_view val);
inline bool cmIsOff(const char* val)
{
- if (!val) {
- return true;
- }
- return cmIsOff(cm::string_view(val));
+ return !val || cmIsOff(cm::string_view(val));
+}
+inline bool cmIsOff(std::string const* val)
+{
+ return !val || cmIsOff(*val);
}
/** Returns true if string @a str starts with the character @a prefix. */
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1e78d36938..798c29ad45 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1213,7 +1213,7 @@ bool cmSystemTools::UnsetEnv(const char* value)
{
# if !defined(HAVE_UNSETENV)
std::string var = cmStrCat(value, '=');
- return cmSystemTools::PutEnv(var.c_str());
+ return cmSystemTools::PutEnv(var);
# else
unsetenv(value);
return true;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 36e1ad5fd1..0e5dfef1f1 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -7,6 +7,7 @@
#include <cstring>
#include <initializer_list>
#include <iterator>
+#include <map>
#include <set>
#include <sstream>
#include <unordered_set>
@@ -185,6 +186,7 @@ public:
std::vector<cmInstallTargetGenerator*> InstallGenerators;
std::set<std::string> SystemIncludeDirectories;
cmTarget::LinkLibraryVectorType OriginalLinkLibraries;
+ std::map<std::string, BTs<std::string>> LanguageStandardProperties;
std::vector<std::string> IncludeDirectoriesEntries;
std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces;
std::vector<std::string> CompileOptionsEntries;
@@ -214,6 +216,15 @@ public:
std::string ProcessSourceItemCMP0049(const std::string& s);
};
+namespace {
+#define SETUP_COMMON_LANGUAGE_PROPERTIES(lang) \
+ initProp(#lang "_COMPILER_LAUNCHER"); \
+ initProp(#lang "_STANDARD"); \
+ initProp(#lang "_STANDARD_REQUIRED"); \
+ initProp(#lang "_EXTENSIONS"); \
+ initProp(#lang "_VISIBILITY_PRESET")
+}
+
cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
Visibility vis, cmMakefile* mf, PerConfig perConfig)
: impl(cm::make_unique<cmTargetInternals>())
@@ -270,8 +281,14 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
};
// Setup default property values.
- if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
- this->GetType() != cmStateEnums::UTILITY) {
+ if (this->CanCompileSources()) {
+
+ SETUP_COMMON_LANGUAGE_PROPERTIES(C);
+ SETUP_COMMON_LANGUAGE_PROPERTIES(OBJC);
+ SETUP_COMMON_LANGUAGE_PROPERTIES(CXX);
+ SETUP_COMMON_LANGUAGE_PROPERTIES(OBJCXX);
+ SETUP_COMMON_LANGUAGE_PROPERTIES(CUDA);
+
initProp("ANDROID_API");
initProp("ANDROID_API_MIN");
initProp("ANDROID_ARCH");
@@ -333,38 +350,22 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initProp("NO_SYSTEM_FROM_IMPORTED");
initProp("BUILD_WITH_INSTALL_NAME_DIR");
initProp("C_CLANG_TIDY");
- initProp("C_COMPILER_LAUNCHER");
initProp("C_CPPLINT");
initProp("C_CPPCHECK");
initProp("C_INCLUDE_WHAT_YOU_USE");
initProp("LINK_WHAT_YOU_USE");
- initProp("C_STANDARD");
- initProp("C_STANDARD_REQUIRED");
- initProp("C_EXTENSIONS");
- initProp("OBJC_COMPILER_LAUNCHER");
- initProp("OBJC_STANDARD");
- initProp("OBJC_STANDARD_REQUIRED");
- initProp("OBJC_EXTENSIONS");
initProp("CXX_CLANG_TIDY");
- initProp("CXX_COMPILER_LAUNCHER");
initProp("CXX_CPPLINT");
initProp("CXX_CPPCHECK");
initProp("CXX_INCLUDE_WHAT_YOU_USE");
- initProp("CXX_STANDARD");
- initProp("CXX_STANDARD_REQUIRED");
- initProp("CXX_EXTENSIONS");
- initProp("OBJCXX_COMPILER_LAUNCHER");
- initProp("OBJCXX_STANDARD");
- initProp("OBJCXX_STANDARD_REQUIRED");
- initProp("OBJCXX_EXTENSIONS");
- initProp("CUDA_STANDARD");
- initProp("CUDA_STANDARD_REQUIRED");
- initProp("CUDA_EXTENSIONS");
- initProp("CUDA_COMPILER_LAUNCHER");
initProp("CUDA_SEPARABLE_COMPILATION");
initProp("CUDA_RESOLVE_DEVICE_SYMBOLS");
initProp("CUDA_RUNTIME_LIBRARY");
initProp("CUDA_ARCHITECTURES");
+ initProp("VISIBILITY_INLINES_HIDDEN");
+ initProp("JOB_POOL_COMPILE");
+ initProp("JOB_POOL_LINK");
+ initProp("JOB_POOL_PRECOMPILE_HEADER");
initProp("LINK_SEARCH_START_STATIC");
initProp("LINK_SEARCH_END_STATIC");
initProp("Swift_LANGUAGE_VERSION");
@@ -375,6 +376,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initPropValue("UNITY_BUILD_BATCH_SIZE", "8");
initPropValue("UNITY_BUILD_MODE", "BATCH");
initPropValue("PCH_WARN_INVALID", "ON");
+
#ifdef __APPLE__
if (this->GetGlobalGenerator()->IsXcode()) {
initProp("XCODE_SCHEME_ADDRESS_SANITIZER");
@@ -408,7 +410,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
}
// Setup per-configuration property default values.
- if (this->GetType() != cmStateEnums::UTILITY) {
+ if (this->GetType() != cmStateEnums::UTILITY &&
+ this->GetType() != cmStateEnums::GLOBAL_TARGET) {
static const auto configProps = {
/* clang-format needs this comment to break after the opening brace */
"ARCHIVE_OUTPUT_DIRECTORY_", "LIBRARY_OUTPUT_DIRECTORY_",
@@ -417,8 +420,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
"INTERPROCEDURAL_OPTIMIZATION_"
};
// Collect the set of configuration types.
- std::vector<std::string> configNames;
- mf->GetConfigurations(configNames);
+ std::vector<std::string> configNames =
+ mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
for (std::string const& configName : configNames) {
std::string configUpper = cmSystemTools::UpperCase(configName);
for (auto const& prop : configProps) {
@@ -485,16 +488,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
impl->Makefile->GetLinkDirectoriesBacktraces());
}
- if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
- this->GetType() != cmStateEnums::UTILITY) {
- initProp("C_VISIBILITY_PRESET");
- initProp("CXX_VISIBILITY_PRESET");
- initProp("OBJC_VISIBILITY_PRESET");
- initProp("OBJCXX_VISIBILITY_PRESET");
- initProp("CUDA_VISIBILITY_PRESET");
- initProp("VISIBILITY_INLINES_HIDDEN");
- }
-
if (impl->TargetType == cmStateEnums::EXECUTABLE) {
initProp("ANDROID_GUI");
initProp("CROSSCOMPILING_EMULATOR");
@@ -503,6 +496,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
if (impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
impl->TargetType == cmStateEnums::MODULE_LIBRARY) {
this->SetProperty("POSITION_INDEPENDENT_CODE", "True");
+ } else if (this->CanCompileSources()) {
+ initProp("POSITION_INDEPENDENT_CODE");
}
if (impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
impl->TargetType == cmStateEnums::EXECUTABLE) {
@@ -510,11 +505,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initProp("WINDOWS_EXPORT_ALL_SYMBOLS");
}
- if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
- this->GetType() != cmStateEnums::UTILITY) {
- initProp("POSITION_INDEPENDENT_CODE");
- }
-
// Record current policies for later use.
impl->Makefile->RecordPolicies(impl->PolicyMap);
@@ -526,13 +516,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
impl->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW);
}
- if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
- this->GetType() != cmStateEnums::UTILITY) {
- initProp("JOB_POOL_COMPILE");
- initProp("JOB_POOL_LINK");
- initProp("JOB_POOL_PRECOMPILE_HEADER");
- }
-
if (impl->TargetType <= cmStateEnums::GLOBAL_TARGET) {
initProp("DOTNET_TARGET_FRAMEWORK");
initProp("DOTNET_TARGET_FRAMEWORK_VERSION");
@@ -598,6 +581,40 @@ cmGlobalGenerator* cmTarget::GetGlobalGenerator() const
return impl->Makefile->GetGlobalGenerator();
}
+BTs<std::string> const* cmTarget::GetLanguageStandardProperty(
+ const std::string& propertyName) const
+{
+ auto entry = impl->LanguageStandardProperties.find(propertyName);
+ if (entry != impl->LanguageStandardProperties.end()) {
+ return &entry->second;
+ }
+
+ return nullptr;
+}
+
+void cmTarget::SetLanguageStandardProperty(std::string const& lang,
+ std::string const& value,
+ const std::string& feature)
+{
+ cmListFileBacktrace featureBacktrace;
+ for (size_t i = 0; i < impl->CompileFeaturesEntries.size(); i++) {
+ if (impl->CompileFeaturesEntries[i] == feature) {
+ if (i < impl->CompileFeaturesBacktraces.size()) {
+ featureBacktrace = impl->CompileFeaturesBacktraces[i];
+ }
+ break;
+ }
+ }
+
+ BTs<std::string>& languageStandardProperty =
+ impl->LanguageStandardProperties[cmStrCat(lang, "_STANDARD")];
+ if (languageStandardProperty.Value != value) {
+ languageStandardProperty.Value = value;
+ languageStandardProperty.Backtraces.clear();
+ }
+ languageStandardProperty.Backtraces.emplace_back(featureBacktrace);
+}
+
void cmTarget::AddUtility(std::string const& name, bool cross, cmMakefile* mf)
{
impl->Utilities.insert(BT<std::pair<std::string, bool>>(
@@ -636,6 +653,12 @@ bool cmTarget::IsAppBundleOnApple() const
this->GetPropertyAsBool("MACOSX_BUNDLE"));
}
+bool cmTarget::IsAndroidGuiExecutable() const
+{
+ return (this->GetType() == cmStateEnums::EXECUTABLE && impl->IsAndroid &&
+ this->GetPropertyAsBool("ANDROID_GUI"));
+}
+
std::vector<cmCustomCommand> const& cmTarget::GetPreBuildCommands() const
{
return impl->PreBuildCommands;
@@ -1127,6 +1150,11 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
return;
}
#define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP
+ MAKE_STATIC_PROP(C_STANDARD);
+ MAKE_STATIC_PROP(CXX_STANDARD);
+ MAKE_STATIC_PROP(CUDA_STANDARD);
+ MAKE_STATIC_PROP(OBJC_STANDARD);
+ MAKE_STATIC_PROP(OBJCXX_STANDARD);
MAKE_STATIC_PROP(COMPILE_DEFINITIONS);
MAKE_STATIC_PROP(COMPILE_FEATURES);
MAKE_STATIC_PROP(COMPILE_OPTIONS);
@@ -1310,6 +1338,15 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
cmProp tmp = reusedTarget->GetProperty("COMPILE_PDB_NAME");
this->SetProperty("COMPILE_PDB_NAME", tmp ? tmp->c_str() : nullptr);
this->AddUtility(reusedFrom, false, impl->Makefile);
+ } else if (prop == propC_STANDARD || prop == propCXX_STANDARD ||
+ prop == propCUDA_STANDARD || prop == propOBJC_STANDARD ||
+ prop == propOBJCXX_STANDARD) {
+ if (value) {
+ impl->LanguageStandardProperties[prop] =
+ BTs<std::string>(value, impl->Makefile->GetBacktrace());
+ } else {
+ impl->LanguageStandardProperties.erase(prop);
+ }
} else {
impl->Properties.SetProperty(prop, value);
}
@@ -1413,6 +1450,11 @@ void cmTarget::AppendProperty(const std::string& prop,
} else if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME")) {
impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
prop + " property may not be APPENDed.");
+ } else if (prop == "C_STANDARD" || prop == "CXX_STANDARD" ||
+ prop == "CUDA_STANDARD" || prop == "OBJC_STANDARD" ||
+ prop == "OBJCXX_STANDARD") {
+ impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
+ prop + " property may not be appended.");
} else {
impl->Properties.AppendProperty(prop, value, asString);
}
@@ -1626,6 +1668,11 @@ cmProp cmTarget::GetComputedProperty(const std::string& prop,
cmProp cmTarget::GetProperty(const std::string& prop) const
{
#define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP
+ MAKE_STATIC_PROP(C_STANDARD);
+ MAKE_STATIC_PROP(CXX_STANDARD);
+ MAKE_STATIC_PROP(CUDA_STANDARD);
+ MAKE_STATIC_PROP(OBJC_STANDARD);
+ MAKE_STATIC_PROP(OBJCXX_STANDARD);
MAKE_STATIC_PROP(LINK_LIBRARIES);
MAKE_STATIC_PROP(TYPE);
MAKE_STATIC_PROP(INCLUDE_DIRECTORIES);
@@ -1646,6 +1693,11 @@ cmProp cmTarget::GetProperty(const std::string& prop) const
MAKE_STATIC_PROP(TRUE);
#undef MAKE_STATIC_PROP
static std::unordered_set<std::string> const specialProps{
+ propC_STANDARD,
+ propCXX_STANDARD,
+ propCUDA_STANDARD,
+ propOBJC_STANDARD,
+ propOBJCXX_STANDARD,
propLINK_LIBRARIES,
propTYPE,
propINCLUDE_DIRECTORIES,
@@ -1664,6 +1716,15 @@ cmProp cmTarget::GetProperty(const std::string& prop) const
propSOURCES
};
if (specialProps.count(prop)) {
+ if (prop == propC_STANDARD || prop == propCXX_STANDARD ||
+ prop == propCUDA_STANDARD || prop == propOBJC_STANDARD ||
+ prop == propOBJCXX_STANDARD) {
+ auto propertyIter = impl->LanguageStandardProperties.find(prop);
+ if (propertyIter == impl->LanguageStandardProperties.end()) {
+ return nullptr;
+ }
+ return &(propertyIter->second.Value);
+ }
if (prop == propLINK_LIBRARIES) {
if (impl->LinkImplementationPropertyEntries.empty()) {
return nullptr;
@@ -1804,8 +1865,7 @@ std::string const& cmTarget::GetSafeProperty(std::string const& prop) const
bool cmTarget::GetPropertyAsBool(const std::string& prop) const
{
- cmProp p = this->GetProperty(prop);
- return p && cmIsOn(*p);
+ return cmIsOn(this->GetProperty(prop));
}
cmPropertyMap const& cmTarget::GetProperties() const
@@ -1838,6 +1898,27 @@ bool cmTarget::IsPerConfig() const
return impl->PerConfig;
}
+bool cmTarget::CanCompileSources() const
+{
+ if (this->IsImported()) {
+ return false;
+ }
+ switch (this->GetType()) {
+ case cmStateEnums::EXECUTABLE:
+ case cmStateEnums::STATIC_LIBRARY:
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::OBJECT_LIBRARY:
+ return true;
+ case cmStateEnums::UTILITY:
+ case cmStateEnums::INTERFACE_LIBRARY:
+ case cmStateEnums::GLOBAL_TARGET:
+ case cmStateEnums::UNKNOWN_LIBRARY:
+ break;
+ }
+ return false;
+}
+
const char* cmTarget::GetSuffixVariableInternal(
cmStateEnums::ArtifactType artifact) const
{
@@ -1865,7 +1946,7 @@ const char* cmTarget::GetSuffixVariableInternal(
case cmStateEnums::RuntimeBinaryArtifact:
// Android GUI application packages store the native
// binary as a shared library.
- return (impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
+ return (this->IsAndroidGuiExecutable()
? "CMAKE_SHARED_LIBRARY_SUFFIX"
: "CMAKE_EXECUTABLE_SUFFIX");
case cmStateEnums::ImportLibraryArtifact:
@@ -1906,7 +1987,7 @@ const char* cmTarget::GetPrefixVariableInternal(
case cmStateEnums::RuntimeBinaryArtifact:
// Android GUI application packages store the native
// binary as a shared library.
- return (impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
+ return (this->IsAndroidGuiExecutable()
? "CMAKE_SHARED_LIBRARY_PREFIX"
: "");
case cmStateEnums::ImportLibraryArtifact:
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index f0ddb686a7..43f1887b09 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -196,6 +196,7 @@ public:
bool IsImported() const;
bool IsImportedGloballyVisible() const;
bool IsPerConfig() const;
+ bool CanCompileSources() const;
bool GetMappedConfig(std::string const& desired_config, cmProp& loc,
cmProp& imp, std::string& suffix) const;
@@ -209,6 +210,9 @@ public:
//! Return whether this target is an executable Bundle on Apple.
bool IsAppBundleOnApple() const;
+ //! Return whether this target is a GUI executable on Android.
+ bool IsAndroidGuiExecutable() const;
+
//! Get a backtrace from the creation of the target.
cmListFileBacktrace const& GetBacktrace() const;
@@ -233,6 +237,13 @@ public:
void AddSystemIncludeDirectories(std::set<std::string> const& incs);
std::set<std::string> const& GetSystemIncludeDirectories() const;
+ BTs<std::string> const* GetLanguageStandardProperty(
+ const std::string& propertyName) const;
+
+ void SetLanguageStandardProperty(std::string const& lang,
+ std::string const& value,
+ const std::string& feature);
+
cmStringRange GetIncludeDirectoriesEntries() const;
cmBacktraceRange GetIncludeDirectoriesBacktraces() const;
diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx
index 06be4f0ddd..aa1abdd64c 100644
--- a/Source/cmTargetCompileFeaturesCommand.cxx
+++ b/Source/cmTargetCompileFeaturesCommand.cxx
@@ -4,6 +4,7 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmStandardLevelResolver.h"
#include "cmStringAlgorithms.h"
#include "cmTargetPropCommandBase.h"
@@ -29,9 +30,10 @@ private:
const std::vector<std::string>& content,
bool /*prepend*/, bool /*system*/) override
{
+ cmStandardLevelResolver standardResolver(this->Makefile);
for (std::string const& it : content) {
std::string error;
- if (!this->Makefile->AddRequiredTargetFeature(tgt, it, &error)) {
+ if (!standardResolver.AddRequiredTargetFeature(tgt, it, &error)) {
this->SetError(error);
return false; // Not (successfully) handled.
}
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index af91177178..78b230c69e 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -102,7 +102,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Prepend with the emulator when cross compiling if required.
cmProp emulator = target->GetProperty("CROSSCOMPILING_EMULATOR");
- if (emulator != nullptr && !emulator->empty()) {
+ if (cmNonempty(emulator)) {
std::vector<std::string> emulatorWithArgs = cmExpandedList(*emulator);
std::string emulatorExe(emulatorWithArgs[0]);
cmSystemTools::ConvertToUnixSlashes(emulatorExe);
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 13f73dc484..bd6bb3d57c 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -164,7 +164,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
break;
case 's': // Seconds since UNIX epoch (midnight 1-jan-1970)
{
- // Build a time_t for UNIX epoch and substract from the input "timeT":
+ // Build a time_t for UNIX epoch and subtract from the input "timeT":
struct tm tmUnixEpoch;
memset(&tmUnixEpoch, 0, sizeof(tmUnixEpoch));
tmUnixEpoch.tm_mday = 1;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a8e424d606..6369c1fdd3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -232,15 +232,17 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator(
, LocalGenerator(
(cmLocalVisualStudio10Generator*)target->GetLocalGenerator())
{
- this->Makefile->GetConfigurations(this->Configurations);
+ this->Configurations =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
this->NsightTegra = gg->IsNsightTegra();
+ this->Android = gg->TargetsAndroid();
for (int i = 0; i < 4; ++i) {
this->NsightTegraVersion[i] = 0;
}
sscanf(gg->GetNsightTegraVersion().c_str(), "%u.%u.%u.%u",
&this->NsightTegraVersion[0], &this->NsightTegraVersion[1],
&this->NsightTegraVersion[2], &this->NsightTegraVersion[3]);
- this->MSTools = !this->NsightTegra;
+ this->MSTools = !this->NsightTegra && !this->Android;
this->Managed = false;
this->TargetCompileAsWinRT = false;
this->IsMissingFiles = false;
@@ -333,6 +335,13 @@ void cmVisualStudio10TargetGenerator::Generate()
this->ProjectType = csproj;
this->Managed = true;
}
+
+ if (this->Android &&
+ this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE &&
+ !this->GeneratorTarget->Target->IsAndroidGuiExecutable()) {
+ this->GlobalGenerator->AddAndroidExecutableWarning(this->Name);
+ }
+
// Tell the global generator the name of the project file
this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME",
this->Name);
@@ -427,7 +436,7 @@ void cmVisualStudio10TargetGenerator::Generate()
e1.Attribute("Label", "Globals");
e1.Element("ProjectGuid", "{" + this->GUID + "}");
- if (this->MSTools &&
+ if ((this->MSTools || this->Android) &&
this->GeneratorTarget->GetType() <= cmStateEnums::GLOBAL_TARGET) {
this->WriteApplicationTypeSettings(e1);
this->VerifyNecessaryFiles();
@@ -469,7 +478,11 @@ void cmVisualStudio10TargetGenerator::Generate()
cmProp vsGlobalKeyword =
this->GeneratorTarget->GetProperty("VS_GLOBAL_KEYWORD");
if (!vsGlobalKeyword) {
- e1.Element("Keyword", "Win32Proj");
+ if (this->GlobalGenerator->TargetsAndroid()) {
+ e1.Element("Keyword", "Android");
+ } else {
+ e1.Element("Keyword", "Win32Proj");
+ }
} else {
e1.Element("Keyword", *vsGlobalKeyword);
}
@@ -658,7 +671,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);
}
}
@@ -1134,9 +1147,11 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
break;
case cmStateEnums::EXECUTABLE:
if (this->NsightTegra &&
- !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) {
+ !this->GeneratorTarget->Target->IsAndroidGuiExecutable()) {
// Android executables are .so too.
configType = "DynamicLibrary";
+ } else if (this->Android) {
+ configType = "DynamicLibrary";
} else {
configType = "Application";
}
@@ -1166,6 +1181,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
}
} else if (this->NsightTegra) {
this->WriteNsightTegraConfigurationValues(e1, c);
+ } else if (this->Android) {
+ this->WriteAndroidConfigurationValues(e1, c);
}
}
}
@@ -1324,6 +1341,24 @@ void cmVisualStudio10TargetGenerator::WriteNsightTegraConfigurationValues(
}
}
+void cmVisualStudio10TargetGenerator::WriteAndroidConfigurationValues(
+ Elem& e1, std::string const&)
+{
+ cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
+ if (cmProp projectToolsetOverride =
+ this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
+ e1.Element("PlatformToolset", *projectToolsetOverride);
+ } else if (const char* toolset = gg->GetPlatformToolset()) {
+ e1.Element("PlatformToolset", toolset);
+ }
+ if (cmProp stlType =
+ this->GeneratorTarget->GetProperty("ANDROID_STL_TYPE")) {
+ if (*stlType != "none") {
+ e1.Element("UseOfStl", *stlType);
+ }
+ }
+}
+
void cmVisualStudio10TargetGenerator::WriteCustomCommands(Elem& e0)
{
this->CSharpCustomCommandNames.clear();
@@ -1941,7 +1976,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
}
cmProp toolOverride = sf->GetProperty("VS_TOOL_OVERRIDE");
- if (toolOverride && !toolOverride->empty()) {
+ if (cmNonempty(toolOverride)) {
tool = toolOverride->c_str();
}
@@ -1950,12 +1985,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
if (this->GlobalGenerator->TargetsWindowsPhone() ||
this->GlobalGenerator->TargetsWindowsStore()) {
cmProp content = sf->GetProperty("VS_DEPLOYMENT_CONTENT");
- if (content && !content->empty()) {
+ if (cmNonempty(content)) {
toolHasSettings = true;
deployContent = *content;
cmProp location = sf->GetProperty("VS_DEPLOYMENT_LOCATION");
- if (location && !location->empty()) {
+ if (cmNonempty(location)) {
deployLocation = *location;
}
}
@@ -2258,7 +2293,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
e2.Attribute("UnityFilesDirectory", unityDir);
} else {
// Visual Studio versions prior to 2017 15.8 do not know about unity
- // builds, thus we exclude the files alredy part of unity sources.
+ // builds, thus we exclude the files already part of unity sources.
if (!si.Source->GetPropertyAsBool("SKIP_UNITY_BUILD_INCLUSION")) {
exclude_configs = si.Configs;
}
@@ -2915,7 +2950,9 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
}
}
- if (this->MSTools) {
+ if (this->Android) {
+ e2.Element("ObjectFileName", "$(IntDir)%(filename).o");
+ } else if (this->MSTools) {
cmsys::RegularExpression clangToolset("v[0-9]+_clang_.*");
const char* toolset = this->GlobalGenerator->GetPlatformToolset();
if (toolset && clangToolset.find(toolset)) {
@@ -4021,8 +4058,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0)
// output manifest flags <Manifest></Manifest>
this->WriteManifestOptions(e1, c);
if (this->NsightTegra &&
- this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE &&
- this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) {
+ this->GeneratorTarget->Target->IsAndroidGuiExecutable()) {
this->WriteAntBuildOptions(e1, c);
}
}
@@ -4108,7 +4144,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
Elem e1(e0, "ItemGroup");
e1.SetHasElements();
for (cmGeneratorTarget const* dt : depends) {
- if (dt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ if (!dt->IsInBuildSystem()) {
continue;
}
// skip fortran targets as they can not be processed by MSBuild
@@ -4137,8 +4173,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
}
// Don't reference targets that don't produce any output.
- if (dt->GetManagedType(this->Configurations[0]) ==
- cmGeneratorTarget::ManagedType::Undefined) {
+ if (this->Configurations.empty() ||
+ dt->GetManagedType(this->Configurations[0]) ==
+ cmGeneratorTarget::ManagedType::Undefined) {
e2.Element("ReferenceOutputAssembly", "false");
e2.Element("CopyToOutputDirectory", "Never");
}
@@ -4354,6 +4391,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings(Elem& e1)
bool isAppContainer = false;
bool const isWindowsPhone = this->GlobalGenerator->TargetsWindowsPhone();
bool const isWindowsStore = this->GlobalGenerator->TargetsWindowsStore();
+ bool const isAndroid = this->GlobalGenerator->TargetsAndroid();
std::string const& rev = this->GlobalGenerator->GetApplicationTypeRevision();
if (isWindowsPhone || isWindowsStore) {
e1.Element("ApplicationType",
@@ -4391,13 +4429,19 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings(Elem& e1)
this->Name + "_$(Configuration)_$(Platform).xap");
}
}
+ } else if (isAndroid) {
+ e1.Element("ApplicationType", "Android");
+ e1.Element("ApplicationTypeRevision",
+ gg->GetAndroidApplicationTypeRevision());
}
if (isAppContainer) {
e1.Element("AppContainerApplication", "true");
- } else if (this->Platform == "ARM64") {
- e1.Element("WindowsSDKDesktopARM64Support", "true");
- } else if (this->Platform == "ARM") {
- e1.Element("WindowsSDKDesktopARMSupport", "true");
+ } else if (!isAndroid) {
+ if (this->Platform == "ARM64") {
+ e1.Element("WindowsSDKDesktopARM64Support", "true");
+ } else if (this->Platform == "ARM") {
+ e1.Element("WindowsSDKDesktopARMSupport", "true");
+ }
}
std::string const& targetPlatformVersion =
gg->GetWindowsTargetPlatformVersion();
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 7c71de3dc5..c54057ab87 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -70,6 +70,7 @@ private:
void WriteExtraSource(Elem& e1, cmSourceFile const* sf);
void WriteNsightTegraConfigurationValues(Elem& e1,
std::string const& config);
+ void WriteAndroidConfigurationValues(Elem& e1, std::string const& config);
void WriteSource(Elem& e2, cmSourceFile const* sf);
void WriteExcludeFromBuild(Elem& e2,
std::vector<size_t> const& exclude_configs);
@@ -215,6 +216,7 @@ private:
bool MSTools;
bool Managed;
bool NsightTegra;
+ bool Android;
unsigned int NsightTegraVersion[4];
bool TargetCompileAsWinRT;
std::set<std::string> IPOEnabledConfigurations;
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index f4c2f2d4c7..55e941d947 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -33,7 +33,7 @@ void cmXCodeScheme::WriteXCodeSharedScheme(const std::string& xcProjDir,
// Create shared scheme sub-directory tree
//
std::string xcodeSchemeDir = cmStrCat(xcProjDir, "/xcshareddata/xcschemes");
- cmSystemTools::MakeDirectory(xcodeSchemeDir.c_str());
+ cmSystemTools::MakeDirectory(xcodeSchemeDir);
std::string xcodeSchemeFile =
cmStrCat(xcodeSchemeDir, '/', this->TargetName, ".xcscheme");
@@ -324,8 +324,7 @@ bool cmXCodeScheme::WriteLaunchActionBooleanAttribute(
bool defaultValue)
{
cmProp property = Target->GetTarget()->GetProperty(varName);
- bool isOn =
- (property == nullptr && defaultValue) || (property && cmIsOn(*property));
+ bool isOn = (property == nullptr && defaultValue) || cmIsOn(property);
if (isOn) {
xout.Attribute(attrName.c_str(), "YES");
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 162e807f14..1e688eded3 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -64,10 +64,6 @@
# include "cmVariableWatch.h"
#endif
-#if !defined(CMAKE_BOOTSTRAP)
-# define CMAKE_USE_ECLIPSE
-#endif
-
#if defined(__MINGW32__) && defined(CMAKE_BOOTSTRAP)
# define CMAKE_BOOT_MINGW
#endif
@@ -101,16 +97,13 @@
#if !defined(CMAKE_BOOTSTRAP)
# include "cmGlobalNinjaGenerator.h"
#endif
-#include "cmExtraCodeLiteGenerator.h"
-#if !defined(CMAKE_BOOT_MINGW)
+#if !defined(CMAKE_BOOTSTRAP)
# include "cmExtraCodeBlocksGenerator.h"
-#endif
-#include "cmExtraKateGenerator.h"
-#include "cmExtraSublimeTextGenerator.h"
-
-#ifdef CMAKE_USE_ECLIPSE
+# include "cmExtraCodeLiteGenerator.h"
# include "cmExtraEclipseCDT4Generator.h"
+# include "cmExtraKateGenerator.h"
+# include "cmExtraSublimeTextGenerator.h"
#endif
#if defined(__linux__) || defined(_WIN32)
@@ -201,7 +194,7 @@ cmake::cmake(Role role, cmState::Mode mode)
};
// The "c" extension MUST precede the "C" extension.
- setupExts(this->SourceFileExtensions,
+ setupExts(this->CLikeSourceFileExtensions,
{ "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" });
setupExts(this->HeaderFileExtensions,
{ "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" });
@@ -780,8 +773,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
std::cout << "Warn about uninitialized values.\n";
this->SetWarnUninitialized(true);
} else if (cmHasLiteralPrefix(arg, "--warn-unused-vars")) {
- std::cout << "Finding unused variables.\n";
- this->SetWarnUnused(true);
+ // Option was removed.
} else if (cmHasLiteralPrefix(arg, "--no-warn-unused-cli")) {
std::cout << "Not searching for unused variables given on the "
<< "command line.\n";
@@ -1137,13 +1129,9 @@ void cmake::AddDefaultExtraGenerators()
#if !defined(CMAKE_BOOTSTRAP)
this->ExtraGenerators.push_back(cmExtraCodeBlocksGenerator::GetFactory());
this->ExtraGenerators.push_back(cmExtraCodeLiteGenerator::GetFactory());
- this->ExtraGenerators.push_back(cmExtraSublimeTextGenerator::GetFactory());
- this->ExtraGenerators.push_back(cmExtraKateGenerator::GetFactory());
-
-# ifdef CMAKE_USE_ECLIPSE
this->ExtraGenerators.push_back(cmExtraEclipseCDT4Generator::GetFactory());
-# endif
-
+ this->ExtraGenerators.push_back(cmExtraKateGenerator::GetFactory());
+ this->ExtraGenerators.push_back(cmExtraSublimeTextGenerator::GetFactory());
#endif
}
@@ -1383,7 +1371,7 @@ struct SaveCacheEntry
int cmake::HandleDeleteCacheVariables(const std::string& var)
{
- std::vector<std::string> argsSplit = cmExpandedList(std::string(var), true);
+ std::vector<std::string> argsSplit = cmExpandedList(var, true);
// erase the property to avoid infinite recursion
this->State->SetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_", "");
if (this->State->GetIsInTryCompile()) {
@@ -1499,10 +1487,10 @@ int cmake::Configure()
this->Messenger->SetSuppressDeprecatedWarnings(value && cmIsOff(*value));
value = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED");
- this->Messenger->SetDeprecatedWarningsAsErrors(value && cmIsOn(*value));
+ this->Messenger->SetDeprecatedWarningsAsErrors(cmIsOn(value));
value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
- this->Messenger->SetSuppressDevWarnings(value && cmIsOn(*value));
+ this->Messenger->SetSuppressDevWarnings(cmIsOn(value));
value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS");
this->Messenger->SetDevWarningsAsErrors(value && cmIsOff(*value));
@@ -1970,6 +1958,17 @@ void cmake::AddGlobCacheEntry(bool recurse, bool listDirectories,
backtrace);
}
+std::vector<std::string> cmake::GetAllExtensions() const
+{
+ std::vector<std::string> allExt = this->CLikeSourceFileExtensions.ordered;
+ allExt.insert(allExt.end(), this->HeaderFileExtensions.ordered.begin(),
+ this->HeaderFileExtensions.ordered.end());
+ // cuda extensions are also in SourceFileExtensions so we ignore it here
+ allExt.insert(allExt.end(), this->FortranFileExtensions.ordered.begin(),
+ this->FortranFileExtensions.ordered.end());
+ return allExt;
+}
+
std::string cmake::StripExtension(const std::string& file) const
{
auto dotpos = file.rfind('.');
@@ -1979,7 +1978,7 @@ std::string cmake::StripExtension(const std::string& file) const
#else
auto ext = cm::string_view(file).substr(dotpos + 1);
#endif
- if (this->IsSourceExtension(ext) || this->IsHeaderExtension(ext)) {
+ if (this->IsAKnownExtension(ext)) {
return file.substr(0, dotpos);
}
}
@@ -2269,7 +2268,7 @@ int cmake::CheckBuildSystem()
if (this->ClearBuildSystem) {
// Get the generator used for this build system.
const char* genName = mf.GetDefinition("CMAKE_DEPENDS_GENERATOR");
- if (!genName || genName[0] == '\0') {
+ if (!cmNonempty(genName)) {
genName = "Unix Makefiles";
}
@@ -2743,9 +2742,7 @@ int cmake::Build(int jobs, const std::string& dir,
}
projName = *cachedProjectName;
- cmProp cachedVerbose =
- this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE");
- if (cachedVerbose && cmIsOn(*cachedVerbose)) {
+ if (cmIsOn(this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"))) {
verbose = true;
}
diff --git a/Source/cmake.h b/Source/cmake.h
index 086ec87658..0c4f429f01 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -264,44 +264,33 @@ public:
this->GeneratorToolsetSet = true;
}
- const std::vector<std::string>& GetSourceExtensions() const
+ bool IsAKnownSourceExtension(cm::string_view ext) const
{
- return this->SourceFileExtensions.ordered;
+ return this->CLikeSourceFileExtensions.Test(ext) ||
+ this->CudaFileExtensions.Test(ext) ||
+ this->FortranFileExtensions.Test(ext);
}
- bool IsSourceExtension(cm::string_view ext) const
+ bool IsACLikeSourceExtension(cm::string_view ext) const
{
- return this->SourceFileExtensions.Test(ext);
+ return this->CLikeSourceFileExtensions.Test(ext);
}
- const std::vector<std::string>& GetHeaderExtensions() const
- {
- return this->HeaderFileExtensions.ordered;
- }
-
- bool IsHeaderExtension(cm::string_view ext) const
- {
- return this->HeaderFileExtensions.Test(ext);
- }
-
- const std::vector<std::string>& GetCudaExtensions() const
+ bool IsAKnownExtension(cm::string_view ext) const
{
- return this->CudaFileExtensions.ordered;
+ return this->IsAKnownSourceExtension(ext) || this->IsAHeaderExtension(ext);
}
- bool IsCudaExtension(cm::string_view ext) const
- {
- return this->CudaFileExtensions.Test(ext);
- }
+ std::vector<std::string> GetAllExtensions() const;
- const std::vector<std::string>& GetFortranExtensions() const
+ const std::vector<std::string>& GetHeaderExtensions() const
{
- return this->FortranFileExtensions.ordered;
+ return this->HeaderFileExtensions.ordered;
}
- bool IsFortranExtension(cm::string_view ext) const
+ bool IsAHeaderExtension(cm::string_view ext) const
{
- return this->FortranFileExtensions.Test(ext);
+ return this->HeaderFileExtensions.Test(ext);
}
// Strips the extension (if present and known) from a filename
@@ -461,8 +450,6 @@ public:
bool GetWarnUninitialized() { return this->WarnUninitialized; }
void SetWarnUninitialized(bool b) { this->WarnUninitialized = b; }
- bool GetWarnUnused() { return this->WarnUnused; }
- void SetWarnUnused(bool b) { this->WarnUnused = b; }
bool GetWarnUnusedCli() { return this->WarnUnusedCli; }
void SetWarnUnusedCli(bool b) { this->WarnUnusedCli = b; }
bool GetCheckSystemVars() { return this->CheckSystemVars; }
@@ -616,7 +603,6 @@ private:
TraceFormat TraceFormatVar = TRACE_HUMAN;
cmGeneratedFileStream TraceFile;
bool WarnUninitialized = false;
- bool WarnUnused = false;
bool WarnUnusedCli = true;
bool CheckSystemVars = false;
std::map<std::string, bool> UsedCliVariables;
@@ -628,7 +614,7 @@ private:
std::string CheckStampList;
std::string VSSolutionFile;
std::string EnvironmentGenerator;
- FileExtensions SourceFileExtensions;
+ FileExtensions CLikeSourceFileExtensions;
FileExtensions HeaderFileExtensions;
FileExtensions CudaFileExtensions;
FileExtensions FortranFileExtensions;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index d662a9abca..7c66c5cbc9 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -3,11 +3,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cstring>
#include <iostream>
+#include <sstream>
#include <string>
#include <vector>
@@ -91,7 +93,6 @@ const char* cmDocumentationOptions[][2] = {
{ "--trace-redirect=<file>",
"Redirect trace output to a file instead of stderr." },
{ "--warn-uninitialized", "Warn about uninitialized values." },
- { "--warn-unused-vars", "Warn about unused variables." },
{ "--no-warn-unused-cli", "Don't warn about command line options." },
{ "--check-system-vars",
"Find problems with variable usage in system "
@@ -519,6 +520,121 @@ int do_build(int ac, char const* const* av)
#endif
}
+bool parse_default_directory_permissions(const std::string& permissions,
+ std::string& parsedPermissionsVar)
+{
+ std::vector<std::string> parsedPermissions;
+ enum Doing
+ {
+ DoingNone,
+ DoingOwner,
+ DoingGroup,
+ DoingWorld,
+ DoingOwnerAssignment,
+ DoingGroupAssignment,
+ DoingWorldAssignment,
+ };
+ Doing doing = DoingNone;
+
+ auto uniquePushBack = [&parsedPermissions](const std::string& e) {
+ if (std::find(parsedPermissions.begin(), parsedPermissions.end(), e) ==
+ parsedPermissions.end()) {
+ parsedPermissions.push_back(e);
+ }
+ };
+
+ for (auto const& e : permissions) {
+ switch (doing) {
+ case DoingNone:
+ if (e == 'u') {
+ doing = DoingOwner;
+ } else if (e == 'g') {
+ doing = DoingGroup;
+ } else if (e == 'o') {
+ doing = DoingWorld;
+ } else {
+ return false;
+ }
+ break;
+ case DoingOwner:
+ if (e == '=') {
+ doing = DoingOwnerAssignment;
+ } else {
+ return false;
+ }
+ break;
+ case DoingGroup:
+ if (e == '=') {
+ doing = DoingGroupAssignment;
+ } else {
+ return false;
+ }
+ break;
+ case DoingWorld:
+ if (e == '=') {
+ doing = DoingWorldAssignment;
+ } else {
+ return false;
+ }
+ break;
+ case DoingOwnerAssignment:
+ if (e == 'r') {
+ uniquePushBack("OWNER_READ");
+ } else if (e == 'w') {
+ uniquePushBack("OWNER_WRITE");
+ } else if (e == 'x') {
+ uniquePushBack("OWNER_EXECUTE");
+ } else if (e == ',') {
+ doing = DoingNone;
+ } else {
+ return false;
+ }
+ break;
+ case DoingGroupAssignment:
+ if (e == 'r') {
+ uniquePushBack("GROUP_READ");
+ } else if (e == 'w') {
+ uniquePushBack("GROUP_WRITE");
+ } else if (e == 'x') {
+ uniquePushBack("GROUP_EXECUTE");
+ } else if (e == ',') {
+ doing = DoingNone;
+ } else {
+ return false;
+ }
+ break;
+ case DoingWorldAssignment:
+ if (e == 'r') {
+ uniquePushBack("WORLD_READ");
+ } else if (e == 'w') {
+ uniquePushBack("WORLD_WRITE");
+ } else if (e == 'x') {
+ uniquePushBack("WORLD_EXECUTE");
+ } else if (e == ',') {
+ doing = DoingNone;
+ } else {
+ return false;
+ }
+ break;
+ }
+ }
+ if (doing != DoingOwnerAssignment && doing != DoingGroupAssignment &&
+ doing != DoingWorldAssignment) {
+ return false;
+ }
+
+ std::ostringstream oss;
+ for (auto i = 0u; i < parsedPermissions.size(); i++) {
+ if (i != 0) {
+ oss << ";";
+ }
+ oss << parsedPermissions[i];
+ }
+
+ parsedPermissionsVar = oss.str();
+ return true;
+}
+
int do_install(int ac, char const* const* av)
{
#ifdef CMAKE_BOOTSTRAP
@@ -529,6 +645,7 @@ int do_install(int ac, char const* const* av)
std::string config;
std::string component;
+ std::string defaultDirectoryPermissions;
std::string prefix;
std::string dir;
bool strip = false;
@@ -541,6 +658,7 @@ int do_install(int ac, char const* const* av)
DoingConfig,
DoingComponent,
DoingPrefix,
+ DoingDefaultDirectoryPermissions,
};
Doing doing = DoingDir;
@@ -559,6 +677,8 @@ int do_install(int ac, char const* const* av)
(strcmp(av[i], "-v") == 0)) {
verbose = true;
doing = DoingNone;
+ } else if (strcmp(av[i], "--default-directory-permissions") == 0) {
+ doing = DoingDefaultDirectoryPermissions;
} else {
switch (doing) {
case DoingDir:
@@ -577,6 +697,10 @@ int do_install(int ac, char const* const* av)
prefix = av[i];
doing = DoingNone;
break;
+ case DoingDefaultDirectoryPermissions:
+ defaultDirectoryPermissions = av[i];
+ doing = DoingNone;
+ break;
default:
std::cerr << "Unknown argument " << av[i] << std::endl;
dir.clear();
@@ -593,6 +717,8 @@ int do_install(int ac, char const* const* av)
" <dir> = Project binary directory to install.\n"
" --config <cfg> = For multi-configuration tools, choose <cfg>.\n"
" --component <comp> = Component-based install. Only install <comp>.\n"
+ " --default-directory-permissions <permission> \n"
+ " Default install permission. Use default permission <permission>.\n"
" --prefix <prefix> = The installation prefix CMAKE_INSTALL_PREFIX.\n"
" --strip = Performing install/strip.\n"
" -v --verbose = Enable verbose output.\n"
@@ -633,6 +759,18 @@ int do_install(int ac, char const* const* av)
args.emplace_back("-DCMAKE_INSTALL_CONFIG_NAME=" + config);
}
+ if (!defaultDirectoryPermissions.empty()) {
+ std::string parsedPermissionsVar;
+ if (!parse_default_directory_permissions(defaultDirectoryPermissions,
+ parsedPermissionsVar)) {
+ std::cerr << "--default-directory-permissions is in incorrect format"
+ << std::endl;
+ return 1;
+ }
+ args.emplace_back("-DCMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS=" +
+ parsedPermissionsVar);
+ }
+
args.emplace_back("-P");
args.emplace_back(dir + "/cmake_install.cmake");
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index de76d734ee..1a5fea1e33 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -126,6 +126,7 @@ void CMakeCommandUsage(const char* program)
<< " touch <file>... - touch a <file>.\n"
<< " touch_nocreate <file>... - touch a <file> but do not create it.\n"
<< " create_symlink old new - create a symbolic link new -> old\n"
+ << " create_hardlink old new - create a hard link new -> old\n"
<< " true - do nothing with an exit code of 0\n"
<< " false - do nothing with an exit code of 1\n"
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -582,12 +583,10 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
filesDiffer = cmsys::SystemTools::TextFilesDiffer(args[3], args[4]);
} else {
::CMakeCommandUsage(args[0].c_str());
- return 1;
+ return 2;
}
if (filesDiffer) {
- std::cerr << "Files \"" << args[args.size() - 2] << "\" to \""
- << args[args.size() - 1] << "\" are different.\n";
return 1;
}
return 0;
@@ -602,8 +601,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
}
cmsys::ifstream fin(args[3].c_str(), std::ios::in | std::ios::binary);
if (!fin) {
- std::cerr << "could not open object list file: " << args[3].c_str()
- << "\n";
+ std::cerr << "could not open object list file: " << args[3] << "\n";
return 1;
}
std::vector<std::string> files;
@@ -626,13 +624,12 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
}
FILE* fout = cmsys::SystemTools::Fopen(args[2], "w+");
if (!fout) {
- std::cerr << "could not open output .def file: " << args[2].c_str()
- << "\n";
+ std::cerr << "could not open output .def file: " << args[2] << "\n";
return 1;
}
bindexplib deffile;
if (args.size() >= 5) {
- auto a = args[4];
+ std::string const& a = args[4];
if (cmHasLiteralPrefix(a, "--nm=")) {
deffile.SetNmPath(a.substr(5));
std::cerr << a.substr(5) << "\n";
@@ -640,7 +637,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
std::cerr << "unknown argument: " << a << "\n";
}
}
- for (auto const& file : files) {
+ for (std::string const& file : files) {
std::string const& ext = cmSystemTools::GetFilenameLastExtension(file);
if (cmSystemTools::LowerCase(ext) == ".def") {
if (!deffile.AddDefinitionFile(file.c_str())) {
@@ -1022,7 +1019,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
// Command to create a symbolic link. Fails on platforms not
// supporting them.
if (args[1] == "create_symlink" && args.size() == 4) {
- const char* destinationFileName = args[3].c_str();
+ std::string const& destinationFileName = args[3];
if ((cmSystemTools::FileExists(destinationFileName) ||
cmSystemTools::FileIsSymlink(destinationFileName)) &&
!cmSystemTools::RemoveFile(destinationFileName)) {
@@ -1038,6 +1035,34 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 0;
}
+ // Command to create a hard link. Fails on platforms not
+ // supporting them.
+ if (args[1] == "create_hardlink" && args.size() == 4) {
+ const char* SouceFileName = args[2].c_str();
+ const char* destinationFileName = args[3].c_str();
+
+ if (!cmSystemTools::FileExists(SouceFileName)) {
+ std::cerr << "failed to create hard link because source path '"
+ << SouceFileName << "' does not exist \n";
+ return 1;
+ }
+
+ if ((cmSystemTools::FileExists(destinationFileName) ||
+ cmSystemTools::FileIsSymlink(destinationFileName)) &&
+ !cmSystemTools::RemoveFile(destinationFileName)) {
+ std::string emsg = cmSystemTools::GetLastSystemError();
+ std::cerr << "failed to create hard link '" << destinationFileName
+ << "' because existing path cannot be removed: " << emsg
+ << "\n";
+ return 1;
+ }
+
+ if (!cmSystemTools::CreateLink(args[2], args[3])) {
+ return 1;
+ }
+ return 0;
+ }
+
// Command to do nothing with an exit code of 0.
if (args[1] == "true") {
return 0;
@@ -1379,15 +1404,12 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
#if defined(_WIN32) && !defined(__CYGWIN__)
// Write registry value
if (args[1] == "write_regv" && args.size() > 3) {
- return cmSystemTools::WriteRegistryValue(args[2].c_str(),
- args[3].c_str())
- ? 0
- : 1;
+ return cmSystemTools::WriteRegistryValue(args[2], args[3]) ? 0 : 1;
}
// Delete registry value
if (args[1] == "delete_regv" && args.size() > 2) {
- return cmSystemTools::DeleteRegistryValue(args[2].c_str()) ? 0 : 1;
+ return cmSystemTools::DeleteRegistryValue(args[2]) ? 0 : 1;
}
// Remove file
diff --git a/Source/kwsys/Glob.hxx.in b/Source/kwsys/Glob.hxx.in
index b5a34d59a1..e8474e2001 100644
--- a/Source/kwsys/Glob.hxx.in
+++ b/Source/kwsys/Glob.hxx.in
@@ -126,8 +126,8 @@ protected:
bool RecurseListDirs;
private:
- Glob(const Glob&); // Not implemented.
- void operator=(const Glob&); // Not implemented.
+ Glob(const Glob&) = delete;
+ void operator=(const Glob&) = delete;
};
} // namespace @KWSYS_NAMESPACE@
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index cc4552913d..e1e7721b41 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -2128,17 +2128,17 @@ static void kwsysProcessSetExitExceptionByIndex(kwsysProcess* cp, int sig,
#endif
#ifdef SIGABRT
case SIGABRT:
- KWSYSPE_CASE(Other, "Child aborted");
+ KWSYSPE_CASE(Other, "Subprocess aborted");
break;
#endif
#ifdef SIGKILL
case SIGKILL:
- KWSYSPE_CASE(Other, "Child killed");
+ KWSYSPE_CASE(Other, "Subprocess killed");
break;
#endif
#ifdef SIGTERM
case SIGTERM:
- KWSYSPE_CASE(Other, "Child terminated");
+ KWSYSPE_CASE(Other, "Subprocess terminated");
break;
#endif
#ifdef SIGHUP
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 25705ea287..2c39b916d5 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1453,7 +1453,7 @@ bool SystemTools::PathCygwinToWin32(const char* path, char* win32_path)
bool SystemTools::Touch(const std::string& filename, bool create)
{
- if (!SystemTools::PathExists(filename)) {
+ if (!SystemTools::FileExists(filename)) {
if (create) {
FILE* file = Fopen(filename, "a+b");
if (file) {
diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c
index 0c658f566e..eed770cd85 100644
--- a/Source/kwsys/testProcess.c
+++ b/Source/kwsys/testProcess.c
@@ -450,24 +450,25 @@ static int runChild2(kwsysProcess* kp, const char* cmd[], int state,
printf("The process is still executing.\n");
break;
case kwsysProcess_State_Expired:
- printf("Child was killed when timeout expired.\n");
+ printf("Subprocess was killed when timeout expired.\n");
break;
case kwsysProcess_State_Exited:
- printf("Child exited with value = %d\n", kwsysProcess_GetExitValue(kp));
+ printf("Subprocess exited with value = %d\n",
+ kwsysProcess_GetExitValue(kp));
result = ((exception != kwsysProcess_GetExitException(kp)) ||
(value != kwsysProcess_GetExitValue(kp)));
break;
case kwsysProcess_State_Killed:
- printf("Child was killed by parent.\n");
+ printf("Subprocess was killed by parent.\n");
break;
case kwsysProcess_State_Exception:
- printf("Child terminated abnormally: %s\n",
+ printf("Subprocess terminated abnormally: %s\n",
kwsysProcess_GetExceptionString(kp));
result = ((exception != kwsysProcess_GetExitException(kp)) ||
(value != kwsysProcess_GetExitValue(kp)));
break;
case kwsysProcess_State_Disowned:
- printf("Child was disowned.\n");
+ printf("Subprocess was disowned.\n");
break;
case kwsysProcess_State_Error:
printf("Error in administrating child process: [%s]\n",
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 1d3461443a..cfa420df49 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -422,6 +422,28 @@ static bool CheckFileOperations()
res = false;
}
+#if !defined(_WIN32)
+ std::string const testBadSymlink(testNewDir + "/badSymlink.txt");
+ std::string const testBadSymlinkTgt(testNewDir + "/missing/symlinkTgt.txt");
+ if (!kwsys::SystemTools::CreateSymlink(testBadSymlinkTgt, testBadSymlink)) {
+ std::cerr << "Problem with CreateSymlink for: " << testBadSymlink << " -> "
+ << testBadSymlinkTgt << std::endl;
+ res = false;
+ }
+
+ if (!kwsys::SystemTools::Touch(testBadSymlink, false)) {
+ std::cerr << "Problem with Touch (no create) for: " << testBadSymlink
+ << std::endl;
+ res = false;
+ }
+#endif
+
+ if (!kwsys::SystemTools::Touch(testNewDir, false)) {
+ std::cerr << "Problem with Touch (no create) for: " << testNewDir
+ << std::endl;
+ res = false;
+ }
+
kwsys::SystemTools::Touch(testNewFile, true);
if (!kwsys::SystemTools::RemoveADirectory(testNewDir)) {
std::cerr << "Problem with RemoveADirectory for: " << testNewDir
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index bb50d76f04..0b2c8f6c2a 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -29,6 +29,9 @@ set(CMakeLib_TESTS
testCMExtMemory.cxx
testCMExtAlgorithm.cxx
)
+if (CMake_TEST_FILESYSTEM_PATH OR NOT CMake_HAVE_CXX_FILESYSTEM)
+ list(APPEND CMakeLib_TESTS testCMFilesystemPath.cxx)
+endif()
add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx)
diff --git a/Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt b/Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt
index 7c84ee1665..4bef6c5e05 100644
--- a/Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt
+++ b/Tests/CMakeLib/PseudoMemcheck/CMakeLists.txt
@@ -15,6 +15,9 @@ target_link_libraries(pseudo_purify CMakeLib)
add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx")
set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC)
target_link_libraries(pseudo_BC CMakeLib)
+add_executable(pseudo_cuda-memcheck "${CMAKE_CURRENT_BINARY_DIR}/ret0.cxx")
+set_target_properties(pseudo_cuda-memcheck PROPERTIES OUTPUT_NAME cuda-memcheck)
+target_link_libraries(pseudo_cuda-memcheck CMakeLib)
# binary to be used as pre- and post-memcheck command that fails
add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.cxx")
diff --git a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
index 3183bc0b6b..f37ad59648 100644
--- a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
+++ b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
@@ -1,8 +1,14 @@
-#include <cmSystemTools.h>
-#include "cmsys/Encoding.hxx"
#include <string>
+#include <vector>
+
+#include "cmsys/Encoding.hxx"
+
+#include <cmSystemTools.h>
+// clang-format off
#define RETVAL @_retval@
+#define CMAKE_COMMAND "@CMAKE_COMMAND@"
+// clang-format on
int main(int ac, char** av)
{
@@ -14,6 +20,9 @@ int main(int ac, char** av)
std::string exename = argv[0];
std::string logarg;
bool nextarg = false;
+ // execute the part after the last argument?
+ // the logfile path gets passed as environment variable PSEUDO_LOGFILE
+ bool exec = false;
if (exename.find("valgrind") != std::string::npos) {
logarg = "--log-file=";
@@ -26,6 +35,10 @@ int main(int ac, char** av)
} else if (exename.find("BC") != std::string::npos) {
nextarg = true;
logarg = "/X";
+ } else if (exename.find("cuda-memcheck") != std::string::npos) {
+ nextarg = true;
+ exec = true;
+ logarg = "--log-file";
}
if (!logarg.empty()) {
@@ -45,8 +58,25 @@ int main(int ac, char** av)
}
}
+ // find the last argument position
+ int lastarg_pos = 1;
+ for (int i = 1; i < argc; ++i) {
+ std::string arg = argv[i];
+ if (arg.find("--") == 0) {
+ lastarg_pos = i;
+ }
+ }
+
if (!logfile.empty()) {
cmSystemTools::Touch(logfile, true);
+ // execute everything after the last argument with additional environment
+ int callarg_pos = lastarg_pos + (nextarg ? 2 : 1);
+ if (exec && callarg_pos < argc) {
+ std::vector<std::string> callargs{ CMAKE_COMMAND, "-E", "env",
+ "PSEUDO_LOGFILE=" + logfile };
+ callargs.insert(callargs.end(), &argv[callarg_pos], &argv[argc]);
+ cmSystemTools::RunSingleCommand(callargs);
+ }
}
}
diff --git a/Tests/CMakeLib/testCMExtMemory.cxx b/Tests/CMakeLib/testCMExtMemory.cxx
index 6663c17d8d..2aeaf7f84c 100644
--- a/Tests/CMakeLib/testCMExtMemory.cxx
+++ b/Tests/CMakeLib/testCMExtMemory.cxx
@@ -13,7 +13,7 @@ public:
class Derived : public Base
{
public:
- ~Derived() = default;
+ ~Derived() override = default;
void method() {}
};
diff --git a/Tests/CMakeLib/testCMFilesystemPath.cxx b/Tests/CMakeLib/testCMFilesystemPath.cxx
new file mode 100644
index 0000000000..1e8452043a
--- /dev/null
+++ b/Tests/CMakeLib/testCMFilesystemPath.cxx
@@ -0,0 +1,1006 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include <algorithm>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include <cm/filesystem>
+#include <cm/iomanip>
+
+namespace {
+
+namespace fs = cm::filesystem;
+
+void checkResult(bool success)
+{
+ if (!success) {
+ std::cout << " => failed";
+ }
+ std::cout << std::endl;
+}
+
+bool testConstructors()
+{
+ std::cout << "testConstructors()";
+
+ bool result = true;
+
+ {
+ fs::path p;
+ if (p != fs::path()) {
+ result = false;
+ }
+ }
+ {
+ fs::path p1("/a/b/c");
+ fs::path p2("/a/b/c");
+ if (p1 != p2) {
+ result = false;
+ }
+ if (p1.string() != p2.string()) {
+ result = false;
+ }
+ if (p1.string() != "/a/b/c") {
+ result = false;
+ }
+ }
+ {
+ std::string s("/a/b/c");
+ fs::path p1(s);
+ fs::path p2(s.begin(), s.end());
+ if (p1 != p2) {
+ result = false;
+ }
+ if (p1.string() != s || p2.string() != s) {
+ result = false;
+ }
+#if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR
+ std::string s2(s);
+ s2 += '\0';
+ fs::path p3(s2.begin());
+ if (p1 != p3 || p3.string() != s) {
+ result = false;
+ }
+#endif
+ }
+ {
+ std::wstring s(L"/a/b/c");
+ fs::path p1(s);
+ fs::path p2(s.begin(), s.end());
+ if (p1 != p2) {
+ result = false;
+ }
+ if (p1.wstring() != s || p2.wstring() != s) {
+ result = false;
+ }
+#if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR
+ std::wstring s2(s);
+ s2 += L'\0';
+ fs::path p3(s2.begin());
+ if (p1 != p3 || p3.wstring() != s) {
+ result = false;
+ }
+#endif
+ }
+ {
+ std::string s("/a/b/c");
+ fs::path::string_type ws;
+ for (auto c : s) {
+ ws += fs::path::value_type(c);
+ }
+ fs::path p1(ws);
+ fs::path p2(ws.begin(), ws.end());
+ if (p1 != p2) {
+ result = false;
+ }
+ if (p1.native() != ws || p2.native() != ws) {
+ result = false;
+ }
+#if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR
+ fs::path::string_type ws2(ws);
+ ws2 += fs::path::value_type('\0');
+ fs::path p3(ws2.begin());
+ if (p1 != p3 || p3.native() != ws) {
+ result = false;
+ }
+#endif
+ }
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testConcatenation()
+{
+ std::cout << "testConcatenation()";
+
+ bool result = true;
+
+ {
+ fs::path p("/a/b");
+ p /= "c";
+ if (!(p.string() == "/a/b/c" || p.string() == "/a/b\\c")) {
+ result = false;
+ }
+ p += "d";
+ if (!(p.string() == "/a/b/cd" || p.string() == "/a/b\\cd")) {
+ result = false;
+ }
+ fs::path p2("x/y");
+ p /= p2;
+ if (!(p.string() == "/a/b/cd/x/y" || p.string() == "/a/b\\cd\\x/y")) {
+ result = false;
+ }
+ p = p / p2;
+ if (!(p.string() == "/a/b/cd/x/y/x/y" ||
+ p.string() == "/a/b\\cd\\x/y\\x/y")) {
+ result = false;
+ }
+ }
+ {
+ fs::path p("a");
+ p /= "";
+ if (!(p.string() == "a/" || p.string() == "a\\")) {
+ result = false;
+ }
+ p /= "/b";
+ if (p.string() != "/b") {
+ result = false;
+ }
+ }
+#if defined(_WIN32)
+ {
+ fs::path p("a");
+ p /= "c:/b";
+ if (p.string() != "c:/b") {
+ result = false;
+ }
+ p = fs::path("a") / "c:";
+ if (p.string() != "c:") {
+ result = false;
+ }
+ p = fs::path("c:") / "";
+ if (p.string() != "c:") {
+ result = false;
+ }
+ p = fs::path("c:a") / "/b";
+ if (p.string() != "c:/b") {
+ result = false;
+ }
+ p = fs::path("c:a") / "c:b";
+ if (p.string() != "c:a\\b") {
+ result = false;
+ }
+ p = fs::path("//host") / "b";
+ if (p.string() != "//host\\b") {
+ result = false;
+ }
+ p = fs::path("//host/") / "b";
+ if (p.string() != "//host/b") {
+ result = false;
+ }
+ }
+#endif
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testModifiers()
+{
+ std::cout << "testModifiers()";
+
+ bool result = true;
+
+ {
+ std::string s("a///b/");
+ fs::path p(s);
+ std::replace(
+ s.begin(), s.end(), '/',
+ static_cast<std::string::value_type>(fs::path::preferred_separator));
+ p.make_preferred();
+ if (p.string() != s) {
+ result = false;
+ }
+ }
+ {
+ fs::path p("a/b/c.e.f");
+ p.remove_filename();
+ if (p.string() != "a/b/") {
+ result = false;
+ }
+ p.remove_filename();
+ if (p.string() != "a/b/") {
+ result = false;
+ }
+ }
+ {
+ fs::path p("a/b/c.e.f");
+ p.replace_filename("x.y");
+ if (p.string() != "a/b/x.y") {
+ result = false;
+ }
+ }
+ {
+ fs::path p("a/b/c.e.f");
+ p.replace_extension(".x");
+ if (p.string() != "a/b/c.e.x") {
+ result = false;
+ }
+ p.replace_extension(".y");
+ if (p.string() != "a/b/c.e.y") {
+ result = false;
+ }
+ p.replace_extension();
+ if (p.string() != "a/b/c.e") {
+ result = false;
+ }
+ p = "/a/b";
+ p.replace_extension(".x");
+ if (p.string() != "/a/b.x") {
+ result = false;
+ }
+ p = "/a/b/";
+ p.replace_extension(".x");
+ if (p.string() != "/a/b/.x") {
+ result = false;
+ }
+ }
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testObservers()
+{
+ std::cout << "testObservers()";
+
+ bool result = true;
+
+ {
+ std::string s("a/b/c");
+ fs::path p(s);
+ fs::path::string_type st;
+ for (auto c : s) {
+ st += static_cast<fs::path::value_type>(c);
+ }
+ if (p.native() != st || static_cast<fs::path::string_type>(p) != st ||
+ p.c_str() != st) {
+ result = false;
+ }
+ }
+ {
+ std::string s("a//b//c");
+ std::wstring ws(L"a//b//c");
+ fs::path p(s);
+ if (p.string() != s || p.wstring() != ws) {
+ result = false;
+ }
+ }
+ {
+ std::string s("a/b/c");
+ std::wstring ws;
+ for (auto c : s) {
+ ws += static_cast<std::wstring::value_type>(c);
+ }
+ std::string ns(s);
+ std::replace(
+ ns.begin(), ns.end(), '/',
+ static_cast<std::string::value_type>(fs::path::preferred_separator));
+ fs::path p(ns);
+ if (p.generic_string() != s || p.generic_wstring() != ws) {
+ result = false;
+ }
+ }
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testCompare()
+{
+ std::cout << "testCompare()";
+
+ bool result = true;
+
+ {
+ std::string s("a/b/c");
+ fs::path p1(s);
+ fs::path p2(s);
+ if (p1.compare(p2) != 0) {
+ result = false;
+ }
+ p2 = "a/b";
+ if (p1.compare(p2) <= 0) {
+ result = false;
+ }
+ p2 = "a/d";
+ if (p1.compare(p2) >= 0) {
+ result = false;
+ }
+ p2 = "a/b/d";
+ if (p1.compare(p2) >= 0) {
+ result = false;
+ }
+ p2 = "a/b/a";
+ if (p1.compare(p2) <= 0) {
+ result = false;
+ }
+ p2 = "a/b/c/d";
+ if (p1.compare(p2) >= 0) {
+ result = false;
+ }
+ p1 = "a";
+ p2 = "b";
+ if (p1.compare(p2) == 0) {
+ result = false;
+ }
+ }
+ {
+ // LWG 3096 (https://cplusplus.github.io/LWG/issue3096)
+ // fs::path p1("/a/");
+ // fs::path p2("/a/.");
+ // if (p1.compare(p2) != 0) {
+ // result = false;
+ // }
+ }
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testGeneration()
+{
+ std::cout << "testGeneration()";
+
+ bool result = true;
+
+ {
+ fs::path p("a/./b/..");
+ if (p.lexically_normal().generic_string() != "a/") {
+ result = false;
+ }
+ p = "a/.///b/../";
+ if (p.lexically_normal().generic_string() != "a/") {
+ result = false;
+ }
+ }
+#if defined(_WIN32)
+ {
+ fs::path p("//host/./b/..");
+ if (p.lexically_normal().string() != "\\\\host\\") {
+ result = false;
+ }
+ p = "//host/.///b/../";
+ if (p.lexically_normal().string() != "\\\\host\\") {
+ result = false;
+ }
+ p = "c://a/.///b/../";
+ if (p.lexically_normal().string() != "c:\\a\\") {
+ result = false;
+ }
+ }
+#endif
+
+ {
+ if (fs::path("/a//d").lexically_relative("/a/b/c") != "../../d") {
+ result = false;
+ }
+ if (fs::path("/a//b///c").lexically_relative("/a/d") != "../b/c") {
+ result = false;
+ }
+ if (fs::path("a/b/c").lexically_relative("a") != "b/c") {
+ result = false;
+ }
+ if (fs::path("a/b/c").lexically_relative("a/b/c/x/y") != "../..") {
+ result = false;
+ }
+ if (fs::path("a/b/c").lexically_relative("a/b/c") != ".") {
+ result = false;
+ }
+ if (fs::path("a/b").lexically_relative("c/d") != "../../a/b") {
+ result = false;
+ }
+ }
+ {
+#if defined(_WIN32)
+ if (fs::path("/a/d").lexically_relative("e/d/c") != "/a/d") {
+ result = false;
+ }
+ if (!fs::path("c:/a/d").lexically_relative("e/d/c").empty()) {
+ result = false;
+ }
+#else
+ if (!fs::path("/a/d").lexically_relative("e/d/c").empty()) {
+ result = false;
+ }
+#endif
+ }
+ {
+#if defined(_WIN32)
+ if (fs::path("c:/a/d").lexically_proximate("e/d/c") != "c:/a/d") {
+ result = false;
+ }
+#else
+ if (fs::path("/a/d").lexically_proximate("e/d/c") != "/a/d") {
+ result = false;
+ }
+#endif
+ if (fs::path("/a/d").lexically_proximate("/a/b/c") != "../../d") {
+ result = false;
+ }
+ }
+ // LWG 3070
+ {
+#if defined(_WIN32)
+ if (!fs::path("/a:/b:").lexically_relative("/a:/c:").empty()) {
+ result = false;
+ }
+ if (fs::path("c:/a/b").lexically_relative("c:/a/d") != "../b") {
+ result = false;
+ }
+ if (!fs::path("c:/a/b:").lexically_relative("c:/a/d").empty()) {
+ result = false;
+ }
+ if (!fs::path("c:/a/b").lexically_relative("c:/a/d:").empty()) {
+ result = false;
+ }
+#else
+ if (fs::path("/a:/b:").lexically_relative("/a:/c:") != "../b:") {
+ result = false;
+ }
+#endif
+ }
+ // LWG 3096
+ {
+ if (fs::path("/a").lexically_relative("/a/.") != ".") {
+ result = false;
+ }
+ if (fs::path("/a").lexically_relative("/a/") != ".") {
+ result = false;
+ }
+ if (fs::path("a/b/c").lexically_relative("a/b/c") != ".") {
+ result = false;
+ }
+ if (fs::path("a/b/c").lexically_relative("a/b/c/") != ".") {
+ result = false;
+ }
+ if (fs::path("a/b/c").lexically_relative("a/b/c/.") != ".") {
+ result = false;
+ }
+ if (fs::path("a/b/c/").lexically_relative("a/b/c") != ".") {
+ result = false;
+ }
+ if (fs::path("a/b/c/.").lexically_relative("a/b/c") != ".") {
+ result = false;
+ }
+ if (fs::path("a/b/c/.").lexically_relative("a/b/c/") != ".") {
+ result = false;
+ }
+ }
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testDecomposition()
+{
+ std::cout << "testDecomposition()";
+
+ bool result = true;
+
+ {
+ if (!fs::path("/a/b").root_name().empty()) {
+ result = false;
+ }
+#if defined(_WIN32)
+ if (fs::path("c:/a/b").root_name() != "c:") {
+ result = false;
+ }
+ if (fs::path("c:a/b").root_name() != "c:") {
+ result = false;
+ }
+ if (fs::path("c:").root_name() != "c:") {
+ result = false;
+ }
+ if (fs::path("//host/b").root_name() != "//host") {
+ result = false;
+ }
+ if (fs::path("//host").root_name() != "//host") {
+ result = false;
+ }
+#endif
+ }
+ {
+ if (!fs::path("a/b").root_directory().empty()) {
+ result = false;
+ }
+ if (fs::path("/a/b").root_directory() != "/") {
+ result = false;
+ }
+#if defined(_WIN32)
+ if (!fs::path("c:a/b").root_directory().empty()) {
+ result = false;
+ }
+ if (fs::path("/a/b").root_directory() != "/") {
+ result = false;
+ }
+ if (fs::path("c:/a/b").root_directory() != "/") {
+ result = false;
+ }
+ if (fs::path("//host/b").root_directory() != "/") {
+ result = false;
+ }
+#endif
+ }
+ {
+ if (!fs::path("a/b").root_path().empty()) {
+ result = false;
+ }
+ if (fs::path("/a/b").root_path() != "/") {
+ result = false;
+ }
+#if defined(_WIN32)
+ if (fs::path("c:a/b").root_path() != "c:") {
+ result = false;
+ }
+ if (fs::path("/a/b").root_path() != "/") {
+ result = false;
+ }
+ if (fs::path("c:/a/b").root_path() != "c:/") {
+ result = false;
+ }
+ if (fs::path("//host/b").root_path() != "//host/") {
+ result = false;
+ }
+#endif
+ }
+ {
+ if (!fs::path("/").relative_path().empty()) {
+ result = false;
+ }
+ if (fs::path("a/b").relative_path() != "a/b") {
+ result = false;
+ }
+ if (fs::path("/a/b").relative_path() != "a/b") {
+ result = false;
+ }
+#if defined(_WIN32)
+ if (fs::path("c:a/b").relative_path() != "a/b") {
+ result = false;
+ }
+ if (fs::path("/a/b").relative_path() != "a/b") {
+ result = false;
+ }
+ if (fs::path("c:/a/b").relative_path() != "a/b") {
+ result = false;
+ }
+ if (fs::path("//host/b").relative_path() != "b") {
+ result = false;
+ }
+#endif
+ }
+ {
+ if (fs::path("/a/b").parent_path() != "/a") {
+ result = false;
+ }
+ if (fs::path("/a/b/").parent_path() != "/a/b") {
+ result = false;
+ }
+ if (fs::path("/a/b/.").parent_path() != "/a/b") {
+ result = false;
+ }
+ if (fs::path("/").parent_path() != "/") {
+ result = false;
+ }
+#if defined(_WIN32)
+ if (fs::path("c:/a/b").parent_path() != "c:/a") {
+ result = false;
+ }
+ if (fs::path("c:/").parent_path() != "c:/") {
+ result = false;
+ }
+ if (fs::path("c:").parent_path() != "c:") {
+ result = false;
+ }
+ if (fs::path("//host/").parent_path() != "//host/") {
+ result = false;
+ }
+ if (fs::path("//host").parent_path() != "//host") {
+ result = false;
+ }
+#endif
+ }
+ {
+ if (fs::path("/a/b.txt").filename() != "b.txt") {
+ result = false;
+ }
+ if (fs::path("/a/.b").filename() != ".b") {
+ result = false;
+ }
+ if (fs::path("/foo/bar/").filename() != "") {
+ result = false;
+ }
+ if (fs::path("/foo/.").filename() != ".") {
+ result = false;
+ }
+ if (fs::path("/foo/..").filename() != "..") {
+ result = false;
+ }
+ if (fs::path(".").filename() != ".") {
+ result = false;
+ }
+ if (fs::path("..").filename() != "..") {
+ result = false;
+ }
+ if (!fs::path("/").filename().empty()) {
+ result = false;
+ }
+#if defined(_WIN32)
+ if (fs::path("c:a").filename() != "a") {
+ result = false;
+ }
+ if (fs::path("c:/a").filename() != "a") {
+ result = false;
+ }
+ if (!fs::path("c:").filename().empty()) {
+ result = false;
+ }
+ if (!fs::path("c:/").filename().empty()) {
+ result = false;
+ }
+ if (!fs::path("//host").filename().empty()) {
+ result = false;
+ }
+#endif
+ }
+ {
+ if (fs::path("/a/b.txt").stem() != "b") {
+ result = false;
+ }
+ if (fs::path("/a/b.c.txt").stem() != "b.c") {
+ result = false;
+ }
+ if (fs::path("/a/.b").stem() != ".b") {
+ result = false;
+ }
+ if (fs::path("/a/b").stem() != "b") {
+ result = false;
+ }
+ if (fs::path("/a/b/.").stem() != ".") {
+ result = false;
+ }
+ if (fs::path("/a/b/..").stem() != "..") {
+ result = false;
+ }
+ if (!fs::path("/a/b/").stem().empty()) {
+ result = false;
+ }
+#if defined(_WIN32)
+ if (!fs::path("c:/a/b/").stem().empty()) {
+ result = false;
+ }
+ if (!fs::path("c:/").stem().empty()) {
+ result = false;
+ }
+ if (!fs::path("c:").stem().empty()) {
+ result = false;
+ }
+ if (!fs::path("//host/").stem().empty()) {
+ result = false;
+ }
+ if (!fs::path("//host").stem().empty()) {
+ result = false;
+ }
+#endif
+ }
+ {
+ if (fs::path("/a/b.txt").extension() != ".txt") {
+ result = false;
+ }
+ if (fs::path("/a/b.").extension() != ".") {
+ result = false;
+ }
+ if (!fs::path("/a/b").extension().empty()) {
+ result = false;
+ }
+ if (fs::path("/a/b.txt/b.cc").extension() != ".cc") {
+ result = false;
+ }
+ if (fs::path("/a/b.txt/b.").extension() != ".") {
+ result = false;
+ }
+ if (!fs::path("/a/b.txt/b").extension().empty()) {
+ result = false;
+ }
+ if (!fs::path("/a/.").extension().empty()) {
+ result = false;
+ }
+ if (!fs::path("/a/..").extension().empty()) {
+ result = false;
+ }
+ if (!fs::path("/a/.hidden").extension().empty()) {
+ result = false;
+ }
+ if (fs::path("/a/..b").extension() != ".b") {
+ result = false;
+ }
+ }
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testQueries()
+{
+ std::cout << "testQueries()";
+
+ bool result = true;
+
+ {
+ if (fs::path("/a/b").has_root_name()) {
+ result = false;
+ }
+ fs::path p("/a/b");
+ if (!p.has_root_directory() || !p.has_root_path()) {
+ result = false;
+ }
+ if (!fs::path("/a/b").has_root_path() || fs::path("a/b").has_root_path()) {
+ result = false;
+ }
+ if (!fs::path("/a/b").has_relative_path() ||
+ fs::path("/").has_relative_path()) {
+ result = false;
+ }
+ if (!fs::path("/a/b").has_parent_path() ||
+ !fs::path("/").has_parent_path() || fs::path("a").has_parent_path()) {
+ result = false;
+ }
+ if (!fs::path("/a/b").has_filename() || !fs::path("a.b").has_filename() ||
+ fs::path("/a/").has_filename() || fs::path("/").has_filename()) {
+ result = false;
+ }
+ if (!fs::path("/a/b").has_stem() || !fs::path("a.b").has_stem() ||
+ !fs::path("/.a").has_stem() || fs::path("/a/").has_stem() ||
+ fs::path("/").has_stem()) {
+ result = false;
+ }
+ if (!fs::path("/a/b.c").has_extension() ||
+ !fs::path("a.b").has_extension() || fs::path("/.a").has_extension() ||
+ fs::path("/a/").has_extension() || fs::path("/").has_extension()) {
+ result = false;
+ }
+#if defined(_WIN32)
+ p = "c:/a/b";
+ if (!fs::path("c:/a/b").has_root_name() || !p.has_root_directory() ||
+ !p.has_root_path()) {
+ result = false;
+ }
+ p = "c:a/b";
+ if (!p.has_root_name() || p.has_root_directory() || !p.has_root_path()) {
+ result = false;
+ }
+ p = "//host/b";
+ if (!p.has_root_name() || !p.has_root_directory() || !p.has_root_path()) {
+ result = false;
+ }
+ p = "//host";
+ if (!p.has_root_name() || p.has_root_directory() || !p.has_root_path()) {
+ result = false;
+ }
+ if (!fs::path("c:/a/b").has_relative_path() ||
+ !fs::path("c:a/b").has_relative_path() ||
+ !fs::path("//host/b").has_relative_path()) {
+ result = false;
+ }
+ if (!fs::path("c:/a/b").has_parent_path() ||
+ !fs::path("c:/").has_parent_path() ||
+ !fs::path("c:").has_parent_path() ||
+ !fs::path("//host/").has_parent_path() ||
+ !fs::path("//host").has_parent_path()) {
+ result = false;
+ }
+#endif
+ }
+ {
+#if defined(_WIN32)
+ fs::path p("c:/a");
+#else
+ fs::path p("/a");
+#endif
+ if (!p.is_absolute() || p.is_relative()) {
+ result = false;
+ }
+ p = "a/b";
+ if (p.is_absolute() || !p.is_relative()) {
+ result = false;
+ }
+#if defined(_WIN32)
+ p = "c:/a/b";
+ if (!p.is_absolute() || p.is_relative()) {
+ result = false;
+ }
+ p = "//host/b";
+ if (!p.is_absolute() || p.is_relative()) {
+ result = false;
+ }
+ p = "/a";
+ if (p.is_absolute() || !p.is_relative()) {
+ result = false;
+ }
+ p = "c:a";
+ if (p.is_absolute() || !p.is_relative()) {
+ result = false;
+ }
+#endif
+ }
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testIterators()
+{
+ std::cout << "testIterators()";
+
+ bool result = true;
+
+ {
+ fs::path p("/a/b/");
+#if defined(_WIN32)
+ std::vector<fs::path::string_type> ref{ L"/", L"a", L"b", L"" };
+#else
+ std::vector<fs::path::string_type> ref{ "/", "a", "b", "" };
+#endif
+ std::vector<fs::path::string_type> res;
+ for (auto i = p.begin(), e = p.end(); i != e; ++i) {
+ res.push_back(*i);
+ }
+ if (res != ref) {
+ result = false;
+ }
+ res.clear();
+ for (const auto& e : p) {
+ res.push_back(e);
+ }
+ if (res != ref) {
+ result = false;
+ }
+ }
+ {
+ fs::path p("/a/b/");
+#if defined(_WIN32)
+ std::vector<fs::path::string_type> ref{ L"", L"b", L"a", L"/" };
+#else
+ std::vector<fs::path::string_type> ref{ "", "b", "a", "/" };
+#endif
+ std::vector<fs::path::string_type> res;
+ auto i = p.end(), b = p.begin();
+ do {
+ res.push_back(*--i);
+ } while (i != b);
+ if (res != ref) {
+ result = false;
+ }
+ }
+
+ checkResult(result);
+
+ return result;
+}
+
+bool testNonMemberFunctions()
+{
+ std::cout << "testNonMemberFunctions()";
+
+ bool result = true;
+
+ {
+ fs::path p1("/a/b/");
+ fs::path p2("/c/d");
+ fs::swap(p1, p2);
+ if (p1.string() != "/c/d" || p2.string() != "/a/b/")
+ result = false;
+ }
+ {
+ auto h1 = fs::hash_value(fs::path("/a//b//"));
+ auto h2 = fs::hash_value(fs::path("/a/b/"));
+ if (h1 != h2)
+ result = false;
+ }
+ {
+ fs::path p1("/a/b/");
+ fs::path p2("/c/d");
+ if (p1 == p2)
+ result = false;
+ p1 = "/a//b//";
+ p2 = "/a/b/";
+ if (p1 != p2)
+ result = false;
+ }
+ {
+ fs::path p = "/a";
+ p = p / "b" / "c";
+ if (p.generic_string() != "/a/b/c") {
+ result = false;
+ }
+ fs::path::string_type ref;
+ ref += fs::path::value_type('/');
+ ref += fs::path::value_type('a');
+ ref += fs::path::preferred_separator;
+ ref += fs::path::value_type('b');
+ ref += fs::path::preferred_separator;
+ ref += fs::path::value_type('c');
+ if (p.native() != ref) {
+ result = false;
+ }
+ }
+ {
+ fs::path p("/a b\\c/");
+ std::ostringstream oss;
+ oss << p;
+ if (oss.str() != "\"/a b\\\\c/\"") {
+ result = false;
+ }
+ std::istringstream iss(oss.str());
+ fs::path p2;
+ iss >> p2;
+ if (p2 != p) {
+ result = false;
+ }
+ }
+
+ checkResult(result);
+
+ return result;
+}
+}
+
+int testCMFilesystemPath(int /*unused*/, char* /*unused*/ [])
+{
+ int result = 0;
+
+ if (!testConstructors()) {
+ result = 1;
+ }
+ if (!testConcatenation()) {
+ result = 1;
+ }
+ if (!testModifiers()) {
+ result = 1;
+ }
+ if (!testObservers()) {
+ result = 1;
+ }
+ if (!testCompare()) {
+ result = 1;
+ }
+ if (!testGeneration()) {
+ result = 1;
+ }
+ if (!testDecomposition()) {
+ result = 1;
+ }
+ if (!testQueries()) {
+ result = 1;
+ }
+ if (!testIterators()) {
+ result = 1;
+ }
+ if (!testNonMemberFunctions()) {
+ result = 1;
+ }
+
+ return result;
+}
diff --git a/Tests/CMakeLib/testRST.expect b/Tests/CMakeLib/testRST.expect
index c19ee9400b..970adaa4ee 100644
--- a/Tests/CMakeLib/testRST.expect
+++ b/Tests/CMakeLib/testRST.expect
@@ -5,7 +5,7 @@ Command ``some_cmd()`` explicit cmake domain.
Command ``some_cmd()`` without target.
Command ``some_cmd`` with target.
Command ``some_cmd_<cmd>()`` placeholder without target.
-Command ``some_cmd_<cmd>`` placholder with target.
+Command ``some_cmd_<cmd>`` placeholder with target.
Command ``some_cmd()`` with parens.
Command ``some_cmd(SUB)`` with subcommand.
Command ``some_cmd(SUB)`` with subcommand and target.
diff --git a/Tests/CMakeLib/testRST.rst b/Tests/CMakeLib/testRST.rst
index d2d1140f3c..6462f1b7fc 100644
--- a/Tests/CMakeLib/testRST.rst
+++ b/Tests/CMakeLib/testRST.rst
@@ -12,7 +12,7 @@ Command :cmake:command:`some_cmd` explicit cmake domain.
Command :command:`some_cmd` without target.
Command :command:`some_cmd <some_cmd>` with target.
Command :command:`some_cmd_<cmd>` placeholder without target.
-Command :command:`some_cmd_<cmd> <some_cmd>` placholder with target.
+Command :command:`some_cmd_<cmd> <some_cmd>` placeholder with target.
Command :command:`some_cmd()` with parens.
Command :command:`some_cmd(SUB)` with subcommand.
Command :command:`some_cmd(SUB) <some_cmd>` with subcommand and target.
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index db6dbf3795..4a774dd392 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -206,6 +206,26 @@ if(BUILD_TESTING)
set(${reg} 0)
endif()
endforeach()
+ if(COMMAND cmake_host_system_information)
+ set(info_vs15 "VS_15_DIR")
+ set(info_vs16 "VS_16_DIR")
+ set(vs_versions)
+ if(WIN32)
+ if(NOT CMAKE_VERSION VERSION_LESS 3.14)
+ set(vs_versions vs15 vs16)
+ elseif(NOT CMAKE_VERSION VERSION_LESS 3.8)
+ set(vs_versions vs15)
+ endif()
+ endif()
+ foreach(info ${vs_versions})
+ cmake_host_system_information(RESULT found QUERY "${info_${info}}")
+ if(found)
+ set(${info} 1)
+ else()
+ set(${info} 0)
+ endif()
+ endforeach()
+ endif()
endif()
#---------------------------------------------------------------------------
@@ -697,38 +717,28 @@ if(BUILD_TESTING)
# build the "Simple" test with the ExtraGenerators, if available
# This doesn't test whether the generated project files work (unfortunately),
# mainly it tests that cmake doesn't crash when generating these project files.
- if(${CMAKE_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_GENERATOR} MATCHES "Ninja")
-
- # check which generators we have
- execute_process(COMMAND ${CMAKE_CMAKE_COMMAND} --help
- OUTPUT_VARIABLE cmakeOutput ERROR_VARIABLE cmakeOutput)
-
- set(extraGenerators
- "CodeBlocks"
- "CodeLite"
- "Eclipse CDT4"
- "Kate"
- "Sublime Text 2")
-
- foreach(extraGenerator ${extraGenerators})
- if ("${cmakeOutput}" MATCHES "${extraGenerator} - ${CMAKE_GENERATOR}")
- set(extraGeneratorTestName "Simple_${extraGenerator}Generator")
- string(REPLACE " " "" extraGeneratorTestName ${extraGeneratorTestName})
-
- add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Simple"
- "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}"
- --build-two-config
- --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}"
- --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
- --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
- --build-project Simple
- --test-command Simple)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}")
- endif ()
- endforeach(extraGenerator)
-
+ if(CMAKE_GENERATOR MATCHES "^(Unix Makefiles|Ninja)$"
+ AND NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
+ foreach(extraGenerator
+ "CodeBlocks"
+ "CodeLite"
+ "Eclipse CDT4"
+ "Kate"
+ "Sublime Text 2"
+ )
+ string(REPLACE " " "" extraGeneratorTestName "Simple_${extraGenerator}Generator")
+ add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/Simple"
+ "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}"
+ --build-two-config
+ --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}"
+ --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
+ --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
+ --build-project Simple
+ --test-command Simple)
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}")
+ endforeach()
endif()
# test for correct sub-project generation
@@ -1451,6 +1461,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
Patch
PostgreSQL
Protobuf
+ SDL
SQLite3
TIFF
Vulkan
@@ -2315,32 +2326,41 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endforeach()
endif()
+ macro(add_test_VSAndroid name generator platform)
+ add_test(NAME "VSAndroid.${name}.${platform}" COMMAND ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VSAndroid"
+ "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}/${platform}"
+ --build-generator "${generator}"
+ --build-project VSAndroid
+ --build-config $<CONFIGURATION>
+ --build-options -DCMAKE_SYSTEM_NAME=Android "-A${platform}"
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}")
+ endmacro()
if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ")
- macro(add_test_VSNsightTegra name generator)
- add_test(NAME VSNsightTegra.${name} COMMAND ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/VSNsightTegra"
- "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}"
- --build-generator "${generator}"
- --build-project VSNsightTegra
- --build-config $<CONFIGURATION>
- --build-options -DCMAKE_SYSTEM_NAME=Android
- )
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}")
- endmacro()
if(vs10)
- add_test_VSNsightTegra(vs10 "Visual Studio 10 2010")
+ add_test_VSAndroid(vs10 "Visual Studio 10 2010" "Tegra-Android")
endif()
if(vs11)
- add_test_VSNsightTegra(vs11 "Visual Studio 11 2012")
+ add_test_VSAndroid(vs11 "Visual Studio 11 2012" "Tegra-Android")
endif()
if(vs12)
- add_test_VSNsightTegra(vs12 "Visual Studio 12 2013")
+ add_test_VSAndroid(vs12 "Visual Studio 12 2013" "Tegra-Android")
endif()
if(vs14)
- add_test_VSNsightTegra(vs14 "Visual Studio 14 2015")
+ add_test_VSAndroid(vs14 "Visual Studio 14 2015" "Tegra-Android")
endif()
endif()
+ if(vs14 AND CMake_TEST_ANDROID_VS14)
+ add_test_VSAndroid(vs14 "Visual Studio 14 2015" "ARM")
+ endif()
+ if(vs15 AND CMake_TEST_ANDROID_VS15)
+ add_test_VSAndroid(vs15 "Visual Studio 15 2017" "ARM")
+ endif()
+ if(vs16 AND CMake_TEST_ANDROID_VS16)
+ add_test_VSAndroid(vs16 "Visual Studio 16 2019" "ARM")
+ endif()
if (APPLE)
if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
@@ -2397,36 +2417,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
endif()
- add_test(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaSet"
- "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet"
- ${build_generator_args}
- --build-noclean
- --build-project WarnUnusedUnusedViaSet
- --build-options
- "--warn-unused-vars")
- set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES
- PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'")
- set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES
- FAIL_REGULAR_EXPRESSION "unused variable \\(unsetting\\) 'UNUSED_VARIABLE'")
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet")
-
- add_test(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaUnset"
- "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset"
- ${build_generator_args}
- --build-noclean
- --build-project WarnUnusedUnusedViaUnset
- --build-options
- "--warn-unused-vars")
- set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
- PASS_REGULAR_EXPRESSION "CMake Warning \\(dev\\) at CMakeLists.txt:7 \\(set\\):")
- set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
- FAIL_REGULAR_EXPRESSION "CMakeLists.txt:5 \\(set\\):")
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset")
-
add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/WarnUnusedCliUnused"
@@ -2916,7 +2906,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
PASS_REGULAR_EXPRESSION "Failed")
else()
set_tests_properties(CTestTestCrash PROPERTIES
- PASS_REGULAR_EXPRESSION "(Illegal|SegFault|Child aborted)")
+ PASS_REGULAR_EXPRESSION "(Illegal|SegFault|Subprocess aborted)")
endif()
configure_file(
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index e32d693a73..348e6d05d0 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -35,7 +35,7 @@ AddCMakeTest(CMakeHostSystemInformation "")
AddCMakeTest(FileDownload "")
set_tests_properties(CMake.FileDownload PROPERTIES
PASS_REGULAR_EXPRESSION "file already exists with expected MD5 sum"
- FAIL_REGULAR_EXPRESSION "Unexpected status"
+ FAIL_REGULAR_EXPRESSION "Unexpected status|incorrectly interpreted"
)
AddCMakeTest(FileDownloadBadHash "")
set_property(TEST CMake.FileDownloadBadHash PROPERTY
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in
index 76c0000c27..69d9a14c4b 100644
--- a/Tests/CMakeTests/FileDownloadTest.cmake.in
+++ b/Tests/CMakeTests/FileDownloadTest.cmake.in
@@ -163,3 +163,16 @@ __reportIfWrongStatus("${status}" 0)
if(NOT EXISTS file12.png)
message(SEND_ERROR "file12.png not downloaded: ${status}")
endif()
+
+message(STATUS "FileDownload:13")
+file(DOWNLOAD
+ ${url}
+ TIMEOUT ${timeout}
+ STATUS status
+ )
+__reportIfWrongStatus("${status}" 0)
+if(EXISTS TIMEOUT)
+ file(REMOVE TIMEOUT)
+ message(SEND_ERROR "TIMEOUT argument was incorrectly interpreted as a filename")
+endif()
+message(STATUS "${status}")
diff --git a/Tests/CMakeTests/FileTestScript.cmake b/Tests/CMakeTests/FileTestScript.cmake
index 145f28a3f6..fc3c28adf2 100644
--- a/Tests/CMakeTests/FileTestScript.cmake
+++ b/Tests/CMakeTests/FileTestScript.cmake
@@ -10,7 +10,7 @@ elseif(testname STREQUAL different_not_enough_args) # fail
file(DIFFERENT ffff)
elseif(testname STREQUAL download_not_enough_args) # fail
- file(DOWNLOAD ffff)
+ file(DOWNLOAD)
elseif(testname STREQUAL read_not_enough_args) # fail
file(READ ffff)
@@ -181,7 +181,7 @@ elseif(testname STREQUAL to_native_path) # pass
message("v='${v}'")
elseif(testname STREQUAL download_wrong_number_of_args) # fail
- file(DOWNLOAD zzzz://bogus/ffff)
+ file(DOWNLOAD)
elseif(testname STREQUAL download_file_with_no_path) # pass
file(DOWNLOAD zzzz://bogus/ffff ffff)
diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt
index 20615fea1a..1c24017b6c 100644
--- a/Tests/COnly/CMakeLists.txt
+++ b/Tests/COnly/CMakeLists.txt
@@ -1,5 +1,5 @@
# a simple C only test case
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.12)
project (COnly C)
set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 253d128f1a..f3d3ad03f0 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -88,12 +88,14 @@ if(CPackGen MATCHES "DragNDrop")
set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.dmg")
if(${CPackComponentWay} STREQUAL "default")
set(expected_count 1)
+ set(expect_dmg_sla 1)
elseif(${CPackComponentWay} STREQUAL "OnePackPerGroup")
set(expected_count 3)
elseif(${CPackComponentWay} STREQUAL "IgnoreGroup")
set(expected_count 4)
elseif(${CPackComponentWay} STREQUAL "AllInOne")
set(expected_count 1)
+ set(expect_dmg_sla 1)
endif()
endif()
@@ -138,6 +140,36 @@ if(expected_file_mask)
if(NOT actual_count EQUAL expected_count)
message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})")
endif()
+
+ if(expect_dmg_sla)
+ execute_process(COMMAND hdiutil udifderez -xml "${expected_file}" OUTPUT_VARIABLE out ERROR_VARIABLE err RESULT_VARIABLE res)
+ if(NOT res EQUAL 0)
+ string(REPLACE "\n" "\n " err " ${err}")
+ message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${expected_file}\nfailed with:\n${err}")
+ endif()
+ foreach(key "LPic" "STR#" "TEXT")
+ if(NOT out MATCHES "<key>${key}</key>")
+ string(REPLACE "\n" "\n " out " ${out}")
+ message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${expected_file}\ndid not show '${key}' key:\n${out}")
+ endif()
+ endforeach()
+ foreach(line
+ # LPic first and last base64 lines
+ "\tAAIAEQADAAEAAAAAAAIAAAAIAAMAAAABAAQAAAAEAAUAAAAOAAYA\n"
+ "\tAA0AAABbAAQAAAAzAA8AAQAMABAAAAALAA4AAA==\n"
+ # STR# first and last base64 lines
+ "\tAAkHRW5nbGlzaAVBZ3JlZQhEaXNhZ3JlZQVQcmludAdTYXZlLi4u\n"
+ "\tdGVkIGEgcHJpbnRlci4=\n"
+ # TEXT first and last base64 lines
+ "\tTElDRU5TRQ0tLS0tLS0tDVRoaXMgaXMgYW4gaW5zdGFsbGVyIGNy\n"
+ "\tTm8gbGljZW5zZSBwcm92aWRlZC4NDQ==\n"
+ )
+ if(NOT out MATCHES "${line}")
+ string(REPLACE "\n" "\n " out " ${out}")
+ message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${expected_file}\ndid not show '${line}':\n${out}")
+ endif()
+ endforeach()
+ endif()
endif()
# Validate content
diff --git a/Tests/CSharpOnly/CMakeLists.txt b/Tests/CSharpOnly/CMakeLists.txt
index 42cbe2e60c..195af05cb4 100644
--- a/Tests/CSharpOnly/CMakeLists.txt
+++ b/Tests/CSharpOnly/CMakeLists.txt
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.3)
# a simple CSharp only test case
project (CSharpOnly CSharp)
diff --git a/Tests/Cuda/MixedStandardLevels4/lib.cpp b/Tests/Cuda/MixedStandardLevels4/lib.cpp
index ef6fc20056..2a65c77c96 100644
--- a/Tests/Cuda/MixedStandardLevels4/lib.cpp
+++ b/Tests/Cuda/MixedStandardLevels4/lib.cpp
@@ -3,7 +3,7 @@
constexpr int func(int A, int B)
{
#if defined(_MSC_VER) && _MSC_VER < 1913
- // no suppport for extended constexpr
+ // no support for extended constexpr
return B * A;
#else
// Verify that we have at least c++14
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu b/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu
index 3924f67c6c..90c70e2803 100644
--- a/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu
@@ -61,7 +61,7 @@ int file1_launch_kernel()
err = cudaGetLastError();
std::cout << err << " " << cudaGetErrorString(err) << std::endl;
if (err == cudaSuccess) {
- // This kernel launch should failed as the device linking never occured
+ // This kernel launch should failed as the device linking never occurred
std::cerr << "file1_kernel: kernel launch should have failed" << std::endl;
return 1;
}
diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt
index 8207dd1661..09689cb429 100644
--- a/Tests/CxxOnly/CMakeLists.txt
+++ b/Tests/CxxOnly/CMakeLists.txt
@@ -1,4 +1,5 @@
# a simple CXX only test case
+cmake_minimum_required(VERSION 2.8.12)
project (CxxOnly CXX)
set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index 5ef67d031c..af9fa96098 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -24,7 +24,7 @@ main.o: clean main.cpp
pngtest: main.o
@$(CMAKE_FOO) -DMODE=LINK >$(tmp)
@foo="`cat $(tmp)`"; \
- printf '"%s" %s %s -o pngtest main.o %s\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(LDFLAGS)" "$$foo" >$(tmp)
+ printf '"%s" %s %s %s -o pngtest main.o %s\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(__EXTRA_OSX_SYSROOT_FLAGS)" "$(LDFLAGS)" "$$foo" >$(tmp)
@cat $(tmp)
@sh $(tmp)
@rm -f $(tmp)
diff --git a/Tests/FindSDL/CMakeLists.txt b/Tests/FindSDL/CMakeLists.txt
new file mode 100644
index 0000000000..e786204dd4
--- /dev/null
+++ b/Tests/FindSDL/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindSDL.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindSDL/Test"
+ "${CMake_BINARY_DIR}/Tests/FindSDL/Test"
+ ${build_generator_args}
+ --build-project TestFindSDL
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindSDL/Test/CMakeLists.txt b/Tests/FindSDL/Test/CMakeLists.txt
new file mode 100644
index 0000000000..61d4f4b334
--- /dev/null
+++ b/Tests/FindSDL/Test/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 3.1)
+project(TestFindSDL C)
+include(CTest)
+
+find_package(SDL)
+
+add_definitions(
+ -DCMAKE_EXPECTED_SDL_VERSION_MAJOR=${SDL_VERSION_MAJOR}
+ -DCMAKE_EXPECTED_SDL_VERSION_MINOR=${SDL_VERSION_MINOR}
+ -DCMAKE_EXPECTED_SDL_VERSION_PATCH=${SDL_VERSION_PATCH})
+
+add_executable(test_sdl_tgt main.c)
+target_link_libraries(test_sdl_tgt SDL::SDL)
+add_test(NAME test_sdl_tgt COMMAND test_sdl_tgt)
+
+add_executable(test_sdl_var main.c)
+target_include_directories(test_sdl_var PRIVATE ${SDL_INCLUDE_DIRS})
+target_link_libraries(test_sdl_var PRIVATE ${SDL_LIBRARIES})
+add_test(NAME test_sdl_var COMMAND test_sdl_var)
diff --git a/Tests/FindSDL/Test/main.c b/Tests/FindSDL/Test/main.c
new file mode 100644
index 0000000000..057289ceb2
--- /dev/null
+++ b/Tests/FindSDL/Test/main.c
@@ -0,0 +1,18 @@
+#include <SDL.h>
+
+int main()
+{
+ // Test 1 requires headers only.
+ SDL_version compiled;
+ SDL_VERSION(&compiled);
+ if (compiled.major != CMAKE_EXPECTED_SDL_VERSION_MAJOR ||
+ compiled.minor != CMAKE_EXPECTED_SDL_VERSION_MINOR ||
+ compiled.patch != CMAKE_EXPECTED_SDL_VERSION_PATCH)
+ return 1;
+
+ // Test 2 requires to link to the library.
+ if (SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0)
+ return 2;
+
+ return 0;
+}
diff --git a/Tests/FindTIFF/Test/CMakeLists.txt b/Tests/FindTIFF/Test/CMakeLists.txt
index 85453edbcf..e235db3697 100644
--- a/Tests/FindTIFF/Test/CMakeLists.txt
+++ b/Tests/FindTIFF/Test/CMakeLists.txt
@@ -1,14 +1,23 @@
cmake_minimum_required(VERSION 3.1)
-project(TestFindTIFF C)
+project(TestFindTIFF)
include(CTest)
-find_package(TIFF REQUIRED)
+find_package(TIFF REQUIRED COMPONENTS CXX)
add_executable(test_tiff_tgt main.c)
target_link_libraries(test_tiff_tgt TIFF::TIFF)
add_test(NAME test_tiff_tgt COMMAND test_tiff_tgt)
+add_executable(test_tiffxx_tgt main.cxx)
+target_link_libraries(test_tiffxx_tgt TIFF::CXX)
+add_test(NAME test_tiffxx_tgt COMMAND test_tiffxx_tgt)
+
add_executable(test_tiff_var main.c)
target_include_directories(test_tiff_var PRIVATE ${TIFF_INCLUDE_DIRS})
target_link_libraries(test_tiff_var PRIVATE ${TIFF_LIBRARIES})
add_test(NAME test_tiff_var COMMAND test_tiff_var)
+
+add_executable(test_tiffxx_var main.cxx)
+target_include_directories(test_tiffxx_var PRIVATE ${TIFF_INCLUDE_DIRS})
+target_link_libraries(test_tiffxx_var PRIVATE ${TIFF_LIBRARIES})
+add_test(NAME test_tiffxx_var COMMAND test_tiffxx_var)
diff --git a/Tests/FindTIFF/Test/main.cxx b/Tests/FindTIFF/Test/main.cxx
new file mode 100644
index 0000000000..f80a31f1bb
--- /dev/null
+++ b/Tests/FindTIFF/Test/main.cxx
@@ -0,0 +1,16 @@
+#include <fstream>
+
+#include <assert.h>
+#include <tiffio.hxx>
+
+int main()
+{
+ /* Without any TIFF file to open, test that the call fails as
+ expected. This tests that linking worked. */
+ TIFF* tiff = TIFFOpen("invalid.tiff", "r");
+ assert(!tiff);
+
+ std::ifstream s;
+ TIFF* tiffxx = TIFFStreamOpen("invalid.tiff", &s);
+ return 0;
+}
diff --git a/Tests/FindVulkan/Test/CMakeLists.txt b/Tests/FindVulkan/Test/CMakeLists.txt
index 0b13d53209..9d36a0da30 100644
--- a/Tests/FindVulkan/Test/CMakeLists.txt
+++ b/Tests/FindVulkan/Test/CMakeLists.txt
@@ -13,3 +13,12 @@ add_executable(test_var main.c)
target_include_directories(test_var PRIVATE ${Vulkan_INCLUDE_DIRS})
target_link_libraries(test_var PRIVATE ${Vulkan_LIBRARIES})
add_test(NAME test_var COMMAND test_var)
+
+if(Vulkan_GLSLC_EXECUTABLE)
+ add_test(NAME test_glslc
+ COMMAND ${CMAKE_COMMAND}
+ "-DVULKAN_GLSLC_EXECUTABLE=${Vulkan_GLSLC_EXECUTABLE}"
+ "-DVULKAN_GLSLC_EXECUTABLE_TARGET=$<TARGET_FILE:Vulkan::glslc>"
+ -P "${CMAKE_CURRENT_LIST_DIR}/Run-glslc.cmake"
+ )
+endif()
diff --git a/Tests/FindVulkan/Test/Run-glslc.cmake b/Tests/FindVulkan/Test/Run-glslc.cmake
new file mode 100644
index 0000000000..086eb9d0f0
--- /dev/null
+++ b/Tests/FindVulkan/Test/Run-glslc.cmake
@@ -0,0 +1,20 @@
+cmake_minimum_required(VERSION 3.12)
+
+function(run_glslc exe exe_display)
+ execute_process(COMMAND ${exe} --help
+ OUTPUT_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE result
+ )
+
+ if(NOT result EQUAL 0)
+ message(SEND_ERROR "Result of ${exe_display} --help is ${result}, should be 0")
+ endif()
+
+ if(NOT output MATCHES "^glslc - Compile shaders into SPIR-V")
+ message(SEND_ERROR "Output of ${exe_display} --help is \"${output}\", should begin with \"glslc - Compile shaders into SPIR-V\"")
+ endif()
+endfunction()
+
+run_glslc("${VULKAN_GLSLC_EXECUTABLE}" "\${VULKAN_GLSLC_EXECUTABLE}")
+run_glslc("${VULKAN_GLSLC_EXECUTABLE_TARGET}" "Vulkan::glslc")
diff --git a/Tests/FindVulkan/Test/main.c b/Tests/FindVulkan/Test/main.c
index b29c9ec9ec..1bff6510eb 100644
--- a/Tests/FindVulkan/Test/main.c
+++ b/Tests/FindVulkan/Test/main.c
@@ -2,10 +2,10 @@
int main()
{
- VkInstanceCreateInfo instanceCreateInfo = {};
+ VkInstanceCreateInfo instanceCreateInfo = { 0 };
instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
- VkApplicationInfo applicationInfo = {};
+ VkApplicationInfo applicationInfo = { 0 };
applicationInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
applicationInfo.apiVersion = VK_API_VERSION_1_0;
applicationInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt
index b2adfb2bcb..7325b324ca 100644
--- a/Tests/FindX11/Test/CMakeLists.txt
+++ b/Tests/FindX11/Test/CMakeLists.txt
@@ -29,6 +29,7 @@ test_x11_component(x11_components SM)
set(X11_X11_FOUND ${X11_FOUND})
test_x11_component(x11_components X11)
test_x11_component(x11_components Xau)
+test_x11_component(x11_components Xaw)
test_x11_component(x11_components xcb)
test_x11_component(x11_components X11_xcb)
test_x11_component(x11_components xcb_icccm)
@@ -67,6 +68,7 @@ target_link_libraries(test_var PRIVATE ${X11_LIBRARIES})
# Not included in X11_LIBRARIES.
foreach(lib
Xau
+ Xaw
xcb
X11_xcb
xcb_icccm
diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c
index c8144e09cd..f8c723c7b0 100644
--- a/Tests/FindX11/Test/main.c
+++ b/Tests/FindX11/Test/main.c
@@ -308,6 +308,24 @@ static int test_Xv(void)
}
#endif
+#ifdef HAVE_X11_Xaw
+# include <X11/Intrinsic.h>
+# include <X11/Xaw/Box.h>
+
+static void test_Xaw(void)
+{
+ XrmOptionDescRec opt_table[] = { { NULL } };
+
+ Widget toplevel;
+ toplevel =
+ XtInitialize("test", "test", opt_table, XtNumber(opt_table), NULL, NULL);
+ Widget box =
+ XtCreateManagedWidget("testbox", boxWidgetClass, toplevel, NULL, 0);
+ return;
+}
+
+#endif
+
#include <stddef.h>
int main(int argc, char* argv[])
@@ -392,6 +410,9 @@ int main(int argc, char* argv[])
#ifdef HAVE_X11_Xv
test_Xv,
#endif
+#ifdef HAVE_X11_Xaw
+ test_Xaw,
+#endif
NULL,
};
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index d24df2df84..637f5816a1 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(FortranOnly Fortran)
message("CTEST_FULL_OUTPUT ")
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 9d5134203b..ebbe28873b 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -40,9 +40,9 @@ add_custom_target(check-part1 ALL
-Dtest_and_0_invalidcontent=$<AND:0,invalidcontent>
-Dtest_config_0=$<CONFIG:$<CONFIGURATION>x>
-Dtest_config_1=$<CONFIG:$<CONFIGURATION>>
- -Dtest_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG>
- -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE>
- -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo>$<CONFIG:RELWITHDEBINFO>$<CONFIG:relwithdebinfo>
+ -Dtest_config_debug=$<CONFIG:Debug,DEBUG,DeBuG>
+ -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE,ReLeAsE>
+ -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo,RELWITHDEBINFO>$<CONFIG:relwithdebinfo>
-Dtest_config_minsizerel=$<CONFIG:MinSizeRel>$<CONFIG:MINSIZEREL>$<CONFIG:minsizerel>
-Dtest_not_0=$<NOT:0>
-Dtest_not_1=$<NOT:1>
@@ -180,9 +180,7 @@ set_property(TARGET imported3 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc)
set_property(TARGET imported3 APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:DEBUG>:$<TARGET_PROPERTY:imported1,INTERFACE_INCLUDE_DIRECTORIES>>)
set_property(TARGET imported3 APPEND PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELEASE>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>)
-set_property(TARGET imported3 APPEND PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELWITHDEBINFO>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>)
+ INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELEASE,RELWITHDEBINFO>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>)
set_property(TARGET imported3 APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:MINSIZEREL>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>)
diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake
index 4fb730887a..5571c3d6aa 100644
--- a/Tests/GeneratorExpression/check-part3.cmake
+++ b/Tests/GeneratorExpression/check-part3.cmake
@@ -9,11 +9,11 @@ check(test_version_equal_1 "0")
check(test_version_equal_2 "1")
if(config AND NOT config STREQUAL NoConfig)
- if(NOT "${test_imported_includes}" MATCHES "^;*/imported[12]/include/with space;*$")
+ if(NOT "${test_imported_includes}" MATCHES "^[^;]*/imported[12]/include/with space$")
message(SEND_ERROR "test_imported_includes is not correct: ${test_imported_includes}")
endif()
else()
- if(NOT "${test_imported_includes}" MATCHES "^;;;$")
+ if(NOT "${test_imported_includes}" MATCHES "^$")
message(SEND_ERROR "test_imported_includes is not an empty list: ${test_imported_includes}")
endif()
endif()
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/standard.h b/Tests/GhsMulti/GhsMultiSrcGroups/standard.h
index 2773a55111..66522d5c86 100644
--- a/Tests/GhsMulti/GhsMultiSrcGroups/standard.h
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/standard.h
@@ -1 +1 @@
-#define somthing
+#define something
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test3.h b/Tests/GhsMulti/GhsMultiSrcGroups/test3.h
index 2773a55111..66522d5c86 100644
--- a/Tests/GhsMulti/GhsMultiSrcGroups/test3.h
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test3.h
@@ -1 +1 @@
-#define somthing
+#define something
diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
index 99f0de925d..af7b09259a 100644
--- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
@@ -91,7 +91,7 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
source_file = info->CAPI->CreateNewSourceFile(mf);
cstr = info->CAPI->SourceFileGetSourceName(source_file);
- sprintf(buffer, "Shold be empty (source file name): [%s]", cstr);
+ sprintf(buffer, "Should be empty (source file name): [%s]", cstr);
info->CAPI->DisplaySatus(mf, buffer);
cstr = info->CAPI->SourceFileGetFullPath(source_file);
sprintf(buffer, "Should be empty (source file full path): [%s]", cstr);
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
index 99f0de925d..af7b09259a 100644
--- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
@@ -91,7 +91,7 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
source_file = info->CAPI->CreateNewSourceFile(mf);
cstr = info->CAPI->SourceFileGetSourceName(source_file);
- sprintf(buffer, "Shold be empty (source file name): [%s]", cstr);
+ sprintf(buffer, "Should be empty (source file name): [%s]", cstr);
info->CAPI->DisplaySatus(mf, buffer);
cstr = info->CAPI->SourceFileGetFullPath(source_file);
sprintf(buffer, "Should be empty (source file full path): [%s]", cstr);
diff --git a/Tests/Module/CheckTypeSize/CMakeLists.txt b/Tests/Module/CheckTypeSize/CMakeLists.txt
index 16989fe23f..102cf0c177 100644
--- a/Tests/Module/CheckTypeSize/CMakeLists.txt
+++ b/Tests/Module/CheckTypeSize/CMakeLists.txt
@@ -21,6 +21,8 @@ check_type_size("((struct somestruct*)0)->somechar" SIZEOF_STRUCTMEMBER_CHAR)
# Check CXX types
check_type_size(bool SIZEOF_BOOL LANGUAGE CXX)
+check_type_size(uint8_t SIZEOF_UINT8_T LANGUAGE CXX)
+check_type_size(std::uint8_t SIZEOF_STD_UINT8_T LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES someclass.hxx)
check_type_size("((ns::someclass*)0)->someint" SIZEOF_NS_CLASSMEMBER_INT LANGUAGE CXX)
diff --git a/Tests/Module/CheckTypeSize/CheckTypeSize.cxx b/Tests/Module/CheckTypeSize/CheckTypeSize.cxx
index 15dc890c81..45cd393d0d 100644
--- a/Tests/Module/CheckTypeSize/CheckTypeSize.cxx
+++ b/Tests/Module/CheckTypeSize/CheckTypeSize.cxx
@@ -11,6 +11,12 @@
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
+#ifdef HAVE_CSTDINT
+# include <cstdint>
+#endif
+#ifdef HAVE_CSTDDEF
+# include <cstddef>
+#endif
#include <stdio.h>
@@ -122,6 +128,26 @@ int main()
NODEF(SIZEOF_SSIZE_T);
#endif
+/* uint8_t */
+#if defined(SIZEOF_UINT8_T)
+ CHECK(uint8_t, SIZEOF_UINT8_T);
+# if !defined(HAVE_SIZEOF_UINT8_T)
+ NODEF(HAVE_SIZEOF_UINT8_T);
+# endif
+#elif defined(HAVE_SIZEOF_UINT8_T)
+ NODEF(SIZEOF_UINT8_T);
+#endif
+
+/* std::uint8_t */
+#if defined(SIZEOF_STD_UINT8_T)
+ CHECK(std::uint8_t, SIZEOF_STD_UINT8_T);
+# if !defined(HAVE_SIZEOF_STD_UINT8_T)
+ NODEF(HAVE_SIZEOF_STD_UINT8_T);
+# endif
+#elif defined(HAVE_SIZEOF_STD_UINT8_T)
+ NODEF(SIZEOF_STD_UINT8_T);
+#endif
+
/* ns::someclass::someint */
#if defined(SIZEOF_NS_CLASSMEMBER_INT)
CHECK(y.someint, SIZEOF_NS_CLASSMEMBER_INT);
diff --git a/Tests/Module/CheckTypeSize/config.hxx.in b/Tests/Module/CheckTypeSize/config.hxx.in
index 8c66ade6c2..9a80689368 100644
--- a/Tests/Module/CheckTypeSize/config.hxx.in
+++ b/Tests/Module/CheckTypeSize/config.hxx.in
@@ -1,11 +1,21 @@
#cmakedefine HAVE_SYS_TYPES_H
#cmakedefine HAVE_STDINT_H
#cmakedefine HAVE_STDDEF_H
+#cmakedefine HAVE_CSTDINT
+#cmakedefine HAVE_CSTDDEF
/* bool */
#cmakedefine HAVE_SIZEOF_BOOL
@SIZEOF_BOOL_CODE@
+/* uint8_t */
+#cmakedefine HAVE_SIZEOF_UINT8_T
+@SIZEOF_UINT8_T_CODE@
+
+/* std::uint8_t */
+#cmakedefine HAVE_SIZEOF_STD_UINT8_T
+@SIZEOF_STD_UINT8_T_CODE@
+
/* struct ns::somestruct::someint */
#cmakedefine HAVE_SIZEOF_NS_STRUCTMEMBER_INT
@SIZEOF_NS_STRUCTMEMBER_INT_CODE@
diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake
index 45798ce593..81dd09020d 100644
--- a/Tests/RunCMake/Android/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Android/RunCMakeTest.cmake
@@ -18,15 +18,33 @@ function(run_Android case)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
run_cmake(${case})
- run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .)
+ set(configs ".")
+ if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(configs Release Debug)
+ endif()
+ foreach(config IN LISTS configs)
+ set(build_suffix)
+ set(config_arg)
+ if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(build_suffix "-${config}")
+ set(config_arg --config "${config}")
+ endif()
+ run_cmake_command(${case}-build${build_suffix} ${CMAKE_COMMAND} --build . ${config_arg})
+ endforeach()
endfunction()
+set(RunCMake_GENERATOR_PLATFORM_OLD "${RunCMake_GENERATOR_PLATFORM}")
+
+if(RunCMake_GENERATOR MATCHES "Visual Studio")
+ set(RunCMake_GENERATOR_PLATFORM "ARM")
+endif()
set(RunCMake_TEST_OPTIONS
-DCMAKE_SYSTEM_NAME=Android
-DCMAKE_SYSROOT=${CMAKE_CURRENT_SOURCE_DIR}
)
run_cmake(BadSYSROOT)
unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}")
foreach(ndk IN LISTS TEST_ANDROID_NDK)
# Load available toolchain versions and abis.
@@ -70,6 +88,9 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
if(_versions MATCHES "clang")
set(_versions "clang" ${_versions})
endif()
+ if(RunCMake_GENERATOR MATCHES "Visual Studio")
+ set(_versions "clang")
+ endif()
list(REMOVE_DUPLICATES _versions)
list(SORT _versions)
set(_versions ";${_versions}")
@@ -77,44 +98,58 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
list(REMOVE_DUPLICATES _abis_${vers})
endforeach()
+ set(ndk_arg -DCMAKE_ANDROID_NDK=${ndk})
+ if(RunCMake_GENERATOR MATCHES "Visual Studio")
+ set(ndk_arg)
+ endif()
+
# Test failure cases.
message(STATUS "ndk='${ndk}'")
+ if(RunCMake_GENERATOR MATCHES "Visual Studio")
+ set(RunCMake_GENERATOR_PLATFORM "ARM")
+ endif()
set(RunCMake_TEST_OPTIONS
-DCMAKE_SYSTEM_NAME=Android
- -DCMAKE_ANDROID_NDK=${ndk}
+ ${ndk_arg}
-DCMAKE_ANDROID_ARCH_ABI=badabi
)
run_cmake(ndk-badabi)
+ if(RunCMake_GENERATOR MATCHES "Visual Studio")
+ set(RunCMake_GENERATOR_PLATFORM "x86")
+ endif()
set(RunCMake_TEST_OPTIONS
-DCMAKE_SYSTEM_NAME=Android
- -DCMAKE_ANDROID_NDK=${ndk}
+ ${ndk_arg}
-DCMAKE_ANDROID_ARCH_ABI=x86
-DCMAKE_ANDROID_ARM_MODE=0
)
run_cmake(ndk-badarm)
+ if(RunCMake_GENERATOR MATCHES "Visual Studio")
+ set(RunCMake_GENERATOR_PLATFORM "ARM")
+ endif()
if("armeabi" IN_LIST _abis_)
set(RunCMake_TEST_OPTIONS
-DCMAKE_SYSTEM_NAME=Android
- -DCMAKE_ANDROID_NDK=${ndk}
+ ${ndk_arg}
-DCMAKE_ANDROID_ARM_NEON=0
)
run_cmake(ndk-badneon)
endif()
set(RunCMake_TEST_OPTIONS
-DCMAKE_SYSTEM_NAME=Android
- -DCMAKE_ANDROID_NDK=${ndk}
+ ${ndk_arg}
-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=badver
)
run_cmake(ndk-badver)
set(RunCMake_TEST_OPTIONS
-DCMAKE_SYSTEM_NAME=Android
- -DCMAKE_ANDROID_NDK=${ndk}
+ ${ndk_arg}
-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=1.0
)
run_cmake(ndk-badvernum)
set(RunCMake_TEST_OPTIONS
-DCMAKE_SYSTEM_NAME=Android
- -DCMAKE_ANDROID_NDK=${ndk}
+ ${ndk_arg}
-DCMAKE_ANDROID_STL_TYPE=badstl
)
run_cmake(ndk-badstl)
@@ -131,6 +166,7 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
run_cmake(ndk-sysroot-armeabi)
unset(RunCMake_TEST_OPTIONS)
endif()
+ set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}")
# Find available STLs.
set(stl_types
@@ -157,23 +193,41 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
armeabi-v6
armeabi-v7a
arm64-v8a
- mips
- mips64
x86
x86_64
)
+ if(NOT RunCMake_GENERATOR MATCHES "Visual Studio")
+ list(APPEND abi_names mips mips64)
+ endif()
+ set(abi_to_arch_armeabi ARM)
+ set(abi_to_arch_armeabi-v6 ARM)
+ set(abi_to_arch_armeabi-v7a ARM)
+ set(abi_to_arch_arm64-v8a ARM64)
+ set(abi_to_arch_x86 x86)
+ set(abi_to_arch_x86_64 x64)
# Test all combinations.
foreach(vers IN LISTS _versions)
foreach(stl IN LISTS stl_types)
- foreach(config Release Debug)
+ set(configs Release Debug)
+ set(foreach_list "${configs}")
+ if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(foreach_list ".")
+ endif()
+ foreach(config IN LISTS foreach_list)
# Test this combination for all available abis.
- message(STATUS "ndk='${ndk}' vers='${vers}' stl='${stl}' config='${config}'")
+ set(config_status " config='${config}'")
+ set(build_type_arg "-DCMAKE_BUILD_TYPE=${config}")
+ if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(config_status)
+ string(REPLACE ";" "\\\\;" build_type_arg "-DCMAKE_CONFIGURATION_TYPES=${configs}")
+ endif()
+ message(STATUS "ndk='${ndk}' vers='${vers}' stl='${stl}'${config_status}")
set(RunCMake_TEST_OPTIONS
- -DCMAKE_ANDROID_NDK=${ndk}
+ ${ndk_arg}
-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=${vers}
-DCMAKE_ANDROID_STL_TYPE=${stl}
- -DCMAKE_BUILD_TYPE=${config}
+ "${build_type_arg}"
)
foreach(abi IN LISTS abi_names)
# Skip ABIs not supported by this compiler.
@@ -182,6 +236,9 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
endif()
# Run the tests for this combination.
+ if(RunCMake_GENERATOR MATCHES "Visual Studio")
+ set(RunCMake_GENERATOR_PLATFORM "${abi_to_arch_${abi}}")
+ endif()
if("${abi}" STREQUAL "armeabi")
run_Android(ndk-armeabi-thumb) # default: -DCMAKE_ANDROID_ARCH_ABI=armeabi -DCMAKE_ANDROID_ARM_MODE=0
run_Android(ndk-armeabi-arm -DCMAKE_ANDROID_ARM_MODE=1) # default: -DCMAKE_ANDROID_ARCH_ABI=armeabi
@@ -191,6 +248,7 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
run_Android(ndk-${abi}-neon -DCMAKE_ANDROID_ARCH_ABI=${abi} -DCMAKE_ANDROID_ARM_NEON=1)
endif()
endif()
+ set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}")
endforeach()
unset(RunCMake_TEST_OPTIONS)
endforeach()
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake
index d96ab86484..32412aa84b 100644
--- a/Tests/RunCMake/Android/common.cmake
+++ b/Tests/RunCMake/Android/common.cmake
@@ -96,7 +96,7 @@ add_executable(android_c android.c)
add_executable(android_cxx android.cxx)
add_library(android_cxx_lib SHARED android_lib.cxx)
-set(objdump "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}objdump")
+set(objdump "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}objdump${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}")
if(NOT EXISTS "${objdump}")
message(FATAL_ERROR "Expected tool missing:\n ${objdump}")
endif()
diff --git a/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt b/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt
new file mode 100644
index 0000000000..a3b3634e6f
--- /dev/null
+++ b/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt
@@ -0,0 +1,7 @@
+^(CMake Warning:
+ You are using Visual Studio tools for Android, which does not support
+ standalone executables\. However, the following executable targets do not
+ have the ANDROID_GUI property set, and thus will not be built as expected\.
+ They will be built as shared libraries with executable filenames:
+
+ android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$
diff --git a/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt
new file mode 100644
index 0000000000..a3b3634e6f
--- /dev/null
+++ b/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt
@@ -0,0 +1,7 @@
+^(CMake Warning:
+ You are using Visual Studio tools for Android, which does not support
+ standalone executables\. However, the following executable targets do not
+ have the ANDROID_GUI property set, and thus will not be built as expected\.
+ They will be built as shared libraries with executable filenames:
+
+ android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$
diff --git a/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt
new file mode 100644
index 0000000000..a3b3634e6f
--- /dev/null
+++ b/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt
@@ -0,0 +1,7 @@
+^(CMake Warning:
+ You are using Visual Studio tools for Android, which does not support
+ standalone executables\. However, the following executable targets do not
+ have the ANDROID_GUI property set, and thus will not be built as expected\.
+ They will be built as shared libraries with executable filenames:
+
+ android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$
diff --git a/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt
new file mode 100644
index 0000000000..a3b3634e6f
--- /dev/null
+++ b/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt
@@ -0,0 +1,7 @@
+^(CMake Warning:
+ You are using Visual Studio tools for Android, which does not support
+ standalone executables\. However, the following executable targets do not
+ have the ANDROID_GUI property set, and thus will not be built as expected\.
+ They will be built as shared libraries with executable filenames:
+
+ android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$
diff --git a/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt
new file mode 100644
index 0000000000..a3b3634e6f
--- /dev/null
+++ b/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt
@@ -0,0 +1,7 @@
+^(CMake Warning:
+ You are using Visual Studio tools for Android, which does not support
+ standalone executables\. However, the following executable targets do not
+ have the ANDROID_GUI property set, and thus will not be built as expected\.
+ They will be built as shared libraries with executable filenames:
+
+ android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$
diff --git a/Tests/RunCMake/Android/ndk-x86-stderr.txt b/Tests/RunCMake/Android/ndk-x86-stderr.txt
new file mode 100644
index 0000000000..a3b3634e6f
--- /dev/null
+++ b/Tests/RunCMake/Android/ndk-x86-stderr.txt
@@ -0,0 +1,7 @@
+^(CMake Warning:
+ You are using Visual Studio tools for Android, which does not support
+ standalone executables\. However, the following executable targets do not
+ have the ANDROID_GUI property set, and thus will not be built as expected\.
+ They will be built as shared libraries with executable filenames:
+
+ android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$
diff --git a/Tests/RunCMake/Android/ndk-x86_64-stderr.txt b/Tests/RunCMake/Android/ndk-x86_64-stderr.txt
new file mode 100644
index 0000000000..a3b3634e6f
--- /dev/null
+++ b/Tests/RunCMake/Android/ndk-x86_64-stderr.txt
@@ -0,0 +1,7 @@
+^(CMake Warning:
+ You are using Visual Studio tools for Android, which does not support
+ standalone executables\. However, the following executable targets do not
+ have the ANDROID_GUI property set, and thus will not be built as expected\.
+ They will be built as shared libraries with executable filenames:
+
+ android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$
diff --git a/Tests/RunCMake/BundleUtilities/ExecutableScripts.cmake b/Tests/RunCMake/BundleUtilities/ExecutableScripts.cmake
new file mode 100644
index 0000000000..78a9b66a9f
--- /dev/null
+++ b/Tests/RunCMake/BundleUtilities/ExecutableScripts.cmake
@@ -0,0 +1,18 @@
+include(BundleUtilities)
+
+set(BU_CHMOD_BUNDLE_ITEMS ON)
+
+function(check_script script)
+ fixup_bundle_item(${script} ${script} "" "")
+endfunction()
+
+# Should not throw any errors
+# Shell script
+set(script_sh_EMBEDDED_ITEM ${CMAKE_CURRENT_LIST_DIR}/test.app/script.sh)
+check_script(${CMAKE_CURRENT_LIST_DIR}/test.app/script.sh)
+# Batch script
+set(script_bat_EMBEDDED_ITEM ${CMAKE_CURRENT_LIST_DIR}/test.app/script.bat)
+check_script(${CMAKE_CURRENT_LIST_DIR}/test.app/script.bat)
+# Shell script without extension
+set(script_EMBEDDED_ITEM ${CMAKE_CURRENT_LIST_DIR}/test.app/script)
+check_script(${CMAKE_CURRENT_LIST_DIR}/test.app/script)
diff --git a/Tests/RunCMake/BundleUtilities/RunCMakeTest.cmake b/Tests/RunCMake/BundleUtilities/RunCMakeTest.cmake
index 14aaff1976..df28102f2a 100644
--- a/Tests/RunCMake/BundleUtilities/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BundleUtilities/RunCMakeTest.cmake
@@ -9,3 +9,4 @@ run_cmake(CMP0080-WARN)
run_cmake_command(CMP0080-COMMAND-OLD ${CMAKE_COMMAND} -DCMP0080_VALUE:STRING=OLD -P ${RunCMake_SOURCE_DIR}/CMP0080-COMMAND.cmake)
run_cmake_command(CMP0080-COMMAND-NEW ${CMAKE_COMMAND} -DCMP0080_VALUE:STRING=NEW -P ${RunCMake_SOURCE_DIR}/CMP0080-COMMAND.cmake)
run_cmake_command(CMP0080-COMMAND-WARN ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/CMP0080-COMMAND.cmake)
+run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake)
diff --git a/Tests/RunCMake/BundleUtilities/test.app/script b/Tests/RunCMake/BundleUtilities/test.app/script
new file mode 100755
index 0000000000..23bf47c06d
--- /dev/null
+++ b/Tests/RunCMake/BundleUtilities/test.app/script
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+echo "Hello World"
diff --git a/Tests/RunCMake/BundleUtilities/test.app/script.bat b/Tests/RunCMake/BundleUtilities/test.app/script.bat
new file mode 100755
index 0000000000..dbb0ec2c75
--- /dev/null
+++ b/Tests/RunCMake/BundleUtilities/test.app/script.bat
@@ -0,0 +1,3 @@
+@echo off
+
+echo "Hello world"
diff --git a/Tests/RunCMake/BundleUtilities/test.app/script.sh b/Tests/RunCMake/BundleUtilities/test.app/script.sh
new file mode 100755
index 0000000000..23bf47c06d
--- /dev/null
+++ b/Tests/RunCMake/BundleUtilities/test.app/script.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+echo "Hello World"
diff --git a/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt
new file mode 100644
index 0000000000..66a58fb827
--- /dev/null
+++ b/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.$
diff --git a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt
index 048762d000..a446211dbe 100644
--- a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt
+++ b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt
@@ -1,4 +1,11 @@
-^CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\):
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
++
+CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\):
The OLD behavior for policy CMP0019 will be removed from a future version
of CMake.
diff --git a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt
index 1e4b47d0ca..f7b9c0e889 100644
--- a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt
@@ -1,3 +1,10 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
++
CMake Warning \(dev\) in CMakeLists.txt:
Policy CMP0019 is not set: Do not re-expand variables in include and link
information. Run "cmake --help-policy CMP0019" for policy details. Use
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt
new file mode 100644
index 0000000000..66a58fb827
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt
new file mode 100644
index 0000000000..66a58fb827
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt
new file mode 100644
index 0000000000..66a58fb827
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt
new file mode 100644
index 0000000000..66a58fb827
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt
new file mode 100644
index 0000000000..66a58fb827
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt
index 6a6a0c782c..87404d3a97 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt
@@ -1,3 +1,10 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
++
CMake Warning \(dev\) in CMakeLists.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
index 2f7dfbfb7f..5d757200bc 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
@@ -1,4 +1,11 @@
-^CMake Warning \(dev\) in CMakeLists.txt:
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
++
+CMake Warning \(dev\) in CMakeLists.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt
new file mode 100644
index 0000000000..66a58fb827
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.$
diff --git a/Tests/RunCMake/CMP0026/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMakeLists.txt
index 12cd3c7757..4b3de84d94 100644
--- a/Tests/RunCMake/CMP0026/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0026/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0027/CMakeLists.txt b/Tests/RunCMake/CMP0027/CMakeLists.txt
index 12cd3c7757..4b3de84d94 100644
--- a/Tests/RunCMake/CMP0027/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0027/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0028/CMakeLists.txt b/Tests/RunCMake/CMP0028/CMakeLists.txt
index 144cdb4ee3..4f867df1c0 100644
--- a/Tests/RunCMake/CMP0028/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0028/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) # policy used at end of dir
diff --git a/Tests/RunCMake/CMP0037/CMakeLists.txt b/Tests/RunCMake/CMP0037/CMakeLists.txt
index 12cd3c7757..4b3de84d94 100644
--- a/Tests/RunCMake/CMP0037/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0037/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0041/CMakeLists.txt b/Tests/RunCMake/CMP0041/CMakeLists.txt
index f452db1770..a06591c31f 100644
--- a/Tests/RunCMake/CMP0041/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0041/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0042/CMakeLists.txt b/Tests/RunCMake/CMP0042/CMakeLists.txt
index f452db1770..a06591c31f 100644
--- a/Tests/RunCMake/CMP0042/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0042/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0043/CMakeLists.txt b/Tests/RunCMake/CMP0043/CMakeLists.txt
index d027f3e0ef..cc8a6f812a 100644
--- a/Tests/RunCMake/CMP0043/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0043/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) # policy used at end of dir
diff --git a/Tests/RunCMake/CMP0045/CMakeLists.txt b/Tests/RunCMake/CMP0045/CMakeLists.txt
index f452db1770..a06591c31f 100644
--- a/Tests/RunCMake/CMP0045/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0045/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 5d005540d8..294e25215e 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -166,6 +166,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
-DPSEUDO_BC=$<TARGET_FILE:pseudo_BC>
-DPSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify>
-DPSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind>
+ -DPSEUDO_CUDA_MEMCHECK=$<TARGET_FILE:pseudo_cuda-memcheck>
-DPSEUDO_BC_NOLOG=$<TARGET_FILE:pseudonl_BC>
-DPSEUDO_PURIFY_NOLOG=$<TARGET_FILE:pseudonl_purify>
-DPSEUDO_VALGRIND_NOLOG=$<TARGET_FILE:pseudonl_valgrind>
@@ -209,6 +210,7 @@ add_RunCMake_test(DisallowedCommands)
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(ExportCompileCommands)
endif()
+add_RunCMake_test(ExcludeFromAll)
add_RunCMake_test(ExternalData)
add_RunCMake_test(FeatureSummary)
add_RunCMake_test(FPHSA)
@@ -394,7 +396,7 @@ add_RunCMake_test(while)
add_RunCMake_test(CMP0004)
add_RunCMake_test(TargetPolicies)
add_RunCMake_test(alias_targets)
-add_RunCMake_test(interface_library)
+add_RunCMake_test(InterfaceLibrary)
add_RunCMake_test(no_install_prefix)
add_RunCMake_test(configure_file)
add_RunCMake_test(CTestTimeout -DTIMEOUT=${CTestTestTimeout_TIME})
@@ -689,8 +691,8 @@ add_RunCMake_test(AutoExportDll
add_RunCMake_test(AndroidMK)
if(CMake_TEST_ANDROID_NDK OR CMake_TEST_ANDROID_STANDALONE_TOOLCHAIN)
- if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
- message(FATAL_ERROR "Android tests supported only by Makefile and Ninja generators")
+ if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja|Visual Studio 1[456]")
+ message(FATAL_ERROR "Android tests supported only by Makefile, Ninja, and Visual Studio >= 14 generators")
endif()
foreach(v TEST_ANDROID_NDK TEST_ANDROID_STANDALONE_TOOLCHAIN)
if(CMake_${v})
diff --git a/Tests/RunCMake/CPack/DragNDrop/Accept.txt b/Tests/RunCMake/CPack/DragNDrop/Accept.txt
new file mode 100644
index 0000000000..975fbec825
--- /dev/null
+++ b/Tests/RunCMake/CPack/DragNDrop/Accept.txt
@@ -0,0 +1 @@
+y
diff --git a/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake b/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake
index 023e597ad4..896fba7c2e 100644
--- a/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake
+++ b/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake
@@ -5,6 +5,7 @@ function(getPackageContent FILE RESULT_VAR)
file(REMOVE_RECURSE "${path_}/content")
file(MAKE_DIRECTORY "${path_}/content")
execute_process(COMMAND ${HDIUTIL_EXECUTABLE} attach -mountroot ${path_}/content -nobrowse ${FILE}
+ INPUT_FILE "${src_dir}/DragNDrop/Accept.txt"
RESULT_VARIABLE attach_result_
ERROR_VARIABLE attach_error_
OUTPUT_STRIP_TRAILING_WHITESPACE)
diff --git a/Tests/RunCMake/CPack/DragNDrop/packaging_MONOLITHIC_default.cmake b/Tests/RunCMake/CPack/DragNDrop/packaging_MONOLITHIC_default.cmake
new file mode 100644
index 0000000000..ca278907cd
--- /dev/null
+++ b/Tests/RunCMake/CPack/DragNDrop/packaging_MONOLITHIC_default.cmake
@@ -0,0 +1,2 @@
+set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK ON)
+set(CPACK_DMG_VOLUME_NAME "volume-name")
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 064b4dca60..530bcdf5ad 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -10,6 +10,7 @@ run_cpack_test(DEBUGINFO "RPM.DEBUGINFO;DEB.DEBUGINFO" true "COMPONENT")
run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM.DEFAULT_PERMISSIONS;DEB.DEFAULT_PERMISSIONS" false "MONOLITHIC;COMPONENT")
run_cpack_test(DEPENDENCIES "RPM.DEPENDENCIES;DEB.DEPENDENCIES" true "COMPONENT")
run_cpack_test(DIST "RPM.DIST" false "MONOLITHIC")
+run_cpack_test(DMG_SLA "DragNDrop" false "MONOLITHIC")
run_cpack_test(EMPTY_DIR "RPM.EMPTY_DIR;DEB.EMPTY_DIR;TGZ" true "MONOLITHIC;COMPONENT")
run_cpack_test(VERSION "RPM.VERSION;DEB.VERSION" false "MONOLITHIC;COMPONENT")
run_cpack_test(EXTRA "DEB.EXTRA" false "COMPONENT")
@@ -46,3 +47,4 @@ run_cpack_test_subtests(
"MONOLITHIC;COMPONENT"
)
run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT")
+run_cpack_test_package_target(PRE_POST_SCRIPTS "ZIP" false "MONOLITHIC;COMPONENT")
diff --git a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
index 70ad48b4b6..6e841fc923 100644
--- a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
@@ -34,7 +34,7 @@ set(_expected_description [[ Description: This is the summary line
This is the Debian package multiline description.
.
It must be formatted properly! Otherwise, the result `*.deb`
- package become broken and cant be installed!
+ package become broken and cannot be installed!
.
It may contains `;` characters (even like this `;;;;`). Example:
.
diff --git a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake
index 893eb0113c..2a27b46225 100644
--- a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake
+++ b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake
@@ -5,7 +5,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "This is the summary line")
set(_description [[This is the Debian package multiline description.
It must be formatted properly! Otherwise, the result `*.deb`
-package become broken and cant be installed!
+package become broken and cannot be installed!
It may contains `;` characters (even like this `;;;;`). Example:
diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf b/Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf
new file mode 100644
index 0000000000..c1da71171b
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf
@@ -0,0 +1,7 @@
+{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
+{\colortbl ;\red0\green0\blue255;}
+{\*\generator Riched20 10.0.18362}\viewkind4\uc1
+\pard\sa200\sl276\slmult1\b\f0\fs22\lang9 LICENSE\b0\par
+This is an installer created using CPack ({{\field{\*\fldinst{HYPERLINK https://cmake.org }}{\fldrslt{https://cmake.org\ul0\cf0}}}}\f0\fs22 ). No license provided.\par
+\par
+}
diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/English.menu.txt b/Tests/RunCMake/CPack/tests/DMG_SLA/English.menu.txt
new file mode 100644
index 0000000000..b2cbc2542a
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DMG_SLA/English.menu.txt
@@ -0,0 +1,9 @@
+English
+Agree
+Disagree
+Print
+Save...
+You agree to the License Agreement terms when you click the "Agree" button.
+Software License Agreement
+This text cannot be saved. This disk may be full or locked or the file may be locked.
+Unable to print. Make sure you have selected a printer.
diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA/ExpectedFiles.cmake
new file mode 100644
index 0000000000..d1a3a5fb2d
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DMG_SLA/ExpectedFiles.cmake
@@ -0,0 +1,2 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt b/Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt
new file mode 100644
index 0000000000..0edd1f2c3e
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt
@@ -0,0 +1,3 @@
+LIZENZ
+------
+Dies ist ein Installationsprogramm, das mit erstellt wurde CPack (https://cmake.org). Keine Lizenz angegeben.
diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt b/Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt
new file mode 100644
index 0000000000..77248183d6
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt
@@ -0,0 +1,9 @@
+German
+Akzeptieren
+Ablehnen
+Drucken
+Speichern...
+Klicken Sie auf "Akzeptieren", wenn Sie mit den Bestimmungen des Software-Lizenzvertrages einverstanden sind.
+Software-Lizenzvertrag
+Dieser Text kann nicht gesichert werden. Diese Festplatte ist mšglicherweise voll oder geschŸtzt oder der Ordner ist geschŸtzt.
+Es kann nicht gedruckt werden. Bitte stellen Sie sicher, dass ein Drucker ausgewŠhlt ist.
diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA/VerifyResult.cmake
new file mode 100644
index 0000000000..010e14c737
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DMG_SLA/VerifyResult.cmake
@@ -0,0 +1,33 @@
+set(dmg "${bin_dir}/${FOUND_FILE_1}")
+execute_process(COMMAND hdiutil udifderez -xml "${dmg}" OUTPUT_VARIABLE out ERROR_VARIABLE err RESULT_VARIABLE res)
+if(NOT res EQUAL 0)
+ string(REPLACE "\n" "\n " err " ${err}")
+ message(FATAL_ERROR "Running 'hdiutil udifderez -xml' on\n ${dmg}\nfailed with:\n${err}")
+endif()
+foreach(key "LPic" "STR#" "TEXT" "RTF ")
+ if(NOT out MATCHES "<key>${key}</key>")
+ string(REPLACE "\n" "\n " out " ${out}")
+ message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${dmg}\ndid not show '${key}' key:\n${out}")
+ endif()
+endforeach()
+foreach(line
+ # LPic
+ "\tAAAAAgAAAAAAAAADAAEAAA==\n"
+ # STR# English first and last base64 lines
+ "\tAAkHRW5nbGlzaAVBZ3JlZQhEaXNhZ3JlZQVQcmludAdTYXZlLi4u\n"
+ "\tZCBhIHByaW50ZXIu\n"
+ # STR# German first and last base64 lines
+ "\tAAkGR2VybWFuC0FremVwdGllcmVuCEFibGVobmVuB0RydWNrZW4M\n"
+ "\tYXVzZ2V3wopobHQgaXN0Lg==\n"
+ # RTF English first and last base64 lines
+ "\te1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZGVmZjBcbm91aWNvbXBh\n"
+ "\tdmlkZWQuXHBhcg1ccGFyDX0NDQ==\n"
+ # TEXT German first and last base64 lines
+ "\tTElaRU5aDS0tLS0tLQ1EaWVzIGlzdCBlaW4gSW5zdGFsbGF0aW9u\n"
+ "\tZ2ViZW4uDQ0=\n"
+ )
+ if(NOT out MATCHES "${line}")
+ string(REPLACE "\n" "\n " out " ${out}")
+ message(FATAL_ERROR "error: running 'hdiutil udifderez -xml' on\n ${dmg}\ndid not show '${line}':\n${out}")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/CPack/tests/DMG_SLA/test.cmake b/Tests/RunCMake/CPack/tests/DMG_SLA/test.cmake
new file mode 100644
index 0000000000..2804b0bb99
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DMG_SLA/test.cmake
@@ -0,0 +1,3 @@
+install(FILES CMakeLists.txt DESTINATION foo)
+set(CPACK_DMG_SLA_DIR "${CMAKE_CURRENT_LIST_DIR}")
+set(CPACK_DMG_SLA_LANGUAGES English German)
diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake
index 6f7c4c224e..3db80142f2 100644
--- a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake
+++ b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake
@@ -29,3 +29,11 @@ expect_file(${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt)
expect_file(${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt)
message(STATUS "This status message is expected to be visible")
+
+set(
+ CPACK_EXTERNAL_BUILT_PACKAGES
+ ${CPACK_TEMPORARY_DIRECTORY}/f1/share/cpack-test/f1.txt
+ ${CPACK_TEMPORARY_DIRECTORY}/f2/share/cpack-test/f2.txt
+ ${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt
+ ${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt
+ )
diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt
index 37d635fa46..587b2e8106 100644
--- a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt
+++ b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt
@@ -1 +1,11 @@
-- This status message is expected to be visible
+CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/external-0\.1\.1-.*\.json generated\.
+CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/external-0\.1\.1-.*\.json\.sha1 generated\.
+CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f1\.txt generated\.
+CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f1\.txt\.sha1 generated\.
+CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f2\.txt generated\.
+CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f2\.txt\.sha1 generated\.
+CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f3\.txt generated\.
+CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f3\.txt\.sha1 generated\.
+CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f4\.txt generated\.
+CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f4\.txt\.sha1 generated\.
diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake
index bc9766b153..d4781baad4 100644
--- a/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake
+++ b/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake
@@ -17,6 +17,7 @@ elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid_bad")
elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "stage_and_package")
set(CPACK_EXTERNAL_ENABLE_STAGING 1)
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/create_package.cmake")
+ set(CPACK_PACKAGE_CHECKSUM SHA1)
endif()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/f1.txt" test1)
diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake
new file mode 100644
index 0000000000..63a36a36e3
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake
@@ -0,0 +1,19 @@
+set(SATU "/satu;/satu/CMakeLists.txt")
+set(DUA "/dua;/dua/CMakeLists.txt")
+
+if(GENERATOR_TYPE STREQUAL ZIP)
+ set(_ext "zip")
+elseif(GENERATOR_TYPE STREQUAL TGZ)
+ set(_ext "tar.gz")
+endif()
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(EXPECTED_FILES_COUNT "2")
+ set(EXPECTED_FILE_1 "*-satu.${_ext}")
+ set(EXPECTED_FILE_CONTENT_1_LIST ${SATU})
+ set(EXPECTED_FILE_2 "*-dua.${_ext}")
+ set(EXPECTED_FILE_CONTENT_2_LIST ${DUA})
+else()
+ set(EXPECTED_FILES_COUNT "1")
+ set(EXPECTED_FILE_CONTENT_1_LIST ${SATU} ${DUA})
+endif()
diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt
new file mode 100644
index 0000000000..319d0da149
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt
@@ -0,0 +1,4 @@
+-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre\.cmake and generator ZIP
+.*
+-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post\.cmake and generator ZIP
+-- Built packages: .*/_CPack_Packages/.*/pre_post_scripts-.*-dua.zip;.*/_CPack_Packages/.*/pre_post_scripts-.*-satu.zip
diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt
new file mode 100644
index 0000000000..632c4d14c2
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt
@@ -0,0 +1,4 @@
+-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre\.cmake and generator ZIP
+.*
+-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post\.cmake and generator ZIP
+-- Built packages: .*/_CPack_Packages/.*/pre_post_scripts-0\.1\.1-.*\.zip
diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake
new file mode 100644
index 0000000000..cf0b1490fd
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake
@@ -0,0 +1,2 @@
+message(STATUS "The message from ${CMAKE_CURRENT_LIST_FILE} and generator ${CPACK_GENERATOR}")
+message(STATUS "Built packages: ${CPACK_PACKAGE_FILES}")
diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake
new file mode 100644
index 0000000000..b04aa6bbf3
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake
@@ -0,0 +1 @@
+message(STATUS "The message from ${CMAKE_CURRENT_LIST_FILE} and generator ${CPACK_GENERATOR}")
diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake
new file mode 100644
index 0000000000..f1b6d5f8f6
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake
@@ -0,0 +1,9 @@
+install(FILES CMakeLists.txt DESTINATION satu COMPONENT satu)
+install(FILES CMakeLists.txt DESTINATION dua COMPONENT dua)
+
+set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/pre.cmake")
+set(CPACK_POST_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/post.cmake")
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(CPACK_COMPONENTS_ALL satu dua)
+endif()
diff --git a/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake
index b3accb58f6..35a93d6a4d 100644
--- a/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake
@@ -13,7 +13,7 @@ function(checkPackageURL FILE TAG EXPECTED_URL)
endif()
endforeach()
if(NOT _seen_url)
- message(FATAL_ERROR "The packge `${FILE}` do not have URL as expected")
+ message(FATAL_ERROR "The package `${FILE}` do not have URL as expected")
endif()
endfunction()
diff --git a/Tests/RunCMake/CTest/CMakeLists.txt b/Tests/RunCMake/CTest/CMakeLists.txt
index 73e6a785a4..f1a83e8c4b 100644
--- a/Tests/RunCMake/CTest/CMakeLists.txt
+++ b/Tests/RunCMake/CTest/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
if(NOT NoProject)
project(${RunCMake_TEST} NONE)
endif()
diff --git a/Tests/RunCMake/CheckModules/CMakeLists.txt b/Tests/RunCMake/CheckModules/CMakeLists.txt
index 9872df2a18..842c5cf523 100644
--- a/Tests/RunCMake/CheckModules/CMakeLists.txt
+++ b/Tests/RunCMake/CheckModules/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 2.8.12)
cmake_policy(SET CMP0054 NEW)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt
new file mode 100644
index 0000000000..d197c913c2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt
new file mode 100644
index 0000000000..8d98f9debd
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
index d2a28310de..cf2c087844 100644
--- a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
@@ -5,3 +5,4 @@ add_custom_command(
add_custom_target(CustomTarget ALL DEPENDS output.txt)
add_custom_target(CustomTarget2 ALL DEPENDS output.txt)
add_custom_target(CustomTarget3 ALL DEPENDS output.txt)
+add_custom_target(CustomTargetFail COMMAND DoesNotExist)
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
index 03286f1f73..e24e131b7c 100644
--- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
+++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
@@ -1 +1 @@
-^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":1}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":true,"version":{.*}}$
+^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":2}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":true,"version":{.*}}$
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt
deleted file mode 100644
index 4729ccb8fa..0000000000
--- a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^Files ".*/compare_files/lf" to ".*/compare_files/crlf" are different.$
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt
deleted file mode 100644
index 8a9ca81f88..0000000000
--- a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^Files "nonexistent_a" to "nonexistent_b" are different.$
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt
new file mode 100644
index 0000000000..0cfbf08886
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt
@@ -0,0 +1 @@
+2
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt
new file mode 100644
index 0000000000..8d98f9debd
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-result.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-no-arg-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-result.txt
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-no-arg-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-no-arg-stderr.txt
new file mode 100644
index 0000000000..50d9b0332a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-no-arg-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Error: cmake version .*
+Usage: .* -E <command> \[arguments\.\.\.\]
+Available commands:
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-result.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-result.txt
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt
new file mode 100644
index 0000000000..21e60eec02
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-no-directory-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: failed to create link .* no such file or directory
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-result.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-non-existent-source-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-result.txt
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-non-existent-source-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-non-existent-source-stderr.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-non-existent-source-stderr.txt
new file mode 100644
index 0000000000..a3345712b9
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-non-existent-source-stderr.txt
@@ -0,0 +1 @@
+^failed to create hard link because source path .* does not exist
diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake
new file mode 100644
index 0000000000..5b97aecc0d
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-prereq-check.cmake
@@ -0,0 +1,3 @@
+if(${actual_stderr_var} MATCHES "operation not permitted")
+ unset(msg)
+endif()
diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/add_custom_command-TARGET-result.txt
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-stderr.txt b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-stderr.txt
new file mode 100644
index 0000000000..a3345712b9
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_create_hardlink-unresolved-symlink-stderr.txt
@@ -0,0 +1 @@
+^failed to create hard link because source path .* does not exist
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 973391d646..b20e683ed3 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -22,6 +22,7 @@ run_cmake_command(E_compare_files-different-eol ${CMAKE_COMMAND} -E compare_file
run_cmake_command(E_compare_files-ignore-eol-same ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/lf ${RunCMake_SOURCE_DIR}/compare_files/crlf)
run_cmake_command(E_compare_files-ignore-eol-empty ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/empty1 ${RunCMake_SOURCE_DIR}/compare_files/empty2)
run_cmake_command(E_compare_files-ignore-eol-nonexistent ${CMAKE_COMMAND} -E compare_files --ignore-eol nonexistent_a nonexistent_b)
+run_cmake_command(E_compare_files-invalid-arguments ${CMAKE_COMMAND} -E compare_files file1.txt file2.txt file3.txt)
run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append)
run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename)
run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg)
@@ -66,6 +67,32 @@ run_cmake_command(install-bad-dir
run_cmake_command(install-options-to-vars
${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-install-options-to-vars
--strip --prefix /var/test --config sample --component pack)
+run_cmake_command(install-default-dir-permissions-all
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,g=rx,o=rx)
+run_cmake_command(install-default-dir-permissions-afew
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,g=rx)
+run_cmake_command(install-default-dir-permissions-none
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars)
+run_cmake_command(install-default-dir-permissions-invalid-comma1
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwxg=,x)
+run_cmake_command(install-default-dir-permissions-invalid-comma2
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwxg,=x)
+run_cmake_command(install-default-dir-permissions-comma-at-the-end
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,)
+run_cmake_command(install-default-dir-permissions-invalid-assignment
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,=x)
+run_cmake_command(install-default-dir-permissions-assignment-at-the-end
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions u=rwx,g=)
+run_cmake_command(install-default-dir-permissions-assignment-at-the-beginning
+ ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars
+ --default-directory-permissions =u=rwx,g=rx)
run_cmake_command(cache-bad-entry
${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-entry/)
@@ -134,6 +161,8 @@ function(run_BuildDir)
${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget)
run_cmake_command(BuildDir--build-multiple-targets ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build -t CustomTarget2 --target CustomTarget3)
+ run_cmake_command(BuildDir--build-multiple-targets-fail ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build -t CustomTargetFail --target CustomTarget3)
run_cmake_command(BuildDir--build-multiple-targets-jobs ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget CustomTarget2 -j2 --target CustomTarget3)
run_cmake_command(BuildDir--build-multiple-targets-with-clean-first ${CMAKE_COMMAND} -E chdir ..
@@ -319,6 +348,42 @@ run_cmake_command(E_create_symlink-no-replace-dir
${CMAKE_COMMAND} -E create_symlink T .
)
+#create hard link tests
+run_cmake_command(E_create_hardlink-no-arg
+ ${CMAKE_COMMAND} -E create_hardlink
+ )
+
+set(dir ${RunCMake_BINARY_DIR}/hardlink_tests)
+file(REMOVE_RECURSE "${dir}")
+file(MAKE_DIRECTORY ${dir})
+
+run_cmake_command(E_create_hardlink-non-existent-source
+ ${CMAKE_COMMAND} -E create_hardlink ${dir}/I_dont_exist ${dir}/link
+ )
+
+file(TOUCH ${dir}/1)
+
+run_cmake_command(E_create_hardlink-ok
+ ${CMAKE_COMMAND} -E create_hardlink ${dir}/1 ${dir}/1-link
+ )
+
+run_cmake_command(E_create_hardlink-no-directory
+ ${CMAKE_COMMAND} -E create_hardlink ${dir}/1 ${dir}/a/1-link
+ )
+
+#On Windows, if the user does not have sufficient privileges
+#don't fail this test
+set(RunCMake_DEFAULT_stderr "(operation not permitted)?")
+run_cmake_command(E_create_hardlink-unresolved-symlink-prereq
+ ${CMAKE_COMMAND} -E create_symlink ${dir}/1 ${dir}/1-symlink
+ )
+file(REMOVE ${dir}/1)
+
+run_cmake_command(E_create_hardlink-unresolved-symlink
+ ${CMAKE_COMMAND} -E create_hardlink ${dir}/1-symlink ${dir}/1s-link
+ )
+unset(RunCMake_DEFAULT_stderr)
+
set(in ${RunCMake_SOURCE_DIR}/copy_input)
set(out ${RunCMake_BINARY_DIR}/copy_output)
file(REMOVE_RECURSE "${out}")
diff --git a/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake b/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake
new file mode 100644
index 0000000000..42ef7456fe
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake
@@ -0,0 +1,3 @@
+if(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS)
+ message("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is ${CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS}")
+endif()
diff --git a/Tests/RunCMake/interface_library/genex_link-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt
index 573541ac97..573541ac97 100644
--- a/Tests/RunCMake/interface_library/genex_link-result.txt
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt
new file mode 100644
index 0000000000..42f4b3f854
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt
@@ -0,0 +1 @@
+CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE;GROUP_READ;GROUP_EXECUTE
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt
new file mode 100644
index 0000000000..813d9c3662
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt
@@ -0,0 +1 @@
+CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE;GROUP_READ;GROUP_EXECUTE;WORLD_READ;WORLD_EXECUTE
diff --git a/Tests/RunCMake/interface_library/global-interface-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/global-interface-result.txt
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt
new file mode 100644
index 0000000000..1b80952401
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt
new file mode 100644
index 0000000000..6680932e18
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt
@@ -0,0 +1 @@
+CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE
diff --git a/Tests/RunCMake/interface_library/invalid_name-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/invalid_name-result.txt
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt
new file mode 100644
index 0000000000..1b80952401
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/interface_library/invalid_signature-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/invalid_signature-result.txt
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt
new file mode 100644
index 0000000000..1b80952401
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/interface_library/target_commands-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/target_commands-result.txt
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt
new file mode 100644
index 0000000000..1b80952401
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/interface_library/whitelist-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt
index d00491fd7e..d00491fd7e 100644
--- a/Tests/RunCMake/interface_library/whitelist-result.txt
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt
new file mode 100644
index 0000000000..1b80952401
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt
@@ -0,0 +1 @@
+--default-directory-permissions is in incorrect format
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt
new file mode 100644
index 0000000000..10f32932ee
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CompatibleInterface/CMakeLists.txt b/Tests/RunCMake/CompatibleInterface/CMakeLists.txt
index f452db1770..ebab7a357a 100644
--- a/Tests/RunCMake/CompatibleInterface/CMakeLists.txt
+++ b/Tests/RunCMake/CompatibleInterface/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
index 0196611ca3..64b52d9e1a 100644
--- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
+++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.3)
project(CompatibleInterface)
diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake
index 5772856cc6..f072eb0bc6 100644
--- a/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake
+++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake
@@ -5,5 +5,5 @@ add_library(bar UNKNOWN IMPORTED)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING INCLUDE_DIRECTORIES)
add_executable(user main.cpp)
-set_property(TARGET user PROPERTY INCLUDE_DIRECTORIES bar_inc)
+set_property(TARGET user PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/bar_inc)
target_link_libraries(user foo bar)
diff --git a/Tests/RunCMake/CompilerChange/CMakeLists.txt b/Tests/RunCMake/CompilerChange/CMakeLists.txt
index b4b30165f0..14c47ad6bb 100644
--- a/Tests/RunCMake/CompilerChange/CMakeLists.txt
+++ b/Tests/RunCMake/CompilerChange/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
if(NOT RunCMake_TEST)
set(RunCMake_TEST "$ENV{RunCMake_TEST}") # needed when cache is deleted
endif()
diff --git a/Tests/RunCMake/CompilerNotFound/CMakeLists.txt b/Tests/RunCMake/CompilerNotFound/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/CompilerNotFound/CMakeLists.txt
+++ b/Tests/RunCMake/CompilerNotFound/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Configure/CMakeLists.txt b/Tests/RunCMake/Configure/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/Configure/CMakeLists.txt
+++ b/Tests/RunCMake/Configure/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/DisallowedCommands/CMakeLists.txt b/Tests/RunCMake/DisallowedCommands/CMakeLists.txt
index 12cd3c7757..4b3de84d94 100644
--- a/Tests/RunCMake/DisallowedCommands/CMakeLists.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/interface_library/CMakeLists.txt b/Tests/RunCMake/ExcludeFromAll/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/interface_library/CMakeLists.txt
+++ b/Tests/RunCMake/ExcludeFromAll/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake b/Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake
new file mode 100644
index 0000000000..2b4fc89311
--- /dev/null
+++ b/Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake
@@ -0,0 +1,26 @@
+include(RunCMake)
+
+function(run_single_config_test label config exclude_from_all_value expectation)
+ set(case single-config)
+ message("-- Starting ${case} test: ${label}")
+ set(full_case_name "${case}-build-${config}")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${full_case_name}/")
+ run_cmake_with_options(${case}
+ -DCMAKE_BUILD_TYPE=${config}
+ -DTOOL_EXCLUDE_FROM_ALL=${exclude_from_all_value})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ include(${RunCMake_TEST_BINARY_DIR}/target_files_${config}.cmake)
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config ${config})
+endfunction()
+
+run_single_config_test("explictly not excluded" Debug 0 "should_exist")
+run_single_config_test("excluded" Debug 1 "should_not_exist")
+
+if(RunCMake_GENERATOR MATCHES "^(Xcode|Visual Studio)")
+ run_cmake(error-on-mixed-config)
+else()
+ run_single_config_test("explicitly not excluded with genex"
+ Release $<CONFIG:Debug> "should_exist")
+ run_single_config_test("excluded with genex"
+ Debug $<CONFIG:Debug> "should_not_exist")
+endif()
diff --git a/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-result.txt b/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt b/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt
new file mode 100644
index 0000000000..6dc785f3f2
--- /dev/null
+++ b/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error in CMakeLists.txt:
+ The EXCLUDE_FROM_ALL property of target "release_only_tool" varies by
+ configuration. This is not supported by the "[^"]+"
diff --git a/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config.cmake b/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config.cmake
new file mode 100644
index 0000000000..6c0ed1d4a6
--- /dev/null
+++ b/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config.cmake
@@ -0,0 +1,6 @@
+enable_language(C)
+
+set(CMAKE_CONFIGURATION_TYPES "Release;Debug" CACHE STRING "")
+
+add_executable(release_only_tool main.c)
+set_property(TARGET release_only_tool PROPERTY EXCLUDE_FROM_ALL "$<NOT:$<CONFIG:Release>>")
diff --git a/Tests/RunCMake/ExcludeFromAll/main.c b/Tests/RunCMake/ExcludeFromAll/main.c
new file mode 100644
index 0000000000..f8b643afbf
--- /dev/null
+++ b/Tests/RunCMake/ExcludeFromAll/main.c
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/ExcludeFromAll/single-config-build-check.cmake b/Tests/RunCMake/ExcludeFromAll/single-config-build-check.cmake
new file mode 100644
index 0000000000..1c455f2562
--- /dev/null
+++ b/Tests/RunCMake/ExcludeFromAll/single-config-build-check.cmake
@@ -0,0 +1,17 @@
+if(expectation STREQUAL "should_not_exist")
+ set(should_exist FALSE)
+elseif(expectation STREQUAL "should_exist")
+ set(should_exist TRUE)
+else()
+ message(FATAL_ERROR "Encountered unknown expectation: ${expectation}")
+endif()
+
+if(EXISTS "${TARGET_FILE_tool_${config}}")
+ if(NOT should_exist)
+ message(FATAL_ERROR "${TARGET_FILE_tool_${config}} should not exist.")
+ endif()
+else()
+ if(should_exist)
+ message(FATAL_ERROR "${TARGET_FILE_tool_${config}} should exist.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/ExcludeFromAll/single-config.cmake b/Tests/RunCMake/ExcludeFromAll/single-config.cmake
new file mode 100644
index 0000000000..aa49c214eb
--- /dev/null
+++ b/Tests/RunCMake/ExcludeFromAll/single-config.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+add_executable(tool main.c)
+set_property(TARGET tool PROPERTY EXCLUDE_FROM_ALL "${TOOL_EXCLUDE_FROM_ALL}")
+
+file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/target_files_$<CONFIG>.cmake" CONTENT [[
+set(TARGET_FILE_tool_$<CONFIG> [==[$<TARGET_FILE:tool>]==])
+]])
diff --git a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt
+++ b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ExternalData/CMakeLists.txt b/Tests/RunCMake/ExternalData/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/ExternalData/CMakeLists.txt
+++ b/Tests/RunCMake/ExternalData/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FPHSA/CMakeLists.txt b/Tests/RunCMake/FPHSA/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/FPHSA/CMakeLists.txt
+++ b/Tests/RunCMake/FPHSA/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FeatureSummary/CMakeLists.txt b/Tests/RunCMake/FeatureSummary/CMakeLists.txt
index 72abfc8099..74b3ff8de3 100644
--- a/Tests/RunCMake/FeatureSummary/CMakeLists.txt
+++ b/Tests/RunCMake/FeatureSummary/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index a3dd9ffc32..b567bf1347 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -12,7 +12,7 @@ def read_codemodel_json_data(filename):
def check_objects(o, g):
assert is_list(o)
assert len(o) == 1
- check_index_object(o[0], "codemodel", 2, 1, check_object_codemodel(g))
+ check_index_object(o[0], "codemodel", 2, 2, check_object_codemodel(g))
def check_backtrace(t, b, backtrace):
btg = t["backtraceGraph"]
@@ -42,6 +42,16 @@ def check_backtrace(t, b, backtrace):
assert b is None
+def check_backtraces(t, actual, expected):
+ assert is_list(actual)
+ assert is_list(expected)
+ assert len(actual) == len(expected)
+
+ i = 0
+ while i < len(actual):
+ check_backtrace(t, actual[i], expected[i])
+ i += 1
+
def check_directory(c):
def _check(actual, expected):
assert is_dict(actual)
@@ -421,6 +431,19 @@ def check_target(c):
missing_exception=lambda e: "Precompile header: %s" % e["header"],
extra_exception=lambda a: "Precompile header: %s" % a["header"])
+ if "languageStandard" in expected:
+ expected_keys.append("languageStandard")
+
+ def check_language_standard(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["backtraces", "standard"]
+ assert actual["standard"] == expected["standard"]
+ check_backtraces(obj, actual["backtraces"], expected["backtraces"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_language_standard(actual["languageStandard"], expected["languageStandard"])
+
if expected["defines"] is not None:
expected_keys.append("defines")
@@ -544,6 +567,8 @@ def gen_check_targets(c, g, inSource):
read_codemodel_json_data("targets/zero_check_cxx.json"),
read_codemodel_json_data("targets/cxx_lib.json"),
read_codemodel_json_data("targets/cxx_exe.json"),
+ read_codemodel_json_data("targets/cxx_standard_compile_feature_exe.json"),
+ read_codemodel_json_data("targets/cxx_standard_exe.json"),
read_codemodel_json_data("targets/cxx_shared_lib.json"),
read_codemodel_json_data("targets/cxx_shared_exe.json"),
read_codemodel_json_data("targets/cxx_static_lib.json"),
@@ -592,6 +617,12 @@ def gen_check_targets(c, g, inSource):
e["sources"] = precompile_header_data["sources"]
e["sourceGroups"] = precompile_header_data["sourceGroups"]
+ if os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "cxx", "cxx_std_11.txt")):
+ for e in expected:
+ if e["name"] == "cxx_standard_compile_feature_exe":
+ language_standard_data = read_codemodel_json_data("targets/cxx_standard_compile_feature_exe_languagestandard.json")
+ e["compileGroups"][0]["languageStandard"] = language_standard_data["languageStandard"]
+
if not os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "ipo_enabled.txt")):
for e in expected:
try:
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
index ebe717aea6..a51b6eb8d6 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
@@ -7,6 +7,8 @@
"^ALL_BUILD::@a56b12a3f5c0529fb296$",
"^ZERO_CHECK::@a56b12a3f5c0529fb296$",
"^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_standard_exe::@a56b12a3f5c0529fb296$",
"^cxx_lib::@a56b12a3f5c0529fb296$",
"^cxx_shared_exe::@a56b12a3f5c0529fb296$",
"^cxx_shared_lib::@a56b12a3f5c0529fb296$",
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json
index 296ae6c257..363e8530cf 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json
@@ -10,6 +10,8 @@
"^ZERO_CHECK::@a56b12a3f5c0529fb296$",
"^cxx_lib::@a56b12a3f5c0529fb296$",
"^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_standard_exe::@a56b12a3f5c0529fb296$",
"^cxx_shared_lib::@a56b12a3f5c0529fb296$",
"^cxx_shared_exe::@a56b12a3f5c0529fb296$",
"^cxx_static_lib::@a56b12a3f5c0529fb296$",
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
index 92a794444b..1f443b12ab 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
@@ -80,6 +80,14 @@
"backtrace": null
},
{
+ "id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_standard_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
"id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
"backtrace": null
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
index b4def78c55..59bd750e06 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
@@ -116,6 +116,14 @@
"backtrace": null
},
{
+ "id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_standard_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
"id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
"backtrace": null
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json
new file mode 100644
index 0000000000..d6d573f8b9
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json
@@ -0,0 +1,110 @@
+{
+ "name": "cxx_standard_compile_feature_exe",
+ "id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 26,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "languageStandard" :
+ {
+ "backtraces": [
+ [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 27,
+ "command": "set_property",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ ],
+ "standard" : "98"
+ },
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 26,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_standard_compile_feature_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_standard_compile_feature_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_standard_compile_feature_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json
new file mode 100644
index 0000000000..0c4eabb09c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe_languagestandard.json
@@ -0,0 +1,36 @@
+{
+ "languageStandard" :
+ {
+ "backtraces": [
+ [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 29,
+ "command": "target_compile_features",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 30,
+ "command": "target_compile_features",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ ],
+ "standard" : "11"
+ }
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json
new file mode 100644
index 0000000000..9cb28321a3
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json
@@ -0,0 +1,110 @@
+{
+ "name": "cxx_standard_exe",
+ "id": "^cxx_standard_exe::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 23,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "languageStandard" :
+ {
+ "backtraces": [
+ [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 24,
+ "command": "set_property",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ ],
+ "standard" : "17"
+ },
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 23,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_standard_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_standard_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_standard_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
index fa51195fec..76235f5c5a 100644
--- a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
+++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
@@ -19,3 +19,14 @@ target_link_options(cxx_exe PUBLIC TargetLinkOptions)
target_link_directories(cxx_exe PUBLIC "${CMAKE_BINARY_DIR}/TargetLinkDir")
target_precompile_headers(cxx_exe PUBLIC ../empty.h)
+
+add_executable(cxx_standard_exe ../empty.cxx)
+set_property(TARGET cxx_standard_exe PROPERTY CXX_STANDARD 17)
+
+add_executable(cxx_standard_compile_feature_exe ../empty.cxx)
+set_property(TARGET cxx_standard_compile_feature_exe PROPERTY CXX_STANDARD 98)
+if(CMAKE_CXX_STANDARD_DEFAULT AND DEFINED CMAKE_CXX11_STANDARD_COMPILE_OPTION)
+ target_compile_features(cxx_standard_compile_feature_exe PRIVATE cxx_std_11)
+ target_compile_features(cxx_standard_compile_feature_exe PRIVATE cxx_decltype)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_std_11.txt" "")
+endif()
diff --git a/Tests/RunCMake/File_Generate/AdjacentInOut.cmake b/Tests/RunCMake/File_Generate/AdjacentInOut.cmake
new file mode 100644
index 0000000000..828c2ee692
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/AdjacentInOut.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0070 NEW)
+if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt")
+ message(FATAL_ERROR "CMake should not re-run during the build!")
+endif()
+configure_file(AdjacentInOut.in ${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt.tmp)
+file(GENERATE OUTPUT AdjacentInOut.txt INPUT ${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt.tmp)
diff --git a/Tests/RunCMake/File_Generate/AdjacentInOut.in b/Tests/RunCMake/File_Generate/AdjacentInOut.in
new file mode 100644
index 0000000000..bfbbda73c5
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/AdjacentInOut.in
@@ -0,0 +1 @@
+Sample Text File
diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt
index bc0cf5d164..3178de5834 100644
--- a/Tests/RunCMake/File_Generate/CMakeLists.txt
+++ b/Tests/RunCMake/File_Generate/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
if(NOT TEST_FILE)
set(TEST_FILE ${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
index 94aaca84a1..5987417d20 100644
--- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
+++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
@@ -72,6 +72,7 @@ if (UNIX AND EXISTS /bin/sh)
if (NOT script_output STREQUAL SUCCESS)
message(SEND_ERROR "Generated script did not execute correctly:\n${script_output}\n====\n${script_error}")
endif()
+ unset(RunCMake_TEST_NO_CLEAN)
endif()
if (RunCMake_GENERATOR MATCHES Makefiles)
@@ -104,3 +105,10 @@ if (RunCMake_GENERATOR MATCHES Makefiles)
message(SEND_ERROR "File did not re-generate: \"${RunCMake_BINARY_DIR}/ReRunCMake-build/output_file.txt\"")
endif()
endif()
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AdjacentInOut-build)
+run_cmake(AdjacentInOut)
+set(RunCMake_TEST_NO_CLEAN 1)
+run_cmake_command(AdjacentInOut-nowork ${CMAKE_COMMAND} --build .)
+unset(RunCMake_TEST_BINARY_DIR)
+unset(RunCMake_TEST_NO_CLEAN)
diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt b/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt
new file mode 100644
index 0000000000..68d23d48c2
--- /dev/null
+++ b/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0072-OLD.cmake:1 \(cmake_policy\):
+ The OLD behavior for policy CMP0072 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/FindPkgConfig/CMakeLists.txt b/Tests/RunCMake/FindPkgConfig/CMakeLists.txt
index 72abfc8099..74b3ff8de3 100644
--- a/Tests/RunCMake/FindPkgConfig/CMakeLists.txt
+++ b/Tests/RunCMake/FindPkgConfig/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake
index fc3a7664bc..aa293d55af 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake
@@ -20,7 +20,7 @@ endif()
unset(FOO_MODULE_NAME)
-# verify variable get's also set on subsequent run
+# verify variable gets also set on subsequent run
pkg_search_module(FOO REQUIRED foo bletch bar)
if(NOT FOO_MODULE_NAME STREQUAL "bletch")
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-TARGET_PROPERTY.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-TARGET_PROPERTY.cmake
new file mode 100644
index 0000000000..293dddaccd
--- /dev/null
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-TARGET_PROPERTY.cmake
@@ -0,0 +1,17 @@
+enable_language(C)
+
+add_library (lib SHARED empty.c)
+set_target_properties(lib PROPERTIES
+ INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:C>:/usr/include>"
+ COMPILE_DEFINITIONS "$<$<COMPILE_LANGUAGE:C>:DEF>"
+ COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:C>:-O>")
+
+add_custom_target(drive
+ COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:lib,INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:lib,COMPILE_DEFINITIONS>
+ $<TARGET_PROPERTY:lib,COMPILE_OPTIONS>)
+
+add_custom_command(TARGET drive PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:lib,INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:lib,COMPILE_DEFINITIONS>
+ $<TARGET_PROPERTY:lib,COMPILE_OPTIONS>)
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake
index 6691fdfca7..15a5e79eb4 100644
--- a/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake
@@ -8,3 +8,4 @@ run_cmake(COMPILE_LANGUAGE-add_executable)
run_cmake(COMPILE_LANGUAGE-add_library)
run_cmake(COMPILE_LANGUAGE-add_test)
run_cmake(COMPILE_LANGUAGE-unknown-lang)
+run_cmake(COMPILE_LANGUAGE-TARGET_PROPERTY)
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-TARGET_PROPERTY.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-TARGET_PROPERTY.cmake
new file mode 100644
index 0000000000..6a718d64a8
--- /dev/null
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-TARGET_PROPERTY.cmake
@@ -0,0 +1,17 @@
+enable_language(C)
+
+add_library (lib SHARED empty.c)
+set_target_properties(lib PROPERTIES
+ INCLUDE_DIRECTORIES "$<$<COMPILE_LANG_AND_ID:C,GNU>:/usr/include>"
+ COMPILE_DEFINITIONS "$<$<COMPILE_LANG_AND_ID:C,GNU>:DEF>"
+ COMPILE_OPTIONS "$<$<COMPILE_LANG_AND_ID:C,GNU>:-O>")
+
+add_custom_target(drive
+ COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:lib,INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:lib,COMPILE_DEFINITIONS>
+ $<TARGET_PROPERTY:lib,COMPILE_OPTIONS>)
+
+add_custom_command(TARGET drive PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:lib,INCLUDE_DIRECTORIES>
+ $<TARGET_PROPERTY:lib,COMPILE_DEFINITIONS>
+ $<TARGET_PROPERTY:lib,COMPILE_OPTIONS>)
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake
index a0a7bb9beb..68bd05d2e1 100644
--- a/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake
@@ -8,3 +8,4 @@ run_cmake(COMPILE_LANG_AND_ID-add_executable)
run_cmake(COMPILE_LANG_AND_ID-add_library)
run_cmake(COMPILE_LANG_AND_ID-add_test)
run_cmake(COMPILE_LANG_AND_ID-unknown-lang)
+run_cmake(COMPILE_LANG_AND_ID-TARGET_PROPERTY)
diff --git a/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake b/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake
index b3977f1bab..5a5a7bf9fe 100644
--- a/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake
@@ -26,7 +26,7 @@ function(run_GEH)
endforeach()
endfunction()
-# remove these flags from the enviornment if they have been set
+# remove these flags from the environment if they have been set
# so the tests run the correct env
set(env_cxx_flags $ENV{CXXFLAGS})
if(env_cxx_flags)
diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt
index 42dd0ce50b..130de2b705 100644
--- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt
@@ -10,15 +10,6 @@ Call Stack \(most recent call first\):
CMake Error at BadCONFIG.cmake:1 \(add_custom_target\):
Error evaluating generator expression:
- \$<CONFIG:Foo,Bar>
-
- \$<CONFIG> expression requires one or zero parameters.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at BadCONFIG.cmake:1 \(add_custom_target\):
- Error evaluating generator expression:
-
\$<CONFIG:Foo-Bar>
Expression syntax not recognized.
diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake
index 5c22aaabe4..1735ab72ca 100644
--- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake
+++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake
@@ -1,6 +1,5 @@
add_custom_target(check ALL COMMAND check
$<CONFIG:.>
- $<CONFIG:Foo,Bar>
$<CONFIG:Foo-Bar>
$<$<CONFIG:Foo-Nested>:foo>
VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
index 12cd3c7757..4b3de84d94 100644
--- a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
+++ b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake
new file mode 100644
index 0000000000..b43256bdf0
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake
@@ -0,0 +1,6 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/CONFIG-empty-entries-generated.txt" content)
+
+set(expected "1234")
+if(NOT content STREQUAL expected)
+ set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake
new file mode 100644
index 0000000000..a4d53f97ba
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake
@@ -0,0 +1,9 @@
+cmake_policy(SET CMP0070 NEW)
+
+set(text)
+string(APPEND text "$<$<CONFIG:>:1>")
+string(APPEND text "$<$<CONFIG:Release,>:2>")
+string(APPEND text "$<$<CONFIG:,Release>:3>")
+string(APPEND text "$<$<CONFIG:Release,,Debug>:4>")
+string(APPEND text "$<$<CONFIG:Release,Debug>:5>")
+file(GENERATE OUTPUT CONFIG-empty-entries-generated.txt CONTENT ${text})
diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake
new file mode 100644
index 0000000000..66f42c72ef
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake
@@ -0,0 +1,6 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/CONFIG-multiple-entries-generated.txt" content)
+
+set(expected "14")
+if(NOT content STREQUAL expected)
+ set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake
new file mode 100644
index 0000000000..6829282557
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake
@@ -0,0 +1,8 @@
+cmake_policy(SET CMP0070 NEW)
+
+set(text)
+string(APPEND text "$<$<CONFIG:CustomConfig>:1>")
+string(APPEND text "$<$<CONFIG:Release>:2>")
+string(APPEND text "$<$<CONFIG:Debug,Release>:3>")
+string(APPEND text "$<$<CONFIG:Release,CustomConfig,Debug>:4>")
+file(GENERATE OUTPUT CONFIG-multiple-entries-generated.txt CONTENT "${text}")
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 0278cf6591..634911274c 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -12,6 +12,7 @@ run_cmake(BadTargetTypeInterface)
run_cmake(BadTargetTypeObject)
run_cmake(BadInstallPrefix)
run_cmake(BadSHELL_PATH)
+run_cmake(BadCONFIG)
run_cmake(CMP0044-WARN)
run_cmake(NonValidTarget-C_COMPILER_ID)
run_cmake(NonValidTarget-CXX_COMPILER_ID)
@@ -44,6 +45,19 @@ run_cmake(FILTER-InvalidOperator)
run_cmake(FILTER-Exclude)
run_cmake(FILTER-Include)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS [==[-DCMAKE_CONFIGURATION_TYPES=CustomConfig]==])
+else()
+ set(RunCMake_TEST_OPTIONS [==[-DCMAKE_BUILD_TYPE=CustomConfig]==])
+endif()
+run_cmake(CONFIG-multiple-entries)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS [==[-DCMAKE_CONFIGURATION_TYPES=]==])
+else()
+ set(RunCMake_TEST_OPTIONS [==[-DCMAKE_BUILD_TYPE=]==])
+endif()
+run_cmake(CONFIG-empty-entries)
+
set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=OLD)
run_cmake(CMP0085-OLD)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES-check.cmake
new file mode 100644
index 0000000000..ecf7bfee92
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES-check.cmake
@@ -0,0 +1,17 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/out.txt" content)
+
+unset(RunCMake_TEST_FAILED)
+
+if (NOT content MATCHES "(INCLUDES1:${RunCMake_TEST_SOURCE_DIR}/include)")
+ string(APPEND RunCMake_TEST_FAILED "wrong content for INCLUDES1: \"${CMAKE_MATCH_1}\"\n")
+endif()
+
+if (NOT content MATCHES "(INCLUDES2:><)")
+ string(APPEND RunCMake_TEST_FAILED "wrong content for INCLUDES2: \"${CMAKE_MATCH_1}\"\n")
+endif()
+if (NOT content MATCHES "(INCLUDES3:><)")
+ string(APPEND RunCMake_TEST_FAILED "wrong content for INCLUDES3: \"${CMAKE_MATCH_1}\"\n")
+endif()
+if (NOT content MATCHES "(CUSTOM:>;;<)")
+ string(APPEND RunCMake_TEST_FAILED "wrong content for CUSTOM: \"${CMAKE_MATCH_1}\"\n")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake
index cb6f4d8678..e9855bed53 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-INCLUDE_DIRECTORIES.cmake
@@ -14,5 +14,10 @@ target_include_directories(foo3 PUBLIC $<TARGET_PROPERTY:foo2,INCLUDE_DIRECTORIE
add_library(foo4 STATIC empty.c)
target_include_directories(foo4 PUBLIC $<TARGET_PROPERTY:foo3,INCLUDE_DIRECTORIES>)
+add_library (foo5 SHARED empty.c)
+set_property(TARGET foo5 PROPERTY INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:CUDA>:/include/CUDA>" "$<$<COMPILE_LANGUAGE:Fortran>:/include/Fortran>")
+set_property(TARGET foo5 PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:CUDA>:/include/CUDA>" "$<$<COMPILE_LANGUAGE:Fortran>:/include/Fortran>")
+set_property(TARGET foo5 PROPERTY CUSTOM ";;")
+
# Evaluate a genex that looks up INCLUDE_DIRECTORIES on multiple targets.
-file(GENERATE OUTPUT out.txt CONTENT "$<TARGET_PROPERTY:foo4,INCLUDE_DIRECTORIES>")
+file(GENERATE OUTPUT out.txt CONTENT "INCLUDES1:$<TARGET_PROPERTY:foo4,INCLUDE_DIRECTORIES>\nINCLUDES2:>$<TARGET_PROPERTY:foo5,INTERFACE_INCLUDE_DIRECTORIES><\nINCLUDES3:>$<TARGET_PROPERTY:foo5,INCLUDE_DIRECTORIES><\nCUSTOM:>$<TARGET_PROPERTY:foo5,CUSTOM><\n")
diff --git a/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt
+++ b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt
+++ b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML-special-result-check.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML-special-result-check.cmake
new file mode 100644
index 0000000000..fea0a6bc09
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTestXML-special-result-check.cmake
@@ -0,0 +1,28 @@
+set(RESULT_FILES
+ "${RunCMake_TEST_BINARY_DIR}/GoogleTestXMLSpecial/cases.case/0.xml"
+ "${RunCMake_TEST_BINARY_DIR}/GoogleTestXMLSpecial/cases.case/1.xml"
+ "${RunCMake_TEST_BINARY_DIR}/GoogleTestXMLSpecial/cases.case/2.xml"
+)
+
+# Check result files exist
+foreach(file ${RESULT_FILES})
+ if(NOT EXISTS ${file})
+ if(NOT ${RunCMake_TEST_FAILED} STREQUAL "")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}\n")
+ endif()
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}Result XML file ${file} was not created")
+ endif()
+endforeach()
+
+# and no other xml files are created
+file(GLOB_RECURSE file_list "${RunCMake_TEST_BINARY_DIR}/GoogleTestXMLSpecial/*/*.xml" LIST_DIRECTORIES false)
+
+foreach(file ${file_list})
+ list(FIND RESULT_FILES "${file}" idx)
+ if(-1 EQUAL ${idx})
+ if(NOT ${RunCMake_TEST_FAILED} STREQUAL "")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}\n")
+ endif()
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}Invalid file ${file} was created")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake
index 29bd05e6e2..fb91c0e666 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake
+++ b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake
@@ -3,6 +3,17 @@ include(GoogleTest)
enable_testing()
+# This creates the folder structure for the paramterized tests
+# to avoid handling missing folders in C++
+#
+# This must match the match the name defined in xml_output.cpp
+# for every instance of tests with GetParam.
+#
+# The folder name is created fom the test name (output of the line
+# without leading spaces: "GoogleTestXMLSpecial/cases.") and
+# the parts until the last slash ("case/"). These parts are concatenated.
+file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/GoogleTestXMLSpecial/cases.case")
+
add_executable(xml_output xml_output.cpp)
gtest_discover_tests(
xml_output
diff --git a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
index efd22bea9e..530c8abe5a 100644
--- a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
@@ -101,6 +101,13 @@ function(run_GoogleTestXML DISCOVERY_MODE)
-R GoogleTestXML
--no-label-summary
)
+
+ run_cmake_command(GoogleTestXML-special-result
+ ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ -R GoogleTestXMLSpecial
+ --no-label-summary
+ )
endfunction()
function(run_GoogleTest_discovery_timeout DISCOVERY_MODE)
diff --git a/Tests/RunCMake/GoogleTest/xml_output.cpp b/Tests/RunCMake/GoogleTest/xml_output.cpp
index e130231b69..82f0d02377 100644
--- a/Tests/RunCMake/GoogleTest/xml_output.cpp
+++ b/Tests/RunCMake/GoogleTest/xml_output.cpp
@@ -13,11 +13,22 @@ int main(int argc, char** argv)
// This actually defines the name of the file passed in the 2nd run
std::cout << "GoogleTestXML." << std::endl;
std::cout << " Foo" << std::endl;
+ // When changing these names, make sure to adapt the folder creation
+ // in GoogleTestXML.cmake
+ std::cout << "GoogleTestXMLSpecial/cases." << std::endl;
+ std::cout << " case/0 # GetParam() = 42" << std::endl;
+ std::cout << " case/1 # GetParam() = \"string\"" << std::endl;
+ std::cout << " case/2 # GetParam() = \"path/like\"" << std::endl;
} else if (param.find("--gtest_output=xml:") != std::string::npos) {
std::string::size_type split = param.find(":");
std::string filepath = param.substr(split + 1);
// The full file path is passed
std::ofstream ostrm(filepath.c_str(), std::ios::binary);
+ if (!ostrm) {
+ std::cerr << "Failed to create file: " << filepath.c_str()
+ << std::endl;
+ return 1;
+ }
ostrm << "--gtest_output=xml: mockup file\n";
}
}
diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
index 10cd2bce7f..4ce6b5c4b7 100644
--- a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
+++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
@@ -9,6 +9,7 @@
# - All library depend on a common INTERFACE library holding compiler flags
# - We have a custom target to generate a man page
# - Someone has added an UNKNOWN, IMPORTED crypto mining library!
+# - We have a circular dependency between two libraries
add_subdirectory(test_project/third_party_project)
@@ -23,6 +24,13 @@ target_link_libraries(CoreLibrary PUBLIC CompilerFlags)
target_link_libraries(CoreLibrary PRIVATE SeriousLoggingLibrary)
+add_library(SystemLibrary STATIC test_project/system_library.c)
+
+# Create a circular dependency.
+# See https://gitlab.kitware.com/cmake/cmake/issues/20720
+target_link_libraries(CoreLibrary PRIVATE SystemLibrary)
+target_link_libraries(SystemLibrary PRIVATE CoreLibrary)
+
add_library(GraphicLibraryObjects OBJECT test_project/graphic_library.c)
add_library(GraphicLibrary SHARED)
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
index 8b0365a772..31d88df668 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
@@ -28,25 +28,28 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GenerateManPage", shape = box ];
- "node1" -> "node5" // ConsoleApplication -> GenerateManPage
- "node6" [ label = "GraphicApplication", shape = egg ];
- "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node8" [ label = "\"-lm\"", shape = septagon ];
- "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node7" -> "node0" // GraphicLibrary -> CompilerFlags
- "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GenerateManPage", shape = box ];
+ "node1" -> "node6" // ConsoleApplication -> GenerateManPage
+ "node7" [ label = "GraphicApplication", shape = egg ];
+ "node7" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node8" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node9" [ label = "\"-lm\"", shape = septagon ];
+ "node8" -> "node9" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node8" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node10" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node8" -> "node10" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node7" -> "node8" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node11" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node12" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node12" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node12" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
index 1bbf25aba8..26f2f64f13 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
@@ -28,23 +28,26 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
index 1bbf25aba8..26f2f64f13 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
@@ -28,23 +28,26 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
index 558a470617..7f2e01ccfd 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
@@ -27,18 +27,21 @@ subgraph clusterLegend {
"node1" -> "node0" // CoreLibrary -> CompilerFlags
"node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node1" -> "node2" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
- "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node4" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node5" [ label = "\"-lm\"", shape = septagon ];
- "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node4" -> "node0" // GraphicLibrary -> CompilerFlags
- "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node3" [ label = "SystemLibrary", shape = octagon ];
+ "node3" -> "node1" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node1" -> "node3" [ style = dotted ] // CoreLibrary -> SystemLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node6" [ label = "\"-lm\"", shape = septagon ];
+ "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node5" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node5" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node8" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node9" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
index 660af37c0d..db675a8e51 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
@@ -28,19 +28,22 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "GraphicApplication", shape = egg ];
- "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node5" -> "node0" // GraphicLibrary -> CompilerFlags
- "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node7" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node8" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
index 5af7fecc95..234ee39cad 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
@@ -28,8 +28,11 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "\"-lm\"", shape = septagon ];
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "\"-lm\"", shape = septagon ];
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
index 94ec41ce25..6dea88c391 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
@@ -24,20 +24,23 @@ subgraph clusterLegend {
}
"node0" [ label = "ConsoleApplication", shape = egg ];
"node1" [ label = "CoreLibrary", shape = octagon ];
+ "node2" [ label = "SystemLibrary", shape = octagon ];
+ "node2" -> "node1" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node1" -> "node2" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node0" -> "node1" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node2" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node0" -> "node2" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node3" [ label = "GraphicApplication", shape = egg ];
- "node3" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node4" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node5" [ label = "\"-lm\"", shape = septagon ];
- "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node3" -> "node4" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node0" -> "node3" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node4" [ label = "GraphicApplication", shape = egg ];
+ "node4" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node6" [ label = "\"-lm\"", shape = septagon ];
+ "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node5" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
index 65b7a71a49..df3d10ac3e 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
@@ -28,17 +28,20 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
index 8116bc9819..8f832a8f5f 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
@@ -28,21 +28,24 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
index 1bbf25aba8..26f2f64f13 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
@@ -28,23 +28,26 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
index 439d1f76f8..e127daab94 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
@@ -28,17 +28,20 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "\"-lm\"", shape = septagon ];
- "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
index 1be6550164..4f242bb929 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
@@ -28,21 +28,24 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "GraphicApplication", shape = egg ];
- "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node6" [ label = "\"-lm\"", shape = septagon ];
- "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node5" -> "node0" // GraphicLibrary -> CompilerFlags
- "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
index 1cfbe0f6b1..c664af8aec 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
@@ -28,23 +28,26 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
index 9653c33028..557930620c 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
@@ -28,23 +28,26 @@ subgraph clusterLegend {
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
index 82d96d0771..3bf20eca68 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
@@ -28,23 +28,26 @@ subgraph clusterLegend {
"point2" -> "point0" // CoreLibrary -> CompilerFlags
"point3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"point2" -> "point3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "point4" [ label = "SystemLibrary", shape = octagon ];
+ "point4" -> "point2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "point2" -> "point4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"point1" -> "point2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "point4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
- "point1" -> "point4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
- "point5" [ label = "GraphicApplication", shape = egg ];
- "point5" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "point6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "point7" [ label = "\"-lm\"", shape = septagon ];
- "point6" -> "point7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "point6" -> "point0" // GraphicLibrary -> CompilerFlags
- "point6" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "point8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "point6" -> "point8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
- "point5" -> "point6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "point9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "point9" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "point9" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "point10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "point10" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
- "point10" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "point5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "point1" -> "point5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "point6" [ label = "GraphicApplication", shape = egg ];
+ "point6" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "point7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "point8" [ label = "\"-lm\"", shape = septagon ];
+ "point7" -> "point8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "point7" -> "point0" // GraphicLibrary -> CompilerFlags
+ "point7" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "point9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "point7" -> "point9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "point6" -> "point7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "point10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "point10" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "point10" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "point11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "point11" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "point11" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication
index 6893fd19ed..92fe609ea0 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication
@@ -2,21 +2,25 @@ digraph "GraphicApplication" {
node [
fontsize = "12"
];
- "node5" [ label = "GraphicApplication", shape = egg ];
+ "node6" [ label = "GraphicApplication", shape = egg ];
"node2" [ label = "CoreLibrary", shape = octagon ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
"node0" [ label = "CompilerFlags", shape = pentagon ];
"node2" -> "node0" // CoreLibrary -> CompilerFlags
"node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
"node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
"node0" [ label = "CompilerFlags", shape = pentagon ];
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
"node2" [ label = "CoreLibrary", shape = octagon ];
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers
index 3352b1ad55..82a2efe2ef 100644
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers
@@ -5,22 +5,26 @@ node [
"node0" [ label = "CompilerFlags", shape = pentagon ];
"node2" [ label = "CoreLibrary", shape = octagon ];
"node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node4" [ label = "SystemLibrary", shape = octagon ];
+ "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary
"node1" [ label = "ConsoleApplication", shape = egg ];
"node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
}
diff --git a/Tests/RunCMake/Graphviz/test_project/system_library.c b/Tests/RunCMake/Graphviz/test_project/system_library.c
new file mode 100644
index 0000000000..5d6707920e
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/system_library.c
@@ -0,0 +1,3 @@
+void initialize_system()
+{
+}
diff --git a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt
index f452db1770..ebab7a357a 100644
--- a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt
+++ b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/InterfaceLibrary/CMakeLists.txt b/Tests/RunCMake/InterfaceLibrary/CMakeLists.txt
new file mode 100644
index 0000000000..74b3ff8de3
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value-result.txt b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-stderr.txt b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value-stderr.txt
index 454c6555a4..454c6555a4 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value-stderr.txt
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value.cmake b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value.cmake
index 1af65b468a..1af65b468a 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-bad-value.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-bad-value.cmake
diff --git a/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface-result.txt b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-stderr.txt b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface-stderr.txt
index 3a329d20f1..3a329d20f1 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface-stderr.txt
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface.cmake b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface.cmake
index fe6841a368..fe6841a368 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-iface.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-iface.cmake
diff --git a/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported-result.txt b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-stderr.txt b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported-stderr.txt
index e9d94cf4ad..e9d94cf4ad 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported-stderr.txt
diff --git a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported.cmake b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported.cmake
index 07a67d7079..07a67d7079 100644
--- a/Tests/RunCMake/interface_library/IMPORTED_LIBNAME-non-imported.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/IMPORTED_LIBNAME-non-imported.cmake
diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/InterfaceLibrary/RunCMakeTest.cmake
index 5a6af1da68..5a6af1da68 100644
--- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/RunCMakeTest.cmake
diff --git a/Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET-result.txt b/Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt b/Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET-stderr.txt
index c095262652..c095262652 100644
--- a/Tests/RunCMake/interface_library/add_custom_command-TARGET-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET-stderr.txt
diff --git a/Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake b/Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET.cmake
index a5136eff83..a5136eff83 100644
--- a/Tests/RunCMake/interface_library/add_custom_command-TARGET.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/add_custom_command-TARGET.cmake
diff --git a/Tests/RunCMake/InterfaceLibrary/genex_link-result.txt b/Tests/RunCMake/InterfaceLibrary/genex_link-result.txt
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/genex_link-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/interface_library/genex_link.cmake b/Tests/RunCMake/InterfaceLibrary/genex_link.cmake
index 0dbf029fea..0dbf029fea 100644
--- a/Tests/RunCMake/interface_library/genex_link.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/genex_link.cmake
diff --git a/Tests/RunCMake/InterfaceLibrary/global-interface-result.txt b/Tests/RunCMake/InterfaceLibrary/global-interface-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/global-interface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/global-interface-stderr.txt b/Tests/RunCMake/InterfaceLibrary/global-interface-stderr.txt
index 23b45d9264..38585ebdd1 100644
--- a/Tests/RunCMake/interface_library/global-interface-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/global-interface-stderr.txt
@@ -3,7 +3,7 @@ CMake Error at global-interface.cmake:2 \(add_library\):
GLOBAL
- Tried extensions( \.[A-Za-z+]+|
- )*
+ Tried extensions \.c \.C .*
+.*
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/interface_library/global-interface.cmake b/Tests/RunCMake/InterfaceLibrary/global-interface.cmake
index d2bfc64ed9..d2bfc64ed9 100644
--- a/Tests/RunCMake/interface_library/global-interface.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/global-interface.cmake
diff --git a/Tests/RunCMake/InterfaceLibrary/invalid_name-result.txt b/Tests/RunCMake/InterfaceLibrary/invalid_name-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/invalid_name-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/invalid_name-stderr.txt b/Tests/RunCMake/InterfaceLibrary/invalid_name-stderr.txt
index e14fcdedb0..e14fcdedb0 100644
--- a/Tests/RunCMake/interface_library/invalid_name-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/invalid_name-stderr.txt
diff --git a/Tests/RunCMake/interface_library/invalid_name.cmake b/Tests/RunCMake/InterfaceLibrary/invalid_name.cmake
index 9a965aa8a0..575fcc6e1f 100644
--- a/Tests/RunCMake/interface_library/invalid_name.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/invalid_name.cmake
@@ -1,4 +1,4 @@
-
+cmake_minimum_required(VERSION 2.8.12)
add_library(if$ace INTERFACE)
add_library(iface::target INTERFACE)
diff --git a/Tests/RunCMake/InterfaceLibrary/invalid_signature-result.txt b/Tests/RunCMake/InterfaceLibrary/invalid_signature-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/invalid_signature-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/invalid_signature-stderr.txt b/Tests/RunCMake/InterfaceLibrary/invalid_signature-stderr.txt
index 6374b3392b..6374b3392b 100644
--- a/Tests/RunCMake/interface_library/invalid_signature-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/invalid_signature-stderr.txt
diff --git a/Tests/RunCMake/interface_library/invalid_signature.cmake b/Tests/RunCMake/InterfaceLibrary/invalid_signature.cmake
index 4e53534b28..4e53534b28 100644
--- a/Tests/RunCMake/interface_library/invalid_signature.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/invalid_signature.cmake
diff --git a/Tests/RunCMake/interface_library/no_shared_libs.cmake b/Tests/RunCMake/InterfaceLibrary/no_shared_libs.cmake
index ed81878cbe..ed81878cbe 100644
--- a/Tests/RunCMake/interface_library/no_shared_libs.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/no_shared_libs.cmake
diff --git a/Tests/RunCMake/InterfaceLibrary/target_commands-result.txt b/Tests/RunCMake/InterfaceLibrary/target_commands-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/target_commands-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/target_commands-stderr.txt b/Tests/RunCMake/InterfaceLibrary/target_commands-stderr.txt
index 9362a752d8..9362a752d8 100644
--- a/Tests/RunCMake/interface_library/target_commands-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/target_commands-stderr.txt
diff --git a/Tests/RunCMake/interface_library/target_commands.cmake b/Tests/RunCMake/InterfaceLibrary/target_commands.cmake
index 3182e8933e..3182e8933e 100644
--- a/Tests/RunCMake/interface_library/target_commands.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/target_commands.cmake
diff --git a/Tests/RunCMake/InterfaceLibrary/whitelist-result.txt b/Tests/RunCMake/InterfaceLibrary/whitelist-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/InterfaceLibrary/whitelist-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/interface_library/whitelist-stderr.txt b/Tests/RunCMake/InterfaceLibrary/whitelist-stderr.txt
index 577c0cc5d5..577c0cc5d5 100644
--- a/Tests/RunCMake/interface_library/whitelist-stderr.txt
+++ b/Tests/RunCMake/InterfaceLibrary/whitelist-stderr.txt
diff --git a/Tests/RunCMake/interface_library/whitelist.cmake b/Tests/RunCMake/InterfaceLibrary/whitelist.cmake
index 0db6375311..0db6375311 100644
--- a/Tests/RunCMake/interface_library/whitelist.cmake
+++ b/Tests/RunCMake/InterfaceLibrary/whitelist.cmake
diff --git a/Tests/RunCMake/Languages/CMakeLists.txt b/Tests/RunCMake/Languages/CMakeLists.txt
index 8996fef6bd..74b3ff8de3 100644
--- a/Tests/RunCMake/Languages/CMakeLists.txt
+++ b/Tests/RunCMake/Languages/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
-cmake_policy(SET CMP0042 NEW)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll-all-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll-all-build-check.cmake
new file mode 100644
index 0000000000..a4d2758bd1
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll-all-build-check.cmake
@@ -0,0 +1,9 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_FILE_release_only_tool_Release}
+ ${TARGET_EXE_FILE_release_only_tool_Release}
+
+ EXCLUDE
+ ${TARGET_FILE_release_only_tool_Debug}
+ ${TARGET_EXE_FILE_release_only_tool_Debug}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll.cmake b/Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll.cmake
new file mode 100644
index 0000000000..52f84ea920
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/ExcludeFromAll.cmake
@@ -0,0 +1,12 @@
+enable_language(C)
+
+set(CMAKE_CONFIGURATION_TYPES "Release;Debug" CACHE STRING "")
+set(CMAKE_DEFAULT_BUILD_TYPE "Release" CACHE STRING "")
+set(CMAKE_CROSS_CONFIGS "all" CACHE STRING "")
+set(CMAKE_DEFAULT_CONFIGS "all" CACHE STRING "")
+
+add_executable(release_only_tool main.c)
+set_property(TARGET release_only_tool PROPERTY EXCLUDE_FROM_ALL "$<NOT:$<CONFIG:Release>>")
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(release_only_tool)
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 76b488ebb7..92497245d4 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -274,6 +274,11 @@ run_ninja(Install default-install build.ninja install)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}/install")
run_ninja(Install all-install build.ninja install:all)
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ExcludeFromAll-build)
+run_cmake_configure(ExcludeFromAll)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(ExcludeFromAll all "" all:all)
+
# FIXME Get this working
#set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AutoMocExecutable-build)
#run_cmake_configure(AutoMocExecutable)
diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt
index 411cd7cb76..5c7882d688 100644
--- a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt
+++ b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt
@@ -3,7 +3,7 @@ CMake Error at MissingSource.cmake:1 \(add_library\):
missing.c
- Tried extensions( \.[A-Za-z+]+|
- )*
+ Tried extensions \.c \.C .*
+.*
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt
index 65ac8e8db3..44b5d30c03 100644
--- a/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt
+++ b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST})
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt b/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt
index 90afc127ed..c3922d623f 100644
--- a/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt
+++ b/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} CXX)
# MSVC creates extra targets which pollute the stderr unless we set this.
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index cb20fb1f3d..c13c694425 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -154,6 +154,7 @@ function(run_cmake test)
"|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
"|[^\n]*is a member of multiple groups"
+ "|[^\n]*offset in archive not a multiple of 8"
"|[^\n]*from Time Machine by path"
"|[^\n]*Bullseye Testing Technology"
")[^\n]*\n)+"
diff --git a/Tests/RunCMake/SourceProperties/CMakeLists.txt b/Tests/RunCMake/SourceProperties/CMakeLists.txt
index a17c8cd139..e93f0b69e4 100644
--- a/Tests/RunCMake/SourceProperties/CMakeLists.txt
+++ b/Tests/RunCMake/SourceProperties/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} C)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetObjects/CMakeLists.txt b/Tests/RunCMake/TargetObjects/CMakeLists.txt
index be9d4038db..44b5d30c03 100644
--- a/Tests/RunCMake/TargetObjects/CMakeLists.txt
+++ b/Tests/RunCMake/TargetObjects/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST})
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetPolicies/CMakeLists.txt b/Tests/RunCMake/TargetPolicies/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/TargetPolicies/CMakeLists.txt
+++ b/Tests/RunCMake/TargetPolicies/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetProperties/CMakeLists.txt b/Tests/RunCMake/TargetProperties/CMakeLists.txt
index be9d4038db..44b5d30c03 100644
--- a/Tests/RunCMake/TargetProperties/CMakeLists.txt
+++ b/Tests/RunCMake/TargetProperties/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST})
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt
index 90afc127ed..c3922d623f 100644
--- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} CXX)
# MSVC creates extra targets which pollute the stderr unless we set this.
diff --git a/Tests/RunCMake/TargetSources/CMakeLists.txt b/Tests/RunCMake/TargetSources/CMakeLists.txt
index f452db1770..a06591c31f 100644
--- a/Tests/RunCMake/TargetSources/CMakeLists.txt
+++ b/Tests/RunCMake/TargetSources/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
index f26ec2ea51..85e658742f 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
@@ -2,6 +2,6 @@ set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c
file(STRINGS ${unitybuild_c} unitybuild_c_strings)
string(REGEX MATCH ".*#include.*s3.c.*#include.*s1.c.*#include.*s2.c.*" matched_code ${unitybuild_c_strings})
if(NOT matched_code)
- set(RunCMake_TEST_FAILED "Generated unity file doesn't include expected oder of source files")
+ set(RunCMake_TEST_FAILED "Generated unity file doesn't include expected order of source files")
return()
endif()
diff --git a/Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake b/Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake
index 416220b834..0d82d3feb4 100644
--- a/Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake
@@ -31,6 +31,6 @@ if (NOT "${OVERRIDEN_TOOLSET}" STREQUAL "MyCustomToolset")
endif()
if ("${NORMAL_TOOLSET}" STREQUAL "MyCustomToolset")
- set(RunCMake_TEST_FAILED "Main toolset was overriden (it shouldn't)")
+ set(RunCMake_TEST_FAILED "Main toolset was overridden (it shouldn't)")
return()
endif()
diff --git a/Tests/RunCMake/VSSolution/CMakeLists.txt b/Tests/RunCMake/VSSolution/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/VSSolution/CMakeLists.txt
+++ b/Tests/RunCMake/VSSolution/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/XcodeProject/CMakeLists.txt b/Tests/RunCMake/XcodeProject/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/XcodeProject/CMakeLists.txt
+++ b/Tests/RunCMake/XcodeProject/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
index ab31387cd0..75da7b1c44 100644
--- a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.5)
+cmake_minimum_required(VERSION 3.3)
project(XcodeInstallIOS)
diff --git a/Tests/RunCMake/add_dependencies/CMakeLists.txt b/Tests/RunCMake/add_dependencies/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/add_dependencies/CMakeLists.txt
+++ b/Tests/RunCMake/add_dependencies/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/alias_targets/CMakeLists.txt b/Tests/RunCMake/alias_targets/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/alias_targets/CMakeLists.txt
+++ b/Tests/RunCMake/alias_targets/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/alias_targets/invalid-name.cmake b/Tests/RunCMake/alias_targets/invalid-name.cmake
index bbd39e3b6f..01983e54f1 100644
--- a/Tests/RunCMake/alias_targets/invalid-name.cmake
+++ b/Tests/RunCMake/alias_targets/invalid-name.cmake
@@ -1,4 +1,4 @@
-
+cmake_minimum_required(VERSION 2.8.12)
enable_language(CXX)
add_library(foo empty.cpp)
diff --git a/Tests/RunCMake/build_command/CMakeLists.txt b/Tests/RunCMake/build_command/CMakeLists.txt
index 73e6a785a4..f1a83e8c4b 100644
--- a/Tests/RunCMake/build_command/CMakeLists.txt
+++ b/Tests/RunCMake/build_command/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
if(NOT NoProject)
project(${RunCMake_TEST} NONE)
endif()
diff --git a/Tests/RunCMake/cmake_language/call_invalid_command.cmake b/Tests/RunCMake/cmake_language/call_invalid_command.cmake
index 88bf08c2d8..585aad4a61 100644
--- a/Tests/RunCMake/cmake_language/call_invalid_command.cmake
+++ b/Tests/RunCMake/cmake_language/call_invalid_command.cmake
@@ -9,6 +9,6 @@ foreach (command IN ITEMS "function" "ENDFUNCTION"
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE result)
if (NOT result)
- message (SEND_ERROR "cmake_language(CALL ${command}) unexpectedly successfull.")
+ message (SEND_ERROR "cmake_language(CALL ${command}) unexpectedly successful.")
endif()
endforeach()
diff --git a/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt b/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt
new file mode 100644
index 0000000000..7d40dcb047
--- /dev/null
+++ b/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt
@@ -0,0 +1,26 @@
+^CMake Deprecation Warning at Before2812.cmake:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Deprecation Warning at Before2812.cmake:2 \(cmake_policy\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Deprecation Warning at Before2812.cmake:6 \(cmake_policy\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/cmake_minimum_required/Before2812.cmake b/Tests/RunCMake/cmake_minimum_required/Before2812.cmake
new file mode 100644
index 0000000000..220e359d4d
--- /dev/null
+++ b/Tests/RunCMake/cmake_minimum_required/Before2812.cmake
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 2.8.11)
+cmake_policy(VERSION 2.6)
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.6) # simulate pre-3.18 install(EXPORT)-generated call
+cmake_policy(POP)
+cmake_policy(VERSION 2.8.11)
diff --git a/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt b/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt
index e8db6b05be..667561ea79 100644
--- a/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt
+++ b/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
-include(${RunCMake_TEST}.cmake)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt
index a874466d33..81d26d260d 100644
--- a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt
+++ b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt
@@ -1,3 +1,12 @@
+^CMake Deprecation Warning at CompatBefore24.cmake:1 \(cmake_minimum_required\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
CMake Error in CMakeLists.txt:
You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less than
2.4. This version of CMake only supports backwards compatibility with
diff --git a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake
index 1030211e72..3a959bb2f9 100644
--- a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake
@@ -4,6 +4,7 @@ run_cmake(Before24)
run_cmake(CompatBefore24)
run_cmake(Future)
run_cmake(PolicyBefore24)
+run_cmake(Before2812)
run_cmake(Range)
run_cmake(RangeBad)
run_cmake(Unknown)
diff --git a/Tests/RunCMake/configure_file/NoSourcePermissions.cmake b/Tests/RunCMake/configure_file/NoSourcePermissions.cmake
new file mode 100644
index 0000000000..c6ad1311ea
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NoSourcePermissions.cmake
@@ -0,0 +1,10 @@
+configure_file(NoSourcePermissions.sh NoSourcePermissions.sh.out
+ NO_SOURCE_PERMISSIONS)
+
+if (UNIX)
+ execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/NoSourcePermissions.sh.out
+ RESULT_VARIABLE result)
+ if (result EQUAL "0")
+ message(FATAL_ERROR "Copied file has executable permissions")
+ endif()
+endif()
diff --git a/Tests/RunCMake/configure_file/NoSourcePermissions.sh b/Tests/RunCMake/configure_file/NoSourcePermissions.sh
new file mode 100755
index 0000000000..0aa8f412e7
--- /dev/null
+++ b/Tests/RunCMake/configure_file/NoSourcePermissions.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+#Testing NO_SOURCE_PERMISSIONS option of configure_file.
diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
index 32a0770b9f..71694fb0b5 100644
--- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
@@ -15,6 +15,7 @@ run_cmake(NewLineStyle-NoArg)
run_cmake(NewLineStyle-WrongArg)
run_cmake(NewLineStyle-ValidArg)
run_cmake(NewLineStyle-COPYONLY)
+run_cmake(NoSourcePermissions)
if(RunCMake_GENERATOR MATCHES "Make")
# Use a single build tree for a few tests without cleaning.
diff --git a/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in b/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in
index 3b8edf4c90..68a0fcb8bc 100644
--- a/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in
+++ b/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 3.3)
project(CTestTestMemcheck@CASE_NAME@ NONE)
include(CTest)
diff --git a/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-result.txt b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-result.txt
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stderr.txt b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stderr.txt
new file mode 100644
index 0000000000..31dedd2aa8
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stderr.txt
@@ -0,0 +1 @@
+Defect count: 20
diff --git a/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stdout.txt b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stdout.txt
new file mode 100644
index 0000000000..aa3e6984a5
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/DummyCudaMemcheck-stdout.txt
@@ -0,0 +1,10 @@
+Memory checking results:
+Uninitialized __global__ memory read - 1
+Unused memory - 1
+Barrier error - 2
+Invalid __global__ read - 1
+cudaErrorLaunchFailure - 2
+Memory leak - 1
+Potential WAR hazard detected - 4
+Potential RAW hazard detected - 4
+Race reported - 4
diff --git a/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake b/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake
index ab4c5abe58..2b3165bd35 100644
--- a/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_memcheck/RunCMakeTest.cmake
@@ -175,3 +175,15 @@ unset(CMAKELISTS_EXTRA_CODE)
unset(CTEST_EXTRA_CODE)
unset(CTEST_MEMCHECK_ARGS)
unset(CTEST_SUFFIX_CODE)
+
+#-----------------------------------------------------------------------------
+set(CMAKELISTS_EXTRA_CODE
+"add_test(NAME TestSan COMMAND \"${CMAKE_COMMAND}\"
+-P \"${RunCMake_SOURCE_DIR}/testCudaMemcheck.cmake\")
+")
+set(CTEST_SUFFIX_CODE "message(\"Defect count: \${defect_count}\")")
+set(CTEST_MEMCHECK_ARGS "DEFECT_COUNT defect_count")
+run_mc_test(DummyCudaMemcheck "${PSEUDO_CUDA_MEMCHECK}")
+unset(CTEST_MEMCHECK_ARGS)
+unset(CTEST_SUFFIX_CODE)
+unset(CTEST_EXTRA_CODE)
diff --git a/Tests/RunCMake/ctest_memcheck/test.cmake.in b/Tests/RunCMake/ctest_memcheck/test.cmake.in
index 50b4b6ab66..eedf080b78 100644
--- a/Tests/RunCMake/ctest_memcheck/test.cmake.in
+++ b/Tests/RunCMake/ctest_memcheck/test.cmake.in
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 3.3)
# Settings:
set(CTEST_SITE "@SITE@")
diff --git a/Tests/RunCMake/ctest_memcheck/testCudaMemcheck.cmake b/Tests/RunCMake/ctest_memcheck/testCudaMemcheck.cmake
new file mode 100644
index 0000000000..d7d821322f
--- /dev/null
+++ b/Tests/RunCMake/ctest_memcheck/testCudaMemcheck.cmake
@@ -0,0 +1,264 @@
+# this file simulates an execution of cuda-memcheck
+
+set(LOG_FILE "$ENV{PSEUDO_LOGFILE}")
+message("LOG_FILE=[${LOG_FILE}]")
+
+# clear the log file
+file(REMOVE "${LOG_FILE}")
+
+# create an error of each type of sanitizer tool and failure
+
+# initcheck
+file(APPEND "${LOG_FILE}"
+"========= CUDA-MEMCHECK
+========= Uninitialized __global__ memory read of size 4
+========= at 0x00000020 in test(int*, int*)
+========= by thread (0,0,0) in block (0,0,0)
+========= Address 0x1303d80000
+========= Saved host backtrace up to driver entry point
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./uninit-read [0x101d9]
+========= Host Frame:./uninit-read [0x10267]
+========= Host Frame:./uninit-read [0x465b5]
+========= Host Frame:./uninit-read [0x3342]
+========= Host Frame:./uninit-read [0x3143]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./uninit-read [0x31e2]
+=========
+========= Unused memory in allocation 0x1303d80000 of size 16 bytes
+========= Not written any memory.
+========= 100.00% of allocation were unused.
+========= Saved host backtrace up to driver entry point
+========= Host Frame:/lib64/libcuda.so.1 (cuMemAlloc_v2 + 0x1b7) [0x26ec97]
+========= Host Frame:./uninit-read [0x2bbd3]
+========= Host Frame:./uninit-read [0x71ab]
+========= Host Frame:./uninit-read [0x3c84f]
+========= Host Frame:./uninit-read [0x3111]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./uninit-read [0x31e2]
+=========
+========= ERROR SUMMARY: 2 errors
+")
+
+
+# synccheck
+file(APPEND "${LOG_FILE}"
+"========= CUDA-MEMCHECK
+========= Barrier error detected. Divergent thread(s) in warp
+========= at 0x00000058 in test(int*, int*)
+========= by thread (1,0,0) in block (0,0,0)
+========= Device Frame:test(int*, int*) (test(int*, int*) : 0x60)
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./sync [0x101d9]
+========= Host Frame:./sync [0x10267]
+========= Host Frame:./sync [0x465b5]
+========= Host Frame:./sync [0x3342]
+========= Host Frame:./sync [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./sync [0x31e2]
+=========
+========= Barrier error detected. Divergent thread(s) in warp
+========= at 0x00000058 in test(int*, int*)
+========= by thread (0,0,0) in block (0,0,0)
+========= Device Frame:test(int*, int*) (test(int*, int*) : 0x60)
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./sync [0x101d9]
+========= Host Frame:./sync [0x10267]
+========= Host Frame:./sync [0x465b5]
+========= Host Frame:./sync [0x3342]
+========= Host Frame:./sync [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./sync [0x31e2]
+=========
+========= ERROR SUMMARY: 2 errors
+")
+
+# memcheck
+file(APPEND "${LOG_FILE}"
+"========= CUDA-MEMCHECK
+========= Invalid __global__ read of size 4
+========= at 0x00000020 in test(int*, int*)
+========= by thread (0,0,0) in block (0,0,0)
+========= Address 0x00000000 is out of bounds
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./invalid-read [0x101d9]
+========= Host Frame:./invalid-read [0x10267]
+========= Host Frame:./invalid-read [0x465b5]
+========= Host Frame:./invalid-read [0x3342]
+========= Host Frame:./invalid-read [0x3142]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./invalid-read [0x31e2]
+=========
+========= Program hit cudaErrorLaunchFailure (error 719) due to \"unspecified launch failure\" on CUDA API call to cudaDeviceSynchronize.
+========= Saved host backtrace up to driver entry point at error
+========= Host Frame:/lib64/libcuda.so.1 [0x3ac5a3]
+========= Host Frame:./invalid-read [0x2e576]
+========= Host Frame:./invalid-read [0x3147]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./invalid-read [0x31e2]
+=========
+========= Program hit cudaErrorLaunchFailure (error 719) due to \"unspecified launch failure\" on CUDA API call to cudaFree.
+========= Saved host backtrace up to driver entry point at error
+========= Host Frame:/lib64/libcuda.so.1 [0x3ac5a3]
+========= Host Frame:./invalid-read [0x3c106]
+========= Host Frame:./invalid-read [0x3150]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./invalid-read [0x31e2]
+=========
+========= LEAK SUMMARY: 0 bytes leaked in 0 allocations
+========= ERROR SUMMARY: 3 errors
+")
+
+# memcheck with leak-check full
+file(APPEND "${LOG_FILE}"
+"========= CUDA-MEMCHECK
+========= Leaked 10 bytes at 0x1303d80000
+========= Saved host backtrace up to driver entry point at cudaMalloc time
+========= Host Frame:/lib64/libcuda.so.1 (cuMemAlloc_v2 + 0x1b7) [0x26ec97]
+========= Host Frame:./leak [0x2bab3]
+========= Host Frame:./leak [0x708b]
+========= Host Frame:./leak [0x3c72f]
+========= Host Frame:./leak [0x3113]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./leak [0x3174]
+=========
+========= LEAK SUMMARY: 10 bytes leaked in 1 allocations
+========= ERROR SUMMARY: 1 error
+")
+
+# racecheck with racecheck-report all
+file(APPEND "${LOG_FILE}"
+"========= CUDA-MEMCHECK
+========= WARN:(Warp Level Programming) Potential WAR hazard detected at __shared__ 0x3 in block (0, 0, 0) :
+========= Read Thread (31, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= Write Thread (0, 0, 0) at 0x000001a8 in ./race.cu:4:test(int*, int*)
+========= Current Value : 0, Incoming Value : 0
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./race [0x101d9]
+========= Host Frame:./race [0x10267]
+========= Host Frame:./race [0x465b5]
+========= Host Frame:./race [0x3342]
+========= Host Frame:./race [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./race [0x31e2]
+=========
+========= WARN:(Warp Level Programming) Potential WAR hazard detected at __shared__ 0x2 in block (0, 0, 0) :
+========= Read Thread (31, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= Write Thread (0, 0, 0) at 0x000001a8 in ./race.cu:4:test(int*, int*)
+========= Current Value : 0, Incoming Value : 0
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./race [0x101d9]
+========= Host Frame:./race [0x10267]
+========= Host Frame:./race [0x465b5]
+========= Host Frame:./race [0x3342]
+========= Host Frame:./race [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./race [0x31e2]
+=========
+========= WARN:(Warp Level Programming) Potential WAR hazard detected at __shared__ 0x1 in block (0, 0, 0) :
+========= Read Thread (31, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= Write Thread (0, 0, 0) at 0x000001a8 in ./race.cu:4:test(int*, int*)
+========= Current Value : 0, Incoming Value : 0
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./race [0x101d9]
+========= Host Frame:./race [0x10267]
+========= Host Frame:./race [0x465b5]
+========= Host Frame:./race [0x3342]
+========= Host Frame:./race [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./race [0x31e2]
+=========
+========= WARN:(Warp Level Programming) Potential WAR hazard detected at __shared__ 0x0 in block (0, 0, 0) :
+========= Read Thread (31, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= Write Thread (0, 0, 0) at 0x000001a8 in ./race.cu:4:test(int*, int*)
+========= Current Value : 0, Incoming Value : 1
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./race [0x101d9]
+========= Host Frame:./race [0x10267]
+========= Host Frame:./race [0x465b5]
+========= Host Frame:./race [0x3342]
+========= Host Frame:./race [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./race [0x31e2]
+=========
+========= WARN:(Warp Level Programming) Potential RAW hazard detected at __shared__ 0x3 in block (0, 0, 0) :
+========= Write Thread (31, 0, 0) at 0x00000148 in ./race.cu:3:test(int*, int*)
+========= Read Thread (0, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= Current Value : 0
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./race [0x101d9]
+========= Host Frame:./race [0x10267]
+========= Host Frame:./race [0x465b5]
+========= Host Frame:./race [0x3342]
+========= Host Frame:./race [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./race [0x31e2]
+=========
+========= WARN:(Warp Level Programming) Potential RAW hazard detected at __shared__ 0x2 in block (0, 0, 0) :
+========= Write Thread (31, 0, 0) at 0x00000148 in ./race.cu:3:test(int*, int*)
+========= Read Thread (0, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= Current Value : 0
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./race [0x101d9]
+========= Host Frame:./race [0x10267]
+========= Host Frame:./race [0x465b5]
+========= Host Frame:./race [0x3342]
+========= Host Frame:./race [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./race [0x31e2]
+=========
+========= WARN:(Warp Level Programming) Potential RAW hazard detected at __shared__ 0x1 in block (0, 0, 0) :
+========= Write Thread (31, 0, 0) at 0x00000148 in ./race.cu:3:test(int*, int*)
+========= Read Thread (0, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= Current Value : 0
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./race [0x101d9]
+========= Host Frame:./race [0x10267]
+========= Host Frame:./race [0x465b5]
+========= Host Frame:./race [0x3342]
+========= Host Frame:./race [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./race [0x31e2]
+=========
+========= WARN:(Warp Level Programming) Potential RAW hazard detected at __shared__ 0x0 in block (0, 0, 0) :
+========= Write Thread (31, 0, 0) at 0x00000148 in ./race.cu:3:test(int*, int*)
+========= Read Thread (0, 0, 0) at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= Current Value : 0
+========= Saved host backtrace up to driver entry point at kernel launch time
+========= Host Frame:/lib64/libcuda.so.1 (cuLaunchKernel + 0x346) [0x297db6]
+========= Host Frame:./race [0x101d9]
+========= Host Frame:./race [0x10267]
+========= Host Frame:./race [0x465b5]
+========= Host Frame:./race [0x3342]
+========= Host Frame:./race [0x314a]
+========= Host Frame:/lib64/libc.so.6 (__libc_start_main + 0xf5) [0x22505]
+========= Host Frame:./race [0x31e2]
+=========
+========= WARN: Race reported between Read access at 0x00000170 in ./race.cu:4:test(int*, int*)
+========= and Write access at 0x00000148 in ./race.cu:3:test(int*, int*) [4 hazards]
+========= and Write access at 0x000001a8 in ./race.cu:4:test(int*, int*) [4 hazards]
+=========
+========= WARN: Race reported between Write access at 0x00000148 in ./race.cu:3:test(int*, int*)
+========= and Write access at 0x00000148 in ./race.cu:3:test(int*, int*) [124 hazards]
+========= and Read access at 0x00000170 in ./race.cu:4:test(int*, int*) [4 hazards]
+=========
+========= WARN: Race reported between Write access at 0x000001a8 in ./race.cu:4:test(int*, int*)
+========= and Write access at 0x000001a8 in ./race.cu:4:test(int*, int*) [124 hazards]
+========= and Read access at 0x00000170 in ./race.cu:4:test(int*, int*) [4 hazards]
+=========
+========= WARN: Race reported between Write access at 0x00000148 in ./race.cu:3:test(int*, int*)
+========= and Write access at 0x00000148 in ./race.cu:3:test(int*, int*) [124 hazards]
+========= and Read access at 0x00000170 in ./race.cu:4:test(int*, int*) [4 hazards]
+=========
+========= RACECHECK SUMMARY: 12 hazards displayed (0 errors, 12 warnings)
+")
diff --git a/Tests/RunCMake/ctest_update/test.cmake.in b/Tests/RunCMake/ctest_update/test.cmake.in
index 25b8423243..01aab26bb9 100644
--- a/Tests/RunCMake/ctest_update/test.cmake.in
+++ b/Tests/RunCMake/ctest_update/test.cmake.in
@@ -10,7 +10,7 @@ set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
-# FIXME: update test to do someting meaningful with this.
+# FIXME: update test to do something meaningful with this.
set(CTEST_UPDATE_COMMAND "not-actually-used")
set(ctest_test_args "@CASE_CTEST_UPDATE_ARGS@")
diff --git a/Tests/RunCMake/export/CMakeLists.txt b/Tests/RunCMake/export/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/export/CMakeLists.txt
+++ b/Tests/RunCMake/export/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/file/DOWNLOAD-no-save-hash-result.txt b/Tests/RunCMake/file/DOWNLOAD-no-save-hash-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-no-save-hash-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/DOWNLOAD-no-save-hash-stderr.txt b/Tests/RunCMake/file/DOWNLOAD-no-save-hash-stderr.txt
new file mode 100644
index 0000000000..b0f0d19342
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-no-save-hash-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at DOWNLOAD-no-save-hash\.cmake:[0-9]+ \(file\):
+ file DOWNLOAD cannot calculate hash if file is not saved\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/DOWNLOAD-no-save-hash.cmake b/Tests/RunCMake/file/DOWNLOAD-no-save-hash.cmake
new file mode 100644
index 0000000000..ce959a7fec
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-no-save-hash.cmake
@@ -0,0 +1,8 @@
+if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^/")
+ set(slash /)
+endif()
+file(DOWNLOAD
+ "file://${slash}${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-no-save-md5.txt"
+ EXPECTED_HASH MD5=55555555555555555555555555555555
+ STATUS status
+ )
diff --git a/Tests/RunCMake/file/DOWNLOAD-no-save-hash.txt b/Tests/RunCMake/file/DOWNLOAD-no-save-hash.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-no-save-hash.txt
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index a4de1d3eea..8d84943911 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -11,6 +11,7 @@ run_cmake(DOWNLOAD-netrc-bad)
run_cmake(DOWNLOAD-tls-cainfo-not-set)
run_cmake(DOWNLOAD-tls-verify-not-set)
run_cmake(DOWNLOAD-pass-not-set)
+run_cmake(DOWNLOAD-no-save-hash)
run_cmake(TOUCH)
run_cmake(TOUCH-error-in-source-directory)
run_cmake(TOUCH-error-missing-directory)
diff --git a/Tests/RunCMake/find_dependency/CMakeLists.txt b/Tests/RunCMake/find_dependency/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/find_dependency/CMakeLists.txt
+++ b/Tests/RunCMake/find_dependency/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/find_package/CMakeLists.txt b/Tests/RunCMake/find_package/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/find_package/CMakeLists.txt
+++ b/Tests/RunCMake/find_package/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt b/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt
index b336b5621e..ebfd7d030e 100644
--- a/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt
+++ b/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt
@@ -1,9 +1,10 @@
CMake Warning \(dev\) at MissingNormalWarnNoModuleOld.cmake:2 \(find_package\):
- find_package called without NO_MODULE option and no FindNotHere.cmake
- module is in CMAKE_MODULE_PATH. Add NO_MODULE to exclusively request
- Config mode and search for a package configuration file provided by NotHere
- \(NotHereConfig.cmake or nothere-config.cmake\). Otherwise make
- FindNotHere.cmake available in CMAKE_MODULE_PATH.
+ find_package called without either MODULE or CONFIG option and no
+ FindNotHere.cmake module is in CMAKE_MODULE_PATH. Add MODULE to
+ exclusively request Module mode and fail if FindNotHere.cmake is missing.
+ Add CONFIG to exclusively request Config mode and search for a package
+ configuration file provided by NotHere \(NotHereConfig.cmake or
+ nothere-config.cmake\).
\(Variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE enabled this warning.\)
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt b/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt
new file mode 100644
index 0000000000..331d46577e
--- /dev/null
+++ b/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt
@@ -0,0 +1 @@
+-- FakeApp_EXECUTABLE='.*/Tests/RunCMake/find_program/BundleSpaceInName-build/Fake app.app/Contents/MacOS/Fake app'
diff --git a/Tests/RunCMake/find_program/BundleSpaceInName.cmake b/Tests/RunCMake/find_program/BundleSpaceInName.cmake
new file mode 100644
index 0000000000..9152d5b2e9
--- /dev/null
+++ b/Tests/RunCMake/find_program/BundleSpaceInName.cmake
@@ -0,0 +1,8 @@
+set(fakeApp "${CMAKE_CURRENT_BINARY_DIR}/Fake app.app/Contents/MacOS/Fake app")
+file(WRITE "${fakeApp}" "#!/bin/sh\n")
+execute_process(COMMAND chmod a+rx "${fakeApp}")
+
+find_program(FakeApp_EXECUTABLE NAMES "Fake app" NO_DEFAULT_PATH
+ PATHS "${CMAKE_CURRENT_BINARY_DIR}"
+)
+message(STATUS "FakeApp_EXECUTABLE='${FakeApp_EXECUTABLE}'")
diff --git a/Tests/RunCMake/find_program/ExeNoRead.cmake b/Tests/RunCMake/find_program/CMP0109-Common.cmake
index 7e22dc5b36..525413a3d7 100644
--- a/Tests/RunCMake/find_program/ExeNoRead.cmake
+++ b/Tests/RunCMake/find_program/CMP0109-Common.cmake
@@ -1,4 +1,7 @@
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead" "#!/bin/sh\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ReadNoExe" "#ReadNoExe")
execute_process(COMMAND chmod -r+x "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead")
find_program(ExeNoRead_EXECUTABLE NAMES ExeNoRead NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_BINARY_DIR}")
message(STATUS "ExeNoRead_EXECUTABLE='${ExeNoRead_EXECUTABLE}'")
+find_program(ReadNoExe_EXECUTABLE NAMES ReadNoExe NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_BINARY_DIR}")
+message(STATUS "ReadNoExe_EXECUTABLE='${ReadNoExe_EXECUTABLE}'")
diff --git a/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt b/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt
new file mode 100644
index 0000000000..2744463a34
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt
@@ -0,0 +1,2 @@
+-- ExeNoRead_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-NEW-build/ExeNoRead'
+-- ReadNoExe_EXECUTABLE='ReadNoExe_EXECUTABLE-NOTFOUND'
diff --git a/Tests/RunCMake/find_program/CMP0109-NEW.cmake b/Tests/RunCMake/find_program/CMP0109-NEW.cmake
new file mode 100644
index 0000000000..b4a4033ae7
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMP0109-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0109 NEW)
+include(CMP0109-Common.cmake)
diff --git a/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt b/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt
new file mode 100644
index 0000000000..1a0e2a8e25
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt
@@ -0,0 +1,2 @@
+-- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND'
+-- ReadNoExe_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-OLD-build/ReadNoExe'
diff --git a/Tests/RunCMake/find_program/CMP0109-OLD.cmake b/Tests/RunCMake/find_program/CMP0109-OLD.cmake
new file mode 100644
index 0000000000..826016115b
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMP0109-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0109 OLD)
+include(CMP0109-Common.cmake)
diff --git a/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt b/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt
new file mode 100644
index 0000000000..202fc6def8
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt
@@ -0,0 +1,29 @@
+^CMake Warning \(dev\) at CMP0109-Common.cmake:4 \(find_program\):
+ Policy CMP0109 is not set: find_program\(\) requires permission to execute
+ but not to read. Run "cmake --help-policy CMP0109" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ The file
+
+ .*/Tests/RunCMake/find_program/CMP0109-WARN-build/ExeNoRead
+
+ is executable but not readable. CMake is ignoring it for compatibility.
+Call Stack \(most recent call first\):
+ CMP0109-WARN.cmake:1 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at CMP0109-Common.cmake:6 \(find_program\):
+ Policy CMP0109 is not set: find_program\(\) requires permission to execute
+ but not to read. Run "cmake --help-policy CMP0109" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ The file
+
+ .*/Tests/RunCMake/find_program/CMP0109-WARN-build/ReadNoExe
+
+ is readable but not executable. CMake is using it for compatibility.
+Call Stack \(most recent call first\):
+ CMP0109-WARN.cmake:1 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt b/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt
new file mode 100644
index 0000000000..baf560f6f9
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt
@@ -0,0 +1,2 @@
+-- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND'
+-- ReadNoExe_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-WARN-build/ReadNoExe'
diff --git a/Tests/RunCMake/find_program/CMP0109-WARN.cmake b/Tests/RunCMake/find_program/CMP0109-WARN.cmake
new file mode 100644
index 0000000000..a3d59af499
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMP0109-WARN.cmake
@@ -0,0 +1 @@
+include(CMP0109-Common.cmake)
diff --git a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt
deleted file mode 100644
index f2311782dd..0000000000
--- a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
--- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND'
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
index 2bb777bff9..3e23920317 100644
--- a/Tests/RunCMake/find_program/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -17,6 +17,12 @@ else()
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT "${uid}" STREQUAL "0")
- run_cmake(ExeNoRead)
+ run_cmake(CMP0109-WARN)
+ run_cmake(CMP0109-OLD)
+ run_cmake(CMP0109-NEW)
endif()
endif()
+
+if(APPLE)
+ run_cmake(BundleSpaceInName)
+endif()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake
index 9647deabd1..3b03ed7a90 100644
--- a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake
@@ -8,13 +8,13 @@ function(foreachTest result list_var_1 list_var_2 list_var_3)
list(APPEND CMAKE_MESSAGE_INDENT "| ")
foreach(first second third IN ZIP_LISTS ${list_var_1} ${list_var_2} ${list_var_3})
if(NOT first)
- set(first "[undefiend]")
+ set(first "[undefined]")
endif()
if(NOT second)
- set(second "[undefiend]")
+ set(second "[undefined]")
endif()
if(NOT third)
- set(third "[undefiend]")
+ set(third "[undefined]")
endif()
if(NOT _arg_MUTE)
message(STATUS "${first}, ${second}, ${third}")
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt
index 25433fdc38..4730a86ed2 100644
--- a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt
@@ -14,6 +14,6 @@
-- | one, satu, raz
-- | two, dua, dva
-- | three, tiga, tri
--- | \[undefiend\], empat, \[undefiend\]
+-- | \[undefined\], empat, \[undefined\]
-- End output
-- <<< test variable value restored -- PASSED >>>
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake
index 56cfe64344..aa0ed0717f 100644
--- a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake
@@ -9,7 +9,7 @@ function(foreachTest result list_var_1 list_var_2 list_var_3)
foreach(num IN ZIP_LISTS ${list_var_1} ${list_var_2} ${list_var_3})
foreach(i RANGE 2)
if(NOT num_${i})
- set(num_${i} "[undefiend]")
+ set(num_${i} "[undefined]")
endif()
endforeach()
if(NOT _arg_MUTE)
diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt b/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt b/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt
new file mode 100644
index 0000000000..af08afae69
--- /dev/null
+++ b/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at IncorrectArguments.cmake:1 \(get_filename_component\):
+ get_filename_component called with incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake b/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake
new file mode 100644
index 0000000000..e329e29250
--- /dev/null
+++ b/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake
@@ -0,0 +1,2 @@
+get_filename_component(var)
+message("The error is fatal, so this should not print")
diff --git a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake
index 156fc8f3cc..a7820a0deb 100644
--- a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake
+++ b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake
@@ -1,4 +1,5 @@
include(RunCMake)
+run_cmake(IncorrectArguments)
run_cmake(KnownComponents)
run_cmake(UnknownComponent)
diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt
index b146e5b4bf..f86a6889ad 100644
--- a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt
+++ b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at UnknownComponent.cmake:1 \(get_filename_component\):
+^CMake Error at UnknownComponent.cmake:1 \(get_filename_component\):
get_filename_component unknown component BOGUS
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake
index 06abc51e62..19521ba463 100644
--- a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake
+++ b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake
@@ -1 +1,2 @@
get_filename_component(var "/path/to/filename.ext.in" BOGUS)
+message("The error is fatal, so this should not print")
diff --git a/Tests/RunCMake/get_property/CMakeLists.txt b/Tests/RunCMake/get_property/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/get_property/CMakeLists.txt
+++ b/Tests/RunCMake/get_property/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/if/CMakeLists.txt b/Tests/RunCMake/if/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/if/CMakeLists.txt
+++ b/Tests/RunCMake/if/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include/CMakeLists.txt b/Tests/RunCMake/include/CMakeLists.txt
index 12cd3c7757..4b3de84d94 100644
--- a/Tests/RunCMake/include/CMakeLists.txt
+++ b/Tests/RunCMake/include/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include_external_msproject/CMakeLists.txt b/Tests/RunCMake/include_external_msproject/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/include_external_msproject/CMakeLists.txt
+++ b/Tests/RunCMake/include_external_msproject/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake
index 0a2ba63f5a..016251936a 100644
--- a/Tests/RunCMake/include_external_msproject/check_utils.cmake
+++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake
@@ -63,7 +63,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT)
return()
endif()
- # probably whould be better to use configuration name
+ # probably would be better to use configuration name
# extracted from CMAKE_CONFIGURATION_TYPES than just hardcoded "Debug" instead
set(REG_EXP "^(\t)*\\{${FOUND_GUID}\\}\\.Debug[^ ]*\\.ActiveCfg = Debug\\|${PLATFORM_NAME}$")
check_line_exists(${TARGET_FILE} REG_EXP)
diff --git a/Tests/RunCMake/list/CMakeLists.txt b/Tests/RunCMake/list/CMakeLists.txt
index 12cd3c7757..4b3de84d94 100644
--- a/Tests/RunCMake/list/CMakeLists.txt
+++ b/Tests/RunCMake/list/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt
index a0f8837802..9103bd2d41 100644
--- a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt
+++ b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt
@@ -1,4 +1,13 @@
-^CMake Warning \(dev\) at GET-CMP0007-WARN.cmake:4 \(list\):
+^CMake Deprecation Warning at GET-CMP0007-WARN.cmake:1 \(cmake_policy\):
+ Compatibility with CMake < 2.8.12 will be removed from a future version of
+ CMake.
+
+ Update the VERSION argument <min> value or use a ...<max> suffix to tell
+ CMake that the project does not need compatibility with older versions.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Warning \(dev\) at GET-CMP0007-WARN.cmake:4 \(list\):
Policy CMP0007 is not set: list command no longer ignores empty elements.
Run "cmake --help-policy CMP0007" for policy details. Use the cmake_policy
command to set the policy and suppress this warning. List has value =
diff --git a/Tests/RunCMake/math/CMakeLists.txt b/Tests/RunCMake/math/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/math/CMakeLists.txt
+++ b/Tests/RunCMake/math/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/message/CMakeLists.txt b/Tests/RunCMake/message/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/message/CMakeLists.txt
+++ b/Tests/RunCMake/message/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/no_install_prefix/CMakeLists.txt b/Tests/RunCMake/no_install_prefix/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/no_install_prefix/CMakeLists.txt
+++ b/Tests/RunCMake/no_install_prefix/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/project/CMakeLists.txt b/Tests/RunCMake/project/CMakeLists.txt
index 12cd3c7757..4b3de84d94 100644
--- a/Tests/RunCMake/project/CMakeLists.txt
+++ b/Tests/RunCMake/project/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/string/CMakeLists.txt b/Tests/RunCMake/string/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/string/CMakeLists.txt
+++ b/Tests/RunCMake/string/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake
index 2e9cba82c3..6c72546418 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake
@@ -1,4 +1,4 @@
-
+cmake_minimum_required(VERSION 2.8.11)
project(CMP0022-WARN)
add_library(foo SHARED empty_vs6_1.cpp)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake
index fcc8da03e9..dfdf70b274 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake
@@ -1,4 +1,4 @@
-
+cmake_minimum_required(VERSION 2.8.11)
project(CMP0022-WARN)
add_library(foo SHARED empty_vs6_1.cpp)
diff --git a/Tests/RunCMake/target_link_libraries/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/CMakeLists.txt
index 8f85fbf540..667561ea79 100644
--- a/Tests/RunCMake/target_link_libraries/CMakeLists.txt
+++ b/Tests/RunCMake/target_link_libraries/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake
index 9b97918a57..9f86b1850e 100644
--- a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake
+++ b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0022 NEW)
enable_language(C)
add_library(foo STATIC empty.c)
add_library(not_exported STATIC empty.c)
diff --git a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake
index 7122ae91ed..20ec43825d 100644
--- a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake
+++ b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake
@@ -1,4 +1,3 @@
-cmake_policy(SET CMP0022 NEW)
enable_language(C)
add_library(foo STATIC empty.c)
target_link_libraries(foo PRIVATE not_a_target)
diff --git a/Tests/RunCMake/try_compile/CMP0056.cmake b/Tests/RunCMake/try_compile/CMP0056.cmake
index e8d3d4a3bd..2ab79d5dde 100644
--- a/Tests/RunCMake/try_compile/CMP0056.cmake
+++ b/Tests/RunCMake/try_compile/CMP0056.cmake
@@ -1,3 +1,4 @@
+cmake_minimum_required(VERSION 3.1)
enable_language(C)
set(obj "${CMAKE_C_OUTPUT_EXTENSION}")
if(BORLAND)
diff --git a/Tests/RunCMake/try_compile/CMakeLists.txt b/Tests/RunCMake/try_compile/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/try_compile/CMakeLists.txt
+++ b/Tests/RunCMake/try_compile/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/try_compile/CudaStandard-stderr.txt b/Tests/RunCMake/try_compile/CudaStandard-stderr.txt
index 3c6bdf6b71..bcf95d5465 100644
--- a/Tests/RunCMake/try_compile/CudaStandard-stderr.txt
+++ b/Tests/RunCMake/try_compile/CudaStandard-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error at .*/Tests/RunCMake/try_compile/CudaStandard-build/CMakeFiles/CMakeTmp/CMakeLists.txt:[0-9]+ \(add_executable\):
- CUDA_STANDARD is set to invalid value '3'
+ CUDA_STANDARD is set to invalid value '4'
+
CMake Error at CudaStandard.cmake:[0-9]+ \(try_compile\):
Failed to generate test project build system.
diff --git a/Tests/RunCMake/try_compile/CudaStandard.cmake b/Tests/RunCMake/try_compile/CudaStandard.cmake
index 96da422c64..a230424bf3 100644
--- a/Tests/RunCMake/try_compile/CudaStandard.cmake
+++ b/Tests/RunCMake/try_compile/CudaStandard.cmake
@@ -1,7 +1,7 @@
enable_language(CUDA)
try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.cu
- CUDA_STANDARD 3
+ CUDA_STANDARD 4
OUTPUT_VARIABLE out
)
message("try_compile output:\n${out}")
diff --git a/Tests/RunCMake/try_compile/proj/CMakeLists.txt b/Tests/RunCMake/try_compile/proj/CMakeLists.txt
index 78a87c016e..652f5b6be7 100644
--- a/Tests/RunCMake/try_compile/proj/CMakeLists.txt
+++ b/Tests/RunCMake/try_compile/proj/CMakeLists.txt
@@ -1,2 +1,2 @@
-cmake_minimum_required(VERSION 2.8.10)
+cmake_minimum_required(VERSION 3.3)
project(TestProject NONE)
diff --git a/Tests/RunCMake/try_run/CMakeLists.txt b/Tests/RunCMake/try_run/CMakeLists.txt
index e03478039a..e93f0b69e4 100644
--- a/Tests/RunCMake/try_run/CMakeLists.txt
+++ b/Tests/RunCMake/try_run/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.0)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} C)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/variable_watch/CMakeLists.txt b/Tests/RunCMake/variable_watch/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/variable_watch/CMakeLists.txt
+++ b/Tests/RunCMake/variable_watch/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/while/CMakeLists.txt b/Tests/RunCMake/while/CMakeLists.txt
index 12cd3c7757..74b3ff8de3 100644
--- a/Tests/RunCMake/while/CMakeLists.txt
+++ b/Tests/RunCMake/while/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.4)
+cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/SetLang/CMakeLists.txt b/Tests/SetLang/CMakeLists.txt
index 9de4fc61d1..616421ed53 100644
--- a/Tests/SetLang/CMakeLists.txt
+++ b/Tests/SetLang/CMakeLists.txt
@@ -15,3 +15,10 @@ if(CMAKE_GENERATOR MATCHES "^Visual Studio" AND "x${CMAKE_C_COMPILER_ID}" STREQU
add_library(stay stay_c.c stay_cxx.cxx)
set_property(TARGET stay PROPERTY COMPILE_OPTIONS "-TP")
endif()
+
+if((CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang|MSVC|Borland|Embarcadero|Intel|TI|XL)"))
+ add_library(zoom zoom.zzz)
+ set_source_files_properties(zoom.zzz PROPERTIES LANGUAGE CXX)
+ target_link_libraries(SetLang zoom)
+ target_compile_definitions(SetLang PRIVATE WITH_ZOOM)
+endif()
diff --git a/Tests/SetLang/bar.c b/Tests/SetLang/bar.c
index b934356fa1..515e8c233e 100644
--- a/Tests/SetLang/bar.c
+++ b/Tests/SetLang/bar.c
@@ -1,10 +1,22 @@
#include <stdio.h>
int foo();
+
+#ifdef WITH_ZOOM
+int zoom();
+#endif
+
class A
{
public:
- A() { this->i = foo(); }
+ A()
+ {
+ this->i = foo();
+#ifdef WITH_ZOOM
+ i += zoom();
+ i -= zoom();
+#endif
+ }
int i;
};
diff --git a/Tests/SetLang/zoom.zzz b/Tests/SetLang/zoom.zzz
new file mode 100644
index 0000000000..a0c8899b6b
--- /dev/null
+++ b/Tests/SetLang/zoom.zzz
@@ -0,0 +1,7 @@
+int zoom()
+{
+ int r = 10;
+ r++;
+ int ret = r + 10;
+ return ret;
+}
diff --git a/Tests/VSNsightTegra/AndroidManifest.xml b/Tests/VSAndroid/AndroidManifest.xml
index 951e8f3082..951e8f3082 100644
--- a/Tests/VSNsightTegra/AndroidManifest.xml
+++ b/Tests/VSAndroid/AndroidManifest.xml
diff --git a/Tests/VSNsightTegra/CMakeLists.txt b/Tests/VSAndroid/CMakeLists.txt
index 6d74f2f85e..73b1e079cb 100644
--- a/Tests/VSNsightTegra/CMakeLists.txt
+++ b/Tests/VSAndroid/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.3)
-project(VSNsightTegra C CXX)
+project(VSAndroid C CXX)
set(CMAKE_ANDROID_ARCH armv7-a)
set(CMAKE_ANDROID_STL_TYPE stlport_shared)
diff --git a/Tests/VSNsightTegra/build.xml b/Tests/VSAndroid/build.xml
index 17a2cc07b9..17a2cc07b9 100644
--- a/Tests/VSNsightTegra/build.xml
+++ b/Tests/VSAndroid/build.xml
diff --git a/Tests/VSNsightTegra/jni/first.c b/Tests/VSAndroid/jni/first.c
index b9dee2754c..b9dee2754c 100644
--- a/Tests/VSNsightTegra/jni/first.c
+++ b/Tests/VSAndroid/jni/first.c
diff --git a/Tests/VSNsightTegra/jni/first.h b/Tests/VSAndroid/jni/first.h
index 9dfd8b886c..9dfd8b886c 100644
--- a/Tests/VSNsightTegra/jni/first.h
+++ b/Tests/VSAndroid/jni/first.h
diff --git a/Tests/VSNsightTegra/jni/second.c b/Tests/VSAndroid/jni/second.c
index 30bdc17b03..30bdc17b03 100644
--- a/Tests/VSNsightTegra/jni/second.c
+++ b/Tests/VSAndroid/jni/second.c
diff --git a/Tests/VSNsightTegra/proguard-android.txt b/Tests/VSAndroid/proguard-android.txt
index fe73baeb58..fe73baeb58 100644
--- a/Tests/VSNsightTegra/proguard-android.txt
+++ b/Tests/VSAndroid/proguard-android.txt
diff --git a/Tests/VSNsightTegra/res/values/strings.xml b/Tests/VSAndroid/res/values/strings.xml
index 858cdb40ee..858cdb40ee 100644
--- a/Tests/VSNsightTegra/res/values/strings.xml
+++ b/Tests/VSAndroid/res/values/strings.xml
diff --git a/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java b/Tests/VSAndroid/src/com/example/twolibs/TwoLibs.java
index ef9da01cf8..ef9da01cf8 100644
--- a/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java
+++ b/Tests/VSAndroid/src/com/example/twolibs/TwoLibs.java
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index 558d5de959..56e4c1d4ed 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -114,7 +114,7 @@ set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets")
set_property(SOURCE ${STRING_FILES} PROPERTY VS_TOOL_OVERRIDE "PRIResource")
set_property(SOURCE ${DEBUG_CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT $<CONFIG:Debug>)
set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY
- VS_DEPLOYMENT_CONTENT $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>)
+ VS_DEPLOYMENT_CONTENT $<CONFIG:Release,RelWithDebInfo,MinSizeRel>)
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS)
diff --git a/Tests/VariableUnusedViaSet/CMakeLists.txt b/Tests/VariableUnusedViaSet/CMakeLists.txt
deleted file mode 100644
index 0123ab2211..0000000000
--- a/Tests/VariableUnusedViaSet/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(UNUSED_VARIABLE)
-# Warning should occur here
-set(UNUSED_VARIABLE "Usage")
-message(STATUS "${UNUSED_VARIABLE}")
diff --git a/Tests/VariableUnusedViaUnset/CMakeLists.txt b/Tests/VariableUnusedViaUnset/CMakeLists.txt
deleted file mode 100644
index 4b4031da3f..0000000000
--- a/Tests/VariableUnusedViaUnset/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-# NOTE: Changing lines in here changes the test results since the first
-# instance shouldn't warn, but the second should and they have the same message
-
-# A warning should NOT be issued for this line:
-set(UNUSED_VARIABLE)
-# Warning should occur here:
-set(UNUSED_VARIABLE)
-message(STATUS "${UNUSED_VARIABLE}")
diff --git a/Tests/XCTest/StaticLibExample/StaticLibExample.c b/Tests/XCTest/StaticLibExample/StaticLibExample.c
index b198f80f3d..8d16eb5969 100644
--- a/Tests/XCTest/StaticLibExample/StaticLibExample.c
+++ b/Tests/XCTest/StaticLibExample/StaticLibExample.c
@@ -1,6 +1,6 @@
#include "StaticLibExample.h"
-int FourtyFour()
+int FourtyFour(void)
{
return 44;
}
diff --git a/Tests/XCTest/StaticLibExample/StaticLibExample.h b/Tests/XCTest/StaticLibExample/StaticLibExample.h
index 147a909aa9..88695b1c8a 100644
--- a/Tests/XCTest/StaticLibExample/StaticLibExample.h
+++ b/Tests/XCTest/StaticLibExample/StaticLibExample.h
@@ -1 +1 @@
-int FourtyFour();
+int FourtyFour(void);
diff --git a/Utilities/Sphinx/CTestConfig.cmake b/Utilities/Sphinx/CTestConfig.cmake
index 9607e38a43..e5f42601a4 100644
--- a/Utilities/Sphinx/CTestConfig.cmake
+++ b/Utilities/Sphinx/CTestConfig.cmake
@@ -6,7 +6,9 @@
set(CTEST_PROJECT_NAME "CMake")
set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")
-set(CTEST_DROP_METHOD "http")
+if(NOT CTEST_DROP_METHOD STREQUAL "https")
+ set(CTEST_DROP_METHOD "http")
+endif()
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Utilities/Sphinx/update_versions.py b/Utilities/Sphinx/update_versions.py
new file mode 100755
index 0000000000..893e7a719d
--- /dev/null
+++ b/Utilities/Sphinx/update_versions.py
@@ -0,0 +1,115 @@
+#!/usr/bin/env python3
+"""
+This script inserts "versionadded" directive into every .rst document
+and every .cmake module with .rst documentation comment.
+"""
+import re
+import pathlib
+import subprocess
+import argparse
+
+tag_re = re.compile(r'^v3\.(\d+)\.(\d+)(?:-rc(\d+))?$')
+path_re = re.compile(r'Help/(?!dev|guide|manual|cpack_|release).*\.rst|Modules/[^/]*\.cmake$')
+
+def git_root():
+ result = subprocess.run(
+ ['git', 'rev-parse', '--show-toplevel'], check=True, universal_newlines=True, capture_output=True)
+ return pathlib.Path(result.stdout.strip())
+
+def git_tags():
+ result = subprocess.run(['git', 'tag'], check=True, universal_newlines=True, capture_output=True)
+ return [tag for tag in result.stdout.splitlines() if tag_re.match(tag)]
+
+def git_list_tree(ref):
+ result = subprocess.run(
+ ['git', 'ls-tree', '-r', '--full-name', '--name-only', ref, ':/'],
+ check=True, universal_newlines=True, capture_output=True)
+ return [path for path in result.stdout.splitlines() if path_re.match(path)]
+
+def tag_version(tag):
+ return re.sub(r'^v|\.0(-rc\d+)?$', '', tag)
+
+def tag_sortkey(tag):
+ return tuple(int(part or '1000') for part in tag_re.match(tag).groups())
+
+def make_version_map(baseline, since, next_version):
+ versions = {}
+ if next_version:
+ for path in git_list_tree('HEAD'):
+ versions[path] = next_version
+ for tag in sorted(git_tags(), key=tag_sortkey, reverse=True):
+ version = tag_version(tag)
+ for path in git_list_tree(tag):
+ versions[path] = version
+ if baseline:
+ for path in git_list_tree(baseline):
+ versions[path] = None
+ if since:
+ for path in git_list_tree(since):
+ versions.pop(path, None)
+ return versions
+
+cmake_version_re = re.compile(
+ rb'set\(CMake_VERSION_MAJOR\s+(\d+)\)\s+set\(CMake_VERSION_MINOR\s+(\d+)\)\s+set\(CMake_VERSION_PATCH\s+(\d+)\)', re.S)
+
+def cmake_version(path):
+ match = cmake_version_re.search(path.read_bytes())
+ major, minor, patch = map(int, match.groups())
+ minor += patch > 20000000
+ return f'{major}.{minor}'
+
+stamp_re = re.compile(
+ rb'(?P<PREFIX>(^|\[\.rst:\r?\n)[^\r\n]+\r?\n[*^\-=#]+(?P<NL>\r?\n))(?P<STAMP>\s*\.\. versionadded::[^\r\n]*\r?\n)?')
+stamp_pattern_add = rb'\g<PREFIX>\g<NL>.. versionadded:: VERSION\g<NL>'
+stamp_pattern_remove = rb'\g<PREFIX>'
+
+def update_file(path, version, overwrite):
+ try:
+ data = path.read_bytes()
+ except FileNotFoundError as e:
+ return False
+
+ def _replacement(match):
+ if not overwrite and match.start('STAMP') != -1:
+ return match.group()
+ if version:
+ pattern = stamp_pattern_add.replace(b'VERSION', version.encode('utf-8'))
+ else:
+ pattern = stamp_pattern_remove
+ return match.expand(pattern)
+
+ new_data, nrepl = stamp_re.subn(_replacement, data, 1)
+ if nrepl and new_data != data:
+ path.write_bytes(new_data)
+ return True
+ return False
+
+def update_repo(repo_root, version_map, overwrite):
+ total = 0
+ for path, version in version_map.items():
+ if update_file(repo_root / path, version, overwrite):
+ print(f"Version {version or '<none>':6} for {path}")
+ total += 1
+ print(f"Updated {total} file(s)")
+
+def main():
+ parser = argparse.ArgumentParser(allow_abbrev=False)
+ parser.add_argument('--overwrite', action='store_true', help="overwrite existing version tags")
+ parser.add_argument('--baseline', metavar='TAG', default='v3.0.0',
+ help="files present in this tag won't be stamped (default: v3.0.0)")
+ parser.add_argument('--since', metavar='TAG',
+ help="apply changes only to files added after this tag")
+ parser.add_argument('--next-version', metavar='VER',
+ help="version for files not present in any tag (default: from CMakeVersion.cmake)")
+ args = parser.parse_args()
+
+ try:
+ repo_root = git_root()
+ next_version = args.next_version or cmake_version(repo_root / 'Source/CMakeVersion.cmake')
+ version_map = make_version_map(args.baseline, args.since, next_version)
+ update_repo(repo_root, version_map, args.overwrite)
+ except subprocess.CalledProcessError as e:
+ print(f"Command '{' '.join(e.cmd)}' returned code {e.returncode}:\n{e.stderr.strip()}")
+
+if __name__ == '__main__':
+ main()
diff --git a/Utilities/cmlibuv/include/uv/unix.h b/Utilities/cmlibuv/include/uv/unix.h
index 82778ffb9e..f30562e622 100644
--- a/Utilities/cmlibuv/include/uv/unix.h
+++ b/Utilities/cmlibuv/include/uv/unix.h
@@ -47,6 +47,9 @@
#ifdef CMAKE_BOOTSTRAP
# include "posix.h"
+# if defined(__APPLE__)
+# include <TargetConditionals.h>
+# endif
#elif defined(__linux__)
# include "linux.h"
#elif defined (__MVS__)
diff --git a/Utilities/std/CMakeLists.txt b/Utilities/std/CMakeLists.txt
index 17a7aaa4ec..23d9104644 100644
--- a/Utilities/std/CMakeLists.txt
+++ b/Utilities/std/CMakeLists.txt
@@ -4,7 +4,9 @@
set(CMAKE_CXX_EXTENSIONS FALSE)
# source files for CMake std library
-set(SRCS cm/bits/string_view.cxx
+set(SRCS cm/bits/fs_path.cxx
+ cm/bits/string_view.cxx
+ cm/filesystem
cm/memory
cm/optional
cm/shared_mutex
diff --git a/Utilities/std/cm/bits/fs_path.cxx b/Utilities/std/cm/bits/fs_path.cxx
new file mode 100644
index 0000000000..808999899c
--- /dev/null
+++ b/Utilities/std/cm/bits/fs_path.cxx
@@ -0,0 +1,1029 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include <cm/filesystem> // IWYU pragma: associated
+
+#if !defined(CMake_HAVE_CXX_FILESYSTEM)
+
+# include <algorithm>
+# include <cassert>
+# include <cstddef>
+# include <cstdlib>
+# include <functional>
+# include <string>
+# include <utility>
+# include <vector>
+# if defined(_WIN32) && !defined(__CYGWIN__)
+# include <cctype>
+# endif
+# if defined(_WIN32) || defined(__CYGWIN__)
+# include <iterator>
+# endif
+
+# include <cm/memory>
+# include <cm/string_view>
+# include <cmext/string_view>
+
+namespace cm {
+namespace filesystem {
+namespace internals {
+
+class path_parser
+{
+# if defined(__SUNPRO_CC) && defined(__sparc)
+ // Oracle DeveloperStudio C++ compiler generates wrong code if enum size
+ // is different than the default.
+ using enum_size = int;
+# else
+ using enum_size = unsigned char;
+# endif
+
+ enum class state : enum_size
+ {
+ before_begin,
+ in_root_name,
+ in_root_dir,
+ in_filename,
+ trailing_separator,
+ at_end
+ };
+
+ using pointer = char const*;
+
+public:
+ enum class seek_position : enum_size
+ {
+ root_name = static_cast<enum_size>(state::in_root_name),
+ root_directory = static_cast<enum_size>(state::in_root_dir)
+ };
+ enum class peek_fragment : enum_size
+ {
+ remainder,
+ path
+ };
+
+ path_parser(cm::string_view path, bool set_at_end = false)
+ : State(set_at_end ? state::at_end : state::before_begin)
+ , Path(path)
+ {
+ }
+
+ path_parser(const path_parser&) = default;
+
+ ~path_parser() = default;
+
+ void reset() noexcept { this->set_state(state::before_begin); }
+
+ void increment() noexcept
+ {
+ const pointer start = this->next_token();
+ const pointer end = this->after_end();
+
+ if (start == end) {
+ this->set_state(state::at_end);
+ return;
+ }
+
+ switch (this->State) {
+ case state::before_begin: {
+ auto pos = this->consume_root_name(start, end);
+ if (pos) {
+ this->set_state(state::in_root_name);
+ } else {
+ pos = this->consume_separator(start, end);
+ if (pos) {
+ this->set_state(state::in_root_dir);
+ } else {
+ this->consume_filename(start, end);
+ this->set_state(state::in_filename);
+ }
+ }
+ break;
+ }
+ case state::in_root_name: {
+ auto pos = this->consume_separator(start, end);
+ if (pos) {
+ this->set_state(state::in_root_dir);
+ } else {
+ this->consume_filename(start, end);
+ this->set_state(state::in_filename);
+ }
+ break;
+ }
+ case state::in_root_dir: {
+ this->consume_filename(start, end);
+ this->set_state(state::in_filename);
+ break;
+ }
+ case state::in_filename: {
+ auto posSep = this->consume_separator(start, end);
+ if (posSep != end) {
+ auto pos = this->consume_filename(posSep, end);
+ if (pos) {
+ return;
+ }
+ }
+ set_state(state::trailing_separator);
+ break;
+ }
+ case state::trailing_separator: {
+ this->set_state(state::at_end);
+ break;
+ }
+ case state::at_end:
+ // unreachable
+ std::abort();
+ }
+ }
+
+ void decrement() noexcept
+ {
+ const pointer rstart = this->current_token() - 1;
+ const pointer rend = this->before_start();
+
+ if (rstart == rend) {
+ this->set_state(state::before_begin);
+ return;
+ }
+
+ switch (this->State) {
+ case state::at_end: {
+ auto posSep = this->consume_separator(rstart, rend);
+ if (posSep) {
+ if (posSep == rend) {
+ this->set_state(state::in_root_dir);
+ } else {
+ auto pos = this->consume_root_name(posSep, rend, true);
+ if (pos == rend) {
+ this->set_state(state::in_root_dir);
+ } else {
+ this->set_state(state::trailing_separator);
+ }
+ }
+ } else {
+ auto pos = this->consume_root_name(rstart, rend);
+ if (pos == rend) {
+ this->set_state(state::in_root_name);
+ } else {
+ this->consume_filename(rstart, rend);
+ this->set_state(state::in_filename);
+ }
+ }
+ break;
+ }
+ case state::trailing_separator: {
+ this->consume_filename(rstart, rend);
+ this->set_state(state::in_filename);
+ break;
+ }
+ case state::in_filename: {
+ auto posSep = this->consume_separator(rstart, rend);
+ if (posSep == rend) {
+ this->set_state(state::in_root_dir);
+ } else {
+ auto pos = this->consume_root_name(posSep, rend, true);
+ if (pos == rend) {
+ this->set_state(state::in_root_dir);
+ } else {
+ this->consume_filename(posSep, rend);
+ this->set_state(state::in_filename);
+ }
+ }
+ break;
+ }
+ case state::in_root_dir: {
+ auto pos = this->consume_root_name(rstart, rend);
+ if (pos) {
+ this->set_state(state::in_root_name);
+ }
+ break;
+ }
+ case state::in_root_name:
+ case state::before_begin: {
+ // unreachable
+ std::abort();
+ }
+ }
+ }
+
+ path_parser& operator++() noexcept
+ {
+ this->increment();
+ return *this;
+ }
+
+ path_parser& operator--() noexcept
+ {
+ this->decrement();
+ return *this;
+ }
+
+ cm::string_view operator*() const noexcept
+ {
+ switch (this->State) {
+ case state::before_begin:
+ case state::at_end:
+ return cm::string_view();
+ case state::trailing_separator:
+ return "";
+ case state::in_root_dir:
+ case state::in_root_name:
+ case state::in_filename:
+ return this->Entry;
+ default:
+ // unreachable
+ std::abort();
+ }
+ }
+
+ void seek(seek_position position)
+ {
+ state s = static_cast<state>(static_cast<int>(position));
+
+ while (this->State <= s) {
+ this->increment();
+ }
+ }
+
+ cm::string_view peek(peek_fragment fragment)
+ {
+ if (fragment == peek_fragment::remainder) {
+ // peek-up remain part of the initial path
+ return { this->Entry.data(),
+ std::size_t(&this->Path.back() - this->Entry.data() + 1) };
+ }
+ if (fragment == peek_fragment::path) {
+ // peek-up full path until current position
+ return { this->Path.data(),
+ std::size_t(&this->Entry.back() - this->Path.data() + 1) };
+ }
+ return {};
+ }
+
+ bool in_root_name() const { return this->State == state::in_root_name; }
+ bool in_root_directory() const { return this->State == state::in_root_dir; }
+ bool at_end() const { return this->State == state::at_end; }
+
+ bool at_start() const { return this->Entry.data() == this->Path.data(); }
+
+private:
+ void set_state(state newState) noexcept
+ {
+ this->State = newState;
+ if (newState == state::before_begin || newState == state::at_end) {
+ this->Entry = {};
+ }
+ }
+
+ pointer before_start() const noexcept { return this->Path.data() - 1; }
+ pointer after_end() const noexcept
+ {
+ return this->Path.data() + this->Path.size();
+ }
+
+ pointer current_token() const noexcept
+ {
+ switch (this->State) {
+ case state::before_begin:
+ case state::in_root_name:
+ return &this->Path.front();
+ case state::in_root_dir:
+ case state::in_filename:
+ case state::trailing_separator:
+ return &this->Entry.front();
+ case state::at_end:
+ return &this->Path.back() + 1;
+ default:
+ // unreachable
+ std::abort();
+ }
+ }
+ pointer next_token() const noexcept
+ {
+ switch (this->State) {
+ case state::before_begin:
+ return this->Path.data();
+ case state::in_root_name:
+ case state::in_root_dir:
+ case state::in_filename:
+ return &this->Entry.back() + 1;
+ case state::trailing_separator:
+ case state::at_end:
+ return after_end();
+ default:
+ // unreachable
+ std::abort();
+ }
+ }
+
+ pointer consume_separator(pointer ptr, pointer end) noexcept
+ {
+ if (ptr == end ||
+ (*ptr != '/'
+# if defined(_WIN32)
+ && *ptr != '\\'
+# endif
+ )) {
+ return nullptr;
+ }
+ const auto step = ptr < end ? 1 : -1;
+ ptr += step;
+ while (ptr != end &&
+ (*ptr == '/'
+# if defined(_WIN32)
+ || *ptr == '\\'
+# endif
+ )) {
+ ptr += step;
+ }
+ if (step == 1) {
+ this->Entry = cm::string_view(ptr - 1, 1);
+ } else {
+ this->Entry = cm::string_view(ptr + 1, 1);
+ }
+
+ return ptr;
+ }
+
+ pointer consume_filename(pointer ptr, pointer end) noexcept
+ {
+ auto start = ptr;
+
+ if (ptr == end || *ptr == '/'
+# if defined(_WIN32)
+ || *ptr == '\\'
+# endif
+ ) {
+ return nullptr;
+ }
+ const auto step = ptr < end ? 1 : -1;
+ ptr += step;
+ while (ptr != end && *ptr != '/'
+# if defined(_WIN32)
+ && *ptr != '\\'
+# endif
+ ) {
+ ptr += step;
+ }
+
+# if defined(_WIN32)
+ if (step == -1 && (start - ptr) >= 2 && ptr == end) {
+ // rollback drive name consumption, if any
+ if (this->is_drive_name(ptr + 1)) {
+ ptr += 2;
+ }
+ if (ptr == start) {
+ return nullptr;
+ }
+ }
+# endif
+
+ if (step == 1) {
+ this->Entry = cm::string_view(start, ptr - start);
+ } else {
+ this->Entry = cm::string_view(ptr + 1, start - ptr);
+ }
+
+ return ptr;
+ }
+
+# if defined(_WIN32)
+ bool is_drive_name(pointer ptr)
+ {
+ return std::toupper(ptr[0]) >= 'A' && std::toupper(ptr[0]) <= 'Z' &&
+ ptr[1] == ':';
+ }
+# endif
+
+ pointer consume_root_name(pointer ptr, pointer end,
+ bool check_only = false) noexcept
+ {
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ if (ptr < end) {
+ if ((end - ptr) >= 2 && this->is_drive_name(ptr)) {
+ // Drive letter (X:) is a root name
+ if (!check_only) {
+ this->Entry = cm::string_view(ptr, 2);
+ }
+ return ptr + 2;
+ }
+ if ((end - ptr) > 2 && (ptr[0] == '/' || ptr[0] == '\\') &&
+ (ptr[1] == '/' || ptr[1] == '\\') &&
+ (ptr[2] != '/' && ptr[2] != '\\')) {
+ // server name (//server) is a root name
+ auto pos = std::find_if(ptr + 2, end,
+ [](char c) { return c == '/' || c == '\\'; });
+ if (!check_only) {
+ this->Entry = cm::string_view(ptr, pos - ptr);
+ }
+ return pos;
+ }
+ } else {
+ if ((ptr - end) >= 2 && this->is_drive_name(ptr - 1)) {
+ // Drive letter (X:) is a root name
+ if (!check_only) {
+ this->Entry = cm::string_view(ptr - 1, 2);
+ }
+ return ptr - 2;
+ }
+ if ((ptr - end) > 2 && (ptr[0] != '/' && ptr[0] != '\\')) {
+ std::reverse_iterator<pointer> start(ptr);
+ std::reverse_iterator<pointer> stop(end);
+ auto res = std::find_if(start, stop,
+ [](char c) { return c == '/' || c == '\\'; });
+ pointer pos = res.base() - 1;
+ if ((pos - 1) > end && (pos[-1] == '/' || pos[-1] == '\\')) {
+ // server name (//server) is a root name
+ if (!check_only) {
+ this->Entry = cm::string_view(pos - 1, ptr - pos + 2);
+ }
+ return pos - 2;
+ }
+ }
+ }
+# elif defined(__CYGWIN__)
+ if (ptr < end) {
+ if ((end - ptr) > 2 && ptr[0] == '/' && ptr[1] == '/' && ptr[2] != '/') {
+ // server name (//server) is a root name
+ auto pos = std::find(ptr + 2, end, '/');
+ if (!check_only) {
+ this->Entry = cm::string_view(ptr, pos - ptr);
+ }
+ return pos;
+ }
+ } else {
+ if ((ptr - end) > 2 && ptr[0] != '/') {
+ std::reverse_iterator<pointer> start(ptr);
+ std::reverse_iterator<pointer> stop(end);
+ auto res = std::find(start, stop, '/');
+ pointer pos = res.base() - 1;
+ if ((pos - 1) > end && pos[-1] == '/') {
+ // server name (//server) is a root name
+ if (!check_only) {
+ this->Entry = cm::string_view(pos - 1, ptr - pos + 2);
+ }
+ return pos - 2;
+ }
+ }
+ }
+# else
+ (void)ptr;
+ (void)end;
+ (void)check_only;
+# endif
+ return nullptr;
+ }
+
+ state State;
+ const cm::string_view Path;
+ cm::string_view Entry;
+};
+
+// class unicode_helper
+void unicode_helper::append(std::string& str, std::uint32_t codepoint)
+{
+ if (codepoint <= 0x7f) {
+ str.push_back(static_cast<char>(codepoint));
+ } else if (codepoint >= 0x80 && codepoint <= 0x7ff) {
+ str.push_back(static_cast<char>((codepoint >> 6) + 192));
+ str.push_back(static_cast<char>((codepoint & 0x3f) + 128));
+ } else if ((codepoint >= 0x800 && codepoint <= 0xd7ff) ||
+ (codepoint >= 0xe000 && codepoint <= 0xffff)) {
+ str.push_back(static_cast<char>((codepoint >> 12) + 224));
+ str.push_back(static_cast<char>(((codepoint & 0xfff) >> 6) + 128));
+ str.push_back(static_cast<char>((codepoint & 0x3f) + 128));
+ } else if (codepoint >= 0x10000 && codepoint <= 0x10ffff) {
+ str.push_back(static_cast<char>((codepoint >> 18) + 240));
+ str.push_back(static_cast<char>(((codepoint & 0x3ffff) >> 12) + 128));
+ str.push_back(static_cast<char>(((codepoint & 0xfff) >> 6) + 128));
+ str.push_back(static_cast<char>((codepoint & 0x3f) + 128));
+ } else {
+ append(str, 0xfffd);
+ }
+}
+
+unicode_helper::utf8_state unicode_helper::decode(const utf8_state state,
+ const std::uint8_t fragment,
+ std::uint32_t& codepoint)
+{
+ const std::uint32_t utf8_state_info[] = {
+ // encoded states
+ 0x11111111u, 0x11111111u, 0x77777777u, 0x77777777u, 0x88888888u,
+ 0x88888888u, 0x88888888u, 0x88888888u, 0x22222299u, 0x22222222u,
+ 0x22222222u, 0x22222222u, 0x3333333au, 0x33433333u, 0x9995666bu,
+ 0x99999999u, 0x88888880u, 0x22818108u, 0x88888881u, 0x88888882u,
+ 0x88888884u, 0x88888887u, 0x88888886u, 0x82218108u, 0x82281108u,
+ 0x88888888u, 0x88888883u, 0x88888885u, 0u, 0u,
+ 0u, 0u,
+ };
+ std::uint8_t category = fragment < 128
+ ? 0
+ : (utf8_state_info[(fragment >> 3) & 0xf] >> ((fragment & 7) << 2)) & 0xf;
+ codepoint = (state ? (codepoint << 6) | (fragment & 0x3fu)
+ : (0xffu >> category) & fragment);
+ return state == s_reject
+ ? s_reject
+ : static_cast<utf8_state>(
+ (utf8_state_info[category + 16] >> (state << 2)) & 0xf);
+}
+
+} // internals
+
+// Class path
+path& path::operator/=(const path& p)
+{
+ if (p.is_absolute() ||
+ (p.has_root_name() && p.get_root_name() != this->get_root_name())) {
+ this->path_ = p.path_;
+ return *this;
+ }
+ if (p.has_root_directory()) {
+ this->path_ = static_cast<std::string>(this->get_root_name());
+ this->path_ += static_cast<std::string>(p.get_root_directory());
+ } else if (this->has_filename()) {
+ this->path_ += this->preferred_separator;
+# if defined(_WIN32) || defined(__CYGWIN__)
+ // special case: "//host" / "b" => "//host/b"
+ } else if (this->has_root_name() && !this->has_root_directory()) {
+ if (this->path_.length() >= 3 &&
+ (this->path_[0] == '/'
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ || this->path_[0] == '\\'
+# endif
+ ) &&
+ (this->path_[1] == '/'
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ || this->path_[1] == '\\'
+# endif
+ ) &&
+ (this->path_[2] != '/'
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ && this->path_[2] != '\\'
+# endif
+ )) {
+ this->path_ += this->preferred_separator;
+ }
+# endif
+ }
+
+ this->path_ += p.get_relative_path();
+ return *this;
+}
+
+path path::lexically_normal() const
+{
+ if (this->path_.empty()) {
+ return *this;
+ }
+
+ const cm::string_view dot = "."_s;
+ const cm::string_view dotdot = ".."_s;
+
+ std::vector<cm::string_view> root_parts;
+ std::vector<cm::string_view> parts;
+ bool root_directory_defined = false;
+ bool need_final_separator = false;
+ std::size_t path_size = 0;
+
+ internals::path_parser parser(this->path_);
+ ++parser;
+ while (!parser.at_end()) {
+ auto part = *parser;
+
+ if (parser.in_root_name() || parser.in_root_directory()) {
+ if (parser.in_root_directory()) {
+ root_directory_defined = true;
+ }
+ root_parts.push_back(part);
+ path_size += part.size();
+ } else if (part == dotdot) {
+ if (!parts.empty() && parts.back() != dotdot) {
+ need_final_separator = true;
+ path_size -= parts.back().size();
+ parts.pop_back();
+ } else if ((parts.empty() || parts.back() == dotdot) &&
+ !root_directory_defined) {
+ parts.push_back(dotdot);
+ path_size += 2;
+ }
+
+ } else if (part == dot || part.empty()) {
+ need_final_separator = true;
+ if (part.empty()) {
+ parts.push_back(part);
+ }
+ } else {
+ // filename
+ need_final_separator = false;
+ parts.push_back(part);
+ path_size += part.size();
+ }
+ ++parser;
+ }
+
+ // no final separator if last element of path is ".."
+ need_final_separator =
+ need_final_separator && !parts.empty() && parts.back() != dotdot;
+
+ // build final path
+ //// compute final size of path
+ path_size += parts.size() + (need_final_separator ? 1 : 0);
+
+ std::string np;
+ np.reserve(path_size);
+ for (const auto& p : root_parts) {
+ np += p;
+ }
+ // convert any slash to the preferred_separator
+ if (static_cast<std::string::value_type>(this->preferred_separator) != '/') {
+ std::replace(
+ np.begin(), np.end(), '/',
+ static_cast<std::string::value_type>(this->preferred_separator));
+ }
+ for (const auto& p : parts) {
+ if (!p.empty()) {
+ np += p;
+ np += static_cast<std::string::value_type>(this->preferred_separator);
+ }
+ }
+ if (!parts.empty() && !need_final_separator) {
+ // remove extra separator
+ np.pop_back();
+ }
+ if (np.empty()) {
+ np.assign(1, '.');
+ }
+
+ return path(std::move(np));
+}
+
+path path::lexically_relative(const path& base) const
+{
+ internals::path_parser parser(this->path_);
+ ++parser;
+ internals::path_parser parserbase(base.path_);
+ ++parserbase;
+ cm::string_view this_root_name, base_root_name;
+ cm::string_view this_root_dir, base_root_dir;
+
+ if (parser.in_root_name()) {
+ this_root_name = *parser;
+ ++parser;
+ }
+ if (parser.in_root_directory()) {
+ this_root_dir = *parser;
+ ++parser;
+ }
+ if (parserbase.in_root_name()) {
+ base_root_name = *parserbase;
+ ++parserbase;
+ }
+ if (parserbase.in_root_directory()) {
+ base_root_dir = *parserbase;
+ ++parserbase;
+ }
+
+ auto is_path_absolute = [](cm::string_view rn, cm::string_view rd) -> bool {
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ return !rn.empty() && !rd.empty();
+# else
+ (void)rn;
+ return !rd.empty();
+# endif
+ };
+
+ if (this_root_name != base_root_name ||
+ is_path_absolute(this_root_name, this_root_dir) !=
+ is_path_absolute(base_root_name, base_root_dir) ||
+ (this_root_dir.empty() && !base_root_dir.empty())) {
+ return path();
+ }
+
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ // LWG3070 handle special case: filename can also be a root-name
+ auto is_drive_name = [](cm::string_view item) -> bool {
+ return item.length() == 2 && item[1] == ':';
+ };
+ parser.reset();
+ parser.seek(internals::path_parser::seek_position::root_directory);
+ while (!parser.at_end()) {
+ if (is_drive_name(*parser)) {
+ return path();
+ }
+ ++parser;
+ }
+ parserbase.reset();
+ parserbase.seek(internals::path_parser::seek_position::root_directory);
+ while (!parserbase.at_end()) {
+ if (is_drive_name(*parserbase)) {
+ return path();
+ }
+ ++parserbase;
+ }
+# endif
+
+ const cm::string_view dot = "."_s;
+ const cm::string_view dotdot = ".."_s;
+
+ auto a = this->begin(), aend = this->end();
+ auto b = base.begin(), bend = base.end();
+ while (a != aend && b != bend && a->string() == b->string()) {
+ ++a;
+ ++b;
+ }
+
+ int count = 0;
+ for (; b != bend; ++b) {
+ auto part = *b;
+ if (part == dotdot) {
+ --count;
+ } else if (part.string() != dot && !part.empty()) {
+ ++count;
+ }
+ }
+
+ if (count == 0 && (a == this->end() || a->empty())) {
+ return path(dot);
+ }
+ if (count >= 0) {
+ path result;
+ path p_dotdot(dotdot);
+ for (int i = 0; i < count; ++i) {
+ result /= p_dotdot;
+ }
+ for (; a != aend; ++a) {
+ result /= *a;
+ }
+ return result;
+ }
+ // count < 0
+ return path();
+}
+
+path::path_type path::get_generic() const
+{
+ auto gen_path = this->path_;
+ auto start = gen_path.begin();
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ std::replace(gen_path.begin(), gen_path.end(), '\\', '/');
+ // preserve special syntax for root_name ('//server' or '//?')
+ if (gen_path.length() > 2 && gen_path[2] != '/') {
+ start += 2;
+ }
+# endif
+ // remove duplicate separators
+ auto new_end = std::unique(start, gen_path.end(), [](char lhs, char rhs) {
+ return lhs == rhs && lhs == '/';
+ });
+ gen_path.erase(new_end, gen_path.end());
+ return gen_path;
+}
+
+cm::string_view path::get_root_name() const
+{
+ internals::path_parser parser(this->path_);
+ ++parser;
+ if (parser.in_root_name()) {
+ return *parser;
+ }
+ return {};
+}
+
+cm::string_view path::get_root_directory() const
+{
+ internals::path_parser parser(this->path_);
+ ++parser;
+ if (parser.in_root_name()) {
+ ++parser;
+ }
+ if (parser.in_root_directory()) {
+ return *parser;
+ }
+ return {};
+}
+
+cm::string_view path::get_relative_path() const
+{
+ internals::path_parser parser(this->path_);
+ parser.seek(internals::path_parser::seek_position::root_directory);
+ if (parser.at_end()) {
+ return {};
+ }
+ return parser.peek(internals::path_parser::peek_fragment::remainder);
+}
+
+cm::string_view path::get_parent_path() const
+{
+ if (!this->has_relative_path()) {
+ return this->path_;
+ }
+
+ // peek-up full path minus last element
+ internals::path_parser parser(this->path_, true);
+ --parser;
+ if (parser.at_start()) {
+ return {};
+ }
+ --parser;
+ return parser.peek(internals::path_parser::peek_fragment::path);
+}
+
+cm::string_view path::get_filename() const
+{
+ {
+ internals::path_parser parser(this->path_);
+ parser.seek(internals::path_parser::seek_position::root_directory);
+ if (parser.at_end()) {
+ return {};
+ }
+ }
+ {
+ internals::path_parser parser(this->path_, true);
+ return *(--parser);
+ }
+}
+
+cm::string_view path::get_filename_fragment(filename_fragment fragment) const
+{
+ auto file = this->get_filename();
+
+ if (file == "." || file == ".." || file.empty()) {
+ return fragment == filename_fragment::stem ? file : cm::string_view{};
+ }
+
+ auto pos = file.find_last_of('.');
+ if (pos == cm::string_view::npos || pos == 0) {
+ return fragment == filename_fragment::stem ? file : cm::string_view{};
+ }
+ return fragment == filename_fragment::stem ? file.substr(0, pos)
+ : file.substr(pos);
+}
+
+int path::compare_path(cm::string_view str) const
+{
+ internals::path_parser this_pp(this->path_);
+ ++this_pp;
+ internals::path_parser other_pp(str);
+ ++other_pp;
+
+ // compare root_name part
+ {
+ bool compare_root_names = false;
+ cm::string_view this_root_name, other_root_name;
+ int res;
+
+ if (this_pp.in_root_name()) {
+ compare_root_names = true;
+ this_root_name = *this_pp;
+ ++this_pp;
+ }
+ if (other_pp.in_root_name()) {
+ compare_root_names = true;
+ other_root_name = *other_pp;
+ ++other_pp;
+ }
+ if (compare_root_names &&
+ (res = this_root_name.compare(other_root_name) != 0)) {
+ return res;
+ }
+ }
+
+ // compare root_directory part
+ {
+ if (!this_pp.in_root_directory() && other_pp.in_root_directory()) {
+ return -1;
+ } else if (this_pp.in_root_directory() && !other_pp.in_root_directory()) {
+ return 1;
+ }
+ if (this_pp.in_root_directory()) {
+ ++this_pp;
+ }
+ if (other_pp.in_root_directory()) {
+ ++other_pp;
+ }
+ }
+
+ // compare various parts of the paths
+ while (!this_pp.at_end() && !other_pp.at_end()) {
+ int res;
+ if ((res = (*this_pp).compare(*other_pp)) != 0) {
+ return res;
+ }
+ ++this_pp;
+ ++other_pp;
+ }
+
+ // final step
+ if (this_pp.at_end() && !other_pp.at_end()) {
+ return -1;
+ } else if (!this_pp.at_end() && other_pp.at_end()) {
+ return 1;
+ }
+
+ return 0;
+}
+
+// Class path::iterator
+path::iterator::iterator()
+ : path_(nullptr)
+{
+}
+path::iterator::iterator(const iterator& other)
+{
+ this->path_ = other.path_;
+ if (other.parser_) {
+ this->parser_ = cm::make_unique<internals::path_parser>(*other.parser_);
+ this->path_element_ = path(**this->parser_);
+ }
+}
+path::iterator::iterator(const path* p, bool at_end)
+ : path_(p)
+ , parser_(cm::make_unique<internals::path_parser>(p->path_, at_end))
+{
+ if (!at_end) {
+ ++(*this->parser_);
+ this->path_element_ = path(**this->parser_);
+ }
+}
+
+path::iterator::~iterator() = default;
+
+path::iterator& path::iterator::operator=(const iterator& other)
+{
+ this->path_ = other.path_;
+ if (other.parser_) {
+ this->parser_ = cm::make_unique<internals::path_parser>(*other.parser_);
+ this->path_element_ = path(**this->parser_);
+ }
+
+ return *this;
+}
+
+path::iterator& path::iterator::operator++()
+{
+ assert(this->parser_);
+
+ if (this->parser_) {
+ assert(!this->parser_->at_end());
+
+ if (!this->parser_->at_end()) {
+ ++(*this->parser_);
+ if (this->parser_->at_end()) {
+ this->path_element_ = path();
+ } else {
+ this->path_element_ = path(**this->parser_);
+ }
+ }
+ }
+
+ return *this;
+}
+
+path::iterator& path::iterator::operator--()
+{
+ assert(this->parser_);
+
+ if (this->parser_) {
+ assert(!this->parser_->at_start());
+
+ if (!this->parser_->at_start()) {
+ --(*this->parser_);
+ this->path_element_ = path(**this->parser_);
+ }
+ }
+
+ return *this;
+}
+
+bool operator==(const path::iterator& lhs, const path::iterator& rhs)
+{
+ return lhs.path_ == rhs.path_ && lhs.parser_ != nullptr &&
+ ((lhs.parser_->at_end() && rhs.parser_->at_end()) ||
+ (lhs.parser_->at_start() && rhs.parser_->at_start()) ||
+ ((**lhs.parser_).data() == (**rhs.parser_).data()));
+}
+
+std::size_t hash_value(const path& p) noexcept
+{
+ internals::path_parser parser(p.path_);
+ std::hash<cm::string_view> hasher;
+ std::size_t value = 0;
+
+ while (!parser.at_end()) {
+ value = hasher(*parser) + 0x9e3779b9 + (value << 6) + (value >> 2);
+ ++parser;
+ }
+
+ return value;
+}
+} // filesystem
+} // cm
+
+#else
+
+// Avoid empty translation unit.
+void cm_filesystem_path_cxx()
+{
+}
+
+#endif
diff --git a/Utilities/std/cm/filesystem b/Utilities/std/cm/filesystem
new file mode 100644
index 0000000000..6021712a0d
--- /dev/null
+++ b/Utilities/std/cm/filesystem
@@ -0,0 +1,1175 @@
+// -*-c++-*-
+// vim: set ft=cpp:
+
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cm_filesystem
+#define cm_filesystem
+
+#include "cmSTL.hxx" // IWYU pragma: keep
+
+#if defined(CMake_HAVE_CXX_FILESYSTEM)
+
+# include <filesystem> // IWYU pragma: export
+
+#else
+
+# include <cstddef>
+# include <cstdint>
+# include <iostream>
+# include <iterator>
+# include <memory>
+# include <string>
+# include <utility>
+
+# include <cm/iomanip>
+# include <cm/string_view>
+# include <cm/type_traits>
+# include <cmext/iterator>
+
+# if defined(_WIN32) && !defined(__CYGWIN__)
+# include <algorithm>
+# endif
+
+#endif
+
+namespace cm {
+namespace filesystem {
+
+#if defined(CMake_HAVE_CXX_FILESYSTEM)
+
+using std::filesystem::path;
+using std::filesystem::swap;
+using std::filesystem::hash_value;
+
+#else
+
+# if !defined(CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR)
+// Oracle DeveloperStudio C++ compiler on Solaris/Sparc fails to compile
+// the source_traits for iterator check. So disable it for now.
+# define CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR 0
+# endif
+
+namespace internals {
+
+class path_parser;
+
+class unicode_helper
+{
+protected:
+ using utf8_state = unsigned char;
+ static const utf8_state s_start = 0;
+ static const utf8_state s_reject = 8;
+
+ static inline bool in_range(std::uint32_t c, std::uint32_t lo,
+ std::uint32_t hi)
+ {
+ return (static_cast<std::uint32_t>(c - lo) < (hi - lo + 1));
+ }
+
+ static inline bool is_surrogate(std::uint32_t c)
+ {
+ return in_range(c, 0xd800, 0xdfff);
+ }
+
+ static inline bool is_high_surrogate(std::uint32_t c)
+ {
+ return (c & 0xfffffc00) == 0xd800;
+ }
+
+ static inline bool is_low_surrogate(std::uint32_t c)
+ {
+ return (c & 0xfffffc00) == 0xdc00;
+ }
+
+ static void append(std::string& str, std::uint32_t codepoint);
+
+ static utf8_state decode(const utf8_state state, const std::uint8_t fragment,
+ std::uint32_t& codepoint);
+};
+
+template <typename Char, typename = void>
+class unicode
+{
+};
+
+template <typename Char>
+class unicode<Char, typename std::enable_if<(sizeof(Char) == 4)>::type>
+ : public unicode_helper
+{
+public:
+ // UTF32 -> UTF8
+ static std::string to_utf8(const std::wstring& str)
+ {
+ std::string result;
+ for (auto c : str) {
+ append(result, c);
+ }
+ return result;
+ }
+ static std::string to_utf8(Char c)
+ {
+ std::string result;
+ append(result, c);
+ return result;
+ }
+
+ // UTF8 -> UTF32
+ static std::wstring from_utf8(const std::string& str)
+ {
+ std::wstring result;
+ result.reserve(str.length());
+ auto iter = str.begin();
+ utf8_state state = s_start;
+ std::uint32_t codepoint = 0;
+ while (iter < str.end()) {
+ if ((state = decode(state, static_cast<std::uint8_t>(*iter++),
+ codepoint)) == s_start) {
+ result += static_cast<std::wstring::value_type>(codepoint);
+ codepoint = 0;
+ } else if (state == s_reject) {
+ result += static_cast<std::wstring::value_type>(0xfffd);
+ state = s_start;
+ codepoint = 0;
+ }
+ }
+ if (state) {
+ result += static_cast<std::wstring::value_type>(0xfffd);
+ }
+ return result;
+ }
+ static std::wstring from_utf8(char c)
+ {
+ std::wstring result;
+ utf8_state state = s_start;
+ std::uint32_t codepoint = 0;
+ if ((state = decode(state, static_cast<std::uint8_t>(c), codepoint)) ==
+ s_start) {
+ result += static_cast<std::wstring::value_type>(codepoint);
+ } else {
+ result += static_cast<std::wstring::value_type>(0xfffd);
+ }
+
+ return result;
+ }
+};
+
+template <typename Char>
+class unicode<Char, typename std::enable_if<(sizeof(Char) == 2)>::type>
+ : public unicode_helper
+{
+public:
+ // UTF16 -> UTF8
+ static std::string to_utf8(const std::wstring& str)
+ {
+ std::string result;
+ for (auto iter = str.begin(); iter != str.end(); ++iter) {
+ std::uint32_t c = *iter;
+ if (is_surrogate(c)) {
+ ++iter;
+ if (iter != str.end() && is_high_surrogate(c) &&
+ is_low_surrogate(*iter)) {
+ append(result, (std::uint32_t(c) << 10) + *iter - 0x35fdc00);
+ } else {
+ append(result, 0xfffd);
+ if (iter == str.end()) {
+ break;
+ }
+ }
+ } else {
+ append(result, c);
+ }
+ }
+ return result;
+ }
+ static std::string to_utf8(Char c)
+ {
+ std::string result;
+ if (is_surrogate(c)) {
+ append(result, 0xfffd);
+ } else {
+ append(result, c);
+ }
+ return result;
+ }
+
+ // UTF8 -> UTF16
+ static std::wstring from_utf8(const std::string& str)
+ {
+ std::wstring result;
+ result.reserve(str.length());
+ auto iter = str.begin();
+ utf8_state state = s_start;
+ std::uint32_t codepoint = 0;
+ while (iter < str.end()) {
+ if ((state = decode(state, static_cast<std::uint8_t>(*iter++),
+ codepoint)) == s_start) {
+ if (codepoint <= 0xffff) {
+ result += static_cast<std::wstring::value_type>(codepoint);
+ } else {
+ codepoint -= 0x10000;
+ result +=
+ static_cast<std::wstring::value_type>((codepoint >> 10) + 0xd800);
+ result += static_cast<std::wstring::value_type>((codepoint & 0x3ff) +
+ 0xdc00);
+ }
+ codepoint = 0;
+ } else if (state == s_reject) {
+ result += static_cast<std::wstring::value_type>(0xfffd);
+ state = s_start;
+ codepoint = 0;
+ }
+ }
+ if (state) {
+ result += static_cast<std::wstring::value_type>(0xfffd);
+ }
+ return result;
+ }
+ static std::wstring from_utf8(char c)
+ {
+ std::wstring result;
+ utf8_state state = s_start;
+ std::uint32_t codepoint = 0;
+ if ((state = decode(state, static_cast<std::uint8_t>(c), codepoint)) ==
+ s_start) {
+ if (codepoint <= 0xffff) {
+ result += static_cast<std::wstring::value_type>(codepoint);
+ } else {
+ codepoint -= 0x10000;
+ result +=
+ static_cast<std::wstring::value_type>((codepoint >> 10) + 0xd800);
+ result +=
+ static_cast<std::wstring::value_type>((codepoint & 0x3ff) + 0xdc00);
+ }
+ } else {
+ result += static_cast<std::wstring::value_type>(0xfffd);
+ }
+ return result;
+ }
+};
+
+template <typename In, typename Out>
+class unicode_converter;
+
+template <>
+class unicode_converter<char, wchar_t>
+{
+public:
+ std::wstring operator()(const std::string& in)
+ {
+ return unicode<wchar_t>::from_utf8(in);
+ }
+ std::wstring operator()(const char* in)
+ {
+ return unicode<wchar_t>::from_utf8(in);
+ }
+ std::wstring operator()(char in) { return unicode<wchar_t>::from_utf8(in); }
+};
+template <>
+class unicode_converter<wchar_t, char>
+{
+public:
+ std::string operator()(const std::wstring& in)
+ {
+ return unicode<wchar_t>::to_utf8(in);
+ }
+ std::string operator()(const wchar_t* in)
+ {
+ return unicode<wchar_t>::to_utf8(in);
+ }
+ std::string operator()(wchar_t in) { return unicode<wchar_t>::to_utf8(in); }
+};
+template <>
+class unicode_converter<char, char>
+{
+public:
+ std::string operator()(const std::string& in) { return in; }
+ std::string operator()(const char* in) { return std::string(in); }
+ std::string operator()(char in) { return std::string(1, in); }
+};
+template <>
+class unicode_converter<wchar_t, wchar_t>
+{
+public:
+ std::wstring operator()(const std::wstring& in) { return in; }
+ std::wstring operator()(const wchar_t* in) { return std::wstring(in); }
+ std::wstring operator()(wchar_t in) { return std::wstring(1, in); }
+};
+
+template <typename In>
+struct string_converter
+{
+};
+
+template <>
+struct string_converter<char>
+{
+ // some compilers, like gcc 4.8 does not implement the following C++11
+ // signature:
+ // std::string::string(const string&, const Allocator&)
+ // As workaround, use char* pointer.
+ template <typename Char, typename Traits, typename Alloc>
+ static std::basic_string<Char, Traits, Alloc> to(const std::string& in,
+ const Alloc& a)
+ {
+ return std::basic_string<Char, Traits, Alloc>(
+ unicode_converter<char, Char>()(in).c_str(), a);
+ }
+ template <typename Char, typename Traits, typename Alloc>
+ static std::basic_string<Char, Traits, Alloc> to(const char* in,
+ const Alloc& a)
+ {
+ return std::basic_string<Char, Traits, Alloc>(
+ unicode_converter<char, Char>()(in).c_str(), a);
+ }
+ template <typename Char, typename Traits, typename Alloc>
+ static std::basic_string<Char, Traits, Alloc> to(char in, const Alloc& a)
+ {
+ return std::basic_string<Char, Traits, Alloc>(
+ unicode_converter<char, Char>()(in).c_str(), a);
+ }
+
+ template <typename Char>
+ static std::basic_string<Char> to(const std::string& in)
+ {
+ return std::basic_string<Char>(unicode_converter<char, Char>()(in));
+ }
+ template <typename Char>
+ static std::basic_string<Char> to(const char* in)
+ {
+ return std::basic_string<Char>(unicode_converter<char, Char>()(in));
+ }
+ template <typename Char>
+ static std::basic_string<Char> to(char in)
+ {
+ return std::basic_string<Char>(unicode_converter<char, Char>()(in));
+ }
+};
+template <>
+struct string_converter<wchar_t>
+{
+ // some compilers, like gcc 4.8 does not implement the following C++11
+ // signature:
+ // std::string::string(const string&, const Allocator&)
+ // As workaround, use char* pointer.
+ template <typename Char, typename Traits, typename Alloc>
+ static std::basic_string<Char, Traits, Alloc> to(const std::wstring& in,
+ const Alloc& a)
+ {
+ return std::basic_string<Char, Traits, Alloc>(
+ unicode_converter<wchar_t, Char>()(in).c_str(), a);
+ }
+ template <typename Char, typename Traits, typename Alloc>
+ static std::basic_string<Char, Traits, Alloc> to(const wchar_t* in,
+ const Alloc& a)
+ {
+ return std::basic_string<Char, Traits, Alloc>(
+ unicode_converter<wchar_t, Char>()(in).c_str(), a);
+ }
+ template <typename Char, typename Traits, typename Alloc>
+ static std::basic_string<Char, Traits, Alloc> to(wchar_t in, const Alloc& a)
+ {
+ return std::basic_string<Char, Traits, Alloc>(
+ unicode_converter<wchar_t, Char>()(in).c_str(), a);
+ }
+
+ template <typename Char>
+ static std::basic_string<Char> to(const std::wstring& in)
+ {
+ return std::basic_string<Char>(unicode_converter<wchar_t, Char>()(in));
+ }
+ template <typename Char>
+ static std::basic_string<Char> to(const wchar_t* in)
+ {
+ return std::basic_string<Char>(unicode_converter<wchar_t, Char>()(in));
+ }
+ template <typename Char>
+ static std::basic_string<Char> to(wchar_t in)
+ {
+ return std::basic_string<Char>(unicode_converter<wchar_t, Char>()(in));
+ }
+};
+
+template <typename T, typename = void>
+struct source_traits
+{
+};
+
+template <typename T, std::size_t N>
+struct source_traits<T[N]>
+{
+ using value_type = T;
+};
+
+template <typename Char, typename Traits, typename Alloc>
+struct source_traits<std::basic_string<Char, Traits, Alloc>>
+{
+ using value_type =
+ typename std::basic_string<Char, Traits, Alloc>::value_type;
+};
+
+template <>
+struct source_traits<cm::string_view>
+{
+ using value_type = cm::string_view::value_type;
+};
+
+# if CM_FILESYSTEM_SOURCE_TRAITS_ITERATOR
+template <typename T>
+struct source_traits<T, cm::enable_if_t<cm::is_iterator<T>::value, void>>
+{
+ using value_type =
+ typename std::iterator_traits<typename std::decay<T>::type>::value_type;
+};
+# endif
+
+template <typename In, typename Out>
+struct source_converter
+{
+};
+
+template <>
+struct source_converter<char, char>
+{
+ template <typename Iterator>
+ static void append_range(std::string& p, Iterator b, Iterator e)
+ {
+ if (b == e) {
+ return;
+ }
+ p.append(b, e);
+ }
+ template <typename Iterator>
+ static void append_range(std::string& p, Iterator b)
+ {
+ char e = '\0';
+
+ if (*b == e) {
+ return;
+ }
+ for (; *b != e; ++b) {
+ p.push_back(*b);
+ }
+ }
+
+ static void append_source(std::string& p, const cm::string_view s)
+ {
+ append_range(p, s.begin(), s.end());
+ }
+ template <typename Traits, typename Alloc>
+ static void append_source(std::string& p,
+ const std::basic_string<char, Traits, Alloc>& s)
+ {
+ append_range(p, s.begin(), s.end());
+ }
+ template <typename Source>
+ static void append_source(std::string& p, const Source& s)
+ {
+ append_range(p, s);
+ }
+
+ static void set_source(std::string& p, std::string&& s) { p = std::move(s); }
+};
+
+template <>
+struct source_converter<wchar_t, char>
+{
+ template <typename Iterator>
+ static void append_range(std::string& p, Iterator b, Iterator e)
+ {
+ if (b == e) {
+ return;
+ }
+
+ std::wstring tmp(b, e);
+ std::string dest = string_converter<wchar_t>::to<char>(tmp);
+ p.append(dest.begin(), dest.end());
+ }
+ template <typename Iterator>
+ static void append_range(std::string& p, Iterator b)
+ {
+ wchar_t e = '\0';
+
+ if (*b == e) {
+ return;
+ }
+ std::wstring tmp;
+ for (; *b != e; ++b) {
+ tmp.push_back(*b);
+ }
+
+ std::string dest = string_converter<wchar_t>::to<char>(tmp);
+ p.append(dest.begin(), dest.end());
+ }
+
+ template <typename Traits, typename Alloc>
+ static void append_source(std::string& p,
+ const std::basic_string<wchar_t, Traits, Alloc>& s)
+ {
+ append_range(p, s.begin(), s.end());
+ }
+ template <typename Source>
+ static void append_source(std::string& p, const Source& s)
+ {
+ append_range(p, s);
+ }
+
+ static void set_source(std::string& p, std::wstring&& s)
+ {
+ p = string_converter<wchar_t>::to<char>(s);
+ }
+};
+
+template <typename T>
+struct is_pathable_string : std::false_type
+{
+};
+template <typename Traits, typename Alloc>
+struct is_pathable_string<std::basic_string<char, Traits, Alloc>>
+ : std::true_type
+{
+};
+template <typename Traits, typename Alloc>
+struct is_pathable_string<std::basic_string<wchar_t, Traits, Alloc>>
+ : std::true_type
+{
+};
+template <>
+struct is_pathable_string<cm::string_view> : std::true_type
+{
+};
+
+template <typename T, typename = void>
+struct is_pathable_char_array : std::false_type
+{
+};
+template <typename T>
+struct is_pathable_char_array<
+ T,
+ cm::enable_if_t<
+ std::is_same<char*, typename std::decay<T>::type>::value ||
+ std::is_same<wchar_t*, typename std::decay<T>::type>::value,
+ void>>
+ : bool_constant<std::is_same<char*, typename std::decay<T>::type>::value ||
+ std::is_same<wchar_t*, typename std::decay<T>::type>::value>
+{
+};
+
+template <typename T, typename = void>
+struct is_pathable_iterator : std::false_type
+{
+};
+template <typename T>
+struct is_pathable_iterator<
+ T,
+ cm::enable_if_t<
+ is_input_iterator<T>::value &&
+ (std::is_same<char,
+ typename std::iterator_traits<
+ typename std::decay<T>::type>::value_type>::value ||
+ std::is_same<wchar_t,
+ typename std::iterator_traits<
+ typename std::decay<T>::type>::value_type>::value),
+ void>>
+ : bool_constant<
+ std::is_same<char,
+ typename std::iterator_traits<
+ typename std::decay<T>::type>::value_type>::value ||
+ std::is_same<wchar_t,
+ typename std::iterator_traits<
+ typename std::decay<T>::type>::value_type>::value>
+{
+};
+
+# if defined(__SUNPRO_CC) && defined(__sparc)
+// Oracle DeveloperStudio C++ compiler on Solaris/Sparc fails to compile
+// the full 'is_pathable' check. We use it only to improve error messages
+// via 'enable_if' when calling methods with incorrect types. Just
+// pretend all types are allowed so we can at least compile valid code.
+template <typename T>
+struct is_pathable : std::true_type
+{
+};
+# else
+template <typename T>
+struct is_pathable
+ : bool_constant<is_pathable_string<T>::value ||
+ is_pathable_char_array<T>::value ||
+ is_pathable_iterator<T>::value>
+{
+};
+# endif
+}
+
+class path
+{
+ using path_type = std::string;
+
+ template <typename Source>
+ using enable_if_pathable =
+ enable_if_t<internals::is_pathable<Source>::value, path&>;
+
+ enum class filename_fragment : unsigned char
+ {
+ stem,
+ extension
+ };
+
+public:
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ using value_type = wchar_t;
+# else
+ using value_type = char;
+# endif
+ using string_type = std::basic_string<value_type>;
+
+ class iterator;
+ using const_iterator = iterator;
+
+ enum format : unsigned char
+ {
+ auto_format,
+ native_format,
+ generic_format
+ };
+
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ static constexpr value_type preferred_separator = L'\\';
+# else
+ static constexpr value_type preferred_separator = '/';
+# endif
+
+ // Constructors
+ // ============
+ path() noexcept {}
+ path(const path& p)
+ : path_(p.path_)
+ {
+ }
+ path(path&& p) noexcept
+ : path_(std::move(p.path_))
+ {
+ }
+ path(string_type&& source, format fmt = auto_format)
+ {
+ (void)fmt;
+ internals::source_converter<value_type, path_type::value_type>::set_source(
+ this->path_, std::move(source));
+ }
+ template <typename Source, typename = enable_if_pathable<Source>>
+ path(const Source& source, format fmt = auto_format)
+ {
+ (void)fmt;
+ internals::source_converter<
+ typename internals::source_traits<Source>::value_type,
+ path_type::value_type>::append_source(this->path_, source);
+ }
+ template <typename Iterator, typename = enable_if_pathable<Iterator>>
+ path(const Iterator first, Iterator last, format fmt = auto_format)
+ {
+ (void)fmt;
+ internals::source_converter<
+ typename std::iterator_traits<Iterator>::value_type,
+ path_type::value_type>::append_range(this->path_, first, last);
+ }
+
+ ~path() = default;
+
+ // Assignments
+ // ===========
+ path& operator=(const path& p)
+ {
+ if (this != &p) {
+ this->path_ = p.path_;
+ }
+ return *this;
+ }
+ path& operator=(path&& p) noexcept
+ {
+ if (this != &p) {
+ this->path_ = std::move(p.path_);
+ }
+ return *this;
+ }
+ path& operator=(string_type&& source) { return this->assign(source); }
+ template <typename Source, typename = enable_if_pathable<Source>>
+ path& operator=(const Source& source)
+ {
+ return this->assign(source);
+ }
+
+ path& assign(string_type&& source)
+ {
+ internals::source_converter<value_type, path_type::value_type>::set_source(
+ this->path_, std::move(source));
+ return *this;
+ }
+ template <typename Source, typename = enable_if_pathable<Source>>
+ path& assign(const Source& source)
+ {
+ this->path_.clear();
+ internals::source_converter<
+ typename internals::source_traits<Source>::value_type,
+ path_type::value_type>::append_source(this->path_, source);
+ return *this;
+ }
+ template <typename Iterator, typename = enable_if_pathable<Iterator>>
+ path& assign(Iterator first, Iterator last)
+ {
+ this->path_.clear();
+ internals::source_converter<
+ typename std::iterator_traits<Iterator>::value_type,
+ path_type::value_type>::append_range(this->path_, first, last);
+ return *this;
+ }
+
+ // Concatenation
+ // =============
+ path& operator/=(const path& p);
+
+ template <typename Source, typename = enable_if_pathable<Source>>
+ path& append(const Source& source)
+ {
+ return this->operator/=(path(source));
+ }
+ template <typename Source>
+ path& operator/=(const Source& source)
+ {
+ return this->append(source);
+ }
+
+ template <typename Iterator, typename = enable_if_pathable<Iterator>>
+ path& append(Iterator first, Iterator last)
+ {
+ return this->operator/=(path(first, last));
+ }
+
+ path& operator+=(const path& p)
+ {
+ this->path_ += p.path_;
+ return *this;
+ }
+ path& operator+=(const string_type& str)
+ {
+ this->path_ +=
+ internals::string_converter<value_type>::to<path_type::value_type>(str);
+ return *this;
+ }
+ path& operator+=(cm::string_view str)
+ {
+ this->path_.append(str.begin(), str.end());
+ return *this;
+ }
+ path& operator+=(const value_type* str)
+ {
+ this->path_ +=
+ internals::string_converter<value_type>::to<path_type::value_type>(str);
+ return *this;
+ }
+ path& operator+=(const value_type c)
+ {
+ this->path_ +=
+ internals::string_converter<value_type>::to<path_type::value_type>(c);
+ return *this;
+ }
+ template <typename Source, typename = enable_if_pathable<Source>>
+ path& concat(const Source& source)
+ {
+ internals::source_converter<
+ typename internals::source_traits<Source>::value_type,
+ path_type::value_type>::append_source(this->path_, source);
+ return *this;
+ }
+ template <typename Source>
+ path& operator+=(const Source& source)
+ {
+ return this->concat(source);
+ }
+ template <typename Iterator, typename = enable_if_pathable<Iterator>>
+ path& concat(Iterator first, Iterator last)
+ {
+ internals::source_converter<
+ typename std::iterator_traits<Iterator>::value_type,
+ path_type::value_type>::append_range(this->path_, first, last);
+ return *this;
+ }
+
+ // Modifiers
+ // =========
+ void clear() noexcept { this->path_.clear(); }
+
+ path& make_preferred()
+ {
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ std::replace(
+ this->path_.begin(), this->path_.end(), '/',
+ static_cast<path_type::value_type>(this->preferred_separator));
+# endif
+ return *this;
+ }
+
+ path& remove_filename()
+ {
+ auto fname = this->get_filename();
+ if (!fname.empty()) {
+ this->path_.erase(fname.data() - this->path_.data());
+ }
+ return *this;
+ }
+
+ path& replace_filename(const path& replacement)
+ {
+ this->remove_filename();
+ this->operator/=(replacement);
+ return *this;
+ }
+
+ path& replace_extension(const path& replacement = path())
+ {
+ auto ext = this->get_filename_fragment(filename_fragment::extension);
+ if (!ext.empty()) {
+ this->path_.erase(ext.data() - this->path_.data());
+ }
+ if (!replacement.path_.empty()) {
+ if (replacement.path_[0] != '.') {
+ this->path_ += '.';
+ }
+ this->path_.append(replacement.path_);
+ }
+ return *this;
+ }
+
+ void swap(path& other) noexcept { this->path_.swap(other.path_); }
+
+ // Format observers
+ // ================
+ const string_type& native() const noexcept
+ {
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ this->native_path_ = internals::string_converter<
+ path_type::value_type>::to<string_type::value_type>(this->path_);
+ return this->native_path_;
+# else
+ return this->path_;
+# endif
+ }
+ const value_type* c_str() const noexcept { return this->native().c_str(); }
+ operator string_type() const { return this->native(); }
+
+ template <
+ typename Char, typename Traits = std::char_traits<Char>,
+ typename Alloc = std::allocator<Char>,
+ cm::enable_if_t<(std::is_same<Char, char>::value &&
+ std::is_same<Traits, std::char_traits<char>>::value) ||
+ (std::is_same<Char, wchar_t>::value &&
+ std::is_same<Traits, std::char_traits<wchar_t>>::value),
+ int> = 1>
+ std::basic_string<Char, Traits, Alloc> string(const Alloc& a = Alloc()) const
+ {
+ return internals::string_converter<path_type::value_type>::to<Char, Traits,
+ Alloc>(
+ this->path_, a);
+ }
+ const std::string string() const { return this->path_; }
+ std::wstring wstring() const
+ {
+ std::string out = this->string();
+ return internals::string_converter<path_type::value_type>::to<
+ std::wstring::value_type>(out);
+ }
+
+ template <
+ typename Char, typename Traits = std::char_traits<Char>,
+ typename Alloc = std::allocator<Char>,
+ cm::enable_if_t<(std::is_same<Char, char>::value &&
+ std::is_same<Traits, std::char_traits<char>>::value) ||
+ (std::is_same<Char, wchar_t>::value &&
+ std::is_same<Traits, std::char_traits<wchar_t>>::value),
+ int> = 1>
+ std::basic_string<Char, Traits, Alloc> generic_string(
+ const Alloc& a = Alloc()) const
+ {
+ return internals::string_converter<path_type::value_type>::to<Char, Traits,
+ Alloc>(
+ this->get_generic(), a);
+ }
+ std::string generic_string() const { return this->get_generic(); }
+ std::wstring generic_wstring() const
+ {
+ auto dest = this->generic_string();
+ return internals::string_converter<path_type::value_type>::to<
+ std::wstring::value_type>(dest);
+ }
+
+ // Compare
+ // =======
+ int compare(const path& p) const noexcept
+ {
+ return this->compare_path(p.path_);
+ }
+ int compare(const string_type& str) const
+ {
+ return this->compare_path(
+ internals::string_converter<value_type>::to<path_type::value_type>(str));
+ }
+ int compare(const value_type* str) const
+ {
+ return this->compare_path(
+ internals::string_converter<value_type>::to<path_type::value_type>(str));
+ }
+ int compare(cm::string_view str) const { return this->compare_path(str); }
+
+ // Generation
+ // ==========
+ path lexically_normal() const;
+
+ path lexically_relative(const path& base) const;
+
+ path lexically_proximate(const path& base) const
+ {
+ path result = this->lexically_relative(base);
+ return result.empty() ? *this : result;
+ }
+
+ // Decomposition
+ // =============
+ path root_name() const { return get_root_name(); }
+
+ path root_directory() const { return this->get_root_directory(); }
+
+ path root_path() const
+ {
+ return this->root_name().append(this->get_root_directory());
+ }
+
+ path relative_path() const { return this->get_relative_path(); }
+
+ path parent_path() const { return this->get_parent_path(); }
+
+ path filename() const { return this->get_filename(); }
+
+ path stem() const
+ {
+ return this->get_filename_fragment(filename_fragment::stem);
+ }
+ path extension() const
+ {
+ return this->get_filename_fragment(filename_fragment::extension);
+ }
+
+ // Queries
+ // =======
+ bool empty() const noexcept { return this->path_.empty(); }
+
+ bool has_root_name() const { return !this->get_root_name().empty(); }
+
+ bool has_root_directory() const
+ {
+ return !this->get_root_directory().empty();
+ }
+
+ bool has_root_path() const
+ {
+ return this->has_root_name() || this->has_root_directory();
+ }
+
+ bool has_relative_path() const { return !this->get_relative_path().empty(); }
+
+ bool has_parent_path() const { return !this->get_parent_path().empty(); }
+
+ bool has_filename() const { return !this->get_filename().empty(); }
+
+ bool has_stem() const
+ {
+ return !this->get_filename_fragment(filename_fragment::stem).empty();
+ }
+ bool has_extension() const
+ {
+ return !this->get_filename_fragment(filename_fragment::extension).empty();
+ }
+
+ bool is_absolute() const
+ {
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ return this->has_root_name() && this->has_root_directory();
+# else
+ // For CYGWIN, root_name (i.e. //host or /cygdrive/x) is not considered.
+ // Same as current GNU g++ implementation (9.3).
+ return this->has_root_directory();
+# endif
+ }
+
+ bool is_relative() const { return !this->is_absolute(); }
+
+ // Iterators
+ // =========
+ inline iterator begin() const;
+ inline iterator end() const;
+
+ // Non-members
+ // ===========
+ friend inline bool operator==(const path& lhs, const path& rhs) noexcept
+ {
+ return lhs.compare(rhs) == 0;
+ }
+ friend inline bool operator!=(const path& lhs, const path& rhs) noexcept
+ {
+ return lhs.compare(rhs) != 0;
+ }
+ friend inline bool operator<(const path& lhs, const path& rhs) noexcept
+ {
+ return lhs.compare(rhs) < 0;
+ }
+ friend inline bool operator<=(const path& lhs, const path& rhs) noexcept
+ {
+ return lhs.compare(rhs) <= 0;
+ }
+ friend inline bool operator>(const path& lhs, const path& rhs) noexcept
+ {
+ return lhs.compare(rhs) > 0;
+ }
+ friend inline bool operator>=(const path& lhs, const path& rhs) noexcept
+ {
+ return lhs.compare(rhs) >= 0;
+ }
+
+ friend inline path operator/(const path& lhs, const path& rhs)
+ {
+ path result(lhs);
+ result /= rhs;
+
+ return result;
+ }
+
+ template <typename Char, typename Traits>
+ friend inline cm::enable_if_t<
+ (std::is_same<Char, path::value_type>::value &&
+ std::is_same<Traits, std::char_traits<path::value_type>>::value) ||
+ (std::is_same<Char, path::path_type::value_type>::value &&
+ std::is_same<Traits,
+ std::char_traits<path::path_type::value_type>>::value),
+ std::basic_ostream<Char, Traits>&>
+ operator<<(std::basic_ostream<Char, Traits>& os, const path& p)
+ {
+ os << cm::quoted(p.string<Char, Traits>());
+ return os;
+ }
+
+ template <typename Char, typename Traits>
+ friend inline cm::enable_if_t<
+ (std::is_same<Char, path::value_type>::value &&
+ std::is_same<Traits, std::char_traits<path::value_type>>::value) ||
+ (std::is_same<Char, path::path_type::value_type>::value &&
+ std::is_same<Traits,
+ std::char_traits<path::path_type::value_type>>::value),
+ std::basic_istream<Char, Traits>&>
+ operator>>(std::basic_istream<Char, Traits>& is, path& p)
+ {
+ std::basic_string<Char, Traits> tmp;
+ is >> cm::quoted(tmp);
+ p = tmp;
+ return is;
+ }
+
+private:
+ friend class iterator;
+ friend std::size_t hash_value(const path& p) noexcept;
+
+ path_type get_generic() const;
+
+ cm::string_view get_root_name() const;
+ cm::string_view get_root_directory() const;
+ cm::string_view get_relative_path() const;
+ cm::string_view get_parent_path() const;
+ cm::string_view get_filename() const;
+ cm::string_view get_filename_fragment(filename_fragment fragment) const;
+
+ int compare_path(cm::string_view str) const;
+
+ path_type path_;
+# if defined(_WIN32) && !defined(__CYGWIN__)
+ mutable string_type native_path_;
+# endif
+};
+
+class path::iterator
+{
+public:
+ using iterator_category = std::bidirectional_iterator_tag;
+
+ using value_type = path;
+ using difference_type = std::ptrdiff_t;
+ using pointer = const path*;
+ using reference = const path&;
+
+ iterator();
+ iterator(const iterator& other);
+
+ ~iterator();
+
+ iterator& operator=(const iterator& other);
+
+ reference operator*() const { return this->path_element_; }
+
+ pointer operator->() const { return &this->path_element_; }
+
+ iterator& operator++();
+
+ iterator operator++(int)
+ {
+ iterator it(*this);
+ this->operator++();
+ return it;
+ }
+
+ iterator& operator--();
+
+ iterator operator--(int)
+ {
+ iterator it(*this);
+ this->operator--();
+ return it;
+ }
+
+private:
+ friend class path;
+ friend bool operator==(const iterator&, const iterator&);
+
+ iterator(const path* p, bool at_end = false);
+
+ const path* path_;
+ std::unique_ptr<internals::path_parser> parser_;
+ path path_element_;
+};
+
+inline path::iterator path::begin() const
+{
+ return iterator(this);
+}
+inline path::iterator path::end() const
+{
+ return iterator(this, true);
+}
+
+bool operator==(const path::iterator& lhs, const path::iterator& rhs);
+
+inline bool operator!=(const path::iterator& lhs, const path::iterator& rhs)
+{
+ return !(lhs == rhs);
+}
+
+// Non-member functions
+// ====================
+inline void swap(path& lhs, path& rhs) noexcept
+{
+ lhs.swap(rhs);
+}
+
+std::size_t hash_value(const path& p) noexcept;
+
+#endif
+
+} // namespace filesystem
+} // namespace cm
+
+#endif
diff --git a/Utilities/std/cm/iomanip b/Utilities/std/cm/iomanip
new file mode 100644
index 0000000000..6f68530c00
--- /dev/null
+++ b/Utilities/std/cm/iomanip
@@ -0,0 +1,183 @@
+// -*-c++-*-
+// vim: set ft=cpp:
+
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cm_iomanip
+#define cm_iomanip
+
+#include <iomanip> // IWYU pragma: export
+#if __cplusplus < 201402L || defined(_MSVC_LANG) && _MSVC_LANG < 201402L
+# include <ios>
+# include <iostream>
+# include <sstream>
+# include <string>
+# include <type_traits>
+#endif
+#if __cplusplus < 201703L || defined(_MSVC_LANG) && _MSVC_LANG < 201703L
+# include <cm/string_view>
+#endif
+
+namespace cm {
+
+#if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
+
+using std::quoted;
+
+# if __cplusplus < 201703L || defined(_MSVC_LANG) && _MSVC_LANG < 201703L
+
+inline auto quoted(cm::string_view str, char delim = '"', char escape = '\\')
+{
+ return std::quoted(static_cast<std::string>(str), delim, escape);
+}
+
+# endif
+
+#else
+
+namespace internals {
+
+// Struct for delimited strings.
+template <typename String, typename Char>
+struct quoted_string
+{
+ static_assert(std::is_reference<String>::value ||
+ std::is_pointer<String>::value,
+ "String type must be pointer or reference");
+
+ quoted_string(String str, Char del, Char esc)
+ : string_(str)
+ , delim_{ del }
+ , escape_{ esc }
+ {
+ }
+
+ quoted_string& operator=(quoted_string&) = delete;
+
+ String string_;
+ Char delim_;
+ Char escape_;
+};
+
+template <>
+struct quoted_string<cm::string_view, char>
+{
+ quoted_string(cm::string_view str, char del, char esc)
+ : string_(str)
+ , delim_{ del }
+ , escape_{ esc }
+ {
+ }
+
+ quoted_string& operator=(quoted_string&) = delete;
+
+ cm::string_view string_;
+ char delim_;
+ char escape_;
+};
+
+template <typename Char, typename Traits>
+std::basic_ostream<Char, Traits>& operator<<(
+ std::basic_ostream<Char, Traits>& os,
+ const quoted_string<const Char*, Char>& str)
+{
+ std::basic_ostringstream<Char, Traits> ostr;
+ ostr << str.delim_;
+ for (const Char* c = str.string_; *c; ++c) {
+ if (*c == str.delim_ || *c == str.escape_)
+ ostr << str.escape_;
+ ostr << *c;
+ }
+ ostr << str.delim_;
+
+ return os << ostr.str();
+}
+
+template <typename Char, typename Traits, typename String>
+std::basic_ostream<Char, Traits>& operator<<(
+ std::basic_ostream<Char, Traits>& os, const quoted_string<String, Char>& str)
+{
+ std::basic_ostringstream<Char, Traits> ostr;
+ ostr << str.delim_;
+ for (auto c : str.string_) {
+ if (c == str.delim_ || c == str.escape_)
+ ostr << str.escape_;
+ ostr << c;
+ }
+ ostr << str.delim_;
+
+ return os << ostr.str();
+}
+
+template <typename Char, typename Traits, typename Alloc>
+std::basic_istream<Char, Traits>& operator>>(
+ std::basic_istream<Char, Traits>& is,
+ const quoted_string<std::basic_string<Char, Traits, Alloc>&, Char>& str)
+{
+ Char c;
+ is >> c;
+ if (!is.good())
+ return is;
+ if (c != str.delim_) {
+ is.unget();
+ is >> str.string_;
+ return is;
+ }
+ str.string_.clear();
+ std::ios_base::fmtflags flags =
+ is.flags(is.flags() & ~std::ios_base::skipws);
+ do {
+ is >> c;
+ if (!is.good())
+ break;
+ if (c == str.escape_) {
+ is >> c;
+ if (!is.good())
+ break;
+ } else if (c == str.delim_)
+ break;
+ str.string_ += c;
+ } while (true);
+ is.setf(flags);
+
+ return is;
+}
+}
+
+template <typename Char>
+inline internals::quoted_string<const Char*, Char> quoted(
+ const Char* str, Char delim = Char('"'), Char escape = Char('\\'))
+{
+ return internals::quoted_string<const Char*, Char>(str, delim, escape);
+}
+
+template <typename Char, typename Traits, typename Alloc>
+inline internals::quoted_string<const std::basic_string<Char, Traits, Alloc>&,
+ Char>
+quoted(const std::basic_string<Char, Traits, Alloc>& str,
+ Char delim = Char('"'), Char escape = Char('\\'))
+{
+ return internals::quoted_string<
+ const std::basic_string<Char, Traits, Alloc>&, Char>(str, delim, escape);
+}
+
+template <typename Char, typename Traits, typename Alloc>
+inline internals::quoted_string<std::basic_string<Char, Traits, Alloc>&, Char>
+quoted(std::basic_string<Char, Traits, Alloc>& str, Char delim = Char('"'),
+ Char escape = Char('\\'))
+{
+ return internals::quoted_string<std::basic_string<Char, Traits, Alloc>&,
+ Char>(str, delim, escape);
+}
+
+inline internals::quoted_string<cm::string_view, char> quoted(
+ cm::string_view str, char delim = '"', char escape = '\\')
+{
+ return internals::quoted_string<cm::string_view, char>(str, delim, escape);
+}
+
+#endif
+
+} // namespace cm
+
+#endif
diff --git a/Utilities/std/cm/memory b/Utilities/std/cm/memory
index dd0f8226d1..5611f6bb35 100644
--- a/Utilities/std/cm/memory
+++ b/Utilities/std/cm/memory
@@ -6,7 +6,10 @@
#ifndef cm_memory
#define cm_memory
+#include "cmSTL.hxx" // IWYU pragma: keep
+
#include <memory> // IWYU pragma: export
+
#if !defined(CMake_HAVE_CXX_MAKE_UNIQUE)
# include <cstddef>
# include <type_traits>
diff --git a/Utilities/std/cmSTL.hxx.in b/Utilities/std/cmSTL.hxx.in
new file mode 100644
index 0000000000..9c8605c83b
--- /dev/null
+++ b/Utilities/std/cmSTL.hxx.in
@@ -0,0 +1,10 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmSTL_hxx
+#define cmSTL_hxx
+
+/* Whether CMake is using its own STL implementation. */
+#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
+#cmakedefine CMake_HAVE_CXX_FILESYSTEM
+
+#endif
diff --git a/bootstrap b/bootstrap
index 04067dc7ac..2ef0fbbf11 100755
--- a/bootstrap
+++ b/bootstrap
@@ -432,6 +432,7 @@ CMAKE_CXX_SOURCES="\
cmSiteNameCommand \
cmSourceFile \
cmSourceFileLocation \
+ cmStandardLevelResolver \
cmState \
cmStateDirectory \
cmStateSnapshot \
@@ -478,6 +479,7 @@ if ${cmake_system_mingw}; then
fi
CMAKE_STD_CXX_HEADERS="\
+ filesystem \
memory \
optional \
shared_mutex \
@@ -485,6 +487,7 @@ CMAKE_STD_CXX_HEADERS="\
utility \
"
CMAKE_STD_CXX_SOURCES="\
+ fs_path \
string_view \
"
@@ -633,6 +636,8 @@ Configuration:
--system-libuv use system-installed libuv library
--no-system-libuv use cmake-provided libuv library (default)
+ --bootstrap-system-libuv use system-installed libuv library for bootstrap
+
--qt-gui build the Qt-based GUI (requires Qt >= 4.2)
--no-qt-gui do not build the Qt-based GUI (default)
--qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
@@ -855,6 +860,7 @@ cmake_verbose=
cmake_parallel_make=
cmake_ccache_enabled=
cmake_prefix_dir="${cmake_default_prefix}"
+bootstrap_system_libuv=
while test $# != 0; do
case "$1" in
--prefix=*) dir=`cmake_arg "$1"`
@@ -874,6 +880,7 @@ while test $# != 0; do
--no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-librhash|--no-system-zlib|--no-system-liblzma|--no-system-nghttp2|--no-system-zstd|--no-system-libuv)
lib=`cmake_arg "$1" "--no-system-"`
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;;
+ --bootstrap-system-libuv) bootstrap_system_libuv="1" ;;
--qt-gui) cmake_bootstrap_qt_gui="1" ;;
--no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
--qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
@@ -1249,7 +1256,7 @@ echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
#-----------------------------------------------------------------------------
# Test CXX features
-cmake_cxx_features="make_unique"
+cmake_cxx_features="make_unique filesystem"
for feature in ${cmake_cxx_features}; do
eval "cmake_have_cxx_${feature}=0"
@@ -1269,6 +1276,9 @@ for feature in ${cmake_cxx_features}; do
fi
done
+cmake_generate_file "${cmake_bootstrap_dir}/cmSTL.hxx" ""
+
+
#-----------------------------------------------------------------------------
# Test Make
@@ -1489,9 +1499,11 @@ objs=""
for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${CMAKE_STD_CXX_SOURCES} ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do
objs="${objs} ${a}.o"
done
-for a in ${LIBUV_C_SOURCES}; do
- objs="${objs} uv-`cmake_obj ${a}`"
-done
+if test "x${bootstrap_system_libuv}" = "x"; then
+ for a in ${LIBUV_C_SOURCES}; do
+ objs="${objs} uv-`cmake_obj ${a}`"
+ done
+fi
libs=""
@@ -1529,14 +1541,20 @@ else
;;
esac
fi
-uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/include"`"
-if ${cmake_system_mingw}; then
- uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/win"`"
+if test "x${bootstrap_system_libuv}" = "x"; then
+ uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/include"`"
+ if ${cmake_system_mingw}; then
+ uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/win"`"
+ else
+ uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`"
+ fi
+ uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src"`"
else
- uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`"
+ if test `which pkg-config`; then
+ uv_c_flags="${uv_c_flags} `pkg-config --cflags libuv`"
+ fi
+ libs="${libs} -luv"
fi
-uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src"`"
-
if test "x${cmake_ansi_cxx_flags}" != "x"; then
cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
fi
@@ -1618,11 +1636,13 @@ for a in ${KWSYS_CXX_SOURCES}; do
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
done
-for a in ${LIBUV_C_SOURCES}; do
- src=`cmake_escape "${cmake_source_dir}/Utilities/cmlibuv/${a}"`
- echo "uv-`cmake_obj ${a}` : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
- echo " ${cmake_c_compiler} ${cmake_c_flags} ${uv_c_flags} -c ${src} -o uv-`cmake_obj ${a}`" >> "${cmake_bootstrap_dir}/Makefile"
-done
+if test "x${bootstrap_system_libuv}" = "x"; then
+ for a in ${LIBUV_C_SOURCES}; do
+ src=`cmake_escape "${cmake_source_dir}/Utilities/cmlibuv/${a}"`
+ echo "uv-`cmake_obj ${a}` : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
+ echo " ${cmake_c_compiler} ${cmake_c_flags} ${uv_c_flags} -c ${src} -o uv-`cmake_obj ${a}`" >> "${cmake_bootstrap_dir}/Makefile"
+ done
+fi
echo '
rebuild_cache:
cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"